Skip to main content

altius_tx_sdk/
lib.rs

1//! Altius Transaction SDK
2//!
3//! This crate provides utilities for signing and encoding Altius USD multi-token transactions.
4//! This SDK mirrors the JavaScript @altiuslabs/tx-sdk package.
5//!
6//! # Security Note
7//!
8//! This SDK does NOT contain any private keys or addresses. All chain-specific
9//! configuration must be provided by the application layer.
10
11mod error;
12mod signer;
13mod constants;
14mod utils;
15mod transaction;
16mod rpc;
17mod nonce;
18mod client;
19
20pub use error::{Error, Result};
21pub use signer::{EcdsaSigner, Signer, Wallet, generate_private_key, private_key_to_address};
22pub use constants::{
23    BASE_FEE_ATTO,
24    DEFAULT_GAS_LIMIT,
25    DEFAULT_MAX_FEE_PER_GAS,
26    USDA_ADDRESS,
27    FEE_TOKEN_FACTORY_ADDRESS,
28    FEE_MANAGER_ADDRESS,
29    ZERO_ADDRESS,
30    DEFAULT_FAUCET_AMOUNT,
31    DEFAULT_FAUCET_AMOUNT_MICRO,
32    FAUCET_AMOUNT_MICRO,
33    FAUCET_AMOUNT_WEI,
34    TRANSFER_AMOUNT_MICRO,
35    TRANSFER_AMOUNT_WEI,
36    RESERVED_THRESHOLD,
37    FAUCET_FEE_TOKEN,
38    FAUCET_ADDRESS,
39    TOKEN_DECIMALS,
40};
41
42pub use utils::{
43    compute_fee_token_address,
44    is_reserved_address,
45    compute_keccak256,
46    pad_hex,
47    num_to_hex,
48    is_fee_token_prefix,
49    is_valid_fee_token_address,
50    is_index_reserved,
51};
52
53pub use transaction::{
54    TxBuilder,
55    TxFields,
56    SignedTx,
57    Signature,
58    Signer as SignerTrait,
59    create_transaction,
60    fee_payer_signature_hash,
61    TX_TYPE_USD_MULTI_TOKEN,
62    FEE_PAYER_SIGNATURE_MAGIC_BYTE,
63};
64
65pub use rpc::{
66    RpcClient,
67    create_rpc_client,
68};
69
70pub use nonce::{
71    NonceManager,
72    create_nonce_manager,
73};
74
75pub use client::{
76    TxClient,
77    TxClientBuilder,
78    create_tx_client,
79};
80
81// Re-export useful types
82pub use alloy_primitives::{Address, Bytes, U256, B256};