Expand description
XDR decoding engine for Stellar and Soroban structures.
Handles conversion of raw Base64, Hex, or raw-byte XDR payloads into standardized JSON formats (compact or pretty-printed).
§Supported Types
ScValTransactionEnvelopeTransactionResultTransactionMetaLedgerKeyLedgerEntryContractEvent(auto + explicit)
§Example
use sdkt_xdr::decode;
let b64 = "AAAAAQAAAAoAAAAA"; // ScVal::I32(1)
let json = decode(b64, Some("scval"), sdkt_xdr::OutputFormat::Json).unwrap();
println!("{}", json);Re-exports§
pub use builder::build_create_contract_tx;pub use builder::build_create_contract_tx_with_data;pub use builder::build_create_contract_tx_with_data_and_auth;pub use builder::build_create_contract_v2_tx;pub use builder::build_create_contract_v2_tx_with_data;pub use builder::build_create_contract_v2_tx_with_data_and_auth;pub use builder::build_extend_footprint_tx;pub use builder::build_extend_footprint_tx_with_data;pub use builder::build_invoke_transaction;pub use builder::build_invoke_transaction_with_data;pub use builder::build_restore_footprint_tx;pub use builder::build_upload_wasm_tx;pub use builder::build_upload_wasm_tx_with_data;pub use builder::decode_account_id;pub use builder::decode_contract_id;pub use builder::decode_ledger_key;pub use builder::derive_contract_id;pub use builder::memo_id;pub use builder::memo_text;pub use builder::merge_footprint_keys;pub use builder::parse_scval_args;pub use builder::parse_soroban_transaction_data;pub use builder::CreateContractParams;pub use builder::CreateContractV2Params;pub use builder::ExtendFootprintParams;pub use builder::InvokeTransactionParams;pub use builder::RestoreFootprintParams;pub use builder::UploadWasmParams;pub use envelope::decode_envelope;pub use envelope::render_scval;pub use envelope::view_envelope;pub use envelope::EnvelopeView;pub use sign::sign_envelope_with;pub use sign::sign_transaction;pub use sign::verify_signature;pub use sign::Ed25519Signer;pub use sign::Network;pub use sign::Signer;pub use sign::SigningError;pub use sign::SigningOptions;pub use typed::decode_scvals;pub use typed::decode_scvals_ref;pub use typed::encode_scvals;pub use typed::json_args_to_base64;pub use typed::json_to_scval;pub use typed::scval_from_base64;pub use typed::scval_to_base64;pub use typed::Address;pub use typed::FromScVal;pub use typed::IntoScVal;pub use typed::ScValError;
Modules§
- abi_
decode - ABI-aware ScVal decoding using ContractSpec ().
- builder
- Transaction envelope building logic for Soroban.
- envelope
- Human-readable view of a
TransactionEnvelope, for reviewing a transaction before it is signed or submitted. - sign
- Native transaction signing for Soroban / Stellar.
- typed
- Typed Rust <->
ScValconversion and typed contract-invocation helpers.
Structs§
- External
Executable Ref - The owner + tag pair of a CAP-85
CONTRACT_EXECUTABLE_EXTERNAL_REF.
Enums§
- Contract
Executable Ref - A contract’s executable as recorded in its
ContractInstanceledger entry. - Decode
Error - Errors returned by the decoder.
- Ledger
KeyParams - Parameters for constructing a
LedgerKey. - Output
Format - Defines the output formatting style for CLI and RPC responses.
Functions§
- build_
map_ key - Build a Soroban “enum/map”-style storage key
ScVal: anScVecwhose first element issymboland whose remaining elements are the decoded typed key arguments (each supplied as a Base64ScVal). - decode
- Decode a base64- or hex-encoded XDR payload to JSON.
- decode_
bytes - Decode raw bytes (no base64/hex pre-processing).
- encode_
ledger_ key - Encodes
LedgerKeyParamsinto a Base64 XDRLedgerKey. - estimate_
xdr_ size - Estimate the serialized XDR size (in bytes) of a
WriteXdrvalue. - extract_
contract_ data_ value - Extracts the generic
val: ScValand durability from aLedgerEntrycontaining aContractDataentry. - extract_
contract_ executable - Decode a contract instance’s executable out of a Base64 XDR
LedgerEntry. - extract_
wasm_ bytecode - Extracts the raw WASM bytecode from a Base64 encoded
LedgerEntrycontaining aContractCodeentry. - extract_
wasm_ bytecode_ from_ live_ ledger_ entry - Live-wire compatibility decoder for
ContractCodeentries (data-first layout). - extract_
wasm_ hash - Extracts the WASM hash from a Base64 encoded
LedgerEntry. Traverses: LedgerEntry -> LedgerEntryData::ContractData -> ScVal::ContractInstance -> ContractExecutable::Wasm -> Hash - extract_
wasm_ hash_ from_ live_ ledger_ entry - Live-wire compatibility decoder: reads the
LedgerEntryDataunion FIRST (the order the live testnet RPC uses), then ignores any trailinglastModifiedLedgerSeq/ext bytes. Scope is strictly ContractData/Wasm hash extraction. - format_
json - parse_
external_ executable_ hash - Read the 32-byte Wasm hash stored in a CAP-85 executable-tag entry.
- symbol_
scval - Build a validated
ScVal::Symbol. - symbol_
topic_ base64 - Encode an event-name symbol as the base64 XDR
ScValthe RPCgetEventstopic matcher compares against (e.g.topic[0]of a contract event). - validate_
xdr - Validate that a raw byte payload is a well-formed XDR
TransactionEnvelope.