Altius Transaction SDK (Rust)
A Rust SDK for signing and encoding Altius USD multi-token transactions. Supports the USD Multi-Token fee model (0x7a transaction type).
Installation
Add to your Cargo.toml:
[]
= "0.1"
Usage
Basic Signing
use ;
use ;
// Create signer from private key
let signer = from_private_key?
.with_chain_id;
// Get address
let address = signer.address;
// Sign a transaction
let signature = signer.sign_transaction?;
Generate Wallet
use Wallet;
// Generate new wallet
let wallet = generate?;
println!;
println!;
Constants
use ;
println!;
println!;
Security Note
This SDK does NOT contain any private keys or addresses by default. All chain-specific configuration must be provided by the application layer.
IMPORTANT: Never transmit private keys over the network. Sign transactions locally and only send the signed raw transaction to the RPC node.
Transaction Type
This SDK supports the USD Multi-Token fee model (0x7a transaction type):
- fee_token: ERC20 token address used for gas payment
- fee_payer: Account paying the fee (optional, defaults to sender)
- max_fee_per_gas_usd_attodollars: Max gas price in USD attodollars/gas
Key Addresses
| Contract | Address |
|---|---|
| USDA (Fee Token) | 0xa1700000000000000000000000000000000000001 |
| Fee Token Factory | 0xa1700000000000000000000000000000000000000 |
| Fee Manager | 0xFE0000000000000000000000000000000000000001 |
Dependencies
alloy-primitives- Ethereum typesalloy-rlp- RLP encodingrand- Random number generation
License
MIT OR Apache-2.0