hooks_rs::api

Function etxn_fee_base_from_ptr

Source
pub fn etxn_fee_base_from_ptr<T>(
    tx_blob_ptr: *const T,
    tx_blob_len: usize,
) -> Result<u64>
Expand description

Estimate the required fee for a txn to be emitted successfully from a pointer to the transaction buffer. Does the same thing as etxn_fee_base but takes a pointer to the transaction buffer instead of a slice.

ยงExample

let xrp_payment_txn_buffer = XrpPaymentBuilder::uninit_buffer();

// fill the tranasction buffer
// ...
// ...

// finally, once the transaction buffer is filled except the fee part, estimate the fee.
let fee = match etxn_fee_base_from_ptr(xrp_payment_txn_buffer.as_ptr(), xrp_payment_txn_buffer.len());