xrpl_hooks/api/
etxn.rs

1use super::*;
2
3/// Get the burden of a hypothetically emitted transaction
4#[inline(always)]
5pub fn etxn_burden() -> i64 {
6    unsafe { _c::etxn_burden() }
7}
8
9/// Produce an sfEmitDetails suitable for a soon-to-be emitted transaction
10#[inline(always)]
11pub fn etxn_details(emitdet: &mut [u8]) -> Result<u64> {
12    buf_write(emitdet, _c::etxn_details)
13}
14
15/// Estimate the required fee for a txn to be emitted successfully
16#[inline(always)]
17pub fn etxn_fee_base(tx_byte_count: u32) -> Result<u64> {
18    api_1arg_call(tx_byte_count, _c::etxn_fee_base)
19}
20
21/// Estimate the required fee for a txn to be emitted successfully
22#[inline(always)]
23pub fn etxn_reserve(count: u32) -> Result<u64> {
24    api_1arg_call(count, _c::etxn_reserve)
25}
26
27/// Get the generation of a hypothetically emitted transaction
28#[inline(always)]
29pub fn etxn_generation() -> i64 {
30    unsafe { _c::etxn_generation() }
31}
32
33/// Emit a new transaction from the hook
34#[inline(always)]
35pub fn emit(hash: &mut [u8], tx_buf: &[u8]) -> Result<u64> {
36    buf_write_read(hash, tx_buf, _c::emit)
37}