Feat/plasma bot integration#1
Conversation
Add a free-plasma faucet column to the Plasma tab backed by the plasma.bot agent API, alongside the existing self-funded fusion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the always-visible two-column faucet with a conditional button + dialog shown only when the account has 0 plasma and < 10 QSR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fetch /api/stats on dialog open to show bot status, disable unfundable tiers, and auto-select a fundable tier. Fail-open if the check fails. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
digitalSloth
left a comment
There was a problem hiding this comment.
This is cool, it works well and looks good. Just a few minor things to tidy up.
Please can you also remove the superpower docs from this PR too.
| <DialogHeader> | ||
| <DialogTitle>Get free plasma from plazma.bot</DialogTitle> | ||
| <DialogDescription> | ||
| plazma.bot fuses QSR to your account for free. No QSR or wallet unlock required. |
There was a problem hiding this comment.
Can you change the text plazma.bot into a link to your site. People might want to see more about it.
Additionally Im not sure about the 2nd sentence maybe sometime like "No QSR required, just choose a tier and go." I dont really like the "or wallet unlock" wording.
| :disabled="plasmaBot.isFusing.value || !isTierAvailable(tier.key)" | ||
| @click="selectedTier = tier.key" | ||
| > | ||
| {{ tier.label }} · {{ tier.qsr }} |
There was a problem hiding this comment.
Not sure we need the QSR amount here, keep it simple for new users. What do you think?
| // --- plasma.bot (free plasma faucet) --- | ||
| /** Base URL of the plasma.bot agent API (note: domain is spelled "plazma"). */ | ||
| export const PLASMA_BOT_API_URL = 'https://plazma.bot' | ||
|
|
||
| export type PlasmaBotTierKey = 'low' | 'medium' | 'high' | ||
|
|
||
| export interface PlasmaBotTier { | ||
| key: PlasmaBotTierKey | ||
| label: string | ||
| /** QSR the bot fuses for this tier. */ | ||
| qsr: number | ||
| } | ||
|
|
||
| /** Tiers offered by plasma.bot, matching its agent API. */ | ||
| export const PLASMA_BOT_TIERS: readonly PlasmaBotTier[] = [ | ||
| { key: 'low', label: 'Low', qsr: 20 }, | ||
| { key: 'medium', label: 'Medium', qsr: 80 }, | ||
| { key: 'high', label: 'High', qsr: 120 } | ||
| ] as const |
There was a problem hiding this comment.
Id move all of this to the plasma-bot-service.ts although these values are configs they're not really global configs. Lets keep all the plasma bot config self contained in the service.
Another benefit of moving it is that we can remove the double export of PlasmaBotTierKey. Currently its defined here in the config, imported into the service then re-exported from the service to the core/index.ts
| await plasmaBot.fuse(props.activeAccountAddress, selectedTier.value) | ||
| emit('showToast', `plazma.bot fused ${qsr} QSR to your account!`, 'success') | ||
| emit('fused') | ||
| emit('update:open', false) |
There was a problem hiding this comment.
Could we poll the bot here and only close the modal when the fuse has happened? At the moment the toast shows the success message but it takes a bit of time for the plasma to come through
Add plazma.bot to the Plasma tab of the wallet. The dialogue box will ONLY appear if the wallet has fewer than 10 QSR.
Workflow
You can see test fusions here https://plazma.bot/
I exposed
/api/healthand/api/fuseto CORS*. It's still gated by anti-dos measures.