Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Produce an sfEmitDetails suitable for a soon-to-be emitted transaction
Generate and write a 105 byte sfEmitDetails object into the write_ptr
if cbak is not defined
Generate and write a 127 byte sfEmitDetails object into the write_ptr
if cbak is defined.
C
C
write_ptr
uint32_t
Pointer to the buffer receiving the sfEmitDetails record
write_len
uint32_t
Length of the buffer
int64_t
The number of bytes written.
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
TOO_SMALL
- Buffer isn't large enough to receive record
PREREQUISITE_NOT_MET
- The hook failed to call etxn_reserve(n)
first
FEE_TOO_LARGE
- The burden would be too high for the network to allow.
INTERNAL_ERROR
- A generic error in which rippled had trouble generating the required field.
Get the generation of a hypothetically emitted transaction
Return the generation an emitted transaction will carry.
C
C
None
int64_t
The generation an emitted transaction will need in order to be successfully passed to emit()
🚧 WarningFees on a Hooks-enabled ledger are non trivial. See: Hook Fees for details.
Return the amount of the fee in drops recommended for a to-be emitted transaction.
C
C
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.
int64_t
The smallest number of drops that an emitted txn would need to be accepted.
If negative, an error:
OUT_OF_BOUNDS
- The provided buffer is not validly within the hook memory.
PREREQUISITE_NOT_MET
- etxn_reserve
has not been called first.
INVALID_TXN
- The provided buffer did not contain a valid serialized transaction. (Deserialization failed, or a required field was missing.)
Estimate the required fee for a txn to be emitted successfully
Specifies a number of emitted transactions this hook might emit during execution.
C
C
count
uint32_t
The largest number of transactions this hook might emit during the course of one execution.
int64_t
The maximum number of emitted transactions this hook may emit. This will always be the same as the count
parameter or an error as below.
If negative, an error:
ALREADY_SET
- The hook already called this function earlier.
TOO_BIG
- The specified number of emitted transactions is too large.
int64_t
The burden an emitted transaction will need in order to be successfully passed to emit()
write_ptr
uint32_t
Pointer to a buffer to write the transaction hash to
write_len
uint32_t
The size of the buffer to write the transaction hash to (should be 32.)
read_ptr
uint32_t
Pointer to the transaction to emit
read_len
uint32_t
The length of the transaction
int64_t
On success, the number of bytes of transaction hash written (32), or:
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
PREREQUISITE_NOT_MET
- emit_reserve
must be called first
TOO_MANY_EMITTED_TXN
- the number of emitted transactions is now greater than the promise made when emit_reserve
was called earlier
EMISSION_FAILURE
- the transaction was malformed according to the emission rules.
write_ptr
uint32_t
Pointer to a buffer of a suitable size to store the output. Should be at least 32 bytes.
write_len
uint32_t
Length of the output buffer.
int64_t
The number of bytes written
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.