Send Bitcoin and manage RGB UTXOs
Quote and send Bitcoin, inspect unspents, and create UTXOs with @utexo/wdk-wallet-rgb 2.0.3.
RGB transfers require suitable Bitcoin UTXOs. The account exposes both WDK Bitcoin sends and RGB SDK UTXO helpers.
Inspect unspents
account.syncWallet()
const unspents = account.listUnspents()
console.log(unspents)Check native status fields and confirmation requirements before selecting an output for a consequential flow.
Create RGB-compatible UTXOs
Use the combined method when the wallet can construct and sign the whole operation:
const created = await account.createUtxos({
upTo: true,
num: 5,
size: 1_000,
feeRate: 2,
})
console.log('UTXOs created:', created)size is satoshis and feeRate is sat/vbyte. Confirm appropriate values for the current network and RGB workflow.
The release also exposes createUtxosBegin(), signPsbt(), and createUtxosEnd() for a lower-level PSBT flow. Use the exact v2.0.3 declaration and pinned RGB SDK shape when integrating those methods.
Quote a Bitcoin send
const transaction = {
to: recipientAddress,
value: 50_000n,
feeRate: 2,
}
const quote = await account.quoteSendTransaction(transaction)
console.log('Estimated fee:', quote.fee.toString())In v2.0.3, quoteSendTransaction() ignores the supplied feeRate, obtains its own one-block estimate, and constructs and signs a PSBT. sendTransaction() then uses the supplied feeRate or defaults to 1. The quoted fee can therefore differ from the send path. Recheck policy and resulting state instead of treating the quote as a binding guarantee.
Send Bitcoin
const maximumQuotedFee = 2_000n
const quote = await account.quoteSendTransaction(transaction)
if (quote.fee > maximumQuotedFee) {
throw new Error('Quoted Bitcoin fee exceeds the application limit')
}
const result = await account.sendTransaction(transaction)
console.log('Transaction ID:', result.hash)sendTransaction() runs sendBtcBegin → signPsbt → sendBtcEnd and returns {hash, fee}.
Bitcoin-send failures are wrapped with the message prefix RGB transfer failed in this release. Classify the operation from your call context, not that text. A timeout also does not prove that broadcast failed; reconcile by transaction ID, UTXOs, and history before retrying.
manager.getFeeRates() reads main mempool.space recommendations without selecting the wallet network. Do not treat it as authoritative for testnet or regtest.