ConstCopy the wallet to destination, a file path on the node's host, which
it overwrites; a relative one is resolved against qbitd's working
directory. qbit Core v1.0.0 refuses a directory, and a path whose
directory does not exist, with RpcError -4.
The wallet's balances, in bits.
The hash of the active chain's tip.
getblockchaininfo: the chain, its tip, the node's sync state and the activation state of qbit's rules.
The height of the active chain's tip; the genesis block is 0.
The hash of the active chain's block at height. Rejects with RpcError -8 for a height past the tip.
Every block tip the node knows: the active chain's, once, and those of other branches.
Rejects with RpcError code -5 when the transaction is not in the mempool.
getmempoolinfo: the mempool's size, fee floor and limits.
getmininginfo: the tip's difficulty, the network hashrate and the next block's target.
getnetworkinfo: the node's version, connections and relay fee rates.
The txids in the mempool.
The txids in the mempool and the mempool sequence they stand at, to line up with the ZMQ sequence topic.
Every mempool entry, by txid. A full mempool's reply can pass the client's maxResponseBytes.
getwalletinfo: the wallet's state, its lock and any rescan included.
The outputs lockUnspent or walletCreateFundedPsbt's lockUnspents locked, persistent or not.
The wallets in the node's wallet directory, loaded or not.
Whether address is valid on the node's chain, and what it pays to. Needs no wallet.
Lock the wallet; see QbitRpcClient.walletLock for its deadline.
Unlocks the wallet for timeoutSeconds (qbit Core caps it at 100,000,000). The passphrase is never logged or put in an error.
Change an encrypted wallet's passphrase. Neither passphrase is ever logged
or put in an error. Rejects with RpcError -14 for a wrong old
passphrase, and -15 for an unencrypted wallet.
getblocktemplate in proposal mode (BIP23): check a block before hashing
it, everything but its proof of work. Nothing changes at the node. Null if
it would be accepted on the tip, or the reason it would not.
Ask for a merge-mining candidate paying its coinbase to payoutAddress,
which must be a P2MR address (RpcError -5 otherwise). The reply does not
name the address, so nothing can check it against the request: the coinbase
shows it once the block is accepted. The node holds the candidate in a cache
until its parent leaves the tip, -auxpowtemplateexpiry or
-auxpowtemplatecachelimit. An unknown outcome names nothing: ask again.
Create and load a wallet; a name with a path creates it there. With
passphrase it is encrypted, never echoed, and its first unlock runs its
deferred keypool top-up (see walletPassphrase); an empty one is refused,
as qbit Core would create the wallet unencrypted. A failure after sending
is an RpcUnknownOutcomeError: listWalletDir() shows whether it exists.
Rejects with RpcError -4 when it exists already.
Optionaloptions: {The addresses a descriptor derives, one per index of range, which a
ranged descriptor (one with *) needs and any other refuses. The
descriptor needs its checksum. On a P2MR chain a ranged descriptor derives
from private key material, pqc(<xprv>/...): it is redacted from the
node's error as getDescriptorInfo's is. A multipath descriptor (<0;1>)
is refused: derive each of getDescriptorInfo()'s multipathExpansion.
Optionaloptions: { range?: DescriptorRange }A fee rate for confirmation within confTarget blocks, 1 to 1,008. Default mode: the node's, economical.
Optionaloptions: { mode?: FeeEstimateMode }Finalize a signed PSBT and, unless options.extract is false, extract the
network transaction from a complete one. It reads no wallet.
Optionaloptions: { extract?: boolean }Checks that the reply is about address: a bech32 or bech32m address in
either case, any other exactly. Rejects with RpcError code -5 for an
address invalid on this network.
getblock at verbosity 1: the header's fields, sizes and txids, checked
against blockHash. RpcError -5 for an unknown block; -1 for one pruned,
or whose witness data was pruned.
getblockheader, checked against blockHash. Rejects with RpcError -5 for a block the node does not know.
getblock at verbosity 0: the block as stored, as hex, its header checked
to hash to blockHash. A block whose witness data was pruned comes without
it.
The data to build the next permissionless block from. rules are those the
miner understands, ['segwit'] by default (QbitRpcClient.getBlockTemplate
adds signet on signet); it must hold segwit, which qbit Core requires,
and on signet also signet. qbit Core v1.0.0 does not
read capabilities. On main, RpcError -9 with no peers and -10 while the
node syncs. See Mining.
Optionaloptions: { capabilities?: readonly string[]; rules?: readonly string[] }getblock at verbosity 2: as requests.getBlock, each transaction
decoded. A full block's reply can pass the client's maxResponseBytes; see
Large replies.
How many confirmations to wait for before crediting valueBits, from qbit
Core's security model. securityLevel defaults to medium;
mergeMiningPct (0 to 1) and btcHashrate (H/s, above 0) replace the
node's own inputs to the model.
Optionaloptions: { btcHashrate?: number; mergeMiningPct?: number; securityLevel?: SecurityLevel }Analyse a descriptor: its canonical form, without private keys, and its checksum, checked here against the descriptor. The checksum may be left out. A descriptor can hold private keys: they travel only in the request body, and the node's error, which can quote a key, is redacted.
A new receiving address from the wallet's external keypool, listed under
label (the default label, '', when left out; qbit Core reserves *).
See AddressType for the types each chain offers; one the chain or
the wallet does not offer rejects with RpcError code -5, and a wallet
with no keys with code -4. On regtest, a wallet encrypted at creation
rejects with code -12 unless addressType is p2mr.
Optionaloptions: { addressType?: AddressType; label?: string }A new address from the wallet's internal (change) keypool. See
AddressType for the types each chain offers; one the chain or the
wallet does not offer rejects with RpcError code -5. On regtest, a wallet
encrypted at creation rejects with code -12 unless addressType is p2mr
or the node runs with -changetype=p2mr.
Optionaloptions: { addressType?: AddressType }The serialized transaction as hex, checked to hash to txid. Without
-txindex, only mempool transactions or ones in blockHash.
Optionaloptions: { blockHash?: string }The decoded transaction (verbosity 1).
Optionaloptions: { blockHash?: string }A wallet transaction, checked against txid. Rejects with RpcError -5
for a transaction the wallet does not know.
An unspent output, or null when it is spent or does not exist. With
includeMempool (the node's default, true), outputs of mempool
transactions are found and outputs spent in the mempool are not. vout
is 0 to 4,294,967,295: qbit Core reads it as an unsigned 32-bit integer.
Optionaloptions: { includeMempool?: boolean }Which mempool transaction spends each output, checked against outputs,
one entry per output in order. The mempool only: an output spent in a block
and one never spent look alike.
Import descriptors into the wallet, then rescan once from the earliest
timestamp. One result per descriptor, in order: a refused one does not
stop the others. Each is checked before sending (see
DescriptorImport), with its checksum. Descriptors can hold private
keys: they travel only in the request body, and the node's messages,
which can quote a descriptor in full, are redacted. The default deadline
is 120 s: see Wallet administration.
Needs the wallet unlocked (RpcError -13).
Derive keys until each active descriptor's keypool holds newSize
(default -keypool, 1,000). The default deadline is 120 s: see
Wallet administration.
Needs the wallet unlocked (RpcError -13).
Optionaloptions: { newSize?: number }Wallet activity since a block; see SinceBlockHistory. Rejects with
RpcError code -5 for a block the node does not know.
Optionaloptions: ListSinceBlockOptionsThe wallet's newest entries, oldest of them first. Change outputs and a conflicted transaction's receive entries are not listed.
Optionaloptions: ListTransactionsOptionsThe wallet's unspent outputs, filtered by options.
Optionaloptions: ListUnspentOptionsLoad a wallet from the wallet directory, or a path. loadOnStartup true
adds it to the node's startup list and false removes it. Rejects with
RpcError -35 when it is loaded already, and -18 when it does not exist.
Optionaloptions: { loadOnStartup?: boolean }Lock wallet outputs against automatic coin selection (lockunspent with
unlock false). A lock is kept in memory and gone after a node restart,
unless persistent is set: then it is written to the wallet and loaded
again on start. The node checks every output first and rejects with
RpcError code -8, changing nothing, when one is unknown, spent or already
locked; with persistent, an output already locked is locked again,
persistently. outputs must not be empty.
Optionaloptions: { persistent?: boolean }An unsigned replacement for the wallet's unconfirmed transaction txid,
paying a higher fee. It spends every input of the original and may add
more; nothing is signed or sent. Sign it with walletProcessPsbt, store
the hex, then sendRawTransaction. It needs the wallet unlocked (RpcError
-13 otherwise). Side-effecting all the same: when the original has no change
output the wallet recognises, or outputs leave out its change address,
each call takes change keys from the keypool for good. A lost reply is an
RpcUnknownOutcomeError; calling again is safe, at worst using up more
change keys. The change position is random, so a repeat call can return
another transaction. Rejects with RpcError -5 for a transaction the
wallet does not know, -8 for a fee rate too low or a transaction with
descendants, -1 once the original or a replacement is mined (an input "is
already spent"), and -4 for insufficient funds or a fee above -maxtxfee.
Optionaloptions: PsbtBumpFeeOptionsAny allowlisted method, untyped: the result keeps every number as a
JsonNumber. For sendrawtransaction and submitpackage the txids are
computed from the hex, as the typed methods do, and for submitblock,
submitheader (opened with extraMethods) and submitauxblock the block
hash, so an unknown outcome still names them. For a long poll
(waitfornewblock, waitforblockheight, waitforblock) the wait is read
from its timeout parameter, which must be 1 to 3,590,000 ms: absent or 0,
the node would wait with no end, so it is a RangeError. The call's
deadline is then at least the wait plus 10 s, as for the typed long polls.
When the client sends it, it refuses an option qbit Core accepts and then
ignores (a TypeError), and redacts the node's error about
importdescriptors, deriveaddresses or getdescriptorinfo of the key
material of the descriptors sent, as for the typed methods; an
importdescriptors result is the node's as it is, and can quote a
descriptor in full.
The params are serialized here, once, and the request holds them as they
will be sent: parsed back without loss, every number a JsonNumber and
every object without a prototype. So a toJSON or a getter in them runs
once, and what the client checks when it sends them is what it sends; the
txids and the wait are read from them too. The depth limit counts the
request envelope they are sent in, as call() sends them; batch()
refuses an entry its array takes over the limit.
Rescan the chain from startHeight (default 0) to stopHeight (default
the tip) for the wallet's transactions. The default deadline is 120 s: see
Wallet administration.
Rejects with RpcError -8 for a height past the
wallet's tip, -4 while a rescan runs, and -13 while the wallet is locked.
Optionaloptions: { startHeight?: number; stopHeight?: number }Returns the txid. A failure after the request may have reached the node is
an RpcUnknownOutcomeError. maxFeeRateBitsPerKvB caps the fee rate, 1n
to 99,999,999n bits per 1,000 vbytes; left out, qbit Core's default cap of
0.1 QBT/kvB (10,000,000n) applies. 0n is refused: qbit Core reads 0 as no
cap at all. maxBurnAmountBits (default 0n) is the most the transaction
may send to provably unspendable outputs.
Optionaloptions: { maxBurnAmountBits?: bigint; maxFeeRateBitsPerKvB?: bigint }Sign a 32-byte hash with the PQC key that a wallet P2MR address commits
to, for sign-in or attestation: verifyDataPqcHash takes the result as
it is. Every signature counts against the key's signature budget (2^30),
so a failure after sending is an RpcUnknownOutcomeError, and a call
again signs again. includePqcUsage adds the key's budget fields, which
qbit Core advises enabling only for local diagnostics. pubkey,
leafScript and controlBlock choose the leaf when the address commits to
more than one. Rejects with RpcError -13 while the wallet is locked, and
-4 for an address the wallet does not have.
Optionaloptions: {Submit the AuxPoW proof for a candidate of requests.createAuxBlock,
by its hash. Null if the block was accepted, or a
BlockSubmissionReason. RpcError -22 for a proof that does not
decode. A failure after the request may have reached the node is an
RpcUnknownOutcomeError naming blockHash. Look it up with
getBlockHeader, and do not submit it again to find out: the node forgets
an accepted candidate, so that answers stale-prevblk.
Submit a solved block, whole, as hex. Null if it was accepted, or a
BlockSubmissionReason: duplicate and inconclusive are no
refusals. RpcError -22 for hex that does not decode as a block. A failure
after the request may have reached the node is an RpcUnknownOutcomeError
naming the block in blockHash, the hash of the hex's 80-byte header, when
it holds one. Look it up with getBlockHeader, or submit it again: a block
the node has answers duplicate.
Submit up to 25 signed transactions as one package, parents first and the
child last, so a child's fee can pay for its parents (CPFP). A refusal is
in the result, and may be partial: see PackageSubmission. A failure
after the request may have reached the node is an RpcUnknownOutcomeError
naming the package in txids. maxFeeRateBitsPerKvB and
maxBurnAmountBits are as for requests.sendRawTransaction, each
transaction checked: 0n as a fee-rate cap is refused.
Optionaloptions: { maxBurnAmountBits?: bigint; maxFeeRateBitsPerKvB?: bigint }Whether the mempool would accept each transaction, without broadcasting.
maxFeeRateBitsPerKvB caps the fee rate, 1n to 99,999,999n bits per 1,000
vbytes; left out, qbit Core's default cap of 0.1 QBT/kvB (10,000,000n)
applies. 0n is refused: qbit Core reads 0 as no cap at all.
Optionaloptions: { maxFeeRateBitsPerKvB?: bigint }Unload a wallet. With a client wallet, the name must be that one (-8
otherwise). The node answers once every call still running on the wallet
has ended, so its default deadline is 120 s. Rejects with RpcError -18
when it is not loaded, and -4 while it rescans.
Optionaloptions: { loadOnStartup?: boolean }Unlock wallet outputs (lockunspent with unlock true), whether they were
locked persistently or in memory only. The node checks every output first
and rejects with RpcError code -8, changing nothing, when one is unknown,
spent or not locked. outputs must not be empty: qbit Core unlocks nothing
for an empty list and every output when the list is left out, which is
call('lockunspent', [true]).
Takes a signDataPqcHash() result as it is: its fields beyond the proof's are allowed, and not read.
Hold the request until the tip reaches height or waitMs (1 to
3,590,000) has passed, then return the tip. A returned height below
height means the wait ran out, so it is not refused. See
Long polls.
Hold the request until the tip differs from options.currentTip (left out,
from the tip when the node runs the call: a block found between two calls
is missed, and the client does not retry it) or waitMs (1 to 3,590,000)
has passed, then return the tip. A returned tip equal to the one passed
means the wait ran out. A tip that is not the node's returns at once. See
Long polls.
Optionaloptions: { currentTip?: string }A PSBT paying args.outputs, funded from the wallet's coins with change
added, unsigned: sign it with requests.walletProcessPsbt. It counts
as side-effecting (with lockUnspents it locks the coins it selects), so
it is never retried.
Signs (by default) and finalizes what the wallet can. A failure after sending is an RpcUnknownOutcomeError.
Optionaloptions: {
Request builders for every typed method. Each validates its arguments (throwing
TypeErrororRangeErrorbefore anything is sent) and returns an RpcRequest carrying the result parser. Use them withQbitRpcClient.batch; the client's methods of the same name use them too.