#solana #jito #blockchain #rpc #sdk

jito-sdk-rust

Rust SDK for interacting with Jito RPC services on Solana

1 unstable release

0.1.0 Oct 1, 2024

#1 in #jito

Download history 175/week @ 2024-09-27 44/week @ 2024-10-04 41/week @ 2024-10-11 31/week @ 2024-10-18 32/week @ 2024-10-25 68/week @ 2024-11-01 42/week @ 2024-11-08 90/week @ 2024-11-15 75/week @ 2024-11-22 211/week @ 2024-11-29 128/week @ 2024-12-06 191/week @ 2024-12-13

633 downloads per month

MIT license

39KB
150 lines

jito-sdk-rust

Discord Rust Crates.io docs.rs

The Jito JSON-RPC Rust SDK provides an interface for interacting with Jito's enhanced Solana infrastructure. This SDK supports methods for managing bundles and transactions, offering improved performance and additional features while interacting with the Block Engine.

Features

Bundles

  • getInflightBundleStatuses: Retrieve the status of in-flight bundles.
  • getBundleStatuses: Fetch the statuses of submitted bundles.
  • getTipAccounts: Get accounts eligible for tips.
  • sendBundle: Submit bundles to the Jito Block Engine.

Transactions

  • sendTransaction: Submit transactions with enhanced priority and speed.

Installation

Prerequisites

This project requires Rust for development. If you haven't installed Rust yet, follow these steps:

  1. Install Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Follow the on-screen instructions to complete the installation.

  3. Verify the installation:

    rustc --version
    
  4. (Optional but recommended) Keep Rust up to date:

    rustup update
    

Adding jito-sdk-rust to Your Project

Add the following to your Cargo.toml:

[dependencies]
jito-sdk-rust = "0.1.0"  # Replace with the actual version

Usage Examples

Basic Transaction Example

To run the basic transaction example:

  1. Ensure your environment is set up in jito-rust-rpc/examples/basic_txn.rs:

    // Load the sender's keypair
    let sender = load_keypair("/path/to/wallet.json")?;
    
    // Set up receiver pubkey
    let receiver = Pubkey::from_str("YOUR_RECEIVER_PUBKEY")?;
    
  2. Run the example:

    cargo run --example basic_txn
    

Basic Bundle Example

To run the basic bundle example:

  1. Set up your environment in jito-rust-rpc/examples/basic_bundle.rs:

    // Load the sender's keypair
    let sender = load_keypair("/path/to/wallet.json")?;
    
    // Set up receiver pubkey
    let receiver = Pubkey::from_str("YOUR_RECEIVER_PUBKEY")?;
    
  2. Run the example:

    cargo run --example basic_bundle
    

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please join our Discord community.

Dependencies

~7–19MB
~271K SLoC