@utexo/wdk-wallet-rgb bridges the Wallet Development Kit (WDK) interfaces with the RGB ecosystem. It wraps the @utexo/rgb-lib-bare native addon and the @utexo/rgb-sdk Taproot signer inside standard WDK account abstractions, giving wallet builders first-class RGB support without reimplementing the protocol layer.
Installation
Configuration
| Option | Type | Description |
|---|---|---|
network | string | Bitcoin network: 'mainnet', 'testnet', 'testnet4', 'signet', 'utexo', 'regtest' |
dataDir | string | Path to a persistent directory for SQLite state storage |
Classes
WalletManagerRgb
The top-level manager. Constructs account instances and manages the underlying rgb-lib state.
Methods
| Method | Description |
|---|---|
getAccount(mnemonic) | Derive a WalletAccountRgb from a BIP39 mnemonic |
restoreFromBackup(backup, mnemonic) | Restore wallet state from an encrypted backup, then return the account |
getFeeRate() | Get current fee rate estimate |
dispose() | Release native resources |
WalletAccountRgb
The primary account class. Implements the standard WDK account interface plus RGB-specific operations.
Address & Signing (Standard WDK)
| Method | Description |
|---|---|
getAddress() | Get current receive address |
sign(psbt) | Sign a PSBT with the account’s key material |
sendBtc({ address, amount, feeRate }) | On-chain BTC send |
RGB Assets
| Method | Description |
|---|---|
issueAssetNia({ ticker, name, precision, amounts }) | Issue a Non-Inflationary Asset |
issueAssetCfa({ name, precision, amounts, description?, fileDigest? }) | Issue a Collectible Fungible Asset |
issueAssetUda({ name, precision, details?, fileDigest? }) | Issue a Unique Digital Asset (NFT) |
issueAssetIfa({ ticker, name, precision, amounts, inflationAmounts, rejectListUrl }) | Issue an Inflatable Asset |
inflateAsset({ assetId, amounts }) | Inflate an existing IFA |
Inventory & Balances
| Method | Description |
|---|---|
listAssets() | List all RGB assets in the wallet |
getAssetBalance(assetId) | Get balance for a specific asset |
listTransfers(assetId?) | List RGB transfer history. Statuses: WaitingCounterparty, WaitingConfirmations, Settled, Failed |
listUnspents() | List unspent UTXOs with RGB allocations |
Transfers
| Method | Description |
|---|---|
blindReceive({ assetId?, amount?, minConfirmations?, durationSeconds? }) | Generate a blinded RGB invoice |
witnessReceive({ assetId?, amount?, minConfirmations?, durationSeconds? }) | Generate a witness RGB invoice |
transferAsset({ invoice, assetId, amount, donation?, feeRate? }) | Execute an RGB asset transfer |
decodeRgbInvoice(invoice) | Decode an RGB invoice |
UTXO Management
| Method | Description |
|---|---|
createUtxos({ num?, size?, upTo? }) | Create colored UTXOs for RGB operations |
syncWallet() | Sync blockchain and UTXO state |
refreshWallet() | Refresh RGB transfer state |
Backup
| Method | Description |
|---|---|
createBackup({ backupPath, password }) | Create encrypted local backup |
WalletAccountReadOnlyRgb
A view-only account that does not hold private key material. Use for watch-only wallet UIs or balance dashboards.
| Method | Description |
|---|---|
getBalance() | BTC balance (vanilla + colored) |
listAssets() | List RGB assets |
verifySignature({ message, signature, address }) | Verify a Schnorr or ECDSA signature |
Full Example
Further Reading
- WDK Overview
- wdk-rgb-lightning — RGB Lightning for channels and payments
- SDK Overview