Package Exports
- jito-bundle-jitotip
- jito-bundle-jitotip/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jito-bundle-jitotip) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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