Skip to main content

Crate altius_tx_sdk

Crate altius_tx_sdk 

Source
Expand description

Altius Transaction SDK

This crate provides utilities for signing and encoding Altius USD multi-token transactions. This SDK mirrors the JavaScript @altiuslabs/tx-sdk package.

§Security Note

This SDK does NOT contain any private keys or addresses. All chain-specific configuration must be provided by the application layer.

Structs§

Address
An Ethereum address, 20 bytes in length.
Bytes
Wrapper type around bytes::Bytes to support “0x” prefixed hex strings.
EcdsaSigner
A transaction signer using real ECDSA signing
NonceManager
NonceManager for managing transaction nonces
RpcClient
JSON-RPC client for Ethereum-compatible chains
Signature
Signature components
SignedTx
Signed transaction
TxBuilder
TxBuilder for building USD Multi-Token transactions
TxClient
TxClient - High-level client for sending Altius transactions
TxClientBuilder
TxClientBuilder - Builder for TxClient
TxFields
Transaction fields for encoding
Wallet
A wallet with address and optional private key

Enums§

Error

Constants§

BASE_FEE_ATTO
Base fee in attodollars per gas (50 G-attodollars/gas).
DEFAULT_FAUCET_AMOUNT
Default faucet amount in token units (100 USDA with 18 decimals).
DEFAULT_FAUCET_AMOUNT_MICRO
Default faucet amount in microdollars.
DEFAULT_GAS_LIMIT
Default gas limit for ERC20 transfers.
DEFAULT_MAX_FEE_PER_GAS
Default max fee per gas (2x base fee)
FAUCET_ADDRESS
Faucet address (derived from Hardhat/Anvil default mnemonic) This is the default address used by Hardhat/Anvil for the first account.
FAUCET_AMOUNT_MICRO
Default faucet amount in microdollars (for JS compatibility)
FAUCET_AMOUNT_WEI
Default faucet amount in token units (for JS compatibility)
FAUCET_FEE_TOKEN
Default fee token for faucet (USDA)
FEE_MANAGER_ADDRESS
Fee Manager (Independent prefix)
FEE_PAYER_SIGNATURE_MAGIC_BYTE
Magic byte for fee payer signature
FEE_TOKEN_FACTORY_ADDRESS
Fee Token Factory (index 0)
RESERVED_THRESHOLD
Reserved address threshold (indices 0-255 are reserved)
TOKEN_DECIMALS
Token decimals for USDA and fee tokens (ERC-20 standard)
TRANSFER_AMOUNT_MICRO
Default transfer amount in microdollars (10 USDA)
TRANSFER_AMOUNT_WEI
Default transfer amount in token units (10 USDA with 18 decimals)
TX_TYPE_USD_MULTI_TOKEN
Transaction type for USD Multi-Token (EIP-2718)
USDA_ADDRESS
USDA Fee Token (ERC20) - Genesis Fee Token (index 1)
ZERO_ADDRESS
Zero address

Traits§

Signer
Re-export SignerTrait as Signer for API compatibility Signer trait for transaction signing
SignerTrait
Signer trait for transaction signing

Functions§

compute_fee_token_address
Compute deterministic fee token address.
compute_keccak256
Compute keccak256 hash
create_nonce_manager
Create a new nonce manager (convenience function)
create_rpc_client
Create a new RPC client (convenience function)
create_transaction
Create a new transaction (convenience function)
create_tx_client
Create a new TxClient (convenience function)
fee_payer_signature_hash
Compute fee payer signature hash
generate_private_key
Generate a new private key
is_fee_token_prefix
Check if address has fee token prefix (0xa170…)
is_index_reserved
Check if index is reserved (index < 256)
is_reserved_address
Check if address is in reserved range (index < 256)
is_valid_fee_token_address
Check if address is valid fee token (has prefix and not zero)
num_to_hex
Convert number to padded hex
pad_hex
Pad a hex string to specified bytes
private_key_to_address
Convert private key to address

Type Aliases§

B256
32-byte fixed byte-array type.
Result
U256
256-bit unsigned integer type, consisting of 4, 64-bit limbs.