WDK logoWDK documentation

RGB Lightning wallet API reference

Public API reference for @utexo/wdk-rgb-lightning 0.1.0-beta.15.

This page covers the package-root declarations and released runtime behavior of @utexo/wdk-rgb-lightning@0.1.0-beta.15.

Community modules are developed and maintained independently by third-party contributors.

Tether and the WDK Team do not endorse or assume responsibility for their code, security, or maintenance. Use your own judgment and proceed at your own risk.

Package

FieldValue
Package@utexo/wdk-rgb-lightning@0.1.0-beta.15
RepositoryUTEXO-Protocol/wdk-rgb-lightning
Module formatESM
Node/default entryindex.jsindex-node.js
Bare entrybare.jsindex-bare.js
Declarationsindex.d.ts

Install the matching optional native peer. The manager, account, error, and LSP surfaces are shared across runtimes; the package root exports only the binding class selected for the active runtime.

Root exports

GroupExports
Manager and accountsDefault WalletManagerRgbLightning, WalletAccountRgbLightning, WalletAccountReadOnlyRgbLightning
Low-level binding (runtime-selected)Node: NodeRgbLightningBinding; Bare: BareRgbLightningBinding; IRgbLightningBinding type. The declarations name both classes, but each runtime root exports only its selected class.
Wallet errorsRgbLightningError, UnlockError, AccountLockedError, VssError, VssNotConfiguredError, ApayError, NotImplementedError
LSPLspClient, LspError, UtexoLsp, LSP result/config types, timeout and settlement errors
LNURL / addressisUmaAddress, normalizeLightningAddress, parseLightningAddress, fetchDiscovery, resolveAddressToInvoice, LnurlPayError
Account-bound helperspayLightningAddress, requestLspRgbDeposit, payRgbViaLsp

Low-level binding classes are advanced escape hatches. Prefer the manager because it owns external-signer attachment, fallback identity handling, shutdown, and cleanup of secrets retained by the RGB Lightning binding.

WalletManagerRgbLightning

MemberReturnsBehavior
constructor(seed, config)ManagerRequires BIP-39 mnemonic or seed bytes, network, and persistent dataDir.
getAccount(index = 0)Promise<WalletAccountRgbLightning>Returns the only account. Nonzero indexes and registered WDK signer names are rejected.
getAccountByPath(path)Promise<WalletAccountRgbLightning>Accepts only m.
getFeeRates()Promise<FeeRates>Fetches mempool.space recommendations without selecting the configured network.
dispose()voidTerminal for the RGB Lightning node session: shuts down the binding, destroys the VLS signer, and wipes seed buffers retained by the RGB Lightning binding. Do not reuse manager-derived objects after disposal.
static BindingBinding constructorRuntime-selected Node or Bare binding.

WalletAccountReadOnlyRgbLightning

The read-only adapter exposes queries without signing, broadcasting, channel mutation, VSS recovery, or LSP credentials.

GroupMethods
Bootstrap and nodegetBootstrap(), getNodeInfo(), getNetworkInfo()
AddressgetAddress(), getAddressState()
Channels and peerslistChannels(), getChannelId(tempId), listPeers()
LightningdecodeInvoice(), getInvoiceStatus(), listPayments(), getPayment(hash, type)
RGBlistAssets(filter?), getAssetBalance(), getAssetMetadata(), listTransfers(), listTransfersByTxid(), decodeRgbInvoice(), getAssetMedia()
BitcoingetBalance(skipSync?), getBalanceDetails(skipSync?), getTransactions(skipSync?), getTransactionsByTxid(txid, skipSync?), listUnspents(), estimateFee()
WDKgetTokenBalance(), verify(), quoteTransfer(), quoteSendTransaction(), getTransactionReceipt()
DiagnosticscheckIndexerUrl(), checkProxyEndpoint(), vssStatus()

getAddress() throws AccountLockedError before unlock. getAddressState() returns {status:'locked', address:null} without throwing.

Before unlock, getBalance() returns 0n. Use getAddressState() to distinguish a locked account from a ready account with a real zero balance.

getTransactionReceipt() returns only terminal confirmed Bitcoin, settled RGB, or non-pending Lightning records; otherwise it returns null.

WalletAccountRgbLightning

The full account has fixed identity fields:

MemberValue
index0
pathm
keyPair.publicKey33-byte compressed Lightning node public key
keyPair.privateKeyAlways null; VLS holds signing material

Lifecycle and node

MethodBehavior
unlock(nativeRequest)Unlocks the node with native snake_case RPC, indexer, proxy, and announce fields; wraps failures as UnlockError.
getBootstrap()Returns public signer/bootstrap metadata.
getNodeInfo() / getNetworkInfo()Query node and chain information.
sync()Synchronizes node state.
getAddress() / getAddressState()Read current stable address or lock state.
rotateAddress()Explicitly advances the Bitcoin address.
shutdown()Idempotently shuts down the account binding.
dispose()Account no-op; the manager owns terminal cleanup.

Peers, channels, and onion messages

