Expand description
XRPL Hooks API
Re-exports§
pub use self::Result::*;
Structs§
- XFL
- XFL floating point numbers
Enums§
- Account
Type - Account type
- Amount
Type - Amount type
- Data
Repr - Data representation
- Error
- Possible errors returned by Hook APIs.
- FieldId
- Field type
- Field
OrXrp Amount - Field or amount type
- Keylet
Type - 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- Slot
Type Flags - Flags for slot_type
- TxnType
- Transaction type
- XFLCompare
Mode - 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§
- Account
Id - Account id buffer
- Amount
- Amount buffer
- Buffer
- Buffer of the specified size
- Currency
Code - Currency code buffer
- Emit
Details - Emit details buffer
- Hash
- Hash buffer
- Keylet
- Keylet buffer
- Nonce
- Nonce buffer
- State
Key - State key buffer
- TxnPayment
Simple - Simple payment transaction buffer