aethokit

Crates.ioaethokit
lib.rsaethokit
version0.1.0
created_at2025-09-10 03:19:34.203521+00
updated_at2025-09-10 03:19:34.203521+00
descriptionA rust SDK that allows you sponsor transactions on the solana network. (mirror of the TS SDK).
homepagehttps://github.com/kenolabs/aethokit-rust-sdk
repositoryhttps://github.com/kenolabs/aethokit-rust-sdk
max_upload_size
id1831893
size50,148
Bright Senpai (cakezero)

documentation

README

Aethokit Rust SDK

Rust SDK for the Aethokit gas sponsorship API — a mirror of the TypeScript SDK.

  • ✅ Minimal, ergonomic API

  • ✅ Async HTTP using reqwest

  • ✅ Strongly-typed requests/responses via serde

Install

Add to your Cargo.toml:

[dependencies]
aethokit = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] } # for async runtime in binaries/tests

Usage

use aethokit::{Aethokit, AethokitConfig, SponsorTxRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  // load your GAS KEY from environment
  let gas_key = std::env::var("AETHOKIT_GAS_KEY")
    .expect("set AETHOKIT_GAS_KEY in your environment");

  // initialize aethokit config with network
  let aethokit_client = Aethokit::new(AethokitConfig {
    gas_key,
    rpc_or_network: Some("mainnet".into()), // or None if you want default (devnet)
  })?;

  // initialize aethokit config with rpc_url
  let aethokit_client = Aethokit::new(AethokitConfig {
    gas_key,
    rpc_or_network: Some("private-rpc-url".into()), // or None if you want default
  })?;

  // fetch gas address
  let addr = aethokit_client.get_gas_address().await?;
  println!("Gas address: {}", addr);

  // sponsor the tx and get hash
  let hash = aethokit_client.sponsor_tx("<SERIALIZED_TX>".into()).await?;
  println!("Hash: {}", hash);

  Ok(())
}

For usage please refer to the examples here.

Commit count: 9

cargo fmt