-
<static> binaryEncode(chain, block_height, block_index, utxo_index)
-
The txref is binary data encoded over a set number of bytes, determined
by whether a utxoIndex is supplied.
Parameters:
| Name |
Type |
Description |
chain |
string
|
chain The name of the btc chain mainnet or testnet |
block_height |
Number
|
The block in which the transaction is found |
block_index |
Number
|
The position in the block where the transaction is found |
utxo_index |
Number
|
The position of the utxo in the transaction input |
Returns:
txref
A binary encoded txref
-
Type
-
binary
-
<static> binaryToString(data)
-
Convert binary txref to a bech32 formatted string with
delimiters to make it more human readable.
Parameters:
| Name |
Type |
Description |
data |
binary
|
The binary encoded bech32 txref. |
Returns:
txref - The txref in human readable form
-
Type
-
string
-
<static> decode(txref)
-
Convert a txref to ttransaction data
Parameters:
| Name |
Type |
Description |
txref |
Txref
|
The txref encoding the transaction position |
Returns:
tx - The transaction data encoded in the txref
-
Type
-
Object
-
<static> encode(chain, blockHeight, blockIndex, utxoIndex)
-
Encode transaction location data into a txref
Parameters:
| Name |
Type |
Description |
chain |
string
|
chain The name of the btc chain mainnet or testnet |
blockHeight |
Number
|
The block in which the transaction is found |
blockIndex |
Number
|
The position in the block where the transaction is found |
utxoIndex |
Number
|
The position of the utxo in the transaction input |
Returns:
txref - The Bech32 txref
-
Type
-
string