Class: BitcoinAddress ​
Defined in: packages/bitcoin/src/client/rest/address.ts:8
Implements a strongly-typed BitcoinRest to connect to remote bitcoin node via REST API for address-related operations. BitcoinAddress
Constructors ​
Constructor ​
new BitcoinAddress(
api):BitcoinAddress
Defined in: packages/bitcoin/src/client/rest/address.ts:11
Parameters ​
api ​
(params) => Promise<any>
Returns ​
BitcoinAddress
Methods ​
getConfirmedTxs() ​
getConfirmedTxs(
addressOrScripthash,lastSeenTxId?):Promise<RawTransactionRest[]>
Defined in: packages/bitcoin/src/client/rest/address.ts:67
Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
lastSeenTxId? ​
string
The last transaction id seen by the previous query (optional).
Returns ​
Promise<RawTransactionRest[]>
A promise resolving to an array of RawTransactionRest objects.
getInfo() ​
getInfo(
addressOrScripthash):Promise<AddressInfo>
Defined in: packages/bitcoin/src/client/rest/address.ts:56
Get information about an address/scripthash. Available fields: address/scripthash, chain_stats and mempool_stats. {chain,mempool}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count and spent_txo_sum. Elements-based chains don't have the {funded,spent}_txo_sum fields.
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
Returns ​
Promise<AddressInfo>
A promise resolving to an AddressInfo object.
getTxs() ​
getTxs(
addressOrScripthash):Promise<RawTransactionRest[]>
Defined in: packages/bitcoin/src/client/rest/address.ts:22
Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. See Esplora GET /address/:address/txs for details.
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
Returns ​
Promise<RawTransactionRest[]>
A promise resolving to an array of RawTransactionRest objects.
getTxsMempool() ​
getTxsMempool(
addressOrScripthash):Promise<RawTransactionRest[]>
Defined in: packages/bitcoin/src/client/rest/address.ts:44
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
Returns ​
Promise<RawTransactionRest[]>
A promise resolving to an array of RawTransactionRest objects.
getUtxos() ​
getUtxos(
addressOrScripthash):Promise<AddressUtxo[]>
Defined in: packages/bitcoin/src/client/rest/address.ts:81
Get the list of unspent transaction outputs associated with the address/scripthash. See Esplora GET /address/:address/utxo for details.
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
Returns ​
Promise<AddressUtxo[]>
A promise resolving to an array of RawTransactionRest objects.
isFundedAddress() ​
isFundedAddress(
addressOrScripthash):Promise<boolean>
Defined in: packages/bitcoin/src/client/rest/address.ts:32
Calls getAddressTxs and checks if any funds come back. Toggle if those funds are confirmed.
Parameters ​
addressOrScripthash ​
string
The address or scripthash to check.
Returns ​
Promise<boolean>
True if the address has any funds, false otherwise.