The wallet API uses JSON-RPC 2.0 over the same endpoint as the server API. CLI commands accept an optional --wallet / -w parameter (defaults to default).

Wallet Management

listwallets

List all loaded wallet names.

No parameters.

{
  "jsonrpc": "2.0",
  "method": "listwallets",
  "params": [],
  "id": 1
}

Returns: string[]


walletcreate

Create a new wallet, returns mnemonic phrase.

ParameterTypeRequiredDescription
namestringYesName for the new wallet
{
  "jsonrpc": "2.0",
  "method": "walletcreate",
  "params": ["mywallet"],
  "id": 1
}

Returns: string


walletrecover

Recover wallet from mnemonic phrase.

ParameterTypeRequiredDescription
namestringYesName for the recovered wallet
mnemonicstringYesBIP-39 mnemonic phrase
{
  "jsonrpc": "2.0",
  "method": "walletrecover",
  "params": ["mywallet", "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"],
  "id": 1
}

Returns: ()


walletload

Load a wallet by name.

ParameterTypeRequiredDescription
namestringYesName of the wallet to load
{
  "jsonrpc": "2.0",
  "method": "walletload",
  "params": ["mywallet"],
  "id": 1
}

Returns: ()


walletexport

Export a wallet.

ParameterTypeRequiredDescription
namestringYesName of the wallet to export
{
  "jsonrpc": "2.0",
  "method": "walletexport",
  "params": ["mywallet"],
  "id": 1
}

Returns: WalletExport


walletimport

Import a wallet from export object.

ParameterTypeRequiredDescription
walletWalletExportYesExport object containing blockheight, descriptor, and label
{
  "jsonrpc": "2.0",
  "method": "walletimport",
  "params": [{ "blockheight": 800000, "descriptor": "wpkh(...)", "label": "mywallet" }],
  "id": 1
}

Returns: ()


walletgetinfo

Get wallet info including sync status.

ParameterTypeRequiredDescription
namestringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletgetinfo",
  "params": ["mywallet"],
  "id": 1
}

Returns: WalletInfoWithProgress


walletgetbalance

Get wallet balance.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletgetbalance",
  "params": ["mywallet"],
  "id": 1
}

Returns: Balance


walletgetnewaddress

Get new address.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
kindstringYesAddress kind: "Coin" or "Space"
{
  "jsonrpc": "2.0",
  "method": "walletgetnewaddress",
  "params": ["mywallet", "Coin"],
  "id": 1
}

Returns: string


walletincrementaddress

Increment and return next address.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
kindstringYesAddress kind: "Coin" or "Space"
{
  "jsonrpc": "2.0",
  "method": "walletincrementaddress",
  "params": ["mywallet", "Coin"],
  "id": 1
}

Returns: string


Transactions

walletsendrequest

Send a batch of wallet requests.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
requestRpcWalletTxBuilderYesTransaction builder object

The RpcWalletTxBuilder object has the following fields:

FieldTypeDescription
confirmed_onlyboolOnly use confirmed UTXOs
fee_ratenumberFee rate in sat/vB
forceboolForce the transaction
requestsarrayArray of request objects
skip_tx_checkboolSkip transaction checks
{
  "jsonrpc": "2.0",
  "method": "walletsendrequest",
  "params": ["mywallet", {
    "confirmed_only": false,
    "fee_rate": 1,
    "force": false,
    "requests": [],
    "skip_tx_check": false
  }],
  "id": 1
}

Returns: WalletResponse

Request types

open -- Open a space:

{"request": "open", "name": "@example", "amount": 1000}

bid -- Bid on space:

{"request": "bid", "name": "@example", "amount": 2000}

register -- Register space:

{"request": "register", "name": "@example"}

transfer -- Transfer spaces:

{"request": "transfer", "spaces": ["@example"], "to": "bc1q..."}

createnum -- Create a num:

{"request": "createnum"}

operate -- Set up operator:

{"request": "operate", "subject": "@example"}

commit -- Commit root hash:

{"request": "commit", "subject": "@example", "root": "abcdef..."}

delegate -- Delegate operator:

{"request": "delegate", "subject": "@example", "to": "bc1q..."}

setfallback -- Set fallback data:

{"request": "setfallback", "subject": "@example", "data": [0, 1, 2]}

send -- Send coins:

{"request": "send", "amount": 50000, "to": "bc1q..."}

walletbumpfee

Bump fee on an existing transaction.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
txidstringYesTransaction ID to bump
fee_ratenumberYesNew fee rate in sat/vB
skip_tx_checkboolYesSkip transaction checks
{
  "jsonrpc": "2.0",
  "method": "walletbumpfee",
  "params": ["mywallet", "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", 2, false],
  "id": 1
}

Returns: Vec<TxResponse>


walletforcespend

Force spend outpoint.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
outpointstringYesOutpoint to spend (txid:vout)
fee_ratenumberYesFee rate in sat/vB
{
  "jsonrpc": "2.0",
  "method": "walletforcespend",
  "params": ["mywallet", "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0", 1],
  "id": 1
}

Returns: TxResponse


walletlisttransactions

List transactions with pagination.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
countintegerYesNumber of transactions to return
skipintegerYesNumber of transactions to skip
{
  "jsonrpc": "2.0",
  "method": "walletlisttransactions",
  "params": ["mywallet", 10, 0],
  "id": 1
}

Returns: Vec<TxInfo>


Space & Num Queries

walletlistspaces

List all spaces grouped by status.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletlistspaces",
  "params": ["mywallet"],
  "id": 1
}

Returns: ListSpacesResponse


walletlistnums

List all nums.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletlistnums",
  "params": ["mywallet"],
  "id": 1
}

Returns: ListNumsResponse


walletlistunspent

List unspent outputs.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletlistunspent",
  "params": ["mywallet"],
  "id": 1
}

Returns: Vec<WalletOutput>


walletlistbidouts

List bid outputs.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
{
  "jsonrpc": "2.0",
  "method": "walletlistbidouts",
  "params": ["mywallet"],
  "id": 1
}

Returns: Vec<DoubleUtxo>


walletcanoperate

Check if wallet controls operator num for a given subject.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
subjectstringYesSpace name to check
{
  "jsonrpc": "2.0",
  "method": "walletcanoperate",
  "params": ["mywallet", "@example"],
  "id": 1
}

Returns: bool


Signing

walletsignschnorr

Sign message with subject's schnorr key.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
subjectstringYesSpace name whose key to sign with
messagestringYesHex-encoded message to sign
{
  "jsonrpc": "2.0",
  "method": "walletsignschnorr",
  "params": ["mywallet", "@example", "48656c6c6f"],
  "id": 1
}

Returns: string


Marketplace

walletsell

Create listing to sell space.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
spacestringYesSpace name to sell
amountintegerYesSale price in satoshis
{
  "jsonrpc": "2.0",
  "method": "walletsell",
  "params": ["mywallet", "@example", 100000],
  "id": 1
}

Returns: Listing


walletbuy

Buy space from listing.

ParameterTypeRequiredDescription
walletstringYesName of the wallet
listingListingYesListing object from walletsell
fee_ratenumberNoFee rate in sat/vB
skip_tx_checkboolYesSkip transaction checks
{
  "jsonrpc": "2.0",
  "method": "walletbuy",
  "params": ["mywallet", { "space": "@example", "price": 100000, "seller": "bc1q..." }, 1, false],
  "id": 1
}

Returns: TxResponse