solana-priority-fees
v0.0.5
Published
AI-powered Solana transaction priority fee calculator
Downloads
396
Readme
Note: It is currently in beta phase. While suitable for testing and evaluation purposes, it is not recommended for production environments.
How to Use
Installation
npm install solana-priority-fees
Pre-requisite
Create a .env
file with the following content
XAI_API_KEY="Your XAI API KEY"
You can get the XAI_API_KEY
(Grok API), by authorising your X Account. It is offering 25$ worth of credits as per December 2024.
Fetching Priority Fees
Step 1 - Initialize
import { SolanaPriorityFees } from 'ai-fee';
const priorityFees = new SolanaPriorityFees({
xAiApiKey: process.env.XAI_API_KEY
});
Step 2 - Define the writable account addresses of your transactions
const accountKeys=['writable-account-keys-list'];
Step 3 - Get Recommended Fees
const fee = await priorityFees.getPrioritizationFees(accountKeys);