Setup
Load the mnemonic you stored when you created your wallet, for example from an environment variable. Never generate a new mnemonic on each run. Funds sent to the address of a mnemonic you did not store are lost. The snippet connects to mainnet. For Mutinynet, create the wallet as in Create Your Wallet. In Node.js, also passstorage and call configureEventSource before Wallet.create, as
in the Node.js example: the payment
notifications below need an EventSource.
Getting Your Arkade Address
Share the wallet’s Arkade address to receive BTC from other Arkade wallets. It starts withark1 on mainnet and tark1 on test networks.
Receiving Assets
Arkade Assets arrive at the same Arkade address as BTC. Each virtual output lists the assets it holds in itsassets field. Incoming-payment notifications include this field.
Detect Deposits
Watch an address for incoming units of one asset.
Receiving from Bitcoin
Generate a boarding address to move a confirmed Bitcoin output into Arkade.Boarding
Onchain funding and confirmation flow.
Receiving over Lightning
To receive a Lightning payment into an Arkade balance, a solver mints a hold invoice against a hash you supply and funds the Arkade side once it is paid.Receive Lightning
Preimage handling and claiming.
Monitoring for Incoming Payments
UsewaitForIncomingFunds() once or notifyIncomingFunds() for a subscription.
Wait for the Next Deposit
waitForIncomingFunds keeps a subscription open until funds arrive. If your
app can stop waiting first, for example when the user leaves the screen, pass
{ timeoutMs } or { signal } from an AbortController. When the timeout
ends or you call abort(), the SDK closes the subscription and the call
rejects with an AbortError.
Subscribe to Live Updates
notifyIncomingFunds calls your function on every change to the wallet’s
outputs, until you call the stop function it returns:
spentVtxos, and its change arrives in newVtxos in a separate call. The
same output can be reported more than once, so key your updates by
txid:vout. The wallet stores every output itself.
The SDK reconnects the subscription after a network drop. The subscription
ends when your app stops, so call notifyIncomingFunds again at startup.