MethodBehavior
connectPeer(pubkeyAndAddress)Connects a pubkey@host:port peer.
disconnectPeer(request)Forwards the native disconnect request.
listPeers()Returns native peer records.
openChannel(request)Accepts OpenChannelRequest or a native object.
closeChannel(request)Forwards the native close request.
listChannels()Returns native channel records.
getChannelId(temporaryId)Resolves a temporary channel ID.
sendOnionMessage(request)Forwards the caller-supplied native JsonSendOnionMessageRequest unchanged and returns {ok: true}. Validate the exact beta.15 request shape before calling; the declaration types it as object.

Invoices and payments

MethodBehavior
createInvoice(request)Native BOLT11 invoice request.
createLightningInvoice(request)Accepts native snake_case or released camelCase convenience fields.
decodeInvoice(invoice) / getInvoiceStatus(invoice)Query invoice data and status.
createHodlInvoice(params)Creates a HODL invoice for a caller-supplied payment hash.
cancelHodlInvoice(request) / claimHodlInvoice(request)Native HODL lifecycle calls.
sendPayment(request) / keysend(request)Native Lightning payment calls.
listPayments() / getPayment(hash, type)Payment history. type is Outbound, InboundAutoClaim, or InboundHodl.

RGB assets

MethodBehavior
listAssets(filter?), getAssetBalance(), getAssetMetadata()Query held RGB assets.
listTransfers(assetId), listTransfersByTxid(txid)Query transfer records.
refreshTransfers(request), failTransfers(request)Native transfer-state mutation.
createRgbInvoice(request), decodeRgbInvoice(invoice)Create or decode an RGB receive invoice.
sendRgbAsset(request)Sends native grouped RGB recipients.
getAssetMedia(digest), postAssetMedia(request)Reads or uploads asset media.

Runtime JavaScript includes issuance forwarders that beta.15's public declaration omits. They are intentionally excluded here. Use @utexo/wdk-wallet-rgb for released, documented issuance.

Bitcoin and WDK operations

MethodBehavior
sendTransaction({to, value, feeRate?, confirmationTarget?})WDK Bitcoin send; VLS signs internally and returns {hash, fee}.
sendBtc(request)Low-level native Bitcoin send.
createUtxos(request)Native UTXO-creation request.
quoteSendTransaction(tx)Approximate standard-send quote based on 141 vbytes.
transfer(options)Routes BOLT11, node ID, Bitcoin address, or RGB invoice recipients.
quoteTransfer(options)Routes to an approximate flow-specific quote.
sign(message) / verify(message, signature)Lightning message signing and verification.
signTransaction()Always throws NotImplementedError; use operation-specific send methods.
toReadOnlyAccount()Returns the cached query-only adapter.

Transfer routing and units

transfer(options) classifies recipient:

RecipientRouteamount unitReturned fee unit
BOLT11 invoicesendPaymentmillisatoshismillisatoshis
66-character hex node IDkeysendmillisatoshismillisatoshis
rgb: or utxob: invoiceRGB sendRGB asset base units0n because the native fee is not exposed
Other valid recipientBitcoin sendsatoshissatoshis

For RGB routing, token is the asset ID. The generic router assumes Fungible, donation: false, and one confirmation. Use sendRgbAsset() with the exact native request for other assignment kinds or grouped recipients.

An RGB transfer result of fee: 0n does not prove the operation was fee-free. It means beta.15 does not expose the native fee through the WDK result.

The Lightning quote uses a 50-basis-point allowance, not a live route fee. An RGB-routed HTLC has a hard minimum of 3,000,000 msat.

LSP, Lightning Address, and VSS

SurfaceKey methods
LspClienthealth, getInfo, LNURL discovery/callback, address resolution, on-chain send bridge, Lightning receive bridge
UtexoLspconnect, waitForChannel, receiveAsset, settlement/liquidity waits, sendAsset, payAddress, enableLightningAddress, claimPendingPayments
APayapayNew, bootstrapLsp, getLspConfig, createLsp
VSSvssStatus, vssBackup, clearVssFence

In beta.15, UtexoLsp.sendAsset({rgbInvoice, ln}) requires ln.amtMsat and ln.expirySec at runtime even though the public declaration marks ln and those fields optional. Pass the complete shape until the declaration is corrected.

Public HTTP is rejected for LSP and VSS by default, except loopback where supported. LNURL callbacks remain on the discovery host unless allowCrossHostCallback is explicitly enabled. $user@host is normalized as UMA-style address syntax only; the package does not implement UMA signing, compliance, or currency negotiation.

Errors

Selected boundaries use typed errors:

ErrorBoundary
UnlockErrorNode unlock
AccountLockedErrorLocked address/signature operations
VssError, VssNotConfiguredErrorVSS operations
ApayErrorAPay/bootstrap
NotImplementedErrorUnsupported transaction signing
LspError, LnurlPayErrorHTTP LSP and LNURL helpers
LspChannelTimeoutError, LspLiquidityTimeoutError, LspSettlementErrorComposed LSP waits

Many native methods still throw raw Rln(<Variant>): <message> errors. Preserve the original error and operation context.

Declaration boundary

Many native requests and responses are deliberately typed as object or Record<string, unknown> because RLN owns their shape. Do not invent stable fields from demos, another beta, or an unreleased branch. Validate the exact beta.15 payloads your application consumes.

Atomic swap methods are available only on the native binding, not on the released WDK account. They are outside this reference.

Guides

On this page