Expand description
Utility functions for Stellar transaction domain logic.
Structs§
- FeeQuote
- Fee quote structure containing fee estimates in both tokens and stroops
Enums§
- Stellar
Transaction Utils Error - 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