Class: BitcoinTransaction ​
Defined in: packages/bitcoin/src/client/rest/transaction.ts:4
Constructors ​
Constructor ​
new BitcoinTransaction(
api):BitcoinTransaction
Defined in: packages/bitcoin/src/client/rest/transaction.ts:7
Parameters ​
api ​
(params) => Promise<any>
Returns ​
BitcoinTransaction
Methods ​
get() ​
get(
txid):Promise<RawTransactionRest>
Defined in: packages/bitcoin/src/client/rest/transaction.ts:17
Returns the transaction in JSON format. See Esplora GET /tx/:txid for details.
Parameters ​
txid ​
string
The transaction id (required).
Returns ​
Promise<RawTransactionRest>
A promise resolving to data about a transaction in the form specified by verbosity.
getHex() ​
getHex(
txid):Promise<string>
Defined in: packages/bitcoin/src/client/rest/transaction.ts:39
Returns the raw transaction in hex or as binary data. See Esplora GET /tx/:txid/hex and Esplora GET /tx/:txid/raw for details.
Parameters ​
txid ​
string
The transaction id (required).
Returns ​
Promise<string>
A promise resolving to the raw transaction in the specified format.
getRaw() ​
getRaw(
txid):Promise<Bytes>
Defined in: packages/bitcoin/src/client/rest/transaction.ts:50
Returns the raw transaction in hex or as binary data. See Esplora GET /tx/:txid/hex and Esplora GET /tx/:txid/raw for details.
Parameters ​
txid ​
string
The transaction id (required).
Returns ​
Promise<Bytes>
A promise resolving to the raw transaction in the specified format.
isConfirmed() ​
isConfirmed(
txid):Promise<boolean>
Defined in: packages/bitcoin/src/client/rest/transaction.ts:27
Returns the transaction in JSON format. See Esplora GET /tx/:txid for details.
Parameters ​
txid ​
string
The transaction id (required).
Returns ​
Promise<boolean>
A promise resolving to data about a transaction in the form specified by verbosity.
send() ​
send(
tx):Promise<string>
Defined in: packages/bitcoin/src/client/rest/transaction.ts:61
Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success. See Esplora POST /tx for details.
Parameters ​
tx ​
string
The raw transaction in hex format (required).
Returns ​
Promise<string>
The transaction id of the broadcasted transaction.