Expand description

Utility functions for Stellar transaction domain logic.

Structs§

FeeQuote
Fee quote structure containing fee estimates in both tokens and stroops

Enums§

StellarTransactionUtilsError
Errors that can occur during Stellar transaction utility operations.

Functions§

add_operation_to_envelope
Add operation to transaction envelope
amount_to_ui_amount
Convert raw token amount to UI amount based on decimals
asset_to_asset_id
Convert Asset XDR to asset identifier string
change_trust_asset_to_asset_id
Convert ChangeTrustAsset XDR to asset identifier string
convert_v0_to_v1_transaction
Convert a V0 transaction to V1 format for signing. This is needed because the signature payload for V0 transactions uses V1 format internally.
convert_xlm_fee_to_token
Convert XLM fee to token amount using DEX service
count_operations_from_xdr
Count operations in a transaction envelope from XDR base64 string
create_contract_data_key
Create an ScVal key for contract data queries.
create_fee_payment_operation
Create fee payment operation
create_signature_payload
Create a signature payload for the given envelope type
create_transaction_signature_payload
Create signature payload for a transaction directly (for operations-based signing)
estimate_base_fee
Estimate the base transaction fee in XLM (stroops)
estimate_fee
Estimate transaction fee in XLM (stroops) based on envelope content
extract_scval_from_contract_data
Extract ScVal from contract data entry.
extract_time_bounds
Extract time bounds from a transaction envelope
extract_u32_from_scval
Extract a u32 value from an ScVal.
fetch_next_sequence_from_chain
Fetches the current sequence number from the blockchain and calculates the next usable sequence. This is a shared helper that can be used by both stellar_relayer and stellar_transaction.
i64_from_u64
is_bad_sequence_error
Detects if an error is due to a bad sequence number. Returns true if the error message contains indicators of sequence number mismatch.
needs_simulation
Returns true if any operation needs simulation (contract invocation, creation, or wasm upload).
next_sequence_u64
parse_account_id
Parse a Stellar account address string into an AccountId XDR type.
parse_contract_address
Parse a contract address string into a ContractId and extract the hash.
parse_ledger_entry_from_xdr
Parse a ledger entry from base64 XDR string.
parse_transaction_and_count_operations
Parse transaction and count operations
parse_transaction_envelope
Parse transaction envelope from JSON value
query_contract_data_with_fallback
Query contract data with Persistent/Temporary durability fallback.
set_time_bounds
Set time bounds on transaction envelope