Module api

Source
Expand description

XRPL Hooks API

Re-exports§

pub use self::Result::*;

Structs§

XFL
XFL floating point numbers

Enums§

AccountType
Account type
AmountType
Amount type
DataRepr
Data representation
Error
Possible errors returned by Hook APIs.
FieldId
Field type
FieldOrXrpAmount
Field or amount type
KeyletType
Keylet type
Result
Result is a type that represents either success (Ok) or failure (Err). This is simple version of Result type to comply XRPL Hooks Webassembly restrictions
SlotTypeFlags
Flags for slot_type
TxnType
Transaction type
XFLCompareMode
XFL compare mode

Constants§

ACC_ID_LEN
Account id buffer lenght
AMOUNT_LEN
Amount buffer lenght
CURRENCY_CODE_SIZE
Currency code buffer lenght
EMIT_DETAILS_SIZE
Emit details buffer lenght
HASH_LEN
Hash buffer lenght
KEYLET_LEN
Keylet buffer lenght
LEDGER_HASH_LEN
Ledger hash buffer lenght
NONCE_LEN
Nonce buffer lenght
PREPARE_PAYMENT_SIMPLE_SIZE
Payment simple transaction buffer lenght
STATE_KEY_LEN
State key buffer lenght
TF_CANONICAL
Flags canonical

Functions§

_g
Guard function
accept
Accept the originating transaction and commit any changes the hook made
emit
Emit a new transaction from the hook
etxn_burden
Get the burden of a hypothetically emitted transaction
etxn_details
Produce an sfEmitDetails suitable for a soon-to-be emitted transaction
etxn_fee_base
Estimate the required fee for a txn to be emitted successfully
etxn_generation
Get the generation of a hypothetically emitted transaction
etxn_reserve
Estimate the required fee for a txn to be emitted successfully
fee_base
Fetch the fee base of the current ledger
float_compare
Perform a comparison on two XFL floating point numbers
float_divide
Divide an XFL by another XFL floating point number
float_exponent
Get the exponent of an XFL enclosing number
float_exponent_set
Set the exponent of an XFL enclosing number
float_int
Convert an XFL floating point into an integer (floor)
float_invert
Divide one by an XFL floating point number
float_mantissa
Get the mantissa of an XFL enclosing number
float_mantissa_set
Set the mantissa of an XFL enclosing number
float_mulratio
Multiply an XFL floating point by a non-XFL numerator and denominator
float_multiply
Multiply two XFL numbers together
float_negate
Negate an XFL floating point number
float_one
Return the number 1 represented in an XFL enclosing number
float_set
Create a float from an exponent and mantissa
float_sign
Get the sign of an XFL enclosing number
float_sign_set
Set the sign of an XFL enclosing number
float_sto
Output an XFL as a serialized object
float_sto_set
Read a serialized amount into an XFL
float_sum
Add two XFL numbers together
hook_account
Retreive the 20 byte Account ID the Hook is executing on
hook_hash
Retreive the 32 byte namespace biased SHA512H of the currently executing Hook
ledger_last_hash
Retreive the 32 byte namespace biased SHA512H of the last closed ledger
ledger_seq
Fetch the current ledger sequence number
nonce
Generate a 32 byte nonce for use in an emitted transaction
otxn_burden
Get the burden of the originating transaction
otxn_field
Serialize and output a field from the originating transaction
otxn_field_txt
Output a field from the originating transaction as a human readable string
otxn_generation
Get the generation of the originating transaction
otxn_id
Output the canonical hash of the originating transaction
otxn_slot
Load the originating transaction into a slot
otxn_type
Get the Transaction Type of the originating transaction
rollback
Reject the originating transaction and discard any changes the hook made
slot
Serialize and output a slotted object
slot_clear
Free up a currently occupied slot
slot_count
Count the elements of an array object in a slot
slot_float
Parse the STI_AMOUNT in the specified slot and return it as an XFL enclosed number
slot_id
Slot ID
slot_set
Locate an object based on its keylet and place it into a slot
slot_size
Compute the serialized size of an object in a slot
slot_subarray
Index into a slotted array and assign a sub-object to another slot
slot_subfield
Index into a slotted object and assign a sub-object to another slot
slot_type
Retrieve the field code of an object in a slot and, optionally, some other information
state
Retrieve the data pointed to by a Hook State key and write it to an output buffer
state_foreign
Retrieve the data pointed to, on another account, by a Hook State key and write it to an output buffer
state_set
Set the Hook State for a given key and value
sto_emplace
Emplace a field into an existing STObject at its canonical placement
sto_erase
Remove a field from an STObject
sto_subarray
Index into a xrpld serialized array and return the location and length of an index
sto_subfield
Index into a xrpld serialized object and return the location and length of a subfield
sto_validate
Validate an STObject
trace
Write the contents of a buffer to the XRPLD trace log
trace_float
Write a XFL float to the XRPLD trace log
trace_num
Write an integer to the XRPLD trace log
trace_slot
Write the contents of a slot to the XRPLD trace log
util_accid
Convert an r-address into a 20 byte Account ID
util_keylet
Compute a serialized keylet of a given type
util_raddr
Convert a 20 byte Account ID to an r-address
util_sha512h
Compute an sha512-half over some data
util_verify
Verify a cryptographic signature

Type Aliases§

AccountId
Account id buffer
Amount
Amount buffer
Buffer
Buffer of the specified size
CurrencyCode
Currency code buffer
EmitDetails
Emit details buffer
Hash
Hash buffer
Keylet
Keylet buffer
Nonce
Nonce buffer
StateKey
State key buffer
TxnPaymentSimple
Simple payment transaction buffer