1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! # Aptos Rust SDK v2
//!
//! A user-friendly, idiomatic Rust SDK for the Aptos blockchain.
//!
//! This SDK provides a complete interface for interacting with the Aptos blockchain,
//! including account management, transaction building and signing, and API clients
//! for both the fullnode REST API and the indexer GraphQL API.
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use aptos_sdk::{Aptos, AptosConfig};
//! use aptos_sdk::account::{Account, Ed25519Account};
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Connect to testnet
//! let aptos = Aptos::new(AptosConfig::testnet())?;
//!
//! // Create a new account
//! let account = Ed25519Account::generate();
//! println!("Address: {}", account.address());
//!
//! // Get balance (after funding)
//! let balance = aptos.get_balance(account.address()).await?;
//! println!("Balance: {} octas", balance);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Feature Flags
//!
//! The SDK uses feature flags to allow you to include only the functionality you need:
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `ed25519` | Yes | Ed25519 signature scheme |
//! | `secp256k1` | Yes | Secp256k1 ECDSA signatures |
//! | `secp256r1` | Yes | Secp256r1 (P-256) ECDSA signatures |
//! | `mnemonic` | Yes | BIP-39 mnemonic phrase support for key derivation |
//! | `indexer` | Yes | GraphQL indexer client |
//! | `faucet` | Yes | Faucet integration for testnets |
//! | `bls` | No | BLS12-381 signatures |
//! | `keyless` | No | OIDC-based keyless authentication |
//! | `macros` | No | Proc macros for type-safe contract bindings |
//!
//! ## Modules
//!
//! - [`account`] - Account management and key generation
//! - [`crypto`] - Cryptographic primitives and signature schemes
//! - [`transaction`] - Transaction building and signing
//! - [`api`] - REST and GraphQL API clients
//! - [`types`] - Core Aptos types
//! - [`codegen`] - Code generation from Move ABIs
// Pedantic lint exceptions - these are intentionally allowed
// Re-export main entry points
pub use Aptos;
pub use AptosConfig;
pub use ;
// Re-export commonly used types
pub use ;
// Re-export proc macros when the feature is enabled
pub use ;
// Re-export aptos_bcs for use by the MoveStruct derive macro
// This allows downstream users to use the derive macro without adding aptos-bcs as a dependency
pub use aptos_bcs;
// Re-export const_hex for use by generated code (codegen and proc macros)
// This allows downstream users to use generated code without adding const-hex as a dependency
pub use const_hex;