Module host

Module host 

Source
Expand description

Host bindings and utilities exposed to WASM smart contracts.

This module exposes the low-level host ABI plus typed primitives (Result, Error, helpers). Most users should prefer the safe, high-level APIs in crate::core, which wrap these bindings.

§Float Operations for Fungible Tokens (IOUs)

The host provides float arithmetic functions for XRPL’s fungible token amounts. These operations use rippled’s Number class via FFI to ensure exact consensus compatibility:

  • float_from_int / float_from_uint - Convert integers to float format
  • float_set - Create float from exponent and mantissa
  • float_add / float_subtract / float_multiply / float_divide - Arithmetic
  • float_pow / float_root / float_log - Mathematical functions
  • float_compare - Comparison operations

All operations support explicit rounding modes (0=ToNearest, 1=TowardsZero, 2=Downward, 3=Upward).

See the host_bindings documentation for detailed function signatures.

Modules§

assert
Assertion macros for WASM environments.
error_codes
trace

Enums§

Error
Possible errors returned by XRPL Programmability APIs.
Result
Result is a type that represents either a success (Ok) or failure (Err) result from the host.

Functions§

account_keylet⚠
amendment_enabled⚠
amm_keylet⚠
cache_ledger_obj⚠
check_keylet⚠
check_sig⚠
compute_sha512_half⚠
credential_keylet⚠
delegate_keylet⚠
deposit_preauth_keylet⚠
did_keylet⚠
escrow_keylet⚠
float_add⚠
float_compare⚠
float_divide⚠
float_from_int⚠
float_from_uint⚠
float_log⚠
float_multiply⚠
float_pow⚠
float_root⚠
float_set⚠
float_subtract⚠
get_base_fee⚠
get_current_ledger_obj_array_len⚠
get_current_ledger_obj_field⚠
get_current_ledger_obj_nested_array_len⚠
get_current_ledger_obj_nested_field⚠
get_ledger_obj_array_len⚠
get_ledger_obj_field⚠
get_ledger_obj_nested_array_len⚠
get_ledger_obj_nested_field⚠
get_ledger_sqn⚠
get_nft⚠
get_nft_flags⚠
get_nft_issuer⚠
get_nft_serial⚠
get_nft_taxon⚠
get_nft_transfer_fee⚠
get_parent_ledger_hash⚠
get_parent_ledger_time⚠
get_tx_array_len⚠
get_tx_field⚠
get_tx_nested_array_len⚠
get_tx_nested_field⚠
line_keylet⚠
mpt_issuance_keylet⚠
mptoken_keylet⚠
nft_offer_keylet⚠
offer_keylet⚠
oracle_keylet⚠
paychan_keylet⚠
permissioned_domain_keylet⚠
signers_keylet⚠
ticket_keylet⚠
trace⚠
trace_account⚠
trace_amount⚠
trace_num⚠
trace_opaque_float⚠
update_data⚠
vault_keylet⚠