Skip to content

A Rust client for interacting with the Jito network, supporting **rate limiting**, **multi-IP usage**, and **broadcasting requests** to multiple endpoints.

Notifications You must be signed in to change notification settings

dtr125/jito-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jito Client

A Rust client for interacting with the Jito network, supporting rate limiting, multi-IP usage, and broadcasting requests to multiple endpoints.

Features

  • Send single transactions or transaction bundles.
  • Rate limiting (requests per second).
  • Support for multiple IPv4 and IPv6 addresses.
  • Broadcast requests to multiple URLs simultaneously.
  • Easy-to-use builder pattern for client configuration.
  • Fetch Jito tips and bundle statuses.

Usage

Default

use jito_client::JitoClient;

#[tokio::main]
async fn main() {
  let client = JitoClient::new();

  // Send a bundle of transactions
  let response = client.send_bundle(&["tx"]).await.unwrap();
  println!("{:?}", response);

  // Send a bundle and get the bundle ID
  let bid = client.send_bundle_bid(&["tx"]).await.unwrap();
  println!("{:?}", bid);
}

Customized

use jito_client::JitoClientBuilder;

#[tokio::main]
async fn main() {
  // If you have 10 IPs, this is equivalent to sending 30 requests per second
  let client = JitoClientBuilder::new()
      // Sets the request rate limit (requests per second, 0 = unlimited)
      .rate(1)
      // Enables sending requests via multiple IPs (both IPv4 and IPv6)
      .multi_ip(true)
      // Sets the target URLs for the client
      .url(&[
          "https://amsterdam.mainnet.block-engine.jito.wtf",
          "https://tokyo.mainnet.block-engine.jito.wtf",
          "https://london.mainnet.block-engine.jito.wtf",
      ])
      .build()
      .unwrap();
}

Broadcast

use jito_client::JitoClientBuilder;

#[tokio::main]
async fn main() {
  // Each transaction/bundle sent will go to all URLs in parallel
  let client = JitoClientBuilder::new()
      // Configures the client to send requests to all URLs in parallel
      .broadcast(true)
      // Sets the target URLs for the client
      .url(&[
          "https://amsterdam.mainnet.block-engine.jito.wtf",
          "https://tokyo.mainnet.block-engine.jito.wtf",
          "https://london.mainnet.block-engine.jito.wtf",
      ])
      .build()
      .unwrap();
}

About

A Rust client for interacting with the Jito network, supporting **rate limiting**, **multi-IP usage**, and **broadcasting requests** to multiple endpoints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%