jito-bundle-solana
v4.0.1
Published
A TypeScript/JavaScript SDK for creating Jito tip transactions on Solana
Downloads
206
Maintainers
Readme
Jito Tip SDK
A TypeScript/JavaScript SDK for creating Jito tip transactions on Solana.
Installation
npm install jito-bundle-sdkUsage
TypeScript
import { createJitoTipTransaction } from 'jito-bundle';
import { Connection, Keypair } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.generate(); // Your wallet keypair
// Create a tip transaction with default fee (0.00001 SOL)
const tipTransaction = await createJitoTipTransaction(connection, wallet);
// Create a tip transaction with custom fee
const customTipTransaction = await createJitoTipTransaction(connection, wallet, 0.0001);
// Create a tip transaction with custom fee and phrase
const tipWithPhrase = await createJitoTipTransaction(connection, wallet, 0.0001, "custom-phrase");JavaScript (CommonJS)
const { createJitoTipTransaction } = require('jito-bundle');
const { Connection, Keypair } = require('@solana/web3.js');
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.generate(); // Your wallet keypair
// Create a tip transaction with default fee (0.00001 SOL)
const tipTransaction = await createJitoTipTransaction(connection, wallet);
// Create a tip transaction with custom fee
const customTipTransaction = await createJitoTipTransaction(connection, wallet, 0.0001);
// Create a tip transaction with custom fee and phrase
const tipWithPhrase = await createJitoTipTransaction(connection, wallet, 0.0001, "custom-phrase");JavaScript (ES Modules)
import { createJitoTipTransaction } from 'jito-bundle';
import { Connection, Keypair } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.generate(); // Your wallet keypair
// Create a tip transaction with default fee (0.00001 SOL)
const tipTransaction = await createJitoTipTransaction(connection, wallet);
// Create a tip transaction with custom fee
const customTipTransaction = await createJitoTipTransaction(connection, wallet, 0.0001);
// Create a tip transaction with custom fee and phrase
const tipWithPhrase = await createJitoTipTransaction(connection, wallet, 0.0001, "custom-phrase");API
createJitoTipTransaction(connection, wallet, fee?, phrase?)
Creates a Jito tip transaction.
Parameters:
connection(Connection): Solana connection instancewallet(Keypair): Wallet keypair to sign the transactionfee(number, optional): Tip amount in SOL (default: 0.00001)phrase(string, optional): Custom phrase to add to whitelist (default: "")
Returns:
Promise<string>: Base58 encoded transaction string
Dependencies
@solana/web3.js: Solana Web3.js librarybs58: Base58 encoding/decoding
License
ISC
