Module stellar_helpers

Source
Expand description

Helper functions for Stellar-specific operations.

This module provides utility functions for working with Stellar-specific data types and formatting, including address normalization, XDR value parsing, and operation processing.

Enums§

StellarType
Represents all possible Stellar smart contract types
StellarValue
Represents all possible Stellar smart contract values

Functions§

are_same_address
Compares two Stellar addresses for equality, ignoring case and whitespace.
are_same_signature
Compares two Stellar function signatures for equality, ignoring case and whitespace.
combine_i128
Combines the parts of an Int128 into a single string representation.
combine_i256
Combines the parts of an Int256 into a single string representation. Note: hi_hi is signed (i64) while other components are unsigned (u64)
combine_u128
Combines the parts of a UInt128 into a single string representation.
combine_u256
Combines the parts of a UInt256 into a single string representation.
get_contract_code_ledger_key
Extracts contract code ledger key from a contract’s XDR-encoded executable.
get_contract_instance_ledger_key
Creates a LedgerKey for the contract instance.
get_contract_spec
Parse a WASM contract from hex and return a vector of ScSpecEntry.
get_contract_spec_functions
Get contract spec functions from a contract spec.
get_contract_spec_with_function_input_parameters
Parse contract spec functions and populate input parameters.
get_function_signature
Gets the function signature for a Stellar host function operation.
get_kind_from_value
Get the kind of a value from a JSON value.
get_wasm_code_from_ledger_entry_data
Get WASM code from a contract’s XDR-encoded executable.
get_wasm_hash_from_ledger_entry_data
Get WASM hash from a contract’s XDR-encoded executable.
hex_to_bytes
Convert a hexadecimal string to a byte vector.
is_address
Checks if a string is a valid Stellar address.
normalize_address
Normalizes a Stellar address by removing whitespace and converting to lowercase.
normalize_signature
Normalizes a Stellar function signature by removing whitespace and converting to lowercase.
parse_sc_val
Parses a Stellar Contract Value into a decoded parameter entry.
parse_xdr_value
Parses XDR-encoded bytes into a decoded parameter entry.
process_invoke_host_function
Processes a Stellar host function operation into a parsed result.