It is used to simplify complex operations on the aptos network, reduce the difficulty of aptos development, and allow more people to happily build on the aptos network.
continuous building 🔨
### Cargo.toml
[dependencies]
aptos-light-sdk = {git = "https://github.com/0xhappyboy/aptos-light-sdk", branch = "main"}
tokio = {version = "1.4", features = ["full"]}
[patch.crates-io]
merlin = {git = "https://github.com/aptos-labs/merlin"}
x25519-dalek = {git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1"}
### .cargo/config.toml
[build]
rustflags = ["--cfg", "tokio_unstable"]
account: provides operations for accounts
client : used to initialize the client and oper
config : overall situation config
transfer : provides methods for transactions
net : provides methods for net
coin : provides methods for coin
net : provides methods for net
faucet : faucet related methods, valid in Mode::DEV Mode::TEST mode
utils : internal utils
create a account
account::create_new_account()
create a account by private key
account::create_account_by_private_key("private_key")
create a vanity account
/// trying to create an account whose public key meets the conditions starting with 6 and ending with 8
account::create_vanity_account("6666".to_string(),"8888".to_string())
get the public key string of an account
get_public_key(&account).unwrap();
get the private key string of an account
get_private_key(&account).unwrap();
get account balance
let mut aptos_client = AptosClient::new(Mode::DEV);
get_account_balance(&mut aptos_client,&account).unwrap();
initialize client instance
AptosClient::new(Mode::DEV)
create a txn hash
let aptos_client = AptosClient::new(Mode::DEV);
crate_txn_hash(aptos_client,from address,to address,amount)
send a txn hash
let aptos_client = AptosClient::new(Mode::DEV);
let txn = crate_txn_hash(aptos_client,from address,to address,amount)?
send_txn_hash(aptos_client,txn)
batch transfer
let aptos_client = AptosClient::new(Mode::DEV);
let mut from = account::create_account_by_private_key("0x");
let mut to_1 = account::create_account_by_private_key("0x");
let mut to_2 = account::create_account_by_private_key("0x");
let mut v = vec![];
v.push(to_1);
v.push(to_2);
transfer::batch_transfer(&aptos_client, &mut from, &v, 0.1).await;
use the designated account to obtain faucet tokens
let aptos_client = AptosClient::new(Mode::DEV);
let mut account = create_new_account();
faucet::get_faucet_coin(&aptos_client,account,10)