altius-tx-sdk 0.2.0

SDK for signing and sending Altius USD multi-token transactions
Documentation
//! Constants for Altius USD multi-token transactions.
//!
//! These constants define the default fee parameters for USD multi-token chains.
//!
//! **IMPORTANT**: This is the single source of truth for Rust code.
//! All addresses must be defined here AND in the JS SDK (sdk/js/src/constants.js).
//! When modifying addresses, update BOTH SDKs.

use alloy_primitives::{address, Address};

// ============================================================================
// Address Constants
// These addresses are derived from the Altius predeploy system.
// ============================================================================

/// USDA Fee Token (ERC20) - Genesis Fee Token (index 1)
pub const USDA_ADDRESS: Address = address!("0xA170000000000000000000000000000000000001");

/// Fee Token Factory (index 0)
pub const FEE_TOKEN_FACTORY_ADDRESS: Address = address!("0xA170000000000000000000000000000000000000");

/// Fee Manager (Independent prefix)
pub const FEE_MANAGER_ADDRESS: Address = address!("0xFE00000000000000000000000000000000000001");

/// Zero address
pub const ZERO_ADDRESS: Address = address!("0x0000000000000000000000000000000000000000");

// ============================================================================
// Fee Configuration
// ============================================================================

/// Base fee in attodollars per gas (50 G-attodollars/gas).
pub const BASE_FEE_ATTO: u64 = 50_000_000_000;

/// Token decimals for USDA and fee tokens (ERC-20 standard)
pub const TOKEN_DECIMALS: u8 = 18;

/// Default max fee per gas (2x base fee)
pub const DEFAULT_MAX_FEE_PER_GAS: u64 = 100_000_000_000;

/// Default faucet amount in token units (100 USDA with 18 decimals).
pub const DEFAULT_FAUCET_AMOUNT: u128 = 100_000_000_000_000_000_000;

/// Default faucet amount in microdollars.
pub const DEFAULT_FAUCET_AMOUNT_MICRO: u64 = 100_000_000;

/// Default faucet amount in microdollars (for JS compatibility)
pub const FAUCET_AMOUNT_MICRO: u64 = 100_000_000;

/// Default faucet amount in token units (for JS compatibility)
pub const FAUCET_AMOUNT_WEI: u128 = 100_000_000_000_000_000_000;

/// Default transfer amount in microdollars (10 USDA)
pub const TRANSFER_AMOUNT_MICRO: u64 = 10_000_000;

/// Default transfer amount in token units (10 USDA with 18 decimals)
pub const TRANSFER_AMOUNT_WEI: u128 = 10_000_000_000_000_000_000;

// ============================================================================
// Gas Configuration
// ============================================================================

/// Default gas limit for ERC20 transfers.
pub const DEFAULT_GAS_LIMIT: u64 = 100_000;

// ============================================================================
// Validation Constants
// ============================================================================

/// Reserved address threshold (indices 0-255 are reserved)
pub const RESERVED_THRESHOLD: u64 = 256;

// ============================================================================
// Faucet Configuration
// ============================================================================

/// Faucet address (derived from Hardhat/Anvil default mnemonic)
/// This is the default address used by Hardhat/Anvil for the first account.
pub const FAUCET_ADDRESS: Address = address!("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266");

/// Default fee token for faucet (USDA)
pub const FAUCET_FEE_TOKEN: Address = USDA_ADDRESS;