Methods are sorted alphabetically. Each method documents its parameters, return values, and possible errors.
Copies a block.
Parameters:
block(reference, required): Block reference
Result: Reference - Contains the copied block (e.g., {"ref": "$block_copy"})
Error: null (cannot return error)
Returns the number of transactions in a block.
Parameters:
block(reference, required): Block reference
Result: Integer - The transaction count
Error: null (cannot return error)
Creates a block object from raw block data.
Parameters:
raw_block(string, required): Hex-encoded raw block data
Result: Reference - Contains the created block (e.g., {"ref": "$block"})
Error: {} when operation fails
Destroys a block.
Parameters:
block(reference, required): Block reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Gets the hash of a block.
Parameters:
block(reference, required): Block reference
Result: Reference - Contains the returned block hash (e.g., {"ref": "$block_hash"})
Error: null (cannot return error)
Gets the block header from a block.
Parameters:
block(reference, required): Block reference
Result: Reference - Contains the returned block header (e.g., {"ref": "$header"}). The returned block header reference depends on the lifetime of the parent block and does not require an explicit destroy call.
Error: null (cannot return error)
Retrieves the transaction at the given index from a block.
Parameters:
block(reference, required): Block referencetransaction_index(integer, required): Zero-based transaction index
Result: Reference - Contains the returned transaction (e.g., {"ref": "$transaction"}). The returned transaction reference depends on the lifetime of the parent block and does not require an explicit destroy call.
Error: null (cannot return error)
Copies a block hash.
Parameters:
block_hash(reference, required): Block hash reference
Result: Reference - Contains the copied block hash (e.g., {"ref": "$block_hash_copy"})
Error: null (cannot return error)
Creates a block hash object from raw 32-byte block hash data.
Parameters:
block_hash(string, required): Hex-encoded raw 32-byte block hash data
Result: Reference - Contains the created block hash (e.g., {"ref": "$block_hash"})
Error: null (cannot return error)
Destroys a block hash.
Parameters:
block_hash(reference, required): Block hash reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Checks if two block hashes are equal.
Parameters:
hash1(reference, required): First block hash referencehash2(reference, required): Second block hash reference
Result: Boolean - true if the hashes are equal
Error: null (cannot return error)
Returns the raw 32-byte block hash as a hex string.
Parameters:
block_hash(reference, required): Block hash reference
Result: String - Hex-encoded raw 32-byte block hash data
Error: null (cannot return error)
Copies a block header.
Parameters:
header(reference, required): Block header reference
Result: Reference - Contains the copied block header (e.g., {"ref": "$header_copy"})
Error: null (cannot return error)
Creates a block header object from raw serialized header data.
Parameters:
raw_block_header(string, required): Hex-encoded raw block header data. At least 80 bytes are required; if additional bytes are provided, only the first 80 bytes are used to create the header.
Result: Reference - Contains the created block header (e.g., {"ref": "$header"})
Error: {} if fewer than 80 bytes are provided for the serialized block header
Destroys a block header.
Parameters:
header(reference, required): Block header reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Gets the nBits difficulty target of a block header.
Parameters:
header(reference, required): Block header reference
Result: Integer - The nBits value
Error: null (cannot return error)
Gets the hash of a block header.
Parameters:
header(reference, required): Block header reference
Result: Reference - Contains the returned block hash (e.g., {"ref": "$block_hash"})
Error: null (cannot return error)
Gets the nonce of a block header.
Parameters:
header(reference, required): Block header reference
Result: Integer - The nonce value
Error: null (cannot return error)
Gets the previous block hash from a block header.
Parameters:
header(reference, required): Block header reference
Result: Reference - Contains the returned previous block hash (e.g., {"ref": "$prev_hash"}). The returned block hash reference depends on the lifetime of the parent block header and does not require an explicit destroy call.
Error: null (cannot return error)
Gets the timestamp of a block header.
Parameters:
header(reference, required): Block header reference
Result: Integer - The block timestamp as a Unix timestamp
Error: null (cannot return error)
Gets the version field of a block header.
Parameters:
header(reference, required): Block header reference
Result: Integer - The block version
Error: null (cannot return error)
Returns the consensus-serialized block header as a hex string.
Parameters:
header(reference, required): Block header reference
Result: String - Hex-encoded consensus serialization of the block header
Error: {} when operation fails
Returns the consensus-serialized block as a hex string.
Parameters:
block(reference, required): Block reference
Result: String - Hex-encoded consensus serialization of the block
Error: {} when operation fails
Gets the block hash from a block tree entry.
Parameters:
block_tree_entry(reference, required): Block tree entry reference
Result: Reference - Contains the returned block hash (e.g., {"ref": "$block_hash"}). The returned block hash reference is a view that depends on the lifetime of the parent block tree entry and does not require an explicit destroy call.
Error: null (cannot return error)
Checks whether a block tree entry is part of the active chain.
Parameters:
chain(reference, required): Chain referenceblock_tree_entry(reference, required): Block tree entry reference to check
Result: Boolean - true if block is in the active chain, false otherwise
Error: null (cannot return error)
Retrieves a block tree entry at a specific height in the chain.
Parameters:
chain(reference, required): Chain referenceblock_height(integer, required): Height to query
Result: Reference - Contains the returned block tree entry (e.g., {"ref": "$block_tree_entry"}). The returned block tree entry reference depends on the lifetime of the parent chain reference and does not require an explicit destroy call.
Error: {} if the requested height is out of bounds
Gets the current height of the active chain.
Parameters:
chain(reference, required): Chain reference
Result: Integer - The chain height (0 = genesis)
Error: null (cannot return error)
Creates a chainstate manager from a context.
Parameters:
context(reference, required): Context reference
Result: Reference - Contains the created chainstate manager (e.g., {"ref": "$chainstate_manager"})
Error: {} when operation fails
Destroys a chainstate manager and frees associated resources.
Parameters:
chainstate_manager(reference, required): Chainstate manager reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Retrieves the currently active chain from the chainstate manager.
Parameters:
chainstate_manager(reference, required): Chainstate manager reference
Result: Reference - Contains the returned active chain (e.g., {"ref": "$chain"}). The returned chain reference depends on the lifetime of the parent chainstate manager and does not require an explicit destroy call.
Error: null (cannot return error)
Processes a block through validation checks, disk storage, and UTXO set validation; successful processing does not indicate block validity.
Parameters:
chainstate_manager(reference, required): Chainstate manager referenceblock(reference, required): Block reference
Result: Object containing:
new_block(boolean):trueif this block was not processed before,falseotherwise
Error: {} when operation fails
Creates a context with specified chain parameters.
Parameters:
chain_parameters(object, required)chain_type(string, required): Chain type. Allowed values:btck_ChainType_MAINNETbtck_ChainType_TESTNETbtck_ChainType_TESTNET_4btck_ChainType_SIGNETbtck_ChainType_REGTEST
Result: Reference - Contains the created context (e.g., {"ref": "$context"})
Error: {} when operation fails
Destroys a context and frees associated resources.
Parameters:
context(reference, required): Context reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Creates precomputed transaction data for script verification. Precomputed data is reusable when verifying multiple inputs of the same transaction.
Parameters:
tx_to(reference, required): Transaction referencespent_outputs(array of references, optional): Array of TransactionOutput references. Required whenbtck_ScriptVerificationFlags_TAPROOTis set
Result: Reference - Contains the created precomputed transaction data (e.g., {"ref": "$precomputed_txdata"})
Error: {} when operation fails
Destroys precomputed transaction data and frees associated resources.
Parameters:
precomputed_txdata(reference, required): Precomputed transaction data reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Copies a script pubkey.
Parameters:
script_pubkey(reference, required): Script pubkey reference
Result: Reference - Contains the copied script pubkey (e.g., {"ref": "$script_pubkey_copy"})
Error: null (cannot return error)
Creates a script pubkey object from hex-encoded data.
Parameters:
script_pubkey(string, required): Hex-encoded script pubkey data
Result: Reference - Contains the created script pubkey (e.g., {"ref": "$script_pubkey"})
Error: null (cannot return error)
Destroys a script pubkey and frees associated resources.
Parameters:
script_pubkey(reference, required): Script pubkey reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Serializes a script pubkey to raw bytes encoded as hex.
Parameters:
script_pubkey(reference, required): Script pubkey reference
Result: String - Hex-encoded serialized script pubkey bytes
Error: {} when operation fails
Verifies a script pubkey against spending conditions.
Parameters:
script_pubkey(reference, required): ScriptPubkey referenceamount(number, required): Amount of the script pubkey's associated output. May be zero if the witness flag is not settx_to(reference, required): Transaction referenceprecomputed_txdata(reference, optional): PrecomputedTransactionData reference. Required when the taproot flag is setinput_index(number, required): Index of the input in tx_to spending the script_pubkeyflags(array of strings, required): Script verification flags controlling validation constraints. Allowed values:btck_ScriptVerificationFlags_NONEbtck_ScriptVerificationFlags_P2SHbtck_ScriptVerificationFlags_DERSIGbtck_ScriptVerificationFlags_NULLDUMMYbtck_ScriptVerificationFlags_CHECKLOCKTIMEVERIFYbtck_ScriptVerificationFlags_CHECKSEQUENCEVERIFYbtck_ScriptVerificationFlags_WITNESSbtck_ScriptVerificationFlags_TAPROOT
Result: Boolean - true if script is valid, false if invalid
Error: On error, returns {"code": {"type": "btck_ScriptVerifyStatus", "member": ...}} where member can be one of:
ERROR_INVALID_FLAGS_COMBINATION- Invalid or inconsistent verification flags were provided. This occurs when the suppliedscript_verify_flagscombination violates internal consistency rules.ERROR_SPENT_OUTPUTS_REQUIRED- Spent outputs are required but were not provided (e.g., for Taproot verification).
Copies a transaction.
Parameters:
transaction(reference, required): Transaction reference
Result: Reference - Contains the copied transaction (e.g., {"ref": "$transaction_copy"})
Error: null (cannot return error)
Returns the number of inputs in a transaction.
Parameters:
transaction(reference, required): Transaction reference
Result: Integer - The input count
Error: null (cannot return error)
Returns the number of outputs in a transaction.
Parameters:
transaction(reference, required): Transaction reference
Result: Integer - The output count
Error: null (cannot return error)
Creates a transaction object from raw hex-encoded transaction data.
Parameters:
raw_transaction(string, required): Hex-encoded raw transaction data
Result: Reference - Contains the created transaction (e.g., {"ref": "$transaction"})
Error: {} when operation fails
Destroys a transaction.
Parameters:
transaction(reference, required): Transaction reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Retrieves the input at the given index from a transaction.
Parameters:
transaction(reference, required): Transaction referenceinput_index(integer, required): Zero-based input index
Result: Reference - Contains the returned transaction input (e.g., {"ref": "$transaction_input"}). The returned transaction input reference is a view that depends on the lifetime of the parent transaction and does not require an explicit destroy call.
Error: null (cannot return error)
Retrieves the output at the given index from a transaction.
Parameters:
transaction(reference, required): Transaction referenceoutput_index(integer, required): Zero-based output index
Result: Reference - Contains the returned transaction output (e.g., {"ref": "$transaction_output"}). The returned transaction output reference is a view that depends on the lifetime of the parent transaction and does not require an explicit destroy call.
Error: null (cannot return error)
Gets the txid of a transaction.
Parameters:
transaction(reference, required): Transaction reference or transaction view reference
Result: Reference - Contains the returned txid (e.g., {"ref": "$txid"}). The returned txid reference is a view that depends on the lifetime of the parent transaction and does not require an explicit destroy call.
Error: null (cannot return error)
Copies a transaction input.
Parameters:
transaction_input(reference, required): Transaction input reference
Result: Reference - Contains the copied transaction input (e.g., {"ref": "$transaction_input_copy"})
Error: null (cannot return error)
Destroys a transaction input.
Parameters:
transaction_input(reference, required): TransactionInput reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Gets the out point from a transaction input.
Parameters:
transaction_input(reference, required): Transaction input reference
Result: Reference - Contains the returned transaction out point (e.g., {"ref": "$transaction_out_point"}). The returned transaction out point reference is a view that depends on the lifetime of the parent transaction input and does not require an explicit destroy call.
Error: null (cannot return error)
Copies a transaction out point.
Parameters:
transaction_out_point(reference, required): Transaction out point reference
Result: Reference - Contains the copied transaction out point (e.g., {"ref": "$transaction_out_point_copy"})
Error: null (cannot return error)
Destroys a transaction out point.
Parameters:
transaction_out_point(reference, required): Transaction out point reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Gets the output index from a transaction out point.
Parameters:
transaction_out_point(reference, required): Transaction out point reference
Result: Integer - The output index
Error: null (cannot return error)
Gets the txid from a transaction out point.
Parameters:
transaction_out_point(reference, required): Transaction out point reference
Result: Reference - Contains the returned txid (e.g., {"ref": "$txid"}). The returned txid reference is a view that depends on the lifetime of the parent transaction out point and does not require an explicit destroy call.
Error: null (cannot return error)
Copies a transaction output.
Parameters:
transaction_output(reference, required): Transaction output reference
Result: Reference - Contains the copied transaction output (e.g., {"ref": "$transaction_output_copy"})
Error: null (cannot return error)
Creates a transaction output from a script pubkey reference and amount.
Parameters:
script_pubkey(reference, required): ScriptPubkey referenceamount(number, required): Amount in satoshis
Result: Reference - Contains the created transaction output (e.g., {"ref": "$transaction_output"})
Error: null (cannot return error)
Destroys a transaction output.
Parameters:
transaction_output(reference, required): Transaction output reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Gets the amount in satoshis from a transaction output.
Parameters:
transaction_output(reference, required): Transaction output reference
Result: Integer - The amount in satoshis
Error: null (cannot return error)
Gets the script pubkey of a transaction output.
Parameters:
transaction_output(reference, required): Transaction output reference
Result: Reference - Contains the returned script pubkey (e.g., {"ref": "$script_pubkey"}). The returned script pubkey reference is a view that depends on the lifetime of the parent transaction output and does not require an explicit destroy call.
Error: null (cannot return error)
Returns the consensus-serialized transaction as a hex string.
Parameters:
transaction(reference, required): Transaction reference
Result: String - Hex-encoded consensus serialization of the transaction
Error: {} when operation fails
Copies a txid.
Parameters:
txid(reference, required): Txid reference
Result: Reference - Contains the copied txid (e.g., {"ref": "$txid_copy"})
Error: null (cannot return error)
Destroys a txid.
Parameters:
txid(reference, required): Txid reference to destroy
Result: null (void operation)
Error: null (cannot return error)
Checks if two txids are equal.
Parameters:
txid1(reference, required): First txid referencetxid2(reference, required): Second txid reference
Result: Boolean - true if the txids are equal
Error: null (cannot return error)
Returns the txid as raw bytes encoded as hex.
Parameters:
txid(reference, required): Txid reference
Result: String - Hex-encoded raw 32-byte txid
Error: null (cannot return error)