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::fields and crate::objects,
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/float_from_mant_exp- Convert values to float formatfloat_from_stamount/float_from_stnumber- Convert XRP ledger types to float formatfloat_to_int/float_to_mant_exp- Convert float to integer or decomposed formfloat_add/float_sub/float_mult/float_div- Arithmeticfloat_pow- Mathematical functionsfloat_cmp- Comparison operations
All operations support explicit rounding modes; see RoundingMode.
See the host_bindings documentation for detailed function signatures.
Modules§
Structs§
Enums§
- Error
- Possible errors returned by XRPL Programmability APIs.
- Result
Resultis a type that represents either a success (Ok) or failure (Err) result from the host.- Rounding
Mode - Rounding mode for float operations, matching rippled’s
Number::RoundingMode.
Functions§
- accountroot_
id ⚠ - amendment_
enabled ⚠ - amm_id⚠
- apply_
default_ expectations - Applies the same default
.returning(...)wiring ascreate_default_mockonto an existing mock instead of constructing a new one. - base_
fee ⚠ - cache_
le ⚠ - check_
id ⚠ - check_
sig ⚠ - clear_
mock_ host_ bindings - create_
default_ mock - credential_
id ⚠ - delegate_
id ⚠ - deposit_
preauth_ ⚠id - did_id⚠
- escrow_
id ⚠ - float_
add ⚠ - float_
cmp ⚠ - float_
div ⚠ - float_
from_ ⚠int - float_
from_ ⚠mant_ exp - float_
from_ ⚠stamount - float_
from_ ⚠stnumber - float_
from_ ⚠uint - float_
mult ⚠ - float_
pow ⚠ - float_
sub ⚠ - float_
to_ ⚠int - float_
to_ ⚠mant_ exp - home_
le_ ⚠arr_ len - home_
le_ ⚠field - home_
le_ ⚠inner - home_
le_ ⚠inner_ arr_ len - ldgr_
index ⚠ - le_
arr_ ⚠len - le_
field ⚠ - le_
inner ⚠ - le_
inner_ ⚠arr_ len - mpt_
issuance_ ⚠id - mptoken_
id ⚠ - nft_
flags ⚠ - nft_
issuer ⚠ - nft_
offer_ ⚠id - nft_
serial ⚠ - nft_
taxon ⚠ - nft_uri⚠
- nft_
xfer_ ⚠fee - offer_
id ⚠ - oracle_
id ⚠ - parent_
ldgr_ ⚠hash - parent_
ldgr_ ⚠time - paychan_
id ⚠ - permissioned_
domain_ ⚠id - set_
data ⚠ - set_
mock_ host_ bindings - setup_
mock - sha512_
half ⚠ - signers_
id ⚠ - ticket_
id ⚠ - trace⚠
- trustline_
id ⚠ - tx_
arr_ ⚠len - tx_
field ⚠ - tx_
inner ⚠ - tx_
inner_ ⚠arr_ len - vault_
id ⚠