Prerequisites
- Node.js 22.13 to 26
Installation
Basic Setup
A mnemonic, a phrase of 12 words, controls the wallet and its funds. Generate it once, in your project folder:ARKADE_MNEMONIC environment variable. In production, load it from your platform’s secure storage, and never log it.
Shut Down the Wallet
Wallet.create starts background work that keeps running until you call dispose():
- The
VtxoManager, which renews and recovers outputs and settles boarding deposits. - Contract watching, and the wallet’s subscriptions to the operator.
await wallet.dispose() stops all of it. It first lets work already in progress finish, such as a restore or a renewal check, so it may not resolve immediately. Call it once, when your app or script no longer needs the wallet:
- In Node.js, call it before the process should exit. The open subscriptions and timers keep the process alive.
- In an app, call it when the user logs out or switches wallets.
dispose(), the wallet no longer renews outputs. To use the wallet again, create a new instance with Wallet.create.
dispose() doesn’t close your storage. If you passed SQLite or Realm repositories, you own the connection: close it after dispose() resolves. wallet.clear() calls dispose() itself before it wipes the wallet’s data.
Wallet also implements Symbol.asyncDispose. If your toolchain supports explicit resource management, await using calls dispose() when the variable goes out of scope:
ReadonlyWallet has the same dispose() method.
Next Steps
- Receive Payments - Fund the wallet at the address it printed
- Boarding & Offboarding - Move bitcoin from an onchain address into the wallet