swarm-topup
v0.3.0
Published
Embeddable button that lets anyone top up a Swarm postage batch with a card payment via Stripe, with an optional USDC tip.
Maintainers
Readme
swarm-topup
A "Support" button that lets visitors pay by card to keep an artist's storage online.
npm install swarm-topup<div id="support"></div>
<script type="module">
import { TopUpButton } from 'swarm-topup'
new TopUpButton('#support', { batchId: '<your postage batch ID>' })
</script>Visitors pick an amount, pay through Stripe, and come back to your page with a thank-you. Within minutes, the payment extends your postage batch.
With payoutAddress, part of the payment extends the batch and the rest is sent to that address as USDC on Ethereum Mainnet. The server decides the split, 50/50 after its service fee by default, and the modal shows it to the visitor. Use an address the artist controls: the modal says the tip goes to the wallet set up for the artist, who needs to withdraw it from there.
| Option | Default | Description |
| --- | --- | --- |
| batchId | — | Postage batch to keep alive |
| payoutAddress | — | Ethereum Mainnet address that receives a USDC share. Without it, the whole payment goes to storage. |
| amounts | [1, 5, 10] | Preset USD amounts; a custom field is always shown |
| label | Support | Button text |
| theme | dark | background, foreground, muted, accent, danger, font, radius |
| server | https://topup.bzz.limo | Payment server |
The widget uses no cookies. Mention it in your own privacy notice.
