The chain guard's state; see ChainStatus.
The qbit Core version the node reported (getnetworkinfo's version and
subversion) to the newest chain check sent that read one; undefined
before then. supported says whether this package supports it: qbit Core
1.0.x releases. See allowUnsupportedNodeVersion.
What util.inspect and console.log show: QbitRpcClient.toJSON's description, without credentials.
OptionalcallOptions: CallOptionsSend several read or wallet-read requests, long polls apart, in one JSON-RPC batch, matched
to their replies by id. Each entry succeeds or fails on its own, a throwing
parse included; a transport failure, timeout or oversized reply rejects
the whole batch.
OptionalcallOptions: CallOptionsCall any allowlisted method, or one in extraMethods, with positional
parameters. The result is returned unvalidated, with every number as a
JsonNumber. Pass amounts as strings from formatQbt(bits) (qbit Core
accepts amount strings) and integers above 2^53 as bigint.
OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsCount the PQC signatures signing psbt with this wallet would take from
each of its keys, before signing: decodepsbt gives the address of the
output each input spends, and getaddressinfo, for each address once in
one batch, its keys' states and signatures left. Each input needs one
signature from each key its address holds. Rejects with PqcSigningError
when an input names no address, a PQC state comes without its keys, a key
is exhausted or in a state this version does not know, or a key has
fewer signatures left than it needs. Resolves with each key's count, the
worst state, and a warning per critical key; an input whose address
holds no PQC key of this wallet needs none. Needs wallet-read; nothing is
signed. walletProcessPsbt runs it by default.
OptionalcallOptions: CallOptionsClose pooled keep-alive connections. The client stays usable; later calls open new ones.
Send getblockchaininfo, getblockhash 0 and getnetworkinfo in one
JSON-RPC batch, and compare the node's chain with expectedChain, its
genesis block hash with expectedGenesisHash and, on signet, its
signet_challenge with expectedSignetChallenge (a missing one differs),
and read its version into nodeVersion. On a match of all three, on a
supported version (or with allowUnsupportedNodeVersion), wallet-write, broadcast,
mining and wallet-admin calls are allowed; once the confirmation goes stale they re-run
this check before they are sent. On a mismatch, or an unsupported version,
they stay refused and this throws RpcChainGuardError (mismatch or
unsupported_version), as it does when any check finds one while this
call runs (its cookie read, checks, waits and retries included), unless a
confirmChain() begun after that mismatch cleared it first. It returns its
own last check's getblockchaininfo answer, which another check may have
overtaken: call getBlockchainInfo() for current block data. An
unsupported version is reported even when the node's getblockchaininfo
reply does not validate, as it may well be why. An answer that a
connection error or an HTTP 401 elsewhere may postdate is checked again,
after retryDelayMs, up to three checks per attempt; then this throws
reason: 'stale' (retried like a read under readRetries) and changes
nothing. This is a read and the check itself, so any other failure of it
is thrown as it is (RpcTimeoutError, RpcTransportError and so on, about
getblockchaininfo, getblockhash or getnetworkinfo, a version that does
not parse included), never reason: 'check_failed'.
OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.createWallet. Needs wallet-admin, as do the eight methods after it.
Optionaloptions: {OptionalcallOptions: CallOptionsOptionaloptions: { range?: DescriptorRange }OptionalcallOptions: CallOptionsOptionaloptions: { mode?: FeeEstimateMode }OptionalcallOptions: CallOptionsOptionaloptions: { extract?: boolean }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.getBalances.
OptionalcallOptions: CallOptionsSee requests.getBlock.
OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.getBlockHex.
OptionalcallOptions: CallOptionsSee requests.getBlockTemplate. With expectedChain: 'signet', the
rules default to ['segwit', 'signet'], as qbit Core requires there.
Optionaloptions: { capabilities?: readonly string[]; rules?: readonly string[] }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionaloptions: { btcHashrate?: number; mergeMiningPct?: number; securityLevel?: SecurityLevel }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionaloptions: { addressType?: AddressType; label?: string }OptionalcallOptions: CallOptionsOptionaloptions: { addressType?: AddressType }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionaloptions: { blockHash?: string }OptionalcallOptions: CallOptionsOptionaloptions: { blockHash?: string }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.getTxOut.
Optionaloptions: { includeMempool?: boolean }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.importDescriptors: its default deadline is 120 s.
OptionalcallOptions: CallOptionsSee requests.keypoolRefill: its default deadline is 120 s.
Optionaloptions: { newSize?: number }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsOptionaloptions: ListSinceBlockOptionsOptionalcallOptions: CallOptionsOptionaloptions: ListTransactionsOptionsOptionalcallOptions: CallOptionsSee requests.listUnspent.
Optionaloptions: ListUnspentOptionsOptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.loadWallet.
Optionaloptions: { loadOnStartup?: boolean }OptionalcallOptions: CallOptionsLock wallet outputs against automatic coin selection, in memory or, with
persistent, in the wallet. Resolves once every output is locked; see
requests.lockUnspent.
Optionaloptions: { persistent?: boolean }OptionalcallOptions: CallOptionsSee requests.psbtBumpFee.
Optionaloptions: PsbtBumpFeeOptionsOptionalcallOptions: CallOptionsSee requests.rescanBlockchain: its default deadline is 120 s.
Optionaloptions: { startHeight?: number; stopHeight?: number }OptionalcallOptions: CallOptionsOptionaloptions: { maxBurnAmountBits?: bigint; maxFeeRateBitsPerKvB?: bigint }OptionalcallOptions: CallOptionsSee requests.signDataPqcHash: each signature counts against the key's PQC signature budget.
Optionaloptions: {OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.submitBlock.
OptionalcallOptions: CallOptionsOptionaloptions: { maxBurnAmountBits?: bigint; maxFeeRateBitsPerKvB?: bigint }OptionalcallOptions: CallOptionsOptionaloptions: { maxFeeRateBitsPerKvB?: bigint }OptionalcallOptions: CallOptionsA description without credentials, for logs.
See requests.unloadWallet: its default deadline is 120 s.
Optionaloptions: { loadOnStartup?: boolean }OptionalcallOptions: CallOptionsUnlock wallet outputs, however they were locked. Resolves once every output is unlocked; see requests.unlockUnspent.
OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.verifyDataPqcHash: it takes a signDataPqcHash() result as it is.
OptionalcallOptions: CallOptionsLong-poll for a height, under the deadline QbitRpcClient.waitForNewBlock
has. A retry under readRetries asks for no more than the deadline has
left. See requests.waitForBlockHeight.
OptionalcallOptions: CallOptionsLong-poll for a new tip. The deadline is the call's timeoutMs, which must
be at least waitMs plus 10 s, else the longer of that and the client's
timeoutMs. Without options.currentTip it is never retried: a retry
would wait from the tip at that time, past a block found meanwhile. With
it, a retry under readRetries asks for no more than the deadline has
left. See requests.waitForNewBlock.
Optionaloptions: { currentTip?: string }OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsLock the wallet. qbit Core answers only once a first unlock still running
has ended, so the default deadline is QbitRpcClient.walletPassphrase's:
the call's timeoutMs if it gives one, else the longer of 120 s and the
client's timeoutMs. A deadline missed once the request was sent is an
RpcUnknownOutcomeError; one missed before that is an RpcTimeoutError,
or RpcChainGuardError check_failed with one as its cause.
OptionalcallOptions: CallOptionsUnlock the wallet for timeoutSeconds, counted from when the unlock ends.
The deadline is the call's timeoutMs if it gives one, else the longer
of 120 s and the client's timeoutMs:
qbit Core v1.0.0 runs a new encrypted wallet's deferred keypool top-up
inside its first unlock, which took 25 to 49 s on regtest. A deadline
missed once the request was sent is an RpcUnknownOutcomeError: the
wallet may be unlocked, and getWalletInfo().unlockedUntil (0 when
locked) tells. One missed before that (waiting for a request slot, reading
the cookie, connecting, or in the chain re-check) is an RpcTimeoutError,
or RpcChainGuardError check_failed with one as its cause, and
nothing was sent. Every call on that
wallet waits for a first unlock, and the others keep the client's
deadline, so one sent meanwhile can need a longer timeoutMs. See
Unlocking.
OptionalcallOptions: CallOptionsOptionalcallOptions: CallOptionsSee requests.walletProcessPsbt. When it signs (sign is not
false), it first runs QbitRpcClient.checkPqcSigning on psbt and
sends nothing to sign when that refuses: an exhausted PQC key signs nothing
and raises no error, and one that runs out partway leaves the inputs after
it unsigned. So it needs wallet-read too. The check's decodepsbt,
getaddressinfo batch and the signing share one deadline, the call's, and
its signal; a failure of the check is thrown as it is, with nothing signed.
pqcCheck: false skips the check, which is unsafe: only for a caller that
counts the budgets itself, or knows the wallet has no PQC key.
Optionaloptions: {OptionalcallOptions: CallOptions
A JSON-RPC client for one qbit Core node (and optionally one wallet).
Every method is checked against an allowlist and the client's capabilities before anything is sent, wallet-write, broadcast, mining and wallet-admin calls also need a confirmed chain, and every typed result is validated before it is returned. Amounts are
bigintbits. See Errors for the failure model.Each typed method takes the arguments of the request builder of the same name in requests, then CallOptions (
signal,timeoutMs) as a separate last argument:getTxOut(txid, vout, { includeMempool }, { timeoutMs }). A method's own options never hold call options.