Skip to main content

Rust SDK

[dependencies]
fenryx-sdk = "0.2"
tokio = { version = "1", features = ["full"] }

Construct

use fenryx_sdk::RpcClient;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let c = RpcClient::new("https://v2.rpc.fenryx.io");
let st = c.status().await?;
println!("height = {}", st.height);
Ok(())
}

Module shortcuts (Bloque 12.2)

Each returns Result<Option<serde_json::Value>>None on a 404, Some otherwise. The wire format is kept untyped because the module schemas evolve faster than the SDK can re-release.

c.pools().await?;
c.apex_all().await?;
c.gossip_root().await?;
c.tps_estimate().await?;
c.staking_v2_records().await?;
c.staking_v2_reward_pool().await?;
c.pou_records().await?;
c.pc_stats().await?;
c.insurance_proposals().await?;
c.guardian_genesis().await?;
c.did_verify("frx1...").await?;
c.gov_v2_proposals().await?;
c.gov_v2_info().await?;
c.upgrade_current().await?;
c.dex_pools().await?;
c.file_manifests().await?;
c.wasm_contracts().await?;
c.subnets().await?;
c.btc_relay_state().await?;
c.token_list().await?;
c.lightning_channel(42).await?;
c.x1_contract("0x…").await?;

Escape hatch

c.get_json("omnia/anything").await?;
c.post_json("omnia/anything", &serde_json::json!({"foo": "bar"})).await?;

Source

In-tree at sdk/.