Class: BitcoinCoreRpcClient ​
Defined in: packages/bitcoin/src/client/rpc/index.ts:67
Bitcoin Core RPC client.
Implements ​
Implements ​
Constructors ​
Constructor ​
new BitcoinCoreRpcClient(
config,executor?):BitcoinCoreRpcClient
Defined in: packages/bitcoin/src/client/rpc/index.ts:71
Parameters ​
config ​
executor? ​
Returns ​
BitcoinCoreRpcClient
Accessors ​
client ​
Get Signature ​
get client():
JsonRpcTransport
Defined in: packages/bitcoin/src/client/rpc/index.ts:80
Returns ​
config ​
Get Signature ​
get config():
RpcConfig
Defined in: packages/bitcoin/src/client/rpc/index.ts:76
Returns ​
Methods ​
createRawTransaction() ​
createRawTransaction(
inputs,outputs,locktime?,replacable?):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:200
Create a transaction spending the given inputs and creating new outputs.
Parameters ​
inputs ​
outputs ​
locktime? ​
number
replacable? ​
boolean
Returns ​
Promise<string>
Implementation of ​
BitcoinRpcClient.createRawTransaction
createSignSendRawTransaction() ​
createSignSendRawTransaction(
inputs,outputs):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:175
Creates, signs, and sends a raw transaction.
Parameters ​
inputs ​
outputs ​
Returns ​
Promise<string>
Implementation of ​
BitcoinRpcClient.createSignSendRawTransaction
deriveAddresses() ​
deriveAddresses(
descriptor,range?):Promise<DerivedAddresses[]>
Defined in: packages/bitcoin/src/client/rpc/index.ts:205
Derives one or more addresses corresponding to an output descriptor.
Parameters ​
descriptor ​
string
range? ​
number[]
Returns ​
Promise<DerivedAddresses[]>
Implementation of ​
BitcoinRpcClient.deriveAddresses
generateToAddress() ​
generateToAddress(
nblocks,address):Promise<string[]>
Defined in: packages/bitcoin/src/client/rpc/index.ts:210
Mines blocks to a given address (regtest/signet only). Returns array of block hashes.
Parameters ​
nblocks ​
number
address ​
string
Returns ​
Promise<string[]>
Implementation of ​
BitcoinRpcClient.generateToAddress
getBalance() ​
getBalance():
Promise<number>
Defined in: packages/bitcoin/src/client/rpc/index.ts:215
Returns the total available balance.
Returns ​
Promise<number>
Implementation of ​
getBlock() ​
getBlock(
__namedParameters):Promise<BlockResponse|undefined>
Defined in: packages/bitcoin/src/client/rpc/index.ts:110
Returns the block data associated with a blockhash of a valid block.
Parameters ​
__namedParameters ​
Returns ​
Promise<BlockResponse | undefined>
Implementation of ​
getBlockchainInfo() ​
getBlockchainInfo():
Promise<ChainInfo>
Defined in: packages/bitcoin/src/client/rpc/index.ts:142
Returns various blockchain state info.
Returns ​
Promise<ChainInfo>
Implementation of ​
BitcoinRpcClient.getBlockchainInfo
getBlockCount() ​
getBlockCount():
Promise<number>
Defined in: packages/bitcoin/src/client/rpc/index.ts:132
Returns the blockheight of the most-work fully-validated chain.
Returns ​
Promise<number>
Implementation of ​
BitcoinRpcClient.getBlockCount
getBlockHash() ​
getBlockHash(
height):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:137
Returns the blockhash of the block at the given height.
Parameters ​
height ​
number
Returns ​
Promise<string>
Implementation of ​
getNewAddress() ​
getNewAddress(
addressType,label?):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:220
Returns a new Bitcoin address for receiving payments.
Parameters ​
addressType ​
string
label? ​
string
Returns ​
Promise<string>
Implementation of ​
BitcoinRpcClient.getNewAddress
getRawTransaction() ​
getRawTransaction(
txid,verbosity?,blockhash?):Promise<RawTransactionResponse>
Defined in: packages/bitcoin/src/client/rpc/index.ts:261
Get detailed information about a transaction.
Parameters ​
txid ​
string
verbosity? ​
blockhash? ​
string
Returns ​
Promise<RawTransactionResponse>
getRawTransactions() ​
getRawTransactions(
txids,verbosity?):Promise<RawTransactionResponse[]>
Defined in: packages/bitcoin/src/client/rpc/index.ts:272
Get detailed information about multiple transactions using JSON-RPC batching.
Parameters ​
txids ​
string[]
verbosity? ​
Returns ​
Promise<RawTransactionResponse[]>
getTransaction() ​
getTransaction(
txid,include_watchonly?):Promise<WalletTransaction>
Defined in: packages/bitcoin/src/client/rpc/index.ts:256
Get detailed information about in-wallet transaction.
Parameters ​
txid ​
string
include_watchonly? ​
boolean
Returns ​
Promise<WalletTransaction>
listTransactions() ​
listTransactions(
params):Promise<ListTransactionsResult>
Defined in: packages/bitcoin/src/client/rpc/index.ts:190
Returns up to 'count' most recent transactions.
Parameters ​
params ​
Returns ​
Promise<ListTransactionsResult>
Implementation of ​
BitcoinRpcClient.listTransactions
listUnspent() ​
listUnspent(
params):Promise<UnspentTxInfo[]>
Defined in: packages/bitcoin/src/client/rpc/index.ts:225
Returns array of unspent transaction outputs.
Parameters ​
params ​
address? ​
string[]
include_unsafe? ​
boolean
maxconf? ​
number
minconf? ​
number
Returns ​
Promise<UnspentTxInfo[]>
Implementation of ​
sendRawTransaction() ​
sendRawTransaction(
hexstring,maxfeerate?,maxBurnAmount?):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:152
Submit a raw transaction (serialized, hex-encoded) to local node and network.
Parameters ​
hexstring ​
string
maxfeerate? ​
string | number
maxBurnAmount? ​
string | number
Returns ​
Promise<string>
Implementation of ​
BitcoinRpcClient.sendRawTransaction
sendToAddress() ​
sendToAddress(
address,amount):Promise<RawTransactionV2>
Defined in: packages/bitcoin/src/client/rpc/index.ts:240
Send an amount to a given address.
Parameters ​
address ​
string
amount ​
number
Returns ​
Promise<RawTransactionV2>
Implementation of ​
BitcoinRpcClient.sendToAddress
signAndSendRawTransaction() ​
signAndSendRawTransaction(
hexstring):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:161
Signs and sends a raw transaction.
Parameters ​
hexstring ​
string
Returns ​
Promise<string>
Implementation of ​
BitcoinRpcClient.signAndSendRawTransaction
signMessage() ​
signMessage(
address,message):Promise<string>
Defined in: packages/bitcoin/src/client/rpc/index.ts:246
Sign a message with the private key of an address.
Parameters ​
address ​
string
message ​
string
Returns ​
Promise<string>
Implementation of ​
signRawTransaction() ​
signRawTransaction(
hexstring):Promise<SignedRawTx>
Defined in: packages/bitcoin/src/client/rpc/index.ts:147
Sign inputs for raw transaction (serialized, hex-encoded).
Parameters ​
hexstring ​
string
Returns ​
Promise<SignedRawTx>
Implementation of ​
BitcoinRpcClient.signRawTransaction
verifyMessage() ​
verifyMessage(
address,signature,message):Promise<boolean>
Defined in: packages/bitcoin/src/client/rpc/index.ts:251
Verify a signed message.
Parameters ​
address ​
string
signature ​
string
message ​
string
Returns ​
Promise<boolean>