Utexo SDK
This is the underlying SDK used by RGB client applications. It provides a complete set of bindings for interacting with the RGB and managing RGB-based transfers. With this SDK, developers can:- Generate RGB invoices
- Create and manage UTXOs
- Sign PSBTs using local private keys or hardware signing flows
- Fetch asset balances, transfer status, and other RGB-related state
Capabilities of @utexo/rgb-sdk (via WalletManager)
The primary wallet class is UTEXOWallet: initialize with a mnemonic (or seed) and optional{ network, dataDir }, then call await wallet.initialize() before use. It combines standard RGB operations with UTEXO features (Lightning, on-chain deposit/withdrawal).
Wallet Methods
generateKeys(network?)— Generate new wallet keys (mnemonic, xpubs, master fingerprint)restoreUtxoWalletFromBackup({ backupPath, password, targetDir })— Restore UTEXO wallet from file backuprestoreUtxoWalletFromVss({ mnemonic, targetDir, config?, vssServerUrl? })— Restore UTEXO wallet from VSS cloud backupderiveKeysFromMnemonic(network, mnemonic)— Derive wallet keys from existing mnemonicderiveKeysFromSeed(network, seed)— Derive wallet keys from BIP39 seedgetAddress()— Get deposit address (async)getBtcBalance()— Get on-chain BTC balance (async)getXpub()— Get vanilla and colored xpubsgetNetwork()— Get current networklistUnspents()— List unspent UTXOslistAssets()— List RGB assets heldgetAssetBalance(assetId)— Get balance for a specific assetcreateUtxos({ num?, size?, upTo? })— Create UTXOs (async; combines begin, sign, end)blindReceive({ assetId, amount, minConfirmations?, durationSeconds? })— Generate blinded UTXO for receivingwitnessReceive({ assetId, amount, minConfirmations?, durationSeconds? })— Generate witness UTXO for receivingissueAssetNia({ ticker, name, amounts, precision })— Issue a new Non-Inflationary Assetsend({ invoice, assetId, amount, witnessData? })— Complete send (begin → sign → end)signPsbt(psbt, mnemonic?)— Sign PSBT using wallet mnemonic (async)refreshWallet()— Sync and refresh wallet statelistTransactions()— List BTC-level transactionslistTransfers(assetId?)— List RGB transfer history for assetcreateBackup({ backupPath, password })— Create encrypted backup
Lightning Methods
createLightningInvoice(params)— Create Lightning invoice for receivingpayLightningInvoiceBegin(params)— Start Lightning payment (returns unsigned PSBT)payLightningInvoiceEnd(params)— Finalize Lightning payment with signed PSBTpayLightningInvoice(params, mnemonic?)— Complete Lightning payment (begin → sign → end)getLightningSendRequest(lnInvoice)— Get status of Lightning sendgetLightningReceiveRequest(lnInvoice)— Get status of Lightning receivelistLightningPayments()— List Lightning payments
On-chain Methods
onchainReceive(params)— Generate invoice for depositing from mainnet to UTEXOonchainSend(params, mnemonic?)— Complete on-chain withdraw (begin → sign → end)getOnchainSendStatus(invoice)— Get status of on-chain withdraw
Getting Started
Prerequisites
This SDK uses rgb-protocol libraries. All operations are performed locally.Default Endpoints
The SDK uses default endpoints for RGB transport and Bitcoin indexing: Transport Endpoints (RGB protocol communication):- Mainnet:
rpcs://rgb-proxy-mainnet.utexo.com/json-rpc - Testnet:
rpcs://rgb-proxy-testnet3.utexo.com/json-rpc - Signet:
rpcs://rgb-proxy-utexo.utexo.com/json-rpc
- Mainnet:
ssl://electrum.iriswallet.com:50003 - Testnet:
ssl://electrum.iriswallet.com:50013 - Signet:
https://esplora-api.utexo.com