etxn_fee_base
Concepts
Section titled “Concepts”Behaviour
Section titled “Behaviour”- Return the amount of the fee in drops recommended for a to-be emitted transaction.
Definition
Section titled “Definition”int64_t etxn_fee_base ( uint32_t read_ptr, uint32_t read_len);
function etxn_fee_base(txblob: ByteArray | HexString): ErrorCode | number
Example
Section titled “Example”int64_t fee_to_pay = etxn_fee_base(tx_blob, tx_blob_len);
const fee_to_pay = etxn_fee_base(tx_blob)
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
read_ptr | uint32_t | Pointer to the buffer containing the serialized transaction you intend to emit. The fee field is required but ignored (you may use zero). Use the output of this function to populate the fee field correctly. |
read_len | uint32_t | The length of the tx blob. |
Name | Type | Description |
---|---|---|
txblob | ByteArray | HexString | The transaction blob, which can be an array of numbers or a string. |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The smallest number of drops that an emitted txn would need to be accepted. |
Type | Description |
---|---|
number | An ErrorCode if there is an error, or the calculated base fee on success. |