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::Bytesto support “0x” prefixed hex strings. - Ecdsa
Signer - A transaction signer using real ECDSA signing
- Nonce
Manager - NonceManager for managing transaction nonces
- RpcClient
- JSON-RPC client for Ethereum-compatible chains
- Signature
- Signature components
- Signed
Tx - Signed transaction
- TxBuilder
- TxBuilder for building USD Multi-Token transactions
- TxClient
- TxClient - High-level client for sending Altius transactions
- TxClient
Builder - TxClientBuilder - Builder for TxClient
- TxFields
- Transaction fields for encoding
- Wallet
- A wallet with address and optional private key
Enums§
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
- Signer
Trait - 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.