eav7-sdk depends on the consensus library and never on the node crate. You sign with the same code the node validates with — no second implementation of the rule.
A Rust crate on edition 2024. The HTTP client is synchronous (ureq): no async runtime is forced on the caller.
# rust/ é o workspace do monorepo
[dependencies]
eav7-sdk = { path = "sdk" }
# fora do monorepo, aponte para o clone local
# eav7-sdk = { path = "../eav7/rust/sdk" }Without a wallet the client only reads. With one it builds, signs and submits.
use eav7_sdk::{Eav7Client, ProductionWallet};
use std::time::Duration;
// leitura: nenhum segredo envolvido
let cliente = Eav7Client::novo("https://eavscan.com");
// escrita: o cliente passa a assinar com a carteira
let carteira = ProductionWallet::from_file("carteira.json")?;
let cliente = Eav7Client::com_carteira("https://eavscan.com", Box::new(carteira));
// controle fino
let cliente = Eav7Client::construtor("http://127.0.0.1:6070")
.timeout(Duration::from_secs(10))
.construir();Typed methods return structs; get returns raw JSON for whatever has no type yet.
| Method | Description |
|---|---|
status() -> Value | Chain state, as raw JSON. |
conta(&str) -> Conta | Typed account: balance, stake, next nonce, unbonding and claimable reward. |
saldo(&str) -> u128 | Balance in e7, unproven. |
proximo_nonce(&str) -> i64 | Next nonce for the account, mempool-aware. |
bloco(&str) -> Value | Block by height, hash or latest. |
transacao(&str) -> Value | Transaction by id. |
historico(&str, Option<u64>) -> Historico | One page of wallet history, with the next cursor. |
validadores_tipados() -> Vec<Validador> | Active set joined with each validator's performance. |
contrato(&str) -> Value | Verification metadata for an EAVM contract. |
get(&str) -> Value | Escape hatch: any API path, raw JSON. |
A light client does not need the full state to check a balance — a Merkle proof is enough, as long as the root comes from a verified header.
| Method | Description |
|---|---|
raiz_confiavel_do_header(&str) -> String | stateRoot taken from a verified header. |
saldo_provado(&str, Option<&str>) -> u128 | Balance checked by Merkle against the given root. |
// 1) raiz vinda do HEADER verificado, não do próprio /proof
let raiz = cliente.raiz_confiavel_do_header("latest")?;
// 2) saldo conferido por Merkle contra essa raiz
let saldo = cliente.saldo_provado("E7A4B2…9F21", Some(&raiz))?;
println!("saldo PROVADO: {saldo} e7");The shortcuts cover the common types; executar builds any of the 58, and montar signs without touching the network.
| Method | Description |
|---|---|
transferir(&str, u128) -> Submissao | Builds, signs and submits a TRANSFER. |
stake(u128) -> Submissao | Locks balance as stake. |
unstake(u128) -> Submissao | Starts unbonding a slice. |
votar(Vec<(String, u128)>) -> Submissao | Spreads voting weight across candidates. |
reivindicar_recompensa(&str) -> Submissao | Claims voter rewards from a validator. |
executar(&str, u128, impl Fn) -> Submissao | Builds and submits any type, with the spec you shape. |
montar(TxSpec) -> Tx | Signs locally and returns the Tx, without touching the network. |
enviar(&Tx) -> Submissao | Submits an already signed Tx. |
aguardar_confirmacao(&str, Duration) -> Confirmacao | Blocks until the transaction lands in a block, or the timeout fires. |
remetente() -> Remetente | Opens a sender with local nonce reservation. |
Remetente reserves the nonce locally instead of asking the node on every send.
// duas transferências seguidas: a segunda usaria o MESMO nextNonce
// se perguntasse ao nó antes da primeira entrar no mempool.
let mut remetente = cliente.remetente()?;
let a = remetente.transferir("E7DEST…9A02", 5 * UNIT)?;
let b = remetente.transferir("E7OUTRO…41C7", 2 * UNIT)?;
for tx in [a, b] {
let id = tx.id.expect("assinada");
cliente.aguardar_confirmacao(&id, Duration::from_secs(30))?;
}Two runnable examples live in the crate: one reading with proof, one writing.
# consulta um nó, depois PROVA o saldo contra o stateRoot cargo run -p eav7-sdk --example consulta -- http://127.0.0.1:6070 E7A4B2…9F21 # monta, assina e envia uma transferência cargo run -p eav7-sdk --example enviar -- \ http://127.0.0.1:6070 carteira.json E7DEST…9A02 5000000