file: ./content/index.mdx meta: { "title": "Getting Started", "description": "Build with Solana Tracker's professional APIs and developer tools", "icon": "\"" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; import { Step, Steps } from "fumadocs-ui/components/steps"; # Solana Tracker Developer Platform Build powerful Solana applications with enterprise-grade APIs and infrastructure. } title="Data API"> Access token and market data including prices, holders, trends, charts, and real-time updates. --> {" "} } title="Solana RPC Nodes"> Ultra-low latency, enterprise-grade Solana RPC infrastructure with global distribution and dedicated node options. --> } title="Swap API"> Execute token swaps programmatically with complete access to Pump.fun, Moonshot, Raydium, Meteora and all Solana DEXes. --> } title="About Solana Tracker"> Discover how Solana Tracker helps traders and developers with advanced tools for tracking, sniping, and analyzing tokens. --> ## What is Solana Tracker? Our Swap API provides complete functionality for trading on Pump.fun, Moonshot, Raydium, Meteora, and other Solana DEXes through a unified interface, focused on fast pool discovery.
[View Swap API Documentation β†’](/swap-api)
Ultra-low latency access to the Solana blockchain, Global node distribution for minimal latency, Enterprise-grade security and DDoS protection, Archive nodes with full historical data and Dedicated nodes with no rate limits
[View RPC Documentation β†’](/solana-rpc)
Our comprehensive Data API provides access to: Token information, prices, and market caps, Liquidity and volume analytics, Wallet holdings and transactions, Real-time trades and historical charts, Price change events and trending tokens
[View Data API Documentation β†’](/public-data-api/docs)
### Create an account Click [here](https://www.solanatracker.io/account) and signup to get your API Key ### Choose Your API * [Swap API](/swap-api) for trading functionality (No API Key needed)
* [RPC Nodes](/solana-rpc) for blockchain access
* [Data API](/public-data-api/docs) for all Solana Token / Market information
### Integrate and Build Follow our guides and documentation to integrate Solana Tracker in your apps.

Need Custom Solutions?

Our team can help with custom integration, high-volume requirements, or specialized use cases.

Contact Our Team View Full Documentation
file: ./content/priority-fee-api.mdx meta: { "title": "Priority Fee API", "description": "Automatic priority fee calculation for Solana transactions", "icon": "" } This API is available on all Shared RPC plans and can also be enabled on Dedicated Nodes! [View Packages](https://www.solanatracker.io/solana-rpc) # Understanding Priority Fees on Solana Priority fees are optional fees that you can add to your Solana transactions to incentivize block producers (leaders) to include your transaction in the next block. While including a priority fee is recommended, determining the optimal amount can be challenging. Let's explore how to effectively use priority fees with Solana Tracker's Priority Fee API. ## What Are Priority Fees? Priority fees are priced in micro-lamports per compute unit. They serve as an additional incentive for block producers to prioritize your transaction. Think of it as a "tip" to get your transaction processed faster. ## The Priority Fee API Solana Tracker's `getPriorityFeeEstimate` RPC method provides fee recommendations based on historical data, considering both global and local fee markets. This helps you make informed decisions about priority fees for your transactions. ### Using the API You can use the API in two ways: 1. **With a Serialized Transaction** ```json { "jsonrpc": "2.0", "id": "solana-tracker-example", "method": "getPriorityFeeEstimate", "params": [ { "transaction": "", "options": { "recommended": true } } ] } ``` 2. **With Account Keys** Here's how to implement it in JavaScript: ```javascript const { Transaction, Connection, ComputeBudgetProgram, PublicKey, TransactionInstruction } = require('@solana/web3.js'); // Initialize Connection const connection = new Connection("https://rpc-mainnet.solanatracker.io/?api-key=YOUR_API_KEY"); async function getPriorityFeeEst() { const transaction = new Transaction(); // Add a sample instruction transaction.add( new TransactionInstruction({ programId: new PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"), data: Buffer.from("Experimenting", "utf8"), keys: [], }) ); transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash; transaction.feePayer = new PublicKey("your-wallet-public-key"); // Extract account keys const accountKeys = transaction.compileMessage().accountKeys; const publicKeys = accountKeys.map(key => key.toBase58()); // Get fee estimate try { const response = await fetch(connection.rpcEndpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 'solana-tracker-example', method: 'getPriorityFeeEstimate', params: [ { accountKeys: publicKeys, options: { recommended: true, }, } ], }), }); const data = await response.json(); const priorityFeeEstimate = data.result?.priorityFeeEstimate; // Add priority fee to transaction transaction.add( ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityFeeEstimate }), ); console.log("Estimated priority fee:", priorityFeeEstimate); return priorityFeeEstimate; } catch (err) { console.error(`Error: ${err}`); return 10_000; } } ``` ## Advanced Features ### Empty Slot Evaluation The `evaluateEmptySlotAsZero` flag helps optimize fee calculations for accounts with sparse transaction history: ```javascript const response = await fetch("https://rpc-mainnet.solanatracker.io/?api-key=YOUR_API_KEY", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: '1', method: 'getPriorityFeeEstimate', params: [{ transaction: base58EncodedTransaction, options: { recommended: true, evaluateEmptySlotAsZero: true } }] }) }); ``` ### Priority Levels The API supports different priority levels to match your transaction urgency: * Min (0th percentile) * Low (25th percentile) * Medium (50th percentile) * High (75th percentile) * VeryHigh (95th percentile) * UnsafeMax (100th percentile) Here's an example request for all priority levels: ```json { "jsonrpc": "2.0", "id": "1", "method": "getPriorityFeeEstimate", "params": [{ "accountKeys": ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"], "options": { "includeAllPriorityFeeLevels": true } }] } ``` ## Complete Transaction Example Here's a full example of sending a transaction with priority fees: ```javascript const { Connection, SystemProgram, Transaction, sendAndConfirmTransaction, Keypair, ComputeBudgetProgram, } = require("@solana/web3.js"); const bs58 = require("bs58"); const connection = new Connection("https://rpc-mainnet.solanatracker.io/?api-key=YOUR_API_KEY"); const fromKeypair = Keypair.fromSecretKey(Uint8Array.from("[Your secret key]")); const toPubkey = "receiving-wallet-public-key"; async function sendTransactionWithPriorityFee(priorityLevel) { const transaction = new Transaction(); // Add transfer instruction const transferIx = SystemProgram.transfer({ fromPubkey: fromKeypair.publicKey, toPubkey, lamports: 100, }); transaction.add(transferIx); // Get and add priority fee let feeEstimate = { priorityFeeEstimate: 0 }; if (priorityLevel !== "NONE") { feeEstimate = await getPriorityFeeEstimate(priorityLevel, transaction); const computePriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: feeEstimate.priorityFeeEstimate, }); transaction.add(computePriceIx); } // Sign and send transaction transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash; transaction.sign(fromKeypair); try { const txid = await sendAndConfirmTransaction(connection, transaction, [fromKeypair]); console.log(`Transaction sent successfully with signature ${txid}`); } catch (e) { console.error(`Failed to send transaction: ${e}`); } } // Use the function with your desired priority level sendTransactionWithPriorityFee("High"); ``` ## Understanding the Fee Calculation The Priority Fee API calculates fees based on both global and local market conditions: ``` priority_estimate(p: Percentile, accounts: Accounts) = max( percentile(txn_fees, p), percentile(account_fees(accounts), p) ) ``` This calculation considers: * Global fee market: Percentile of fees paid across all transactions * Local fee market: Percentile of fees paid for transactions involving specific accounts * Lookback period: Last 150 slots by default By using Solana Tracker's Priority Fee API, you can optimize your transaction fees and improve the likelihood of quick transaction processing on the Solana network. We have to thank Helius for coding the Priority Fee API and providing the code for free on [Github](https://github.com/helius-labs/atlas-priority-fee-estimator), this API is hosted on our network of RPC's. file: ./content/public-data-api/docs.mdx meta: { "title": "Documentation", "description": "Public API for Solana Tracker data", "icon": "ApiIcon", "full": false } # Documentation The Solana Tracker API gives you powerful, real-time access to the Solana ecosystem with comprehensive data endpoints for: * **Token Data**: Complete token information, metadata, holders, and creation details * **Market Metrics**: Real-time price, liquidity, market cap, and volume statistics * **Price Analysis**: Historical prices, ATH values, and price changes across customizable timeframes * **Transaction Data**: Detailed transaction history, trade analytics, and token flows * **Wallet Tracking**: Portfolio tracking, token holdings, and trader performance * **Chart Visualization**: OHLCV data with flexible timeframes from seconds to months * **Profit Analytics**: PnL calculations, trader rankings, and performance metrics Perfect for developers, traders, analytics platforms, and dApps requiring reliable, comprehensive Solana blockchain data. πŸ“š Looking for WebSocket (Datastream) functionality? Check out our [WebSocket Documentation](/public-data-api/websocket) ## Contents * [Authentication](#authentication) * [Subscription Plans](#subscription-plans-and-limits) * [Token Endpoints](#token-endpoints) * [Price Endpoints](#price-endpoints) * [Wallet Endpoints](#wallet-endpoints) * [Trade Endpoints](#trade-endpoints) * [Chart Data](#chart-data) * [PnL (Profit and Loss) Endpoints](#pnl-data) * [Top Traders](#top-traders) * [Stats and Live Events](#stats-and-live-events) * [Credits](#credits) * [Pagination](#pagination) * [Extra Information](#extra-information) ## Authentication **Base URL**: `https://data.solanatracker.io` Include your API Key (available after subscription) in the `x-api-key` header with each API call. ## Subscription Plans and Limits | Plan | Price | Requests/Month | Rate Limit | Additional Features | | --------------- | ----------- | -------------- | ---------- | ------------------- | | Free | Free | 10,000 | 1/second | - | | Advanced | €50/month | 200,000 | None | - | | Pro | €200/month | 1,000,000 | None | - | | Premium | €397/month | 10,000,000 | None | WebSocket access | | Business | €599/month | 25,000,000 | None | WebSocket access | | Enterprise | €1499/month | 100,000,000 | None | WebSocket access | | Enterprise Plus | Custom | Unlimited | None | Custom package | πŸ’‘ Want to try the WebSocket or have package questions? Email us at [contact@solanatracker.io](mailto:contact@solanatracker.io) ## SDK's πŸ’‘ Just updated! } href="https://github.com/solanatracker/data-api-sdk"> Official Javascript/Typescript SDK {" "} ## Token Endpoints #### `GET /tokens/{tokenAddress}` Retrieves comprehensive information about a specific token. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/{tokenAddress}"> Test in the Data API Playground -> Response ```json { "token":{ "name":"OFFICIAL TRUMP", "symbol":"TRUMP", "mint":"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "uri":"https://arweave.net/cSCP0h2n1crjeSWE9KF-XtLciJalDNFs7Vf-Sm0NNY0", "decimals":6, "description":"", "image":"https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw", "hasFileMetaData":true, "strictSocials":{ }, "creation":{ "creator":"9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx":"5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time":1749298225 } }, "pools":[ { "poolId":"9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2", "liquidity":{ "quote":244375150.385549, "usd":360839586.0302158 }, "price":{ "quote":9.966770767653129, "usd":9.966770767653129 }, "tokenSupply":999999453.314508, "lpBurn":0, "tokenAddress":"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "marketCap":{ "quote":9966765318.964148, "usd":9966765318.964148 }, "market":"meteora-dlmm", "quoteToken":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "decimals":6, "security":{ "freezeAuthority":null, "mintAuthority":null }, "lastUpdated":1743276314161, "deployer":"FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF", "txns":{ "buys":96998, "total":190413, "volume":526726502, "volume24h":16726502, "sells":93414 } } ], "events":{ "1m":{ "priceChangePercentage":0 }, "5m":{ "priceChangePercentage":-0.4975124378109433 }, "15m":{ "priceChangePercentage":-0.9925496893641157 }, "30m":{ "priceChangePercentage":-0.9925496893641157 }, "1h":{ "priceChangePercentage":0.4999999999999992 }, "2h":{ "priceChangePercentage":1.0025000000000053 }, "3h":{ "priceChangePercentage":-1.485124069019019 }, "4h":{ "priceChangePercentage":-1.485124069019019 }, "5h":{ "priceChangePercentage":-1.485124069019019 }, "6h":{ "priceChangePercentage":-2.462933164049435 }, "12h":{ "priceChangePercentage":-3.4310370179445404 }, "24h":{ "priceChangePercentage":-4.389531960045081 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [], "score": 0, "jupiterVerified": true } "buys":0, "sells":0, "txns":0, "holders":651269 } ``` #### `GET /tokens/by-pool/{poolAddress}` Retrieves token information by searching with a pool address. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/by-pool/{poolAddress}"> Test in the Data API Playground -> Response ```json { "token":{ "name":"OFFICIAL TRUMP", "symbol":"TRUMP", "mint":"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "uri":"https://arweave.net/cSCP0h2n1crjeSWE9KF-XtLciJalDNFs7Vf-Sm0NNY0", "decimals":6, "description":"", "image":"https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw", "hasFileMetaData":true, "strictSocials":{ }, "creation":{ "creator":"9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx":"5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time":1749298225 } }, "pools":[ { "poolId":"9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2", "liquidity":{ "quote":244375150.385549, "usd":360839586.0302158 }, "price":{ "quote":9.966770767653129, "usd":9.966770767653129 }, "tokenSupply":999999453.314508, "lpBurn":0, "tokenAddress":"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "marketCap":{ "quote":9966765318.964148, "usd":9966765318.964148 }, "market":"meteora-dlmm", "quoteToken":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "decimals":6, "security":{ "freezeAuthority":null, "mintAuthority":null }, "lastUpdated":1743276314161, "deployer":"FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF", "txns":{ "buys":96998, "total":190413, "volume":526726502, "volume24h":1726502, "sells":93414 } } ], "events":{ "1m":{ "priceChangePercentage":0 }, "5m":{ "priceChangePercentage":-0.4975124378109433 }, "15m":{ "priceChangePercentage":-0.9925496893641157 }, "30m":{ "priceChangePercentage":-0.9925496893641157 }, "1h":{ "priceChangePercentage":0.4999999999999992 }, "2h":{ "priceChangePercentage":1.0025000000000053 }, "3h":{ "priceChangePercentage":-1.485124069019019 }, "4h":{ "priceChangePercentage":-1.485124069019019 }, "5h":{ "priceChangePercentage":-1.485124069019019 }, "6h":{ "priceChangePercentage":-2.462933164049435 }, "12h":{ "priceChangePercentage":-3.4310370179445404 }, "24h":{ "priceChangePercentage":-4.389531960045081 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [], "score": 0, "jupiterVerified": true } "buys":0, "sells":0, "txns":0, "holders":651269 } ``` #### `GET /tokens/{tokenAddress}/holders` Gets the top 100 holders for a specific token and the total amount } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/{tokenAddress}/holders"> Test in the Data API Playground -> Response ```json { "total":651343, "accounts":[ { "wallet":"2RH6rUTPBJ9rUDPpuV9b8z1YL56k1tYU6Uk5ZoaEFFSK", "amount":800000022.564, "value":{ "quote":8134085180.01063, "usd":8134085180.01063 }, "percentage":80.00004595161334 }, { "wallet":"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount":25151426.025001, "value":{ "quote":255729794.894759, "usd":255729794.894759 }, "percentage":2.5151439762462187 }, { "wallet":"C68a6RCGLiPskbPYtAcsCjhG8tfTWYcoB4JjCrXFdqyo", "amount":15978104.518764, "value":{ "quote":162459074.3812657, "usd":162459074.3812657 }, "percentage":1.5978113245847323 }, {...} ], } ``` #### `GET /tokens/{tokenAddress}/holders/top` Gets the top 20 holders for a token. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/{tokenAddress}/holders/top"> Test in the Data API Playground -> Response ```json [ { "address": "FwbBBzAfBgGaAWjEG4nprZQ8mp8w2W3eHLxAWbyUnwXR", "amount": 114837224.78981262, "percentage": 12.897608531935292, "value": { "quote": 364.490083024, "usd": 80016.91106116588 } }, { "address": "Cst5bqk7QJAj1tR7qH9eiYnT7ygDEashKYTFvV1obRGK", "amount": 27748733.327190395, "percentage": 3.116518187950125, "value": { "quote": 88.07368980529128, "usd": 19334.914534601114 } } ] ``` **Developer Tip:** Want to get all token holders? Use this example with your RPC: ```javascript const tokenAccounts = await connection.getParsedProgramAccounts( new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), { filters: [{ dataSize: 165 }, { memcmp: { offset: 0, bytes: mintAddress } }], } ); const accounts = tokenAccounts.map((account) => ({ wallet: account.account.data.parsed.info.owner, amount: account.account.data.parsed.info.tokenAmount.uiAmount, })); ``` #### `GET /tokens/{tokenAddress}/ath` Retrieves the all-time high price of a token (since the data API started recording). } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/{tokenAddress}/ath"> Test in the Data API Playground -> Response ```json { "highest_price": 0.002399892080590551, "timestamp": 171924662484 } ``` #### `GET /deployer/{wallet}` Retrieves all tokens created by a specific wallet with pagination support. Query Parameters * `page` (optional): Page number (default: 1) * `limit` (optional): Number of items per page (default: 250, max: 500) } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/deployer/{wallet}"> Test in the Data API Playground -> Response ```json { "total": 2, "tokens": [ { "name": "OFFICIAL TRUMP", "symbol": "TRUMP", "mint": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw", "decimals": 6, "hasSocials": false, "poolAddress": "7noYm8BxkbFhe3R37qfaE6vfzoJN4ZhQoWwcLpJPdZyw", "liquidityUsd": 534.4163492557315, "marketCapUsd": 0, "priceUsd": 0, "lpBurn": 0, "market": "meteora-dlmm", "freezeAuthority": null, "mintAuthority": null, "createdAt": 0, "lastUpdated": 1741634697371, "buys": 0, "sells": 0, "totalTransactions": 0 }, { "name": "DUNA", "symbol": "DUNA", "mint": "9umkdJdE555ZFMyYbi1AXK2VC2Ge6qUwuLH6bwXPpump", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fipfs.io%2Fipfs%2FQmPxDiTa5SogsT8SsF5Zq3wKaf6HrcDBbbTuKzALQFQPNg", "decimals": 6, "hasSocials": false, "poolAddress": "DyVWcQE7vhPXa6TPoC9DRB7dZLimoSKYSYezW1W4wJD6", "liquidityUsd": 0, "marketCapUsd": 0, "priceUsd": 0, "lpBurn": 0, "market": "meteora-dlmm", "freezeAuthority": null, "mintAuthority": null, "createdAt": 0, "lastUpdated": 1741650596208, "buys": 0, "sells": 0, "totalTransactions": 0 } ] } ``` #### `GET /search` } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/search"> Test in the Data API Playground -> The `/search` endpoint provides a flexible search interface for pools and tokens with comprehensive filtering options and pagination. Query Parameters | Parameter | Type | Default | Description | | -------------- | ------- | --------- | ---------------------------------------------- | | `query` | string | optional | Search term for token symbol, name, or address | | `symbol` | string | optional | Search for all tokens matching an exact symbol | | `page` | integer | 1 | Page number for pagination | | `limit` | integer | 100 | Number of results per page | | `sortBy` | string | createdAt | Field to sort by | | `sortOrder` | string | desc | Sort order: asc or desc | | `showAllPools` | boolean | false | Return all pools for a token if enabled | | Parameter | Type | Description | | -------------- | ------- | --------------------------------------- | | `minCreatedAt` | integer | Minimum creation date in unix time (ms) | | `maxCreatedAt` | integer | Maximum creation date in unix time (ms) | | Parameter | Type | Description | | -------------- | ----- | ------------------------- | | `minLiquidity` | float | Minimum liquidity in USD | | `maxLiquidity` | float | Maximum liquidity in USD | | `minMarketCap` | float | Minimum market cap in USD | | `maxMarketCap` | float | Maximum market cap in USD | | Parameter | Type | Description | | ----------------- | ------ | --------------------------------------------- | | `minVolume` | float | Minimum volume in USD (for default timeframe) | | `maxVolume` | float | Maximum volume in USD (for default timeframe) | | `volumeTimeframe` | string | Timeframe for volume filtering (e.g., '24h') | Supports `minVolume_X` and `maxVolume_X` where X is: `5m`, `15m`, `30m`, `1h`, `6h`, `12h`, `24h` | Parameter | Type | Description | | ---------------------- | ------- | ------------------------------------ | | `minBuys` | integer | Minimum number of buy transactions | | `maxBuys` | integer | Maximum number of buy transactions | | `minSells` | integer | Minimum number of sell transactions | | `maxSells` | integer | Maximum number of sell transactions | | `minTotalTransactions` | integer | Minimum total number of transactions | | `maxTotalTransactions` | integer | Maximum total number of transactions | | Parameter | Type | Description | | ----------------- | ------- | ------------------------ | | `lpBurn` | integer | LP token burn percentage | | `market` | string | Market identifier | | `freezeAuthority` | string | Freeze authority address | | `mintAuthority` | string | Mint authority address | | `deployer` | string | Deployer address | | `status` | string | Token status | | Parameter | Type | Description | | ------------------ | ------- | ------------------------------------- | | `showPriceChanges` | boolean | Include price change data in response | Response ```json { "status": "success", "data": [ { "name": "OFFICIAL TRUMP", "symbol": "TRUMP", "mint": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN", "decimals": 6, "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw", "holders": 651267, "jupiter": true, "verified": true, "liquidityUsd": 360839586.0312104, "marketCapUsd": 9966765318.964148, "priceUsd": 9.966770767653129, "lpBurn": 0, "market": "meteora-dlmm", "freezeAuthority": null, "mintAuthority": null, "poolAddress": "9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2", "totalBuys": 96999, "totalSells": 93415, "totalTransactions": 190414, "volume_5m": 0, "volume": 1053453008.146068, "volume_15m": 59157, "volume_30m": 514425, "volume_1h": 777545, "volume_6h": 6025120, "volume_12h": 11831342, "volume_24h": 14501603, "tokenDetails": { "creator": "HArYFfZtxEA6peDZkvrC68RY6wZ1PyLGrg8y55nRWupy", "tx": "3frR9DTRSVpxtKhey8cqF928jwbEH71rBAYjtziqY6MpE3SzQrnRv6xTbjQZpTEHrzzz9upJcDgTNE2Vp4KzMEuz", "time": 1745532570 } } ] } ``` #### `GET /tokens/latest` Retrieves the latest 100 tokens. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/latest"> Test in the Data API Playground -> Query Parameters `page` (optional): Page number (1-10) Response ```json [ { "token": { "name": "April Fool’s Day", "symbol": "FOOLS", "mint": "DWKaYT4omXcZeDiaAUoJfBMhDK7DDQTymusKohsGpump", "uri": "https://ipfs.io/ipfs/QmWR8ah9MmciD3ErUJDb9csfRoyFHTT5Lves2zSnqXPeYz", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun", "description": "It’s a celebration!", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fimage.solanatracker.io%2Fproxy%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252FQmbBVm7CffYX2wnuCrGLARgQHAoX79E4m1HWN2AcBqGYqa", "showName": true, "twitter": "https://twitter.com/aprilfoolsday", "telegram": "https://t.me/aprilsfoolsday", "strictSocials": { "twitter": "https://twitter.com/aprilfoolsday", "telegram": "https://t.me/aprilsfoolsday" }, "creation": { "creator": "9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx": "5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time": 1749298225 } }, "pools": [], "events": {}, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [], "score": 0, "jupiterVerified": true } "buys": 3, "sells": 0, "txns": 3 }, { "token": { "name": "KWGPOK", "symbol": "OKGWP", "mint": "7HKHmpYMVtwMqwLrH5529q26v8grmUmWscmww97pump", "uri": "https://ipfs.io/ipfs/QmTBkpB8t7R5R9aR2tcJxAM4PM3R6XB9VZ2jE2i1wQR5ar", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun", "description": "POGWSE", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fimage.solanatracker.io%2Fproxy%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252FQmRDA43fShZSVCE73wSbKemivVPYqWhW222n5roH8c987w", "showName": true, "strictSocials": {}, "creation": { "creator": "9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx": "5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time": 1749298225 } }, "pools": [ { "poolId": "7HKHmpYMVtwMqwLrH5529q26v8grmUmWscmww97pump", "liquidity": { "quote": 60.200984914, "usd": 7504.35662608982 }, "price": { "quote": 2.814661839287826e-8, "usd": 0.000003508618049029575 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "7HKHmpYMVtwMqwLrH5529q26v8grmUmWscmww97pump", "marketCap": { "quote": 28.14661839287826, "usd": 3508.618049029575 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 0.45168079312482234, "curve": "Hf4ak2796LJu4nYFUyVAmXV7bxiSvLw3Ayq5C4PFDJWk", "deployer": "6hepaQw3pugEBnwY2JBuYGoE5kZjho4DCSHAUKZhcoe", "lastUpdated": 1743276573362, "createdAt": 1743276571192, "txns": { "buys": 2, "total": 4, "volume": 251, "volume24h": 251, "sells": 1 } } ], "events": { "1m": { "priceChangePercentage": 0 }, "5m": { "priceChangePercentage": 0 }, "15m": { "priceChangePercentage": 0 }, "30m": { "priceChangePercentage": 0 }, "1h": { "priceChangePercentage": 0 }, "2h": { "priceChangePercentage": 0 }, "3h": { "priceChangePercentage": 0 }, "4h": { "priceChangePercentage": 0 }, "5h": { "priceChangePercentage": 0 }, "6h": { "priceChangePercentage": 0 }, "12h": { "priceChangePercentage": 0 }, "24h": { "priceChangePercentage": 0 } }, "risk": { "rugged": false, "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "risks": [ { "name": "No social media", "description": "This token has no social media links", "level": "warning", "score": 2000 }, { "name": "Pump.fun contracts can be changed at any time", "description": "Pump.fun contracts can be changed by Pump.fun at any time", "level": "warning", "score": 10 }, { "name": "Bonding curve not complete", "description": "No raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 5 }, "buys": 3, "sells": 1, "txns": 4 } ] ``` #### `POST /tokens/multi` Accepts an array of token addresses in the request body (up to 20 per request). } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/multi"> Test in the Data API Playground -> Request Body ```json { "tokens": [ "So11111111111111111111111111111111111111112", "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" ] } ``` #### `GET /tokens/trending` #### `GET /tokens/trending/{timeframe}` } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/trending"> Test in the Data API Playground -> Gets the top 100 trending tokens based on transaction volume in the specified timeframe (default: past hour). Available Timeframes `5m`, `15m`, `30m`, `1h` (default), `2h`, `3h`, `4h`, `5h`, `6h`, `12h`, `24h` #### `GET /tokens/volume` #### `GET /tokens/volume/{timeframe}` Retrieves the top 100 tokens sorted by highest volume within the specified timeframe. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/volume"> Test in the Data API Playground -> Available Timeframes `5m`, `15m`, `30m`, `1h`, `6h`, `12h`, `24h` #### `GET /tokens/multi/all` Gets an overview of latest, graduating, and graduated tokens (Pumpvision / Photon Memescope style). Query Parameters * `limit` (optional): Number of tokens per category (latest, graduating, graduated) } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/multi/all"> Test in the Data API Playground -> Response ```json { "latest": [ { "token": { "name": "Cult of Trenching", "symbol": "TrenchCult", "mint": "uwjFzyPjn8ayhfVfeMUzkQBbrgeFMeEd47NvRbCpump", "uri": "https://ipfs.io/ipfs/QmWT5HsQh5oLvnqthDgQEGVUjn3gH9R6PyhJNr4wkdsn66", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun", "description": "", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fimage.solanatracker.io%2Fproxy%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252FQmXWHqMvrqkubp6kxw9vUcNPv42ZXQ3BLcCARXjUoWLsAg", "showName": true, "twitter": "https://x.com/solgoated1/status/1906065859657032002", "website": "https://x.com/solgoated1/status/1906065859657032002", "strictSocials": { "twitter": "https://x.com/solgoated1/status/1906065859657032002" } }, "pools": [ { "poolId": "uwjFzyPjn8ayhfVfeMUzkQBbrgeFMeEd47NvRbCpump", "liquidity": { "quote": 74.997144066, "usd": 9366.628111886268 }, "price": { "quote": 4.3682600325215646e-8, "usd": 0.0000054556567093592755 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "uwjFzyPjn8ayhfVfeMUzkQBbrgeFMeEd47NvRbCpump", "marketCap": { "quote": 43.682600325215645, "usd": 5455.656709359276 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 27.05425691727814, "curve": "7ofQyZf2HmYCmM4LWHNaP9VEZ2frevtwmEdtjBb2hwgh", "deployer": "6Y5FiURYwKGXBPAes1P9WDGuHoi8oiz4FwYWyHeYNXPw", "lastUpdated": 1743276647681, "createdAt": 1743276646913, "txns": { "buys": 3, "total": 3, "volume": 490, "volume24h": 490, "sells": 0 } } ], "events": { "1m": { "priceChangePercentage": 0 }, "5m": { "priceChangePercentage": 0 }, "15m": { "priceChangePercentage": 0 }, "30m": { "priceChangePercentage": 0 }, "1h": { "priceChangePercentage": 0 }, "2h": { "priceChangePercentage": 0 }, "3h": { "priceChangePercentage": 0 }, "4h": { "priceChangePercentage": 0 }, "5h": { "priceChangePercentage": 0 }, "6h": { "priceChangePercentage": 0 }, "12h": { "priceChangePercentage": 0 }, "24h": { "priceChangePercentage": 0 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [ { "name": "Pump.fun contracts can be changed at any time", "description": "Pump.fun contracts can be changed by Pump.fun at any time", "level": "warning", "score": 10 }, { "name": "Bonding curve not complete", "description": "No raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 3 }, "buys": 2, "sells": 0, "txns": 2 } ], "graduating": [ { "token": { "name": "White Grandpa", "symbol": "UNC", "mint": "6wX5EfAx9gGHLQ2Z21N8CaLorGav8EFDdrTzyq1pump", "uri": "https://ipfs.io/ipfs/QmPX3mqev2udUJLVNFHTxY8gTSodDbfbQrYoQvAWq9FVsT", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun", "description": "stay woke\r\nhttps://x.com/DailyLoud/status/1905634722543251595", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fipfs-forward.solanatracker.io%2Fipfs%2FQmRY15KCq65MMgECXWbnAivuDcHV7t7gKXHRpb2qCQbeGM", "showName": true, "twitter": "https://x.com/DailyLoud/status/1905634722543251595", "strictSocials": { "twitter": "https://x.com/DailyLoud/status/1905634722543251595" }, "creation": { "creator": "9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx": "5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time": 1749298225 } }, "pools": [ { "poolId": "6wX5EfAx9gGHLQ2Z21N8CaLorGav8EFDdrTzyq1pump", "liquidity": { "quote": 184.205822434, "usd": 23006.041846940676 }, "price": { "quote": 2.635273705842488e-7, "usd": 0.00003291275832308565 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "6wX5EfAx9gGHLQ2Z21N8CaLorGav8EFDdrTzyq1pump", "marketCap": { "quote": 263.5273705842488, "usd": 32912.75832308565 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 91.22426412249791, "curve": "B8UVQ46EqQ2sEHagX7h1WzDpxuFVXp6fAjiXFaT1D692", "deployer": "4VfBaC9Jftw4Bm1oHYt8TrhamF7DGEr9Ut2JovCPWbqe", "lastUpdated": 1743276647759, "createdAt": 1743274179758, "txns": { "buys": 977, "total": 1866, "volume": 31100, "volume24h": 31100, "sells": 889 }, "bundleId": "e88d7ab51773355bad96ac842f0976231bd87083d77882f56c62a277c840fcb8" } ], "events": { "1m": { "priceChangePercentage": -4.1724840124786216 }, "5m": { "priceChangePercentage": -0.8171310506410367 }, "15m": { "priceChangePercentage": 46.42260473798215 }, "30m": { "priceChangePercentage": 54.14793685627088 }, "1h": { "priceChangePercentage": 868.7250909621494 }, "2h": { "priceChangePercentage": 868.7250909621494 }, "3h": { "priceChangePercentage": 868.7250909621494 }, "4h": { "priceChangePercentage": 868.7250909621494 }, "5h": { "priceChangePercentage": 868.7250909621494 }, "6h": { "priceChangePercentage": 868.7250909621494 }, "12h": { "priceChangePercentage": 868.7250909621494 }, "24h": { "priceChangePercentage": 868.7250909621494 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [ { "name": "Pump.fun contracts can be changed at any time", "description": "Pump.fun contracts can be changed by Pump.fun at any time", "level": "warning", "score": 10 }, { "name": "Bonding curve not complete", "description": "No raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 3 }, "buys": 1182, "sells": 1123, "txns": 2305, "holders": 232 } ], "graduated": [ { "token": { "name": "X Γ† Meow-12", "symbol": "XΓ†Meow-12", "mint": "UkAivL55R7iBEW3wfsTETdiHM1jfByHTRAFQHiKWLyF", "uri": "https://ipfs-forward.solanatracker.io/ipfs/QmZc1ndhGNpywi5YdbiUwWetAumWPCqdyHCDoAN6hVQ7Pb", "decimals": 6, "description": "", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fipfs-forward.solanatracker.io%2Fipfs%2FQme3Qoomq5sUxx8E7BViGQ5CCs9obGHWfA8C6UrmBscPSS", "showName": true, "createdOn": "https://pump.fun", "twitter": "https://x.com/Josikinz/status/1906060748796867071", "hasFileMetaData": true, "strictSocials": { "twitter": "https://x.com/Josikinz/status/1906060748796867071" }, "creation": { "creator": "9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx": "5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time": 1749298225 } }, "pools": [ { "poolId": "5UH61hrcBSgE3fLXQ4bMTtXb7e1bVvSeisJq7z8V8yvE", "liquidity": { "quote": 18.503268912, "usd": 4613.051725397854 }, "price": { "quote": 1.9289130860019372e-8, "usd": 0.0000024044875210544464 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "UkAivL55R7iBEW3wfsTETdiHM1jfByHTRAFQHiKWLyF", "marketCap": { "quote": 19.289130860019373, "usd": 2404.4875210544465 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun-amm", "deployer": "2WDizMKyQaYXJxaZ2oPFGM9kdCZuWhX52oMy57NUESrN", "lastUpdated": 1743276422531, "txns": { "buys": 25, "total": 45, "volume": 5947, "volume24h": 3947, "sells": 20 }, "bundleId": "5ad775152feacf1be43bdbc82a9c0551a2757cca30bb8bfb15c0d1742692a78e" }, { "poolId": "UkAivL55R7iBEW3wfsTETdiHM1jfByHTRAFQHiKWLyF", "liquidity": { "quote": 0, "usd": 0 }, "price": { "quote": null, "usd": null }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "UkAivL55R7iBEW3wfsTETdiHM1jfByHTRAFQHiKWLyF", "marketCap": { "quote": null, "usd": null }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 100, "curve": "WLEgumwUg9brqWHZUYPFVpSqAur5Av8ctYkqegtUDJN", "deployer": "6d22FozaKK239PoBYVffkYKA1QPQZE8fC7AQkpmHQfjp", "lastUpdated": 1743275416731, "createdAt": 1743275416459, "txns": { "buys": 1, "total": 1, "volume": 5305, "volume24h": 4305, "sells": 0 } } ], "events": { "1m": { "priceChangePercentage": 0 }, "5m": { "priceChangePercentage": 2.546993067700225 }, "15m": { "priceChangePercentage": -7.955395053691079 }, "30m": { "priceChangePercentage": -95.75161080372789 }, "1h": { "priceChangePercentage": -95.75161080372789 }, "2h": { "priceChangePercentage": -95.75161080372789 }, "3h": { "priceChangePercentage": -95.75161080372789 }, "4h": { "priceChangePercentage": -95.75161080372789 }, "5h": { "priceChangePercentage": -95.75161080372789 }, "6h": { "priceChangePercentage": -95.75161080372789 }, "12h": { "priceChangePercentage": -95.75161080372789 }, "24h": { "priceChangePercentage": -95.75161080372789 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [ { "name": "Price Decrease", "description": "Price decreased by more than 50% in the last 24 hours", "level": "warning", "score": 1000 } ], "score": 1 }, "buys": 1, "sells": 0, "txns": 1, "holders": 13 } ] } ``` #### `GET /tokens/multi/graduating` Overview of all graduating launchpad tokens (Pump.fun, letsbonk.fun, jupiter studio etc) } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/multi/graduating"> Test in the Data API Playground -> #### `GET /tokens/multi/graduated` Overview of all graduated launchpad tokens (Pump.fun, letsbonk.fun, jupiter studio etc) } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/tokens/multi/graduated"> Test in the Data API Playground -> ## Price Endpoints #### `GET /price` } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/price"> Test in the Data API Playground -> Gets price information for a single token. Query Parameters * `token` (required): The token address * `priceChanges` (optional): Returns price change percentages up to 24 hours ago Response ```json { "price": 1.23, "liquidity": 1000000, "marketCap": 50000000, "lastUpdated": 1628097600000 } ``` #### `GET /price/history` Gets historic price information for a single token. Query Parameters `token` (required): The token address Response ```json { "current": 0.00153420295896641, "3d": 0.0003172284163334442, "5d": 0.00030182128340039925, "7d": 0.0003772164702056164, "14d": 0.0003333105740474755, "30d": 0.0008621030248959815 } ``` #### `GET /price/history/timestamp` Gets specific historic price information for a token at a given timestamp. Query Parameters * `token` (required): The token address * `timestamp` (required): The target timestamp (unix timestamp) Response ```json { "price": 0.0010027648651222173, "timestamp": 1732237829688, "timestamp_unix": 1732237830, "pool": "D5Nbd1N7zAu8zjKoz3yR9WSXTiZr1c1TwRtiHeu5j7iv" } ``` #### `GET /price/history/range` Gets the lowest and highest price in a time range Query Parameters * `token` (required): The token address * `time_from` (required): Start time (unix timestamp) * `time_to` (required): End time (unix timestamp) Response ```json { "token": "HEZ6KcNNUKaWvUCBEe4BtfoeDHEHPkCHY9JaDNqrpump", "price": { "lowest": { "price": 0.000048405946337731886, "time": 1740009112 }, "highest": { "price": 0.003417425506087095, "time": 1740216420 } } } ``` #### `POST /price` Similar to GET /price, but accepts token address in the request body. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/price"> Test in the Data API Playground -> Request Body ```json { "token": "So11111111111111111111111111111111111111112" } ``` #### `GET /price/multi` Gets price information for multiple tokens (up to 100). } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/price/multi"> Test in the Data API Playground -> Query Parameters * `tokens` (required): Comma-separated list of token addresses * `priceChanges` (optional): Returns price change percentages up to 24 hours ago #### `POST /price/multi` Similar to GET /price/multi, but accepts an array of token addresses in the request body. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/price/multi"> Test in the Data API Playground -> Request Body ```json { "tokens": [ "So11111111111111111111111111111111111111112", "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" ] } ``` ## Wallet Endpoints #### `GET /wallet/{owner}` Gets all tokens in a wallet with current value in USD. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/wallet/{owner}"> Test in the Data API Playground -> Response ```json { "tokens": [ { "token": { "name": "Wrapped SOL", "symbol": "SOL", "mint": "So11111111111111111111111111111111111111112", "uri": "", "decimals": 9, "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fcoin-images.coingecko.com%2Fcoins%2Fimages%2F21629%2Flarge%2Fsolana.jpg%3F1696520989", "hasFileMetaData": true, "creation": { "creator": "9zGpUxJr2jnkwSSF9VGezy6aALEfxysE19hvcRSkbn15", "created_tx": "5eHbuGuF1GfFcBgHcym69A1ErUYzY5vD2tE5hJ4A71yvZ7U3e93xMy1CWeH1HcAiyy6Yi8GDoJjeSXHhuDC4CFnW", "created_time": 1749298225 } }, "pools": [...], "events": {...}, "risk": {...}, "balance": 0.775167121, "value": 112.31297732160377 } ], "total": 228.41656975961473, "totalSol": 1.5750283296373857, "timestamp": "2024-08-15 12:49:06" } ``` #### `GET /wallet/{owner}/basic` Gets all tokens in a wallet with current value in USD (lightweight, non-cached option). } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/wallet/{owner}/basic"> Test in the Data API Playground -> Response ```json { "tokens": [ { "address": "So11111111111111111111111111111111111111112", "balance": 0.019911506, "value": 2.4810073805356456, "price": { "quote": 1, "usd": 124.60169414285619 }, "marketCap": { "quote": 79833267.86038868, "usd": 9953124295.82677 }, "liquidity": { "quote": 395459.208121804, "usd": 49303439.00300889 } }, { "address": "9BT13kNGQFKvSj2BibHPKmpxxSnqMFUEEZEMQ5SNpump", "balance": 35145.6526, "value": 0.07660938412685546, "price": { "usd": 0.0000021797684339159336, "quote": 1.6913819975765577e-8 }, "marketCap": { "usd": 2178.6061946025698, "quote": 16.904801629500383 }, "liquidity": { "usd": 4300.296098435483, "quote": 33.367963734 } }, { "address": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm", "balance": 0.078177, "value": 0.03318780628945246, "price": { "usd": 0.42452135908838234, "quote": 0.0034070271837690056 }, "marketCap": { "usd": 424029286.2902132, "quote": 3403078.017575447 }, "liquidity": { "usd": 7978691.886756113, "quote": 64033.57467683 } }, { "address": "AF7CYuqRw61atGBVT9LpxaXuSW9RuGmfnSAEgaHppump", "balance": 2143.21592, "value": 0.0075007010716513205, "price": { "usd": 0.0000034997412074334164, "quote": 2.7995661589662763e-8 }, "marketCap": { "usd": 3499.7412074334165, "quote": 27.995661589662763 }, "liquidity": { "usd": 7505.524527654956, "quote": 60.039332132 } } ], "total": 2.598305272023605, "totalSol": 0.02085288879816225 } ``` #### `GET /wallet/{owner}/page/{page}` Retrieves wallet tokens using pagination with a limit of 250 tokens per request. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/wallet/{owner}/page/{page}"> Test in the Data API Playground -> #### `GET /wallet/{owner}/trades` Gets the latest trades of a wallet. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/wallet/{owner}/trades"> Test in the Data API Playground -> Query Parameters * `cursor` (optional): Cursor for pagination Response ```json { "trades": [ { "tx": "Transaction Signature here", "from": { "address": "So11111111111111111111111111111111111111112", "amount": 0.00009999999747378752, "token": { "name": "Wrapped SOL", "symbol": "SOL", "image": "https://image.solanatracker.io/proxy?url=https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png", "decimals": 9 } }, "to": { "address": "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", "amount": 0.00815899996086955, "token": { "name": "Raydium", "symbol": "RAY", "image": "https://image.solanatracker.io/proxy?url=https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R/logo.png", "decimals": 6 } }, "price": { "usd": 1.7136074522202307, "sol": "" }, "volume": { "usd": 0.014018403988365319, "sol": 0.00009999999747378752 }, "wallet": "WALLET_ADDRESS", "program": "raydium", "time": 1722759119596 } ], "nextCursor": 1722759119596, "hasNextPage": true } ``` #### `GET /wallet/{owner}/chart` Gets wallet portfolio chart data with historical values and PnL information. **Note:** This only shows data when /wallet/:wallet has been called. Each time that endpoint has been called the total value will be stored. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/wallet/{owner}/chart"> Test in the Data API Playground -> Response ```json { "chartData": [ { "date": "2024-12-08", "value": 890670.2, "timestamp": 1733692405000, "pnlPercentage": 0 }, { "date": "2024-05-14", "value": 1450.27, "timestamp": 1715668377000, "pnlPercentage": -99.84 }, { "date": "2025-01-22", "value": 3938345.2, "timestamp": 1737554275000, "pnlPercentage": 575.17 } ], "pnl": { "24h": { "value": 105528.2, "percentage": 2.8 }, "30d": { "value": 3346283.26, "percentage": 634.99 } } } ``` ## Trade Endpoints #### `GET /trades/{tokenAddress}` Gets the latest trades for a token across all pools. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/trades/{tokenAddress}"> Test in the Data API Playground -> Query Parameters for all trade endpoints * `cursor` (optional): Cursor for pagination * `showMeta` (optional): Set to 'true' to add metadata for from and to tokens * `parseJupiter` (optional): Set to 'true' to combine all transfers within a Jupiter swap into a single transaction * `hideArb` (optional): Set to 'true' to hide arbitrage or other transactions that don't match token parameters * `sortDirection` (optional): Sort direction by descending (DESC) or ascending (ASC) order, default is DESC Response ```json { "trades": [ { "tx": "2FxCUeEDQMtKAZtctMqCkPLM7tHPaGJ4hL7nR6VQnxgLUTaxvRYVjHY6nyWD61NmuN9vLKzHZzWvUK71KBu4xGYb", "amount": 164388.579723, "priceUsd": 0.0002468380661718994, "volume": 40.57735911957043, "volumeSol": 0.32487869, "type": "sell", "wallet": "4fFn7mVd8Bfa5LSmbXjHZnwnPkDQnugSycAbFG3caDVV", "time": 1743274860158, "program": "jupiter", "pools": [ "3W5ng1TswwN6CYYnpCG5R9EFmbgFoKPSKCt86rKuchqX", "1upXtuorkR93tWNNTWPsfPve91Xqt3tUhExhqzdDMaY", "GS4CU59F31iL7aR2Q8zVS8DRrcRnXX1yjQ66TqNVQnaR" ] }, { "tx": "46CP5Fu8wiLfj8nPu9afN2ByGAAmgiMMq6TQTWqMtWKdCgysYocx97YcU8uaHZL73zrSgYWZKnaGu9rp4QosS1EF", "amount": 176227.18061500788, "priceUsd": 0.0002488434720999679, "volume": 43.85298350262672, "volumeSol": 0.3499999999999659, "type": "buy", "wallet": "7ACsEkYSvVyCE5AuYC6hP1bNs4SpgCDwsfm3UdnyPERk", "time": 1743274728903, "program": "raydium", "pools": [ "3W5ng1TswwN6CYYnpCG5R9EFmbgFoKPSKCt86rKuchqX" ] } ] } ``` #### `GET /trades/{tokenAddress}/{poolAddress}` Gets the latest trades for a specific token and pool pair. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/trades/{tokenAddress}/{poolAddress}"> Test in the Data API Playground -> #### `GET /trades/{tokenAddress}/{poolAddress}/{owner}` Gets the latest trades for a specific token, pool, and wallet address. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/trades/{tokenAddress}/{poolAddress}/{owner}"> Test in the Data API Playground -> #### `GET /trades/{tokenAddress}/by-wallet/{owner}` Gets the latest trades for a specific token and wallet address. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/trades/{tokenAddress}/by-wallet/{owner}"> Test in the Data API Playground -> Query Parameters for all trade endpoints * `cursor` (optional): Cursor for pagination * `showMeta` (optional): Set to 'true' to add metadata for from and to tokens * `parseJupiter` (optional): Set to 'true' to combine all transfers within a Jupiter swap into a single transaction * `hideArb` (optional): Set to 'true' to hide arbitrage or other transactions that don't match token parameters Response for all trade endpoints ```json { "trades": [ { "tx": "Transaction Signature", "amount": 1000, "priceUsd": 0.1, "volume": 100, "type": "buy", "wallet": "WalletAddress", "time": 1723726185254, "program": "jupiter" } ], "nextCursor": 1723726185254, "hasNextPage": true } ``` ## Chart Data #### `GET /chart/{token}` #### `GET /chart/{token}/{pool}` } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/chart/{token}"> Test in the Data API Playground -> πŸ’‘ View example using the Datastream for live updates on [Github]("https://github.com/solanatracker/solana-chart-example") or a [preview]("https://www.solanatracker.io/tokens/EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm") Gets OHLCV (Open, High, Low, Close, Volume) data for charts. Available Intervals | Shorthand | Interval | Shorthand | Interval | | --------- | --------- | --------- | -------- | | 1s | 1 SECOND | 1h | 1 HOUR | | 5s | 5 SECOND | 2h | 2 HOUR | | 15s | 15 SECOND | 4h | 4 HOUR | | 1m | 1 MINUTE | 6h | 6 HOUR | | 3m | 3 MINUTE | 8h | 8 HOUR | | 5m | 5 MINUTE | 12h | 12 HOUR | | 15m | 15 MINUTE | 1d | 1 DAY | | 30m | 30 MINUTE | 3d | 3 DAY | | | | 1w | 1 WEEK | | | | 1mn | 1 MONTH | Note: The shorthand "1mn" is used for 1 month to avoid confusion with "1m" (1 minute). Query Parameters | Parameter | Type | Default | Description | | ---------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `type` | string | optional | Time interval (e.g., "1s", "1m", "1h", "1d") | | `time_from` | integer | optional | Start time (Unix timestamp in seconds) | | `time_to` | integer | optional | End time (Unix timestamp in seconds) | | `marketCap` | boolean | false | Return chart for market cap instead of pricing | | `removeOutliers` | boolean | true | Set to false to disable outlier removal | | `dynamicPools` | boolean | true | Dynamically picks the main pool over time to create the best and most consistent chart (only applies to `/chart/{token}` without pool) | | `timezone` | string | optional | Timezone for chart data. Accepts timezone abbreviations (PST, EDT, UTC, GMT, etc.) or any IANA timezone identifier | | `fastCache` | boolean | false | Enables a live cache on the chart API for even faster response times | Supported Timezone Abbreviations | Abbreviation | Timezone | | ------------ | -------------------- | | PST/PDT | America/Los\_Angeles | | MST/MDT | America/Denver | | CST/CDT | America/Chicago | | EST/EDT | America/New\_York | | UTC | UTC | | GMT/BST | Europe/London | | CET/CEST | Europe/Berlin | | JST | Asia/Tokyo | | IST | Asia/Kolkata | | AEST/AEDT | Australia/Sydney | **Note:** You can also use any valid IANA timezone identifier like "America/New\_York", "Europe/Paris", "Asia/Shanghai", etc. Response ```json { "oclhv": [ { "open": 0.011223689525154462, "close": 0.011223689525154462, "low": 0.011223689525154462, "high": 0.011223689525154462, "volume": 683.184501136, "time": 1722514489 }, { "open": 0.011223689525154462, "close": 0.011257053686384555, "low": 0.011257053686384555, "high": 0.011257053686384555, "volume": 12788.70421942799, "time": 1722514771 } ] } ``` #### `GET /holders/chart/{token}` Gets token holder count data over time. Returns up to 1000 of the most recent data points. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/holders/chart/{token}"> Test in the Data API Playground -> Query Parameters | Parameter | Type | Default | Description | | ----------- | ------- | -------- | -------------------------------------------- | | `type` | string | 1d | Time interval (e.g., "1s", "1m", "1h", "1d") | | `time_from` | integer | optional | Start time (Unix timestamp in seconds) | | `time_to` | integer | optional | End time (Unix timestamp in seconds) | Response ```json { "holders": [ { "holders": 1235, "time": 1722414489 }, { "holders": 1242, "time": 1722514771 } ] } ``` ## PnL Data #### `GET /pnl/{wallet}` Gets Profit and Loss data for all positions of a wallet. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/pnl/{wallet}"> Test in the Data API Playground -> Gets Profit and Loss data for all positions of a wallet. Query Parameters * `showHistoricPnL` (optional): Adds PnL data for 1d, 7d and 30d intervals (BETA) * `holdingCheck` (optional): Does an extra check for current holding value in wallet * `hideDetails` (optional): Return only summary without data for each token Response ```json { "tokens": { "85tgA28eJCUwpTGkREdocDtkHCgZZySyrdv35w6opump": { "holding": 34909.416624, "held": 402288.62697, "sold": 367379.210346, "realized": 48.24649003, "unrealized": 4665.26723313, "total": 4713.51372317, "total_sold": 1195.95048046, "total_invested": 1256.76208526, "average_buy_amount": 38.08369955, "current_value": 4774.3253279697965, "cost_basis": 0.00312403 } }, "summary": { "realized": 2418.42956164, "unrealized": -634.74038817, "total": 1783.68917347, "totalInvested": 103020.70911717, "averageBuyAmount": 1535.12073025, "totalWins": 222, "totalLosses": 295, "winPercentage": 34.8, "lossPercentage": 46.24 } } ``` #### `GET /first-buyers/{token}` Retrieves the first 100 buyers of a token (since API started recording data) with PnL data for each wallet. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/first-buyers/{token}"> Test in the Data API Playground -> Response ```json [ { "wallet": "4Cj49oNeaf71yoBrpXMJmCaxH3ynu12ZTA1aBFMkQeux", "first_buy_time": 1749298040053, "first_buy": { "signature": "4U8basvKv7D6teHQ23aBv56DkiAHGQZYpzFsvgBL2NvnfrtqeMPSjFRgUehRzBhNddYvJAf8y4LCCJuq4g2Sa5g3", "amount": 5854151.773284, "volume_usd": 524.1346753936324, "time": 1749298040053 }, "first_sell_time": 1749298100973, "last_transaction_time": 1749298312835, "held": 27893430.984015, "sold": 78480.998053, "sold_usd": 7.01709558, "holding": 27893430.984015, "realized": -0.00947531, "unrealized": 254.20472656, "total": 254.19525125, "total_invested": 2283.22325896, "buy_transactions": 53, "sell_transactions": 18, "total_transactions": 71, "average_buy_amount": 43.07968413, "average_sell_amount": 0.38983864, "current_value": 2751.50771692, "cost_basis": 0.00008953 } ] ``` #### `GET /pnl/{wallet}/{token}` Gets Profit and Loss data for a specific token in a wallet. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/pnl/{wallet}/{token}"> Test in the Data API Playground -> Response ```json { "holding": 0, "held": 51095238.095238, "sold": 51095238.095238, "sold_usd": 776.90009082, "realized": 588.64143114, "unrealized": 0, "total": 588.64143114, "total_sold": 776.90009082, "total_invested": 188.25865968, "average_buy_amount": 188.25865968, "current_value": 0, "cost_basis": 0.00000368, "first_buy_time": 1743274275720, "last_buy_time": 1743274275720, "last_sell_time": 1743274299334, "last_trade_time": 1743274299334, "buy_transactions": 1, "sell_transactions": 1, "total_transactions": 2 } ``` ## Top Traders #### `GET /top-traders/all` #### `GET /top-traders/all/{page}` Gets the most profitable traders across all tokens, with optional pagination. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/top-traders/all"> Test in the Data API Playground -> Gets the most profitable traders across all tokens, with optional pagination. Query Parameters * `expandPnl` (boolean): Include detailed PnL data for each token if true * `sortBy` (string): Sort results by metric ("total" or "winPercentage") Response ```json { "wallets":[ { "wallet":"EnQLCLB7NWojruXXNopgH7jhkwoHihTpuzsrtsM2UCSe", "summary":{ "realized":3756474.7271160004, "unrealized":15783289.965727912, "total":19539764.69284411, "totalInvested":8518686.472995985, "totalWins":423, "totalLosses":848, "averageBuyAmount":2681.285469290887, "winPercentage":33.05, "lossPercentage":66.25, "neutralPercentage":0.7 } }, { "wallet":"G1pRtSyKuWSjTqRDcazzKBDzqEF96i1xSURpiXj3yFcc", "summary":{ "realized":5562034.291971359, "unrealized":1763696.487146583, "total":7325730.779117969, "totalInvested":18551286.808092587, "totalWins":581, "totalLosses":1010, "averageBuyAmount":3748.128733793242, "winPercentage":36.27, "lossPercentage":63.05, "neutralPercentage":0.68 } } ] } ``` #### `GET /top-traders/{token}` Gets top 100 traders by PnL for a token. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/top-traders/{token}"> Test in the Data API Playground -> Response ```json [ { "wallet": "5cJ59MEVwdGGfPgSQMm2xoiacrh9U3edEWLeQDYRLavu", "held": 41549988.501104, "sold": 41549988.501104, "holding": 0, "realized": 663.8706273151051, "unrealized": 0, "total": 663.8706273151051, "total_invested": 345.5038083813247 }, { "wallet": "4ocG4Vvbv2Dsam2CQaU5etEbvESvX5oZQb5NjTEaJK27", "held": 51095238.095238, "sold": 51095238.095238, "holding": 0, "realized": 588.6414311400356, "unrealized": 0, "total": 588.6414311400356, "total_invested": 188.25865967784858 }, { "wallet": "FJCZZ9fodGG9NSqSbAJadgGVyz4sXDiJX77rYyq7m4ua", "held": 23467238.92106, "sold": 23467238.92106, "holding": 0, "realized": 560.522503566342, "unrealized": 0, "total": 560.522503566342, "total_invested": 184.350034205613 } ] ``` ## Stats and Live Events #### `GET /stats/{token}` #### `GET /stats/{token}/{pool}` Gets detailed stats for a token or token-pool pair over various time intervals. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/stats/{token}"> Test in the Data API Playground -> Response ```json { "1m": { "buyers": 7, "sellers": 9, "volume": { "buys": 642.307406481682, "sells": 3071.093119714688, "total": 3713.4005261963716 }, "transactions": 102, "buys": 90, "sells": 12, "wallets": 14, "price": 0.0026899499819631667, "priceChangePercentage": 0.017543536395684036 }, "5m": {...}, "15m": {...}, "24h": {...} } ``` #### `GET /events/{tokenAddress}` Gets raw event data for live processing. Returns binary data that needs to be decoded. **Note:** For non-live statistics, use `/stats/{token}` instead which is more efficient. This endpoint is designed for real-time stats updates } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/events/{tokenAddress}"> Test in the Data API Playground -> } href="https://github.com/solanatracker/data-api-sdk/blob/main/src/event-processor.ts"> Decode example code Response Returns binary data (application/octet-stream) that can be decoded into an array of events: ```json [ { "wallet": "8psNvWTrdNTiVRNzAgsou9kETXNJm2SXZyaKuJraVRtf", "amount": 5.677347, "priceUsd": 10.472407812562192, "volume": 59.455493077426524, "type": "sell", "time": 1749298583015 }, { "wallet": "7ACsEkYSvVyCE5AuYC6hP1bNs4SpgCDwsfm3UdnyPERk", "amount": 2469629.599217, "priceUsd": 0.0000098468505465602, "volume": 245.0468505465602, "type": "buy", "time": 1749298314879 } ] ``` **SDK Usage:** The SDK automatically decodes the binary data. Use the `decodeBinaryEvents` function from the SDK to decode the data manually if needed. #### `GET /events/{tokenAddress}/{poolAddress}` Gets raw event data for a specific token and pool. Returns binary data that needs to be decoded. **Note:** For non-live statistics, use `/stats/{token}/{pool}` instead which is more efficient. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/events/{tokenAddress}/{poolAddress}"> Test in the Data API Playground -> } href="https://github.com/solanatracker/data-api-sdk/blob/main/src/event-processor.ts"> Decode example code Response format is the same as `/events/{tokenAddress}`. Code example e ## Credits & Subscription #### `GET /credits` Gets the remaining API credits for your API key. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/credits"> Test in the Data API Playground -> Response ```json { "credits": 9976168 } ``` #### `GET /subscription` Gets current subscription information including credits, plan, and billing details. } href="https://www.solanatracker.io/account/data-api/playground?endpoint=/subscription"> Test in the Data API Playground -> Response ```json { "credits": 9902, "plan": "free", "next_billing_date": "2025-07-15T15:39:11.000Z", "status": "active" } ``` ## Pagination All trade endpoints use cursor-based pagination. Use the `nextCursor` value from the response as the `cursor` parameter in subsequent requests until `hasNextPage` is false. Example usage: ``` GET /trades/{tokenAddress} GET /trades/{tokenAddress}?cursor=1723726185254 ``` The `cursor` is based on the `time` field of the trades. ## Extra Information If a token was bundled, it will have the bundleId on the pool object. Example: ```json { "poolId": "ELBKHojRoP8oKu67zTeKxPb3Exz81pmCbro4yDjpump", "liquidity": { "quote": 60.246977672, "usd": 10227.888120255442 }, "price": { "quote": 2.8189642105022452e-8, "usd": 0.000004785642645344013 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "ELBKHojRoP8oKu67zTeKxPb3Exz81pmCbro4yDjpump", "marketCap": { "quote": 28.18964210502245, "usd": 4785.642645344013 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 0.5546182621565947, "curve": "BvRVC3sSA3qPscfyxLEP8EZxt3EjoBQigJMgcdQt4CfF", "deployer": "HvFsFTB59XWFmRcXN6noEuej5GBd2yZnYDDmnHtYiECz", "lastUpdated": 1740318305150, "createdAt": 1740318255995, "txns": { "buys": 6, "total": 11, "volume": 832, "volume24h": 632, "sells": 4 }, "bundleId": "1a4ef430786340775d41a48a7648e633d2e3e711743c808851c260bf9af0153f" } ``` ## All supported markets: * pumpfun * pumpun-amm * meteora-curve * meteora-dyn-v2 * meteora-dyn * meteora-dlmm * raydium * raydium-clmm * raydium-cpmm * raydium-launchpad * boop * moonshot (this is moonit, they renamed it from moonshot. moonshot is under meteora-curve) * orca file: ./content/public-data-api/index.mdx meta: { "title": "Solana Data API", "description": "Token and pool data for all solana tokens. Including Market Cap, Price, Liquidity, Chart data, price changes, stats, wallet trades and total value, last trades and more", "icon": "HomeIcon", "full": false } ### Solana Tracker Data API Public API for Solana Tracker data. Token and pool data for all Pumpfun, Raydium, Raydium CPMM, Moonshot, Meteora DLMM, Meteora DYN and Orca tokens. Including Market Cap, Price, Liquidity, Chart data, price changes, stats, wallet trades and total value, last trades and more [Documentation](/public-data-api/docs) file: ./content/public-data-api/risk.mdx meta: { "title": "Risk Score", "description": "Risk Scores / Rugcheck API", "icon": "HomeIcon", "full": false } # Risk Scores API The Risk Score API helps assess token investment risk by evaluating multiple factors and generating a normalized risk score from 1-10. This enables users to make more informed decisions when trading tokens on Solana. ## Risk Categories Risk factors are grouped into four main categories based on severity: } title="Warning Factors"> Potential issues that require attention but may not indicate immediate danger } title="Danger Factors"> Significant red flags that suggest high risk or potential for malicious activity } title="Liquidity Factors"> Issues related to token liquidity and holder concentration } title="Snipers & Insiders"> Risks from early buyers and insider wallets ## Scoring Methodology The final risk score is normalized to a scale of 1 to 10, calculated based on the sum of individual risk factor scores (weights). Higher scores indicate higher risk. ## Warning Risk Factors These factors indicate potential concerns but may have legitimate explanations: | Risk Factor | Description | Score | | ------------------------ | --------------------------------------------------------- | ----- | | No social media | Token has no associated social media links | 2000 | | No file metadata | Token has no file metadata | 100 | | Pump.fun contract risks | Pump.fun contracts can be changed by Pump.fun at any time | 10 | | Incomplete bonding curve | No Raydium liquidity pool, bonding curve not complete | 4000 | | Transitioning to Raydium | Token is currently transitioning to Raydium | 100 | | Price decrease | Price decreased by more than 50% in the last 24 hours | 1000 | ## Danger Risk Factors These factors indicate serious concerns that could impact token value and tradability: | Risk Factor | Description | Score | | ------------------------ | ------------------------------------------------------------- | ----- | | Freeze Authority Enabled | Tokens can be frozen and prevented from trading in the future | 7500 | | Mint Authority Enabled | More tokens can be minted by the owner at any time | 2500 | | Rugged | No liquidity, token is considered unsafe to purchase | 20000 | | LP Burned | Allows the owner to remove liquidity at any time | 4000 | ### Dynamic Fee Risk (Meteora Curve) For tokens on Meteora Curve with dynamic fees: | Fee Range | Level | Score | | --------- | ------ | ----- | | >5% | Danger | 1000 | | >10% | Danger | 1500 | | >20% | Danger | 3000 | | >40% | Danger | 4000 | | >50% | Danger | 5000 | | >75% | Danger | 7500 | ## Liquidity Risk Factors These factors assess token liquidity and holder concentration: ### Liquidity Levels | Risk Factor | Description | Level | Score | | ------------------ | ---------------------------------------------- | ------- | ----- | | Very Low Liquidity | The total liquidity for this token is very low | Danger | 7500 | | Low Liquidity | The total liquidity for this token is low | Warning | 5000 | ### Holders

The following risk scores are applied based on the percentage owned by the largest holder:

Threshold Level Score
>90% Danger 7000
>80% Danger 6000
>70% Danger 4600
>60% Danger 4400
>50% Danger 4300
>40% Danger 4100
>30% Danger 3500
>20% Danger 2500
>10% Danger 2000
Risk Factor Description Level Score
Top 10 Holders Top 10 holders own more than 15% of the total supply Danger 5000
## Snipers and Insiders These factors assess the concentration of tokens held by early buyers (snipers) and insider wallets: ### Snipers Risk Levels Snipers are wallets that bought tokens within the first few transactions or blocks: | Ownership Percentage | Level | Score | | -------------------- | ------- | ----- | | >50% | Danger | 10000 | | >30% | Danger | 6000 | | >20% | Danger | 4000 | | >10% | Warning | 3000 | ### Insiders Risk Levels Insiders are wallets potentially connected to the token creators or team: | Ownership Percentage | Level | Score | | -------------------- | ------- | ----- | | >50% | Danger | 10000 | | >30% | Danger | 7000 | | >20% | Danger | 5000 | | >10% | Warning | 3000 | ## API Integration Risk score is returned on all `token` objects with enhanced snipers and insiders data. Example: ```json { "risk":{ "snipers": { "count": 5, "totalBalance": 50000000, "totalPercentage": 12.5, "wallets": [ { "address": "WalletAddress1...", "balance": 20000000, "percentage": 5.0 } ] }, "insiders": { "count": 3, "totalBalance": 30000000, "totalPercentage": 7.5, "wallets": [ { "address": "WalletAddress2...", "balance": 15000000, "percentage": 3.75 } ] }, "top10": 25.5, "rugged": false, "risks": [ { "name": "Snipers", "description": "Snipers own 12.50% of the total supply.", "value": "12.50%", "level": "warning", "score": 3000 }, { "name": "Bonding curve not complete", "description": "No raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 5, "jupiterVerified": false } } ``` ### Risk Object Structure The enhanced risk object now includes: * **`snipers`**: Object containing sniper wallet data * `count`: Number of sniper wallets * `totalBalance`: Total tokens held by snipers * `totalPercentage`: Percentage of supply held by snipers * `wallets`: Array of sniper wallet details * **`insiders`**: Object containing insider wallet data * `count`: Number of insider wallets * `totalBalance`: Total tokens held by insiders * `totalPercentage`: Percentage of supply held by insiders * `wallets`: Array of insider wallet details * **`top10`**: Percentage of supply held by top 10 holders * **`rugged`**: Boolean indicating if token is rugged * **`risks`**: Array of risk factors with names, descriptions, and scores * **`score`**: Normalized risk score (1-10) * **`jupiterVerified`**: Boolean indicating Jupiter verification status Jupiter verified tokens automatically receive a risk score of 0 and have no risk factors, as they have passed Jupiter's strict verification process. More risk factors will be added soon to improve the accuracy and comprehensiveness of the risk assessment. file: ./content/public-data-api/websocket.mdx meta: { "title": "WebSocket - Data Stream", "description": "Stream parsed transactions (per pair or for a wallet), receive new pools/tokens, price updates, and more.", "icon": "WebSocketIcon", "full": false } # WebSocket - Data Stream The WebSocket API is only available for **Premium, Business, and Enterprise** plans. πŸ’‘ **Using our SDK?** The official JavaScript/TypeScript SDK includes a built-in `Datastream` class with an improved API for WebSocket connections. Check out the [SDK documentation](https://github.com/solanatracker/data-api-sdk) for easier integration. With the WebSocket API, you can stream: * Parsed transactions (per pair or for a wallet) * New pools/tokens * Price updates * Pool updates * Token updates * Pumpfun Graduating / Graduated * Pumpfun Bonding Curve Percentage * Curve percentage * **NEW:** Snipers and insiders tracking * **NEW:** Wallet balance tracking * Other market-related data in real time. ## WebSocketService Class Below is the `WebSocketService` class for managing WebSocket connections and room subscriptions. ```javascript import EventEmitter from "eventemitter3"; class WebSocketService { constructor(wsUrl) { this.wsUrl = wsUrl; this.socket = null; this.transactionSocket = null; this.reconnectAttempts = 0; this.reconnectDelay = 2500; this.reconnectDelayMax = 4500; this.randomizationFactor = 0.5; this.emitter = new EventEmitter(); this.subscribedRooms = new Set(); this.transactions = new Set(); this.connect(); if (typeof window !== "undefined") { window.addEventListener("beforeunload", this.disconnect.bind(this)); } } async connect() { if (this.socket && this.transactionSocket) { return; } try { this.socket = new WebSocket(this.wsUrl); this.transactionSocket = new WebSocket(this.wsUrl); this.setupSocketListeners(this.socket, "main"); this.setupSocketListeners(this.transactionSocket, "transaction"); } catch (e) { console.error("Error connecting to WebSocket:", e); this.reconnect(); } } setupSocketListeners(socket, type) { socket.onopen = () => { console.log(`Connected to ${type} WebSocket server`); this.reconnectAttempts = 0; this.resubscribeToRooms(); }; socket.onclose = () => { console.log(`Disconnected from ${type} WebSocket server`); if (type === "main") this.socket = null; if (type === "transaction") this.transactionSocket = null; this.reconnect(); }; socket.onmessage = (event) => { try { const message = JSON.parse(event.data); if (message.type === "message") { if (message.data?.tx && this.transactions.has(message.data.tx)) { return; } else if (message.data?.tx) { this.transactions.add(message.data.tx); } if (message.room.includes('price:')) { this.emitter.emit(`price-by-token:${message.data.token}`, message.data); } this.emitter.emit(message.room, message.data); } } catch (error) { console.error("Error processing message:", error); } }; } disconnect() { if (this.socket) { this.socket.close(); this.socket = null; } if (this.transactionSocket) { this.transactionSocket.close(); this.transactionSocket = null; } this.subscribedRooms.clear(); this.transactions.clear(); } reconnect() { console.log("Reconnecting to WebSocket server"); const delay = Math.min( this.reconnectDelay _ Math.pow(2, this.reconnectAttempts), this.reconnectDelayMax ); const jitter = delay _ this.randomizationFactor; const reconnectDelay = delay + Math.random() \* jitter; setTimeout(() => { this.reconnectAttempts++; this.connect(); }, reconnectDelay); } joinRoom(room) { this.subscribedRooms.add(room); const socket = room.includes("transaction") ? this.transactionSocket : this.socket; if (socket && socket.readyState === WebSocket.OPEN) { socket.send(JSON.stringify({ type: "join", room })); } } leaveRoom(room) { this.subscribedRooms.delete(room); const socket = room.includes("transaction") ? this.transactionSocket : this.socket; if (socket && socket.readyState === WebSocket.OPEN) { socket.send(JSON.stringify({ type: "leave", room })); } } on(room, listener) { this.emitter.on(room, listener); } off(room, listener) { this.emitter.off(room, listener); } getSocket() { return this.socket; } resubscribeToRooms() { if ( this.socket && this.socket.readyState === WebSocket.OPEN && this.transactionSocket && this.transactionSocket.readyState === WebSocket.OPEN ) { for (const room of this.subscribedRooms) { const socket = room.includes("transaction") ? this.transactionSocket : this.socket; socket.send(JSON.stringify({ type: "join", room })); } } } } export default WebSocketService; ``` ```python import json import time import threading from typing import Set import websocket from pyee import EventEmitter class WebSocketService: def __init__(self, ws_url: str): self.ws_url = ws_url self.socket = None self.transaction_socket = None self.reconnect_attempts = 0 self.reconnect_delay = 2.5 self.reconnect_delay_max = 4.5 self.randomization_factor = 0.5 self.emitter = EventEmitter() self.subscribed_rooms: Set[str] = set() self.transactions: Set[str] = set() self.connect() def connect(self): if self.socket and self.transaction_socket: return try: self.socket = websocket.WebSocketApp( self.ws_url, on_open=lambda ws: self.on_open(ws, "main"), on_close=lambda ws: self.on_close(ws, "main"), on_message=self.on_message ) self.transaction_socket = websocket.WebSocketApp( self.ws_url, on_open=lambda ws: self.on_open(ws, "transaction"), on_close=lambda ws: self.on_close(ws, "transaction"), on_message=self.on_message ) threading.Thread(target=self.socket.run_forever, daemon=True).start() threading.Thread(target=self.transaction_socket.run_forever, daemon=True).start() except Exception as e: print(f"Error connecting to WebSocket: {e}") self.reconnect() def on_open(self, ws, socket_type): print(f"Connected to {socket_type} WebSocket server") self.reconnect_attempts = 0 self.resubscribe_to_rooms() def on_close(self, ws, socket_type): print(f"Disconnected from {socket_type} WebSocket server") if socket_type == "main": self.socket = None elif socket_type == "transaction": self.transaction_socket = None self.reconnect() def on_message(self, ws, message): try: message = json.loads(message) if message["type"] == "message": if message["data"].get("tx") and message["data"]["tx"] in self.transactions: return elif message["data"].get("tx"): self.transactions.add(message["data"]["tx"]) if "price:" in message["room"]: self.emitter.emit(f"price-by-token:{message['data']['token']}", message["data"]) self.emitter.emit(message["room"], message["data"]) except Exception as e: print(f"Error processing message: {e}") def disconnect(self): if self.socket: self.socket.close() self.socket = None if self.transaction_socket: self.transaction_socket.close() self.transaction_socket = None self.subscribed_rooms.clear() self.transactions.clear() def reconnect(self): print("Reconnecting to WebSocket server") delay = min( self.reconnect_delay * (2 ** self.reconnect_attempts), self.reconnect_delay_max ) jitter = delay * self.randomization_factor reconnect_delay = delay + (jitter * (2 * time.time() % 1 - 0.5)) def delayed_reconnect(): time.sleep(reconnect_delay) self.reconnect_attempts += 1 self.connect() threading.Thread(target=delayed_reconnect, daemon=True).start() def join_room(self, room: str): self.subscribed_rooms.add(room) socket = self.transaction_socket if "transaction" in room else self.socket if socket and socket.sock and socket.sock.connected: socket.send(json.dumps({"type": "join", "room": room})) def leave_room(self, room: str): self.subscribed_rooms.discard(room) socket = self.transaction_socket if "transaction" in room else self.socket if socket and socket.sock and socket.sock.connected: socket.send(json.dumps({"type": "leave", "room": room})) def on(self, room: str, listener): self.emitter.on(room, listener) def off(self, room: str, listener): self.emitter.remove_listener(room, listener) def get_socket(self): return self.socket def resubscribe_to_rooms(self): if (self.socket and self.socket.sock and self.socket.sock.connected and self.transaction_socket and self.transaction_socket.sock and self.transaction_socket.sock.connected): for room in self.subscribed_rooms: socket = self.transaction_socket if "transaction" in room else self.socket socket.send(json.dumps({"type": "join", "room": room})) # Usage example: ws_service = WebSocketService("wss://datastream.solanatracker.io/your-datastream-url-here") ws_service.join_room("price-by-token:GqmEdRD3zGUZdYPeuDeXxCc8Cj1DBmGSYK97TCwSpump") def on_price_update(data): print(f"Received price update for {data['token']}: {data['price']}") def main(): # Initialize the WebSocket service ws_url = "wss://datastream.solanatracker.io/your-datastream-url-here" ws_service = WebSocketService(ws_url) # Join a room (in this case, for a specific token's price updates) token_room = "price-by-token:GqmEdRD3zGUZdYPeuDeXxCc8Cj1DBmGSYK97TCwSpump" ws_service.join_room(token_room) # Register the event listener ws_service.on(token_room, on_price_update) print("Listening for price updates. Press Ctrl+C to exit.") try: # Keep the script running while True: time.sleep(1) except KeyboardInterrupt: print("Stopping the WebSocket listener...") finally: # Clean up ws_service.off(token_room, on_price_update) ws_service.leave_room(token_room) ws_service.disconnect() if __name__ == "__main__": main() ``` ## Room Types and Usage ### Latest Tokens/Pools **Room Name:** `latest`\ **Description:** Receive updates about the latest tokens and pools. ```json { "token": { "name": "Token Name", "symbol": "DANCE", "mint": "AmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump", "uri": "https://cf-ipfs.com/ipfs/QmVrh4ER81fns3S4QU48WiBuhiusc1KsCxsM8mSs1bEGPv", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun" }, "pools": [ { "liquidity": { "quote": 62, "usd": 8907.761583907999 }, "price": { "quote": 2.9853991922957425e-8, "usd": 0.000004289229715768062 }, "tokenSupply": 1000000000000000, "lpBurn": 100, "tokenAddress": "AmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump", "marketCap": { "quote": 29.853991922957423, "usd": 4289.229715768061 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "deployer": "4Rz5xqikxtZ2s7wE9uQ6n2oLXQi6K65XGoYpKxf24Hqo", "openTime": 0, "poolId": "GmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump" } ], "events": { "30m": { "priceChangePercentage": 0 }, "1h": { "priceChangePercentage": 0 }, "4h": { "priceChangePercentage": 0 }, "24h": { "priceChangePercentage": 0 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [ { "name": "No social media", "description": "This token has no social media links", "level": "warning", "score": 2000 }, { "name": "Pump.fun contracts can be changed at any time", "description": "Pump.fun contracts can be changed by Pump.fun at any time", "level": "warning", "score": 10 }, { "name": "Bonding curve not complete", "description": "No raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 5 } } ``` ### Pool Changes **Room Name:** `pool:poolId`\ **Description:** Receive updates about changes in a specific pool. ```json { "liquidity": { "quote": 62.280000004, "usd": 8947.990185184213 }, "price": { "quote": 3.012424976894315e-8, "usd": 0.000004328058626384536 }, "tokenSupply": 1000000000000000, "lpBurn": 100, "tokenAddress": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "marketCap": { "quote": 30.124249768943148, "usd": 4328.058626384535 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "deployer": "EB58aFKZ3bXSFcPvVNDB9P5QXaG1AiMykmsNo6XmsV4Y", "lastUpdated": 1723727796824, "createdAt": 1723727770351, "poolId": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "txns": { "buys": 134, "sells": 76, "total": 210, "volume": 15644, "volume24h": 15644 } } ``` ### Transactions **Room Name:** `transaction:tokenAddress`\ **Description:** Receive updates on the latest transactions for a specific token. ```json [ { "tx": "2BN6pJ2zJE4cVerXxeBxbRCMZ8ZzcpPmEeBmoB2gESLRxeNNShxtyhKRhDZST6QcWuYBQWf6dJxV4TVQMHJ85fs", "amount": 946904.652554, "priceUsd": 0.000007945268449484616, "volume": 7.625805739043482, "type": "sell", "wallet": "orcACRJYTFjTeo2pV8TfYRTpmqfoYgbVi9GeANXTCc8", "time": 1723728022856, "program": "pump" } ] ``` ### Pair Transactions **Room Name:** `transaction:tokenAddress:poolId`\ **Description:** Receive updates on transactions for a specific token in a specific pool. ```json [ { "tx": "2BN6pJ2zJE4cVerXxeBxbRCMZ8ZzcpPmEeBmoB2gESLRxeNNShxtyhKRhDZST6QcWuYBQWf6dJxV4TVQMHJ85fs", "amount": 946904.652554, "priceUsd": 0.000007945268449484616, "volume": 7.625805739043482, "type": "sell", "wallet": "orcACRJYTFjTeo2pV8TfYRTpmqfoYgbVi9GeANXTCc8", "time": 1723728022856, "program": "pump" } ] ``` ### Pair and Wallet Transactions **Room Name:** `transaction:tokenAddress:poolId:wallet`\ **Description:** Receive updates on transactions for a specific token, pool, and wallet. ```json [ { "tx": "2BN6pJ2zJE4cVerXxeBxbRCMZ8ZzcpPmEeBmoB2gESLRxeNNShxtyhKRhDZST6QcWuYBQWf6dJxV4TVQMHJ85fs", "amount": 946904.652554, "priceUsd": 0.000007945268449484616, "volume": 7.625805739043482, "type": "sell", "wallet": "orcACRJYTFjTeo2pV8TfYRTpmqfoYgbVi9GeANXTCc8", "time": 1723728022856, "program": "pump" } ] ``` ### Price Updates **Room Name:** `price:poolId`, `price-by-token:tokenId` or `price:tokenId`\ **Description:** Receive price updates for a specific pool or token. `price-by-token:tokenId`: Uses the pool with the highest liquidity for price updates. `price:tokenId`: Uses all available pools for price updates. `price:poolId`: Uses specific pool for price updates ```json { "price": 0.000008006158441370585, "price_quote": 0.0000010064, "pool": "EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump", "token": "EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump", "time": 1723728065246 } ``` ### Wallet Transactions **Room Name:** `wallet:walletAddress`\ **Description:** Receive updates about transactions for a specific wallet. ```json { "tx": "4R3ngzDKhgyXDBRJdXiKXUDKUWz3oeMwV6mDh4RjqSpeiA1Jc9i8VHcasrg4UzTvG3GVYpyBXYQBMmh6okYUgbZX", "amount": 77.12537, "priceUsd": 15.381611661924738, "solVolume": 5.994944529684513, "volume": 1186.3124906222604, "type": "buy", "wallet": "MfDuWeqSHEqTFVYZ7LoexgAK9dxk7cy4DFJWjWMGVWa", "time": 1739318753652, "program": "meteora-dlmm", "token": { "from": { "name": "USD Coin", "symbol": "USDC", "image": "https://image.solanatracker.io/proxy?url=undefined", "decimals": 6, "amount": 1187.5, "priceUsd": 1, "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }, "to": { "name": "OFFICIAL TRUMP", "symbol": "TRUMP", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw", "decimals": 6, "priceUsd": 8.1939, "amount": 77.12537, "address": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } } } ``` ### Wallet Balance Updates (NEW) **Room Name:** `wallet:walletAddress:balance`\ **Description:** Receive updates when any token balance changes for a specific wallet. ```json { "wallet": "WalletAddressHere", "token": "TokenMintAddress", "amount": 1000000 } ``` ### Wallet Token Balance Updates (NEW) **Room Name:** `wallet:walletAddress:tokenAddress:balance`\ **Description:** Receive updates when a specific token balance changes for a wallet. ```json { "wallet": "WalletAddressHere", "token": "TokenMintAddress", "amount": 1000000 } ``` Key Fields: * "wallet": The wallet address * `token`": The token mint address * "amount": The new token balance (parsed amount) ### Graduating Tokens **Room Name:** `graduating` or `graduating:sol:175` (for a specific market cap threshold)\ **Description:** Receive updates on tokens that are close to completing their bonding curve on pumpfun/moonshot. ```json { "token": { "name": "The Buy Mechanism", "symbol": "BUY", "mint": "FS53KrzKqNTp3CS7YDSJ61rgyN1cMyUhAbJrn4tbonk", "uri": "https://metadata.pumplify.eu/data/QmcqFDJBnt693eEWSq4xXg31vtfoV3g2PpuEJ5jTyC78hC", "decimals": 6, "isMutable": false, "description": "", "twitter": "https://x.com/i/communities/1943034658800963764", "telegram": "", "website": "", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fmetadata.pumplify.eu%2Fdata%2FQmbrz6CHYyjSu74HyPh8bUCh2ULKtdp7wffJSzKfw5UTCZ", "showName": "true", "hasFileMetaData": true, "strictSocials": { "twitter": "https://x.com/i/communities/1943034658800963764" }, "creation": { "creator": "J5gXsyettqJsMScenY7q7KnNDcojmaKX9jeBCNAMCgBW", "created_tx": "4cD9Dfwqmcv9PgsAKS36UJ3sXMTNgbnd858kAXzA2h3HW8TEqoWEaqNYbqf1ABw4rXPiu2G1DvELLtvUvhqwAL1Q", "created_time": 1752091418 } }, "pools": [ { "poolId": "6zSZt11CQnNL1cyEMAMgdsgyNgB84iqwMWmdqmiKKQFh", "liquidity": { "quote": 60.997331973045306, "usd": 9573.963688163733 }, "price": { "quote": 2.888698914581598e-8, "usd": 0.000004534017738097711 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "FS53KrzKqNTp3CS7YDSJ61rgyN1cMyUhAbJrn4tbonk", "marketCap": { "quote": 28.88698914581598, "usd": 4534.017738097711 }, "market": "raydium-launchpad", "launchpad": { "name": "letsbonk.fun", "url": "https://letsbonk.fun/", "logo": "https://sapphire-working-koi-276.mypinata.cloud/ipfs/bafkreicgnuyebtmnyhmjbwd32t5w2hcwbtwqlrxsc5eedpgtjy7q4remfa", "baseLiquidity": { "amount": 1073025605.596382, "usd": 4865.117129207035 }, "quoteLiquidity": { "amount": 30.000852951, "usd": 4708.846558956698 } }, "curvePercentage": 2.19, "quoteToken": "So11111111111111111111111111111111111111112", "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "deployer": "J5gXsyettqJsMScenY7q7KnNDcojmaKX9jeBCNAMCgBW", "lastUpdated": 1752091418185, "createdAt": 1752091417977, "txns": { "buys": 2, "sells": 0, "total": 2, "volume": 109 } } ], "events": { "1m": { "priceChangePercentage": 0 }, "5m": { "priceChangePercentage": 0 }, "15m": { "priceChangePercentage": 0 }, "30m": { "priceChangePercentage": 0 }, "1h": { "priceChangePercentage": 0 }, "2h": { "priceChangePercentage": 0 }, "3h": { "priceChangePercentage": 0 }, "4h": { "priceChangePercentage": 0 }, "5h": { "priceChangePercentage": 0 }, "6h": { "priceChangePercentage": 0 }, "12h": { "priceChangePercentage": 0 }, "24h": { "priceChangePercentage": 0 } }, "risk": { "top10": 1.7373775733841, "rugged": false, "risks": [ { "name": "Bonding curve not complete", "description": "No Raydium liquidity pool, bonding curve not complete", "level": "warning", "score": 4000 } ], "score": 3 }, "buys": 2, "sells": 0, "txns": 2 } ``` ### Graduated Tokens **Room Name:** `graduated`\ **Description:** Receive updates on tokens that just completed their bonding curve on pumpfun/moonshot and are now on Raydium. ```json { "token": { "name": "Token Name", "symbol": "DANCE", "mint": "AmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump", "uri": "https://cf-ipfs.com/ipfs/QmVrh4ER81fns3S4QU48WiBuhiusc1KsCxsM8mSs1bEGPv", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun" }, "pools": [ { "liquidity": { "quote": 62, "usd": 8907.761583907999 }, "price": { "quote": 2.9853991922957425e-8, "usd": 0.000004289229715768062 }, "tokenSupply": 1000000000000000, "lpBurn": 100, "tokenAddress": "AmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump", "marketCap": { "quote": 29.853991922957423, "usd": 4289.229715768061 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "deployer": "4Rz5xqikxtZ2s7wE9uQ6n2oLXQi6K65XGoYpKxf24Hqo", "openTime": 0, "poolId": "GmJaZvdNptvofC4qe3tvuBNgqLm65p1of5pk6JFHpump" } ], "events": { "30m": { "priceChangePercentage": 0 }, "1h": { "priceChangePercentage": 0 }, "4h": { "priceChangePercentage": 0 }, "24h": { "priceChangePercentage": 0 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [ { "name": "No social media", "description": "This token has no social media links", "level": "warning", "score": 2000 }, { "name": "Pump.fun contracts can be changed at any time", "description": "Pump.fun contracts can be changed by Pump.fun at any time", "level": "warning", "score": 10 } ], "score": 5 } } ``` ### Metadata (BETA) **Room Name:** `metadata:tokenAddress`\ **Description:** Retrieve complete token metadata for a given address, particularly useful when the initial response lacks full details due to pending IPFS propagation. ```json { "name": "Token Name", "symbol": "Token Symbol", "mint": "ZDp3WVAH2wFvCeYa76myFaGoX4wv5u8VQGWvDpmqpump", "uri": "https://ipfs.io/ipfs/Qme5wcWJjnuvHUMwjo7gFDqK4CYr1zsL6uHSKr8EhuYdj7", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun", "description": "Description", "image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fimage.solanatracker.io%2Fproxy%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252FQmasCGX7Gyhhz6ERhGQU1xYRmDo2oqvE8WobHxo1AJcudJ", "showName": true, "twitter": "https://x.com/", "telegram": "https://t.me/", "website": "https://website.ag/" } ``` ### Holders (BETA) **Room Name:** `holders:tokenAddress`\ **Description:** Receive updates on any holder count change for a token. Must have been requested by /tokens/:token/holders endpoint first. ```json { "total": 91367 } ``` ### Token Changes **Room Name:** `token:tokenAddress`\ **Description:** Receive all updates from any pool for a token. ```json { "liquidity": { "quote": 62.280000004, "usd": 8947.990185184213 }, "price": { "quote": 3.012424976894315e-8, "usd": 0.000004328058626384536 }, "tokenSupply": 1000000000000000, "lpBurn": 100, "tokenAddress": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "marketCap": { "quote": 30.124249768943148, "usd": 4328.058626384535 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "deployer": "EB58aFKZ3bXSFcPvVNDB9P5QXaG1AiMykmsNo6XmsV4Y", "lastUpdated": 1723727796824, "createdAt": 1723727770351, "poolId": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "txns": { "buys": 134, "sells": 76, "total": 210, "volume": 15644, "volume24h": 15644 } } ``` ### Token Changes (Main Pool only) **Room Name:** `token:tokenAddress:priamry`\ **Description:** Receive all updates from the main pool for a token. Better for more consistent results. ```json { "liquidity": { "quote": 62.280000004, "usd": 8947.990185184213 }, "price": { "quote": 3.012424976894315e-8, "usd": 0.000004328058626384536 }, "tokenSupply": 1000000000000000, "lpBurn": 100, "tokenAddress": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "marketCap": { "quote": 30.124249768943148, "usd": 4328.058626384535 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "deployer": "EB58aFKZ3bXSFcPvVNDB9P5QXaG1AiMykmsNo6XmsV4Y", "lastUpdated": 1723727796824, "createdAt": 1723727770351, "poolId": "HCuFjMcDaSNAyT6mXegLXvrYdBZdT4Xh1YajS8vrpump", "txns": { "buys": 134, "sells": 76, "total": 210, "volume": 15644, "volume24h": 15644 } } ``` ### Curve Percentage Updates **Room Name:** `{market}:curve:{percentage}`\ **Description:** Receive updates when tokens reach a specific curve percentage on bonding curve platforms like PumpFun **Available Markets:** * `launchpad` * `pumpfun` * `boop` * `meteora-curve` **Example Room Names:** * `pumpfun:curve:30` - Tokens reaching 30% on Pump.fun * `meteora-curve:curve:75` - Tokens reaching 75% on Meteora ```json { "token": { "name": "Token Name", "symbol": "SYMBOL", "mint": "TokenMintAddress", "uri": "https://ipfs.io/ipfs/...", "decimals": 6, "hasFileMetaData": true, "createdOn": "https://pump.fun" }, "pools": [ { "liquidity": { "quote": 45.5, "usd": 6542.25 }, "price": { "quote": 0.0000234, "usd": 0.00336156 }, "tokenSupply": 1000000000, "lpBurn": 100, "tokenAddress": "TokenMintAddress", "marketCap": { "quote": 23400, "usd": 3361560 }, "decimals": 6, "security": { "freezeAuthority": null, "mintAuthority": null }, "quoteToken": "So11111111111111111111111111111111111111112", "market": "pumpfun", "curvePercentage": 30, "curve": "CurveAddress", "deployer": "DeployerAddress", "poolId": "PoolAddress" } ], "events": { "30m": { "priceChangePercentage": 15.5 }, "1h": { "priceChangePercentage": 25.3 }, "4h": { "priceChangePercentage": 45.7 }, "24h": { "priceChangePercentage": 125.9 } }, "risk": { "snipers": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "insiders": { "count": 0, "totalBalance": 0, "totalPercentage": 0, "wallets": [] }, "top10": 0, "rugged": false, "risks": [], "score": 0 } } ``` ### Snipers Updates (NEW) **Room Name:** `sniper:tokenAddress`\ **Description:** Receive real-time updates when sniper wallets change their holdings for a specific token. ```json { "wallet": "WalletAddressHere", "amount": "1000000000", "tokenAmount": 1000000, "percentage": 0.15, "previousAmount": 500000, "previousPercentage": 0.075, "totalSniperPercentage": 5.25, "totalInsiderPercentage": 12.5 } ``` ### Insiders Updates (NEW) **Room Name:** `insider:tokenAddress`\ **Description:** Receive real-time updates when insider wallets change their holdings for a specific token. ```json { "wallet": "WalletAddressHere", "amount": "5000000000", "tokenAmount": 5000000, "percentage": 0.75, "previousAmount": 4000000, "previousPercentage": 0.6, "totalSniperPercentage": 5.25, "totalInsiderPercentage": 12.5 } ``` Key Fields: * "wallet": The sniper/insider wallet address * "amount": Raw token amount (as string) * "tokenAmount": Parsed token amount * "percentage": Current percentage of supply held * "previousAmount": Previous token amount held * "previousPercentage": Previous percentage held * "totalSniperPercentage": Total percentage held by all snipers * "totalInsiderPercentage": Total percentage held by all insiders ## Usage Examples Here are examples of how to use each room type: ```javascript const wsService = new WebSocketService("wss://websocket-url-here.com"); // 1. Latest Tokens/Pools wsService.joinRoom("latest"); wsService.on("latest", (data) => { console.log("Latest token/pool update:", data); }); // 2. Pool Changes wsService.joinRoom(`pool:${poolId}`); wsService.on(`pool:${poolId}`, (data) => { console.log(`Pool ${poolId} update:`, data); }); // 3. Pair Transactions wsService.joinRoom(`transaction:${tokenAddress}:${poolId}`); wsService.on(`transaction:${tokenAddress}:${poolId}`, (data) => { console.log(`New transaction for ${tokenAddress} in pool ${poolId}:`, data); }); // 4. Transactions wsService.joinRoom(`transaction:${tokenAddress}`); wsService.on(`transaction:${tokenAddress}`, (data) => { console.log(`New transaction for ${tokenAddress}:`, data); }); // 5. Pair and Wallet Transactions wsService.joinRoom(`transaction:${tokenAddress}:${poolId}:${walletAddress}`); wsService.on( `transaction:${tokenAddress}:${poolId}:${walletAddress}`, (data) => { console.log( `New transaction for ${tokenAddress} in pool ${poolId} for wallet ${walletAddress}:`, data ); } ); // 6. Price Updates wsService.joinRoom(`price:${poolId}`); wsService.on(`price:${poolId}`, (data) => { console.log(`Price update for pool ${poolId}:`, data); }); wsService.joinRoom(`price-by-token:${tokenId}`); wsService.on(`price-by-token:${tokenId}`, (data) => { console.log(`Price update for token ${tokenId}:`, data); }); // 7. Wallet Transactions wsService.joinRoom(`wallet:${walletAddress}`); wsService.on(`wallet:${walletAddress}`, (data) => { console.log(`New transaction for wallet ${walletAddress}:`, data); }); // 8. NEW - Wallet Balance Updates // Monitor all token balance changes for a wallet wsService.joinRoom(`wallet:${walletAddress}:balance`); wsService.on(`wallet:${walletAddress}:balance`, (data) => { console.log(`Balance update for wallet ${walletAddress}:`); console.log(`Token: ${data.token}`); console.log(`New balance: ${data.amount}`); }); // Monitor specific token balance for a wallet wsService.joinRoom(`wallet:${walletAddress}:${tokenAddress}:balance`); wsService.on(`wallet:${walletAddress}:${tokenAddress}:balance`, (data) => { console.log(`Token balance update for wallet ${walletAddress}:`); console.log(`New ${data.token} balance: ${data.amount}`); }); // 9. Graduating tokens wsService.joinRoom("graduating"); wsService.on("graduating", (data) => { console.log("Latest graduating token", data); }); // Graduating with custom market cap wsService.joinRoom("graduating:sol:175"); wsService.on("graduating:sol:175", (data) => { console.log("Latest graduating token", data); }); // 10. Graduated tokens wsService.joinRoom("graduated"); wsService.on("graduated", (data) => { console.log("Latest graduated token", data); }); // 11. Metadata wsService.joinRoom(`metadata:${tokenAddress}`); wsService.on(`metadata:${tokenAddress}`, (data) => { console.log("Metadata updated", data); }); // 12. Holders update wsService.joinRoom(`holders:${tokenAddress}`); wsService.on(`holders:${tokenAddress}`, (data) => { console.log("Total holders count for token has been updated", data); }); // 13. Token Changes wsService.joinRoom(`token:${tokenAddress}`); wsService.on(`token:${tokenAddress}`, (data) => { console.log(`Token ${tokenAddress} update:`, data); }); // 14. Curve Percentage Updates // Monitor tokens reaching 30% on Pump.fun wsService.joinRoom("pumpfun:curve:30"); wsService.on("pumpfun:curve:30", (data) => { console.log(`Token ${data.token.symbol} reached 30% curve on Pump.fun`); console.log(`Current market cap: $${data.pools[0].marketCap.usd}`); }); // Monitor different percentages and markets wsService.joinRoom("meteora-curve:curve:75"); wsService.on("meteora-curve:curve:75", (data) => { console.log(`Token ${data.token.symbol} reached 75% on Meteora`); }); wsService.joinRoom("boop:curve:50"); wsService.on("boop:curve:50", (data) => { console.log(`Token ${data.token.symbol} is at 50% on Boop`); }); // 15. NEW - Snipers Updates wsService.joinRoom(`sniper:${tokenAddress}`); wsService.on(`sniper:${tokenAddress}`, (data) => { console.log(`Sniper update for ${tokenAddress}:`); console.log(`Wallet: ${data.wallet}`); console.log( `Holdings: ${data.percentage.toFixed( 2 )}% (was ${data.previousPercentage.toFixed(2)}%)` ); console.log(`Total snipers hold: ${data.totalSniperPercentage.toFixed(2)}%`); }); // 16. NEW - Insiders Updates wsService.joinRoom(`insider:${tokenAddress}`); wsService.on(`insider:${tokenAddress}`, (data) => { console.log(`Insider update for ${tokenAddress}:`); console.log(`Wallet: ${data.wallet}`); console.log( `Holdings: ${data.percentage.toFixed( 2 )}% (was ${data.previousPercentage.toFixed(2)}%)` ); console.log( `Total insiders hold: ${data.totalInsiderPercentage.toFixed(2)}%` ); }); ``` ## Using the Official SDK The official JavaScript/TypeScript SDK provides a more intuitive API for WebSocket connections: ```javascript import { Datastream } from "@solana-tracker/data-api"; // Initialize the Datastream const datastream = new Datastream({ wsUrl: "wss://datastream.solanatracker.io/your-datastream-url-here", }); // Connect to the WebSocket server await datastream.connect(); // Subscribe with chained syntax datastream.subscribe.latest().on((data) => { console.log("New token:", data.token.name); }); // Price updates datastream.subscribe.price.token("tokenAddress").on((price) => { console.log(`Price: $${price.price}`); }); // Curve percentage updates datastream.subscribe.curvePercentage("pumpfun", 30).on((data) => { console.log(`Token ${data.token.symbol} reached 30% on Pump.fun`); }); // Transactions datastream.subscribe.tx.token("tokenAddress").on((tx) => { console.log(`${tx.type}: ${tx.amount} tokens`); }); // NEW - Wallet balance tracking // Note: Direct .on() usage is deprecated datastream.subscribe.tx.wallet("walletAddress").transactions().on((tx) => { console.log(`Transaction: ${tx.type} ${tx.amount} tokens`); }); // Monitor all token balances for a wallet datastream.subscribe.tx.wallet("walletAddress").balance().on((update) => { console.log(`Balance changed for token ${update.token}: ${update.amount}`); }); // Monitor specific token balance datastream.subscribe.tx.wallet("walletAddress").tokenBalance("tokenMint").on((update) => { console.log(`Token balance is now: ${update.amount}`); }); // NEW - Snipers tracking datastream.subscribe.snipers("tokenAddress").on((update) => { console.log( `Sniper ${update.wallet.slice( 0, 8 )}... now holds ${update.percentage.toFixed(2)}%` ); }); // NEW - Insiders tracking datastream.subscribe.insiders("tokenAddress").on((update) => { console.log( `Insider ${update.wallet.slice( 0, 8 )}... now holds ${update.percentage.toFixed(2)}%` ); }); // Clean disconnection datastream.disconnect(); ``` [View full SDK documentation β†’](https://github.com/solanatracker/data-api-sdk) file: ./content/solana-rpc/credits.mdx meta: { "title": "Credits and Rate Limits", "description": "Credits and Rate Limits for all Solana RPC plans.", "icon": "HomeIcon", "full": false } # Credits and Rate Limits ## Overview Our API uses a credit-based system with different rate limits depending on your plan. This page explains how credits are consumed and what limits apply to your account. ## Credit Consumption Most API calls cost 1 credit, with exceptions for more resource-intensive operations as detailed below. ### Standard API Calls * **Default Cost**: 1 credit per call ### Higher-Cost API Calls #### Archival API Calls (10 credits each) The following methods retrieve historical blockchain data and cost 10 credits per call: | Method | Description | | ----------------------------------- | ---------------------------------- | | `getTransaction` | Retrieves transaction details | | `getBlock` | Retrieves block information | | `getBlocks` | Retrieves multiple blocks | | `getInflationReward` | Gets inflation rewards | | `getConfirmedBlock` | Gets confirmed block data | | `getConfirmedBlocks` | Gets multiple confirmed blocks | | `getConfirmedTransaction` | Gets confirmed transaction details | | `getConfirmedSignaturesForAddress2` | Gets confirmed signatures (v2) | | `getConfirmedSignaturesForAddress` | Gets confirmed signatures | | `getSignaturesForAddress` | Gets all signatures for an address | | `getBlockTime` | Gets block timestamp | #### Program Account Queries * `getProgramAccounts`: 10 credits per call #### Digital Asset API (DAS) Calls (10 credits each) All Digital Asset Standard API methods cost 10 credits per call: | Method | Description | | ----------------------- | ---------------------------------------- | | `getAsset` | Retrieves asset details | | `getAssetProof` | Gets Merkle proof for an asset | | `getAssetsByOwner` | Lists assets by owner address | | `getAssetsByAuthority` | Lists assets by authority | | `getAssetsByCreator` | Lists assets by creator | | `getAssetsByGroup` | Lists assets by group | | `searchAssets` | Searches for assets by criteria | | `getSignaturesForAsset` | Gets transaction signatures for an asset | | `getTokenAccounts` | Lists token accounts | | `getNFTEditions` | Lists NFT editions | #### Priority Fee API * **Cost**: 1 credit per call ## Plan Comparison Choose the plan that best fits your needs based on your usage requirements: | Feature | Free | Developer | Business | Professional | | -------------------------- | ------- | ---------- | ----------- | ------------ | | **Monthly Credits** | 500,000 | 15,000,000 | 100,000,000 | 220,000,000 | | **General Requests/sec** | 10 | 60 | 225 | 500 | | **Send Transaction/sec** | 1 | 5 | 50 | 100 | | **getProgramAccounts/sec** | 1 | 15 | 25 | 50 | | **DAS API Requests/sec** | 2 | 10 | 50 | 100 | | **WebSocket Connections** | 2 | 25 | 100 | 250 | ## Credit Usage Examples ### Example 1: Standard Application A typical web3 application making 5 regular API calls per user session: * 5 credits per user session * With the Free plan (500,000 credits), you can support up to 100,000 user sessions per month ### Example 2: DAS-Heavy Application An NFT marketplace application that frequently uses DAS API calls: * 2 standard calls (2 credits) + 3 DAS API calls (30 credits) = 32 credits per user session * With the Developer plan (15,000,000 credits), you can support approximately 468,750 user sessions per month ## Best Practices for Credit Optimization 1. **Cache Responses**: Store and reuse responses for frequently accessed data 2. **Batch Requests**: Combine multiple queries when possible 3. **Use WebSockets**: Subscribe to updates instead of polling for changes 4. **Monitor Usage**: Regularly check your credit consumption in the dashboard 5. **Optimize Queries**: Refine your data queries to minimize resource usage ## FAQ **Q: What happens if I exceed my rate limits?**\ A: Requests exceeding your plan's rate limits will be rejected with a 429 (Too Many Requests) error. **Q: Do unused credits roll over to the next month?**\ A: No, credits reset at the beginning of each billing cycle. **Q: How can I monitor my credit usage?**\ A: You can track your credit consumption in real-time through your account dashboard. **Q: Can I upgrade my plan mid-month?**\ A: Yes, you can upgrade at any time. The new limits will apply immediately. **Need Help?**\ Contact our support team at [contact@solanatracker.io](mailto:contact@solanatracker.io) for assistance with your specific use case. file: ./content/solana-rpc/index.mdx meta: { "title": "Solana RPC", "description": "Lightning-fast infrastructure powering the next generation of Solana dApps. Experience unparalleled speed, reliability, and developer support.", "icon": "HomeIcon", "full": false } ### Plans [View credits and limits](/solana-rpc/credits) file: ./content/swap-api/errors.mdx meta: { "title": "Error Messages", "description": "Swap API - Error Messages", "icon": "HomeIcon", "full": false } This document provides a list of possible error messages that may occur for the Swap API ## General Errors ### Internal Error ```json { "error": "An internal error occurred" } ``` **Explanation:** This error indicates that an unexpected issue occurred within the api. **Solution:** Retry or contact support if the problem persists. ### Invalid or Missing Token Address ```json { "error": "Invalid or missing 'from' or 'to' token address" } ``` **Explanation:** The addresses for either the source ("from") token or the destination ("to") token are either missing or invalid. **Solution:** Double-check that you've provided valid addresses for both the source and destination tokens. ### Invalid Amount ```json { "error": "Invalid amount" } ``` **Explanation:** The amount specified for the token swap is not valid. **Solution:** Ensure you're entering a valid number for the amount you wish to swap. The amount should be greater than zero ### Invalid Slippage Tolerance ```json { "error": "Invalid slippage tolerance (should be between 0 and 100%)" } ``` **Explanation:** The specified slippage tolerance is outside the acceptable range. **Solution:** Set a slippage tolerance between 0% and 100%. Common values are typically between 0.1% and 10%. ## Swap-related Errors ### Unable to Fetch Pools ```json { "error": "Failed to swap", "details": "Unable to fetch pools for token" } ``` **Explanation:** The system couldn't retrieve information about liquidity pools for the specified token. **Solution:** Verify that the token address is correct and that the token is supported on the platform. Try again later if the issue persists or contact support ### No Pools for Token ```json { "error": "Failed to swap", "details": "Token has no pools" } ``` **Explanation:** There are no liquidity pools available for the specified token. **Solution:** Check if the token is newly listed or has no liquidity (rug). ### No Liquidity in Pools ```json { "error": "Failed to swap", "details": "No pools with liquidity found" } ``` **Explanation:** While pools exist for the token, none of them currently have sufficient liquidity for the swap. **Solution:** Try swapping a smaller amount, or wait for more liquidity to be added to the pools. *** If you encounter any of these errors, please try the suggested solutions. If problems persist, contact our support team for further assistance. file: ./content/swap-api/get-rate.mdx meta: { "title": "Rate", "description": "Swap API - GET /rate", "icon": "HomeIcon", "full": false } import { Tabs, Tab } from 'fumadocs-ui/components/tabs' import { Steps } from 'fumadocs-ui/components/steps' import { Callout } from 'fumadocs-ui/components/callout' import { CodeBlock } from 'fumadocs-ui/components/codeblock' # Rate Endpoint The Rate endpoint provides price quotes and conversion information for token swaps without executing the transaction. ## Endpoint Details * **Method:** `GET` * **URL:** `https://swap-v2.solanatracker.io/rate` * **Content Type:** `application/json` ## Example Request ```bash curl --location 'https://swap-v2.solanatracker.io/rate?from=So11111111111111111111111111111111111111112&to=4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R&amount=1&slippage=10' ``` ```javascript const response = await fetch( 'https://swap-v2.solanatracker.io/rate?from=So11111111111111111111111111111111111111112&to=4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R&amount=1&slippage=10', { method: 'GET', headers: { 'Content-Type': 'application/json', }, } ); const data = await response.json(); console.log(data); ``` ```python import requests params = { 'from': 'So11111111111111111111111111111111111111112', 'to': '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R', 'amount': '1', 'slippage': '10' } response = requests.get('https://swap-v2.solanatracker.io/rate', params=params) data = response.json() print(data) ``` ## Request Parameters | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------------------------------------------------------- | | `from` | string | Yes | The base token address (e.g., SOL: `So11111111111111111111111111111111111111112`) | | `to` | string | Yes | The quote token address (e.g., RAY: `4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R`) | | `amount` | number | Yes | The amount of the base token to convert | | `slippage` | number | Yes | The maximum acceptable slippage percentage (e.g., `10` for 10%) | The `amount` parameter should be provided in the token's native units, not in lamports or smallest units. ## Response Structure ```json { "amountIn": 1, "amountOut": 9181.330823048, "minAmountOut": 9089.517514818, "currentPrice": 9181.330823048, "executionPrice": 9089.517514818, "priceImpact": 0.0334641736518774, "fee": 0.01, "baseCurrency": { "decimals": 9, "mint": "So11111111111111111111111111111111111111112" }, "quoteCurrency": { "decimals": 9, "mint": "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" }, "platformFee": 9000000, "platformFeeUI": 0.009 } ``` ## Response Fields | Field | Type | Description | | ---------------- | ------ | --------------------------------------------------------------------------------- | | `amountIn` | number | The amount of the source token used for the conversion | | `amountOut` | number | The amount of the destination token that would be received | | `minAmountOut` | number | The minimum amount of the destination token after applying slippage | | `currentPrice` | number | The current market price for the token pair | | `executionPrice` | number | The actual price at which the trade would be executed | | `priceImpact` | number | The difference between market price and execution price as a fraction (0.01 = 1%) | | `fee` | number | The trading fee charged for the transaction | | `baseCurrency` | object | Information about the source token (decimals and mint address) | | `quoteCurrency` | object | Information about the destination token (decimals and mint address) | | `platformFee` | number | The fee charged by the platform in lamports (SOL's smallest unit) | | `platformFeeUI` | number | The platform fee in SOL | The `priceImpact` field indicates how much the trade affects the market price. Higher values indicate less liquidity and potentially unfavorable trading conditions. file: ./content/swap-api/index.mdx meta: { "title": "Swap API", "description": "Instant Access to Solana's DeFi Ecosystem", "icon": "HomeIcon", "full": false } # Solana Tracker - Swap API ## Instant Access to Solana's DeFi Ecosystem The Solana Tracker Swap API offers seamless, zero-delay access to Solana's dynamic token marketplace. Trade tokens the moment they launch with our high-performance infrastructure. ## Key Features * **Zero Delay Trading**: Execute trades instantly as soon as tokens are released on Solana * **Multi-DEX Support**: Access liquidity across all major Solana DEXs from a single API * **Competitive Pricing**: Simple 0.5% fee structure on successful transactions * **Enterprise-Ready**: Volume-based discounts available for high-frequency traders ## Supported Markets Our API seamlessly integrates with Solana's leading decentralized exchanges: * Pump.fun * Pumpswap * Moonshot * Boop * Orca * Meteora * Raydium * Raydium CPMM * Raydium Launchpad (Launchlab) * Meteora Dynamic Bonding Curve * Jupiter ## Volume Discounts Running a trading bot or high-volume platform? We offer tiered fee discounts: | Monthly Volume | Fee Range | | -------------- | --------- | | Standard | 0.5% | | High Volume | 0.1-0.4% | Contact our team to discuss custom pricing based on your specific volume requirements. ## Enterprise Solutions For trading bots, volume bots, or high-throughput applications, reach out to discuss tailored solutions and reduced fee structures. ## Contact Us * **Discord**: [Join our community](https://discord.com/invite/JH2e9rR9fc) * **Email**: [swap-api@solanatracker.io](mailto:swap-api@solanatracker.io) Ready to integrate? Check our developer documentation below to get started. file: ./content/swap-api/libraries.mdx meta: { "title": "Libraries", "description": "Swap API - Official SDK Libraries", "icon": "HomeIcon", "full": false } # Libraries Our Swap API supports a wide range of tokens including: * [Pump.fun](https://pump.fun) tokens * [PumpSwap](https://pump.fun) tokens * Meteora * Orca * Moonshot * Raydium V4 AMM * Raydium Launchpad * Raydium CPMM * Any pool supported by Jupiter ## Official SDKs Get started quickly with our officially supported SDK libraries: TypeScript/JavaScript library for integrating token swaps in web and Node.js applications. Python library for integrating token swaps in Python applications. ## Getting Started 1. **Choose your SDK** - Select the appropriate library for your project 2. **Install the package** - Follow the installation instructions in the respective repository 3. **Make your first swap** - Use the examples provided in the documentation ## Related Resources } title="Data API"> Access token and market data including prices, holders, trends, charts, and real-time updates. file: ./content/swap-api/swap.mdx meta: { "title": "Swap", "description": "Swap API Documentation", "icon": "HomeIcon", "full": false } import { Tabs, Tab } from 'fumadocs-ui/components/tabs' import { Steps } from 'fumadocs-ui/components/steps' import { Callout } from 'fumadocs-ui/components/callout' import { CodeBlock } from 'fumadocs-ui/components/codeblock' import { Cards, Card } from 'fumadocs-ui/components/card' # Swap API Documentation The Swap API provides a simple interface for token swaps on Solana with competitive fees and deep liquidity. ## Supported DEXs & Tokens The API integrates with the following DEXs and token platforms: * [Moonshot](https://dexscreener.com/moonshot/new) * [Pump.fun](https://pump.fun) tokens * [PumpSwap](https://pump.fun) tokens * Raydium * Raydium CPMM * Raydium Launchpad * Orca * Meteora * Any token supported by Jupiter ## Quick Links Easy to use JavaScript and Python libaries. Required and optional parameters for swap requests Code examples for web and Node.js integration API usage fees and volume discounts ## Endpoints ```bash curl --location 'https://swap-v2.solanatracker.io/swap?from=So11111111111111111111111111111111111111112&to=4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R&fromAmount=1&slippage=10&payer=PAYER_ADDRESS' ``` Use GET requests for simple swaps or when integrating with web interfaces. ```bash curl --location 'https://swap-v2.solanatracker.io/swap' \ --header 'Content-Type: application/json' \ --data '{ "from": "So11111111111111111111111111111111111111112", "to": "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", "amount": 1, "slippage": 15, "payer": "arsc4jbDnzaqcCLByyGo7fg7S2SmcFsWUzQuDtLZh2y", "priorityFee": 0.0005, "feeType": "add", "fee": "arsc4jbDnzaqcCLByyGo7fg7S2SmcFsWUzQuDtLZh2y:0.1" }' ``` Use POST requests for more complex swaps with optional parameters or when handling sensitive data. ## Request Parameters Both GET and POST requests support the following required parameters: | Parameter | Description | Example | | ---------- | ------------------------------------------------ | ---------------------------------------------------- | | `from` | The base token address | `So11111111111111111111111111111111111111112` (SOL) | | `to` | The quote token address | `4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R` (RAY) | | `amount` | The amount of the base token to swap | `1`, `"auto"`, or `"50%"` | | `slippage` | Maximum acceptable slippage percentage | `10` or `"auto"` (Dynamic Slippage in Beta) | | `payer` | Public key of the wallet sending the transaction | `PAYER_ADDRESS` | ### Optional Parameters | Parameter | Description | Example | | ------------------ | ---------------------------------------------------- | ------------------------------------------------------------------- | | `priorityFee` | Amount in SOL to increase transaction priority | `0.000005` or `"auto"` | | `priorityFeeLevel` | Priority level when `priorityFee` is set to `"auto"` | `"min"`, `"low"`, `"medium"`, `"high"`, `"veryHigh"`, `"unsafeMax"` | | `txVersion` | Transaction version | `"v0"` or `"legacy"` | | `fee` | Custom fee for your users | `"WALLET_ADDRESS:PERCENTAGE"` | | `customTip` | Custom tip for Jito or similar services | `"WALLET_ADDRESS:SOL_AMOUNT"` | | `feeType` | Fee application type | `"add"` or `"deduct"` | | `onlyDirectRoutes` | Disable multi-hop swaps | `true` or `false` (default) | The `amount` parameter accepts three types of values: * Specific numeric value (e.g., `1`) * `"auto"` to use the full wallet balance * Percentage (e.g., `"50%"`) to use that portion of the wallet balance The `feeType` parameter is set to `"add"` by default. The `"deduct"` option is only used when the `from` address is SOL. For more information about priority fees, [read this blog post](https://www.solanatracker.io/blog/priority-fee-api). ## Example Response ```json { "txn":"BASE64_TX", "rate":{ "amountIn":1, "amountOut":81.631985, "minAmountOut":73.4687865, "currentPrice":0.012219167460548153, "executionPrice":0.010997250714493338, "priceImpact":0.002517, "fee":0.000005, "baseCurrency":{ "mint":"So11111111111111111111111111111111111111112", "decimals":9 }, "quoteCurrency":{ "mint":"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", "decimals":6 }, "platformFee":9000000, "platformFeeUI":0.009 }, "timeTaken":0.016, "type":"legacy" } ``` ## Integration Guide 1. **Request a swap transaction** - Call the swap endpoint with your parameters 2. **Load the transaction** - Deserialize the returned transaction 3. **Sign the transaction** - Use the appropriate wallet or keypair to sign 4. **Send the transaction** - Submit to the Solana network 5. **Confirm the transaction** - Verify the transaction succeeded ### Loading the Transaction ```javascript const serializedTransactionBuffer = Buffer.from(res.txn, "base64"); let txn; if (res.type === 'v0') { txn = VersionedTransaction.deserialize(serializedTransactionBuffer); } else { txn = Transaction.from(serializedTransactionBuffer); } if (!txn) return false; ``` ### Sending the Transaction ```javascript if (res.type === 'v0' && txn) { await wallet.signTransaction(txn); } const txid = await wallet.sendTransaction(txn, connection, { skipPreflight: true, maxRetries: 4, }); ``` Use this approach for web applications with Solana Wallet Adapter. ```javascript const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_SECRET_KEY')); let txid; if (res.type === 'v0' ) { const txn = VersionedTransaction.deserialize(serializedTransactionBuffer); txn.sign([keypair]); txid = await connection.sendRawTransaction(txn.serialize(), { skipPreflight: true, }); } else { const txn = Transaction.from(serializedTransactionBuffer); txn.sign(keypair); const rawTransaction = txn.serialize(); txid = await connection.sendRawTransaction(rawTransaction, { skipPreflight: true, }); } ``` Use this approach for server-side applications or bots. ## Fees We charge a 0.5% fee on each successful transaction. For high-volume usage on public bots or sites, contact us to discuss reduced fees: * Email: [swap-api@solanatracker.io](mailto:swap-api@solanatracker.io) * Discord: [Join our community server](https://discord.com/invite/JH2e9rR9fc) file: ./content/solana-rpc/methods/getAccountInfo.mdx meta: { "title": "getAccountInfo", "description": "Returns all information associated with the account of provided Pubkey.", "sidebar_label": "getAccountInfo" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getAccountInfo RPC Method ## Description Returns all information associated with the account of provided Pubkey. ## Parameters 1. `address` (string) - The Pubkey of the account to query, encoded as a base-58 string. Required. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `encoding` (string, optional) - The encoding format for account data. Options: `base58` (slow), `base64`, `base64+zstd`, or `jsonParsed`. * `dataSlice` (object, optional) - Limits the returned account data using `offset` (usize) and `length` (usize) fields; only available for `base58`, `base64`, or `base64+zstd` encodings. * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated. ## Returns * `result` - `null` if the account doesn’t exist; otherwise, an RpcResponse JSON object with the following fields: * `context` - Metadata about the current state of the Solana network at the time of processing: * `apiVersion` - The version number. * `slot` - The current slot in the Solana cluster when the request was processed. * `value` - Information about the requested account: * `lamports` - The number of lamports assigned to this account, as a u64 (64-bit unsigned integer). * `owner` - The base-58 encoded Pubkey of the program this account is assigned to. * `data` - The data associated with the account, either as encoded binary data or JSON format `{program: state}`, depending on the `encoding` parameter. * `executable` - A boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` - The epoch at which this account will next owe rent, as a u64 (64-bit unsigned integer). * `space` - The amount of storage space required to store the account data. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getAccountInfo","params": ["7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",{"encoding": "base58"}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const publicKey = new web3.PublicKey( "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy" ); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getAccountInfo(publicKey)); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const searchAddress = address("7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy"); const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const { value: accountInfo } = await solanaRpc.getAccountInfo(searchAddress).send(); console.log(accountInfo); })(); ``` ````python from solana.rpc.api import Client from solana.publickey import PublicKey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_account_info(PublicKey("7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy"))) ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getAccountInfo", "params": [ "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy", { "encoding": "base58" } ] }) response = https.request(request) puts response.read_body ```` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getAccountInfo", "params": [ "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy", { "encoding": "base58" } ] }"#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBalance.mdx meta: { "title": "getBalance", "description": "Returns the balance of the account of provided Pubkey.", "sidebar_label": "getBalance" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBalance RPC Method ## Description Returns the balance of the account of provided Pubkey. ## Parameters 1. `address` (string) - The Pubkey of the account to query, encoded as a base-58 string. Required. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated. ## Returns * `result` - `null` if the account doesn’t exist; otherwise, an RpcResponse JSON object with the following fields: * `context` - Metadata about the current state of the Solana network at the time of processing: * `apiVersion` - The version number. * `slot` - The current slot in the Solana cluster when the request was processed. * `value` - The balance of the account in lamports, as a u64 (64-bit unsigned integer). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getBalance", "params":["7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const publicKey = new web3.PublicKey( "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy" ); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getBalance(publicKey)); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const searchAddress = address("7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy"); const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const { value: lamports } = await solanaRpc.getBalance(searchAddress).send(); console.log(lamports.toString()); })(); ``` ```python from solana.rpc.api import Client from solana.publickey import PublicKey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_balance(PublicKey("7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy"))) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBalance", "params": [ "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBalance", "params": [ "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy" ] }"#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBlock.mdx meta: { "title": "getBlock", "description": "Returns identity and transaction information about a confirmed block in the ledger.", "sidebar_label": "getBlock" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlock RPC Method ## Description Returns identity and transaction information about a confirmed block in the ledger. Though getBlock is supported, Solana Foundation recommends using jsonParsed encoding because it includes all transaction account keys (including those from Lookup Tables). To do this with JavaScript, please refer to the getParsedBlock RPC method. ## Parameters 1. `slot` (integer) - The slot number of the block to retrieve, encoded as a u64 (64-bit unsigned integer). 2. `object` (array) - The configuration object with the following fields: * `encoding` (string, optional) - The encoding format for account data. Options: `base58` (slow), `json`, `base64`, `base64+zstd`, or `jsonParsed`. * `transactionDetails` (string, optional) - (default: `full`) The level of transaction detail to return. Options: `full`, `accounts`, `signatures`, or `none`. * `rewards` (boolean, optional) - (default: `false`) Whether to include reward information in the block response. * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - Not supported for this method. * `maxSupportedTransactionVersion` (integer, optional) - The maximum transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If omitted, only legacy transactions are returned, and versioned transactions prompt an error. Use `0` for versioned transactions or omit for legacy only. ## Returns * `result` - `null` if the specified block is not confirmed; otherwise, an RpcResponse JSON object with the following fields: * `blockHeight` - The number of blocks beneath this block. * `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). `null` if not available. * `blockhash` - The hash of the block, encoded as a base-58 string. * `parentSlot` - The slot index of this block’s parent. * `previousBlockhash` - The blockhash of this block’s parent, encoded as a base-58 string. Returns `11111111111111111111111111111111` if the parent block is unavailable due to ledger cleanup. * `transactions` - Present if `full` transaction details are requested; an array of JSON objects with: * `meta` - Transaction status metadata (can be `null`): * `err` - Error code if the transaction failed, or `null` if it succeeds. * `fee` - Total fees paid, encoded as a u64 integer. * `innerInstructions` - Array of inner instructions (omitted if not enabled). * `logMessages` - Array of log messages (omitted if not enabled). * `postBalances` - Array of lamport balances after processing. * `postTokenBalances` - Array of token balances after processing (omitted if not enabled). * `preBalances` - Array of lamport balances before processing. * `preTokenBalances` - Array of token balances before processing (omitted if not enabled). * `rewards` - Reward information (if requested): * `pubkey` - Public key of the rewarded account, encoded as base-58. * `lamports` - Number of reward lamports credited or debited. * `postBalance` - Account balance in lamports after reward. * `rewardType` - Type of reward (`fee`, `rent`, `voting`, `staking`). * `commission` - Vote account commission for voting/staking rewards. * `transaction` - Transaction object (format depends on `encoding`): * `message` - Array of transactions: * `accountKeys` - Array of public keys accessed: * `pubkey` - Public key of the block producer. * `signer` - Indicates if the key signed the transaction. * `source` - Identifies accounts providing funds. * `writable` - Boolean indicating if the account was modified. * `instructions` - Array of executed instructions: * `parsed` - Parsed instruction details: * `info` - Additional transaction details: * `clockSysvar` - Blockchain state information. * `slotHashesSysvar` - Recent slot hashes. * `vote` - Vote accounts involved: * `hash` - Block hash. * `slots` - Slot numbers. * `timestamp` - Unix timestamp of block creation. * `voteAccount` - Validator’s vote account. * `voteAuthority` - Authority for the vote account. * `type` - Block type. * `program` - Program data. * `programId` - Public key of the executed program. * `stackHeight` - Execution stack depth. * `recentBlockhash` - Recent block hash for the cluster. * `signatures` - List of transaction signatures. * `version` - Transaction version (`undefined` if `maxSupportedTransactionVersion` is not set). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getBlock","params":[317175212, {"encoding": "json","maxSupportedTransactionVersion":0,"transactionDetails":"full","rewards":false}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getBlock(317175212, { maxSupportedTransactionVersion: 0 }) ); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const block = await solanaRpc.getBlock(BigInt(317175212)).send(); console.log(block); } catch (error) { console.error("Error fetching block:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_block(317175212, "json", max_supported_transaction_version=0)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlock", "params": [ 317175212, { "encoding": "json", "maxSupportedTransactionVersion": 0, "transactionDetails": "full", "rewards": false } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlock", "params": [ 317175212, { "encoding": "json", "maxSupportedTransactionVersion": 0, "transactionDetails": "full", "rewards": false } ] }"#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBlockCommitment.mdx meta: { "title": "getBlockCommitment", "description": "Returns commitment for particular block.", "sidebar_label": "getBlockCommitment" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlockCommitment RPC Method ## Description Returns commitment for a particular block. ## Parameters 1. `block number` (integer) - The block number identified by the slot, encoded as a u64 (64-bit unsigned integer). Required. ## Returns * `result` - A custom object with the following fields: * `commitment` - The commitment values for the block: * `null` - If the block is unknown. * `array` - An array of u64 integers logging the amount of cluster stake in lamports that has voted on the block at each depth from 0 to `MAX_LOCKOUT_HISTORY + 1`. * `totalStake` - The total number of lamports being used by validators to participate in the block production and voting process, encoded as a u64 integer. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getBlockCommitment","params":[94101948]}' ``` ```javascript // not currently supported by solanaJS directly, using axios instead const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getBlockCommitment", params: [94101948], }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blockCommitment = await solanaRpc.getBlockCommitment(BigInt(94101948)).send(); console.log("Block Commitment:", blockCommitment); } catch (error) { console.error("Error fetching block commitment:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_block_commitment(94101948)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlockCommitment", "params": [ 94101948 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlockCommitment", "params": [ 94101948 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBlockHeight.mdx meta: { "title": "getBlockHeight", "description": "Returns the current block height of the node", "sidebar_label": "getBlockHeight" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlockHeight RPC Method ## Description Returns the current block height of the node ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. It can be one of: * `finalized` - The node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns The current block height encoded in u64 format ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getBlockHeight"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const SOLANA_CONNECTION = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await SOLANA_CONNECTION.getBlockHeight() ); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blockHeight = await solanaRpc.getBlockHeight().send(); console.log(blockHeight); } catch (error) { console.error("Error fetching block height:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getBlockHeight")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlockHeight" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlockHeight" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getBlockProduction.mdx meta: { "title": "getBlockProduction", "description": "Returns recent block production information from the current or previous epoch.", "sidebar_label": "getBlockProduction" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlockProduction RPC Method ## Description Returns recent block production information from the current or previous epoch. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `range` (array, optional) - The slot range to return block production for. If not provided, defaults to the current epoch: * `firstSlot` (integer) - The first slot to return block production information for (inclusive). * `lastSlot` (integer, optional) - The last slot to return block production information for (inclusive). If not provided, defaults to the highest slot. * `identity` (string, optional) - Filters results to this validator identity, encoded in base-58. ## Returns * `result` - A custom object with the following fields: * `context` - Additional context for retrieving block production information: * `apiVersion` - The API version. * `slot` - The slot number for which block production information is retrieved. * `value` - Information about block production in the specified slot range: * `byIdentity` - A dictionary of validator identities (base-58 encoded strings). Each value is a two-element array containing the number of leader slots and the number of blocks produced. * `range` - The block production slot range: * `firstSlot` - The first slot of the block production information (inclusive). * `lastSlot` - The last slot of the block production information (inclusive). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getBlockProduction"}' ``` ```javascript // not currently supported by solanaJS directly, using axios instead const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getBlockProduction", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blockProduction = await solanaRpc.getBlockProduction().send(); console.log(blockProduction); } catch (error) { console.error("Error fetching block production:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getBlockProduction")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlockProduction" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlockProduction" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBlockTime.mdx meta: { "title": "getBlockTime", "description": "Returns the estimated production time of a block.", "sidebar_label": "getBlockTime" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlockTime RPC Method ## Description Returns the estimated production time of a block. ## Parameters 1. `u64` (integer, required) - The block number, identified by Slot ## Returns The response can be either of one value: * `i64` - The estimated production time, as Unix timestamp (seconds since the Unix epoch) * `null` - If timestamp is not available for the block ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getBlockTime","params":[94101948]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getBlockTime(94101948)); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blockTime = await solanaRpc.getBlockTime(BigInt(94101948)).send(); console.log("Block time:", blockTime); } catch (error) { console.error("Error fetching block time:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_block_time(94101948)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlockTime", "params": [ 94101948 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlockTime", "params": [ 94101948 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getBlocks.mdx meta: { "title": "getBlocks", "description": "Returns a list of confirmed blocks between two slots.", "sidebar_label": "getBlocks" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlocks RPC Method ## Description Returns a list of confirmed blocks between two slots. ## Parameters 1. `start_slot` (integer) - The start slot, encoded as a u64 (64-bit unsigned integer). Required. 2. `end_slot` (integer) - The end slot, encoded as a u64 (64-bit unsigned integer). Optional. 3. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. ## Returns * `result` - An array of u64 integers listing confirmed blocks between the `start_slot` and either `end_slot` (if provided) or the latest confirmed block, inclusive. The maximum range allowed is 500,000 slots. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0","id":1,"method":"getBlocks","params":[5, 10]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getBlocks(5, 10)); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blocks = await solanaRpc.getBlocks(BigInt(5), BigInt(10)).send(); console.log("Blocks:", blocks); } catch (error) { console.error("Error fetching blocks:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_blocks(5, 10)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlocks", "params": [ 5, 10 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlocks", "params": [ 5, 10 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getBlocksWithLimit.mdx meta: { "title": "getBlocksWithLimit", "description": "Returns a list of confirmed blocks starting at the given slot", "sidebar_label": "getBlocksWithLimit" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getBlocksWithLimit RPC Method ## Description Returns a list of confirmed blocks starting at the given slot. ## Parameters 1. `start_slot` (integer) - The start slot, encoded as a u64 (64-bit unsigned integer). Required. 2. `limit` (integer) - The limit, encoded as a u64 (64-bit unsigned integer). Required. 3. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. ## Returns * `result` - An array of u64 integers listing confirmed blocks between the `start_slot` and either the `end_slot` (if provided) or the latest confirmed block, inclusive. The maximum range allowed is 500,000 slots. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0","id":1,"method":"getBlocksWithLimit","params":[5, 3]}' ``` ```javascript // not currently supported by solanaJS directly, using axios instead const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getBlocksWithLimit", params: [5, 3], }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const blocks = await solanaRpc.getBlocksWithLimit(BigInt(5), 3).send(); console.log(blocks); } catch (error) { console.error("Error fetching blocks with limit:", error); } })(); ``` ````python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getBlocksWithLimit", params=[5, 3])) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getBlocksWithLimit", "params": [ 5, 3 ] }) response = https.request(request) puts response.read_body ```` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getBlocksWithLimit", "params": [ 5, 3 ] }"#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getClusterNodes.mdx meta: { "title": "getClusterNodes", "description": "Returns information about all the nodes participating in the cluster.", "sidebar_label": "getClusterNodes" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getClusterNodes RPC Method ## Description Returns information about all the nodes participating in the cluster. ## Parameters None ## Returns Returns an array of objects containing information about each node in the cluster, with the following fields: * `featureSet` - The unique identifier of the node's feature set * `gossip` - The gossip network address for the node * `pubkey` - The public key of the node encoded as base-58 string * `rpc` - The IP address and port number of the node's JSON-RPC service. Null if the JSON RPC service is not enabled * `shredVersion` - The version of the data structure used by this node to store and transmit blocks * `tpu` - The TPU network address for the node * `version` - The software version of the node. Null if the version information is not available ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getClusterNodes"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getClusterNodes()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const clusterNodes = await solanaRpc.getClusterNodes().send(); console.log(clusterNodes); } catch (error) { console.error("Error fetching cluster nodes:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_cluster_nodes()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getClusterNodes" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getClusterNodes" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getConfirmedBlock.mdx meta: { "title": "getConfirmedBlock", "description": "Returns identity and transaction information about a confirmed block in the ledger.", "sidebar_label": "getConfirmedBlock" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getConfirmedBlock RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's [getBlock](/solana-rpc/methods/getConfirmedBlock) RPC method. ## Description Returns identity and transaction information about a confirmed block in the ledger. ## Parameters 1. `slot_number` (string) - The slot number encoded as u64, 64-bit unsigned integer 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `encoding` (string) - (default: json) The encoding format for account data. It can be base58 (slow), base64, base64+zstd or jsonParsed * `transactionDetails` (string) - (default: full) It specifies the level of transaction details to include in the response. The possible values are full, signatures, and none * `rewards` (boolean) - (default: true) It determines whether to populate the rewards array or not. ## Returns Returns null if the specified block is not confirmed, otherwise an object with the following fields: * `blockHeight` - The height of the confirmed block * `blockTime` - The estimated production time as Unix timestamp (seconds since the Unix epoch). It is null if not available * `blockhash` - The hash of the confirmed block * `parentSlot` - The slot number of the block's parent * `previousBlockhash` - The hash of the block's predecessor * `transactions` - An array of transaction objects within the block. Each transaction object contains: * `meta` - The transaction status metadata object with the following fields: * `err` - Error code if the transaction failed or null if the transaction succeeds * `fee` - The transaction fee * `innerInstructions` - The list of inner instructions (omitted or null if inner instruction recording was not yet enabled during the transaction) * `loadedAddresses` - The list of loaded addresses objects: * `readonly` - The ordered list of base-58 encoded addresses for readonly loaded accounts * `writable` - The ordered list of base-58 encoded addresses for writable loaded accounts * `logMessages` - An array of string log messages (omitted or null if log message recording was not yet enabled during the transaction) * `postBalances` - An array of u64 account balances after the transaction was processed * `postTokenBalances` - The list of token balances from after the transaction was processed (omitted if inner instruction recording was not yet enabled during the transaction) * `preBalances` - An array of u64 account balances from before the transaction was processed * `preTokenBalances` - The list of token balances from before the transaction was processed (omitted if inner instruction recording was not yet enabled during the transaction) * `rewards` - An array of reward objects detailing the rewards for this block (only present if rewards are requested) * `status` - The processing status of the transaction. It returns Ok if the transaction was successful and Err if the transaction failed with TransactionError * `transaction` - The transaction object with the following fields: * `message` - The transaction message containing: * `accountKeys` - An array of public keys involved in the transaction * `header` - An object containing the transaction's header, including: * `numRequiredSignatures` - The number of required signatures for the transaction * `numReadonlySignedAccounts` - The number of readonly accounts that have signed the transaction * `numReadonlyUnsignedAccounts` - The number of readonly accounts that have not signed the transaction * `instructions` - An array of instruction objects for the transaction with: * `accounts` - An array of integers representing the indices of accounts involved in the instruction * `data` - The instruction data encoded in the specified format * `programIdIndex` - The index of the program ID in the accountKeys * `recentBlockhash` - The most recent blockhash used for the transaction * `signatures` - An array of signatures strings corresponding to the transaction order in the block ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlock","params":[235157119, {"encoding": "json","transactionDetails":"full","rewards":false}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getConfirmedBlock(235157119)); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_confirmed_block(235157119)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlock", "params": [ 235157119, { "encoding": "json", "transactionDetails": "full", "rewards": false } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlock", "params": [ 235157119, { "encoding": "json", "transactionDetails": "full", "rewards": false } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getConfirmedBlocks.mdx meta: { "title": "getConfirmedBlocks", "description": "Returns a list of confirmed blocks between two slots.", "sidebar_label": "getConfirmedBlocks" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getConfirmedBlocks RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's getBlocks RPC method. ## Description Returns a list of confirmed blocks between two slots. ## Parameters 1. `start_slot` (string) - The start slot encoded as u64, 64-bit unsigned integer 2. `end_slot` (string, optional) - The end slot encoded as u64, 64-bit unsigned integer 3. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns An array of u64 integers listing confirmed blocks between start\_slot and either end\_slot, if provided, or latest confirmed block, inclusive. The maximum range allowed is 500,000 slots ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlocks","params":[94101945, 94101948]}' ``` ```javascript // This method is deprecated, please use getBlocks instead // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getConfirmedBlocks", params: [94101945, 94101948], }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_confirmed_blocks(94101945, 94101948)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlocks", "params": [ 94101945, 94101948 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlocks", "params": [ 94101945, 94101948 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getConfirmedBlocksWithLimit.mdx meta: { "title": "getConfirmedBlocksWithLimit", "description": "Returns a list of confirmed blocks starting at the given slot.", "sidebar_label": "getConfirmedBlocksWithLimit" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getConfirmedBlocksWithLimit RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's getBlocksWithLimit RPC method. ## Description Returns a list of confirmed blocks starting at the given slot. ## Parameters 1. `start_slot` (string) - The start slot encoded as u64, 64-bit unsigned integer 2. `limit` (string) - The limit encoded as u64, 64-bit unsigned integer 3. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster ## Returns An array of u64 integers listing confirmed blocks starting at start\_slot for up to limit blocks, inclusive ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlocksWithLimit","params":[94101945, 3]}' ``` ```javascript //This method has been deprecated, please use getBlocksWithLimit instead. const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getConfirmedBlocksWithLimit", params: [94101945, 3], }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getConfirmedBlocksWithLimit", params=(94101945, 3))) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlocksWithLimit", "params": [ 94101945, 3 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlocksWithLimit", "params": [ 94101945, 3 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getConfirmedSignaturesForAddress2.mdx meta: { "title": "getConfirmedSignaturesForAddress2", "description": "Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block.", "sidebar_label": "getConfirmedSignaturesForAddress2" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getConfirmedSignaturesForAddress2 RPC Method ## Description Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block. Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method, you can use Solana's getSignaturesForAddress RPC method. ## Parameters 1. `acc_add` (string) - The account address as a base-58 encoded string. 2. `object` (array) - The configuration object with the following fields: * `limit` (integer, optional) - (default: 1000) The maximum number of transaction signatures to return. The valid range is between 1 and 1,000. * `before` (string, optional) - A base58-encoded transaction signature. If provided, the method will only return signatures that occurred before the specified transaction. * `until` (string, optional) - A base58-encoded transaction signature. If provided, the method will only return signatures that occurred at or before the specified transaction. * `commitment` (string, optional) - (default: finalized) The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. ## Returns An array of transaction signature information, ordered from newest to oldest transaction, with the following fields: * `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. It’s null if not available. * `confirmationStatus` - The transaction’s cluster confirmation status. It can either be `processed`, `confirmed`, or `finalized`. * `err` - Error code if the transaction failed, or null if the transaction succeeds. * `memo` - The memo associated with the transaction, or null if no memo is present. * `signature` - The base58-encoded signature of the transaction. * `slot` - The slot number in which the transaction was confirmed. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getConfirmedSignaturesForAddress2","params": ["Vote111111111111111111111111111111111111111",{"limit": 1}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const publicKey = new web3.PublicKey( "Vote111111111111111111111111111111111111111" ); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getConfirmedSignaturesForAddress2(publicKey)); })(); ``` ```python # get_confirmed_signature_for_address2 is similar to get_signature_for_address. Get_signature_for_address is not currently supported. from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_confirmed_signature_for_address2("Vote111111111111111111111111111111111111111", limit=1)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedSignaturesForAddress2", "params": [ "Vote111111111111111111111111111111111111111", { "limit": 1 } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getConfirmedSignaturesForAddress2", "params": [ "Vote111111111111111111111111111111111111111", { "limit": 1 } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getConfirmedTransaction.mdx meta: { "title": "getConfirmedTransaction", "description": "Returns transaction details for a confirmed transaction.", "sidebar_label": "getConfirmedTransaction" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getConfirmedTransaction RPC Method ## Description Returns transaction details for a confirmed transaction. Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method, you can use Solana's getTransaction RPC method. ## Parameters 1. `tx_sig` (string) - The transaction signature, encoded as a base-58 string. 2. `object` (array) - The configuration object with the following fields: * `encoding` (string, optional) - (default: `json`) The encoding format for the transaction data. Options: `json`, `jsonParsed`, `base58` (slow), `base64`. * `commitment` (string, optional) - (default: `finalized`) The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. ## Returns * `result` - `null` if the specified transaction is not confirmed; otherwise, an object with the following fields: * `blockTime` - The estimated production time, as a Unix timestamp (seconds since the Unix epoch). `null` if not available. * `meta` - Transaction status metadata (can be `null`): * `err` - Error code if the transaction failed, or `null` if it succeeded. * `fee` - Total fees paid, encoded as a u64 integer. * `innerInstructions` - Array of inner instruction objects (omitted if not enabled). * `loadedAddresses` - Array of base58-encoded public keys: * `readonly` - Accounts that are read-only. * `writable` - Accounts that are read and modified. * `logMessages` - Array of log message strings (omitted if not enabled). * `postBalances` - Array of lamport balances after processing. * `postTokenBalances` - Array of token balances after processing (omitted if not enabled). * `preBalances` - Array of lamport balances before processing. * `preTokenBalances` - Array of token balances before processing (omitted if not enabled). * `rewards` - Reward information (if requested). * `status` - Transaction status: `Ok` if successful, `Err` if failed with a `TransactionError`. * `slot` - The slot number of the block, encoded as a u64 integer. * `transaction` - Transaction object (format depends on `encoding`): * `message` - Core transaction data: * `accountKeys` - Array of base58-encoded public keys of involved accounts. * `header` - Signature and readonly account info: * `numReadonlySignedAccounts` - Number of readonly signed accounts. * `numReadonlyUnsignedAccounts` - Number of readonly unsigned accounts. * `numRequiredSignatures` - Number of required signatures. * `instructions` - Array of executed instructions: * `accounts` - Array of base58-encoded public keys for the instruction. * `data` - Encoded instruction data string. * `programIdIndex` - Index of the program ID in `accountKeys`. * `stackHeight` - Execution stack depth. * `recentBlockhash` - Recent block hash for the cluster. * `signatures` - Array of signature strings. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getConfirmedTransaction","params": ["3Pdh1xgS7HYXcPquN1JQQXs8C6Tn2ZTkHg86wXMwDEEnJxVVZsE3WgxHSx258boUtHcMVkKCGbT9dYWWfk7CWV2m","json"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getConfirmedTransaction( "3Pdh1xgS7HYXcPquN1JQQXs8C6Tn2ZTkHg86wXMwDEEnJxVVZsE3WgxHSx258boUtHcMVkKCGbT9dYWWfk7CWV2m" ) ); })(); ``` ```python # get_confirmed_transaction is similar to get_transaction. Get_transaction is not currently supported. from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_confirmed_transaction("3Pdh1xgS7HYXcPquN1JQQXs8C6Tn2ZTkHg86wXMwDEEnJxVVZsE3WgxHSx258boUtHcMVkKCGbT9dYWWfk7CWV2m")) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedTransaction", "params": [ "3Pdh1xgS7HYXcPquN1JQQXs8C6Tn2ZTkHg86wXMwDEEnJxVVZsE3WgxHSx258boUtHcMVkKCGbT9dYWWfk7CWV2m", "json" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getConfirmedTransaction", "params": [ "3Pdh1xgS7HYXcPquN1JQQXs8C6Tn2ZTkHg86wXMwDEEnJxVVZsE3WgxHSx258boUtHcMVkKCGbT9dYWWfk7CWV2m", "json" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getEpochSchedule.mdx meta: { "title": "getEpochSchedule", "description": "Returns epoch schedule information from this cluster's genesis config.", "sidebar_label": "getEpochSchedule" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getEpochSchedule RPC Method ## Description Returns epoch schedule information from this cluster's genesis config. ## Parameters This method takes no parameters. ## Returns * `result` - An object with the following fields: * `firstNormalEpoch` - The first normal-length epoch, calculated as `log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)`. * `firstNormalSlot` - The slot number of the first normal slot, calculated as `MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1)`. * `leaderScheduleSlotOffset` - The number of slots before the beginning of an epoch to calculate a leader schedule for that epoch. * `slotsPerEpoch` - The maximum number of slots in each epoch. * `warmup` - A boolean indicating whether epochs start short and grow. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getEpochSchedule"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getEpochSchedule()); // Note: corrected from getEpochschedule to getEpochSchedule })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const epochSchedule = await solanaRpc.getEpochSchedule().send(); console.log(epochSchedule); } catch (error) { console.error("Error fetching epoch schedule:", error); } })(); ``` ````python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_epoch_schedule()) ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getEpochSchedule" }) response = https.request(request) puts response.read_body ```` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getEpochSchedule" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getFeeCalculatorForBlockhash.mdx meta: { "title": "getFeeCalculatorForBlockhash", "description": "Returns the fee calculator associated with the query blockhash, or null if the blockhash has expired.", "sidebar_label": "getFeeCalculatorForBlockhash" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getFeeCalculatorForBlockhash RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's [isBlockhashValid](/solana-rpc/methods/isBlockhashValid) or [getFeeForMessage](/solana-rpc/methods/getFeeForMessage) RPC method. ## Description Returns the fee calculator associated with the query blockhash, or null if the blockhash has expired. ## Parameters 1. `blockhash` (string) - A string representing the blockhash for which to retrieve the fee calculator. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) (default: finalized) - The level of commitment required for the query. Please note that Processed is not supported. It can be one of the following: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns Returns null if the query blockhash has expired, otherwise RpcResponse JSON object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object describing the cluster fee rate at the queried blockhash ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getFeeCalculatorForBlockhash","params": ["6EUDAG2UBZ1J7CbpixutsELc5c6s4k8YzaWawyKH2Pit"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getFeeCalculatorForBlockhash( "6EUDAG2UBZ1J7CbpixutsELc5c6s4k8YzaWawyKH2Pit" ) ); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_fee_calculator_for_blockhash("6EUDAG2UBZ1J7CbpixutsELc5c6s4k8YzaWawyKH2Pit")) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getFeeCalculatorForBlockhash", "params": [ "6EUDAG2UBZ1J7CbpixutsELc5c6s4k8YzaWawyKH2Pit" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getFeeCalculatorForBlockhash", "params": [ "6EUDAG2UBZ1J7CbpixutsELc5c6s4k8YzaWawyKH2Pit" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getFeeForMessage.mdx meta: { "title": "getFeeForMessage", "description": "Get the fee the network will charge for a particular message.", "sidebar_label": "getFeeForMessage" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getFeeForMessage RPC Method Please note that this method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 ## Description Get the fee the network will charge for a particular message. ## Parameters 1. `message` (string, required) - The transaction message encoded as base64 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `maxSupportedTransactionVersion` (number, optional) - The maximum supported transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt an error ## Returns Returns null if the transaction message is not found, otherwise RpcResponse JSON object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - (u64 | null) The fee corresponding to the message at the specified blockhash ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ -d ' { "id":1, "jsonrpc":"2.0", "method":"getFeeForMessage", "params":[ "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA", { "commitment":"processed" } ] } ' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const YOUR_TRANSACTION = new Transaction(); const YOUR_MESSAGE = YOUR_TRANSACTION.compileMessage(); console.log(await solana.getFeeForMessage(YOUR_MESSAGE)); })(); ``` ```javascript import { createSolanaRpc, GetFeeForMessageApi, Rpc, TransactionMessageBytesBase64 } from "@solana/web3.js"; async function getFeeForMessageExample() { const rpc: Rpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const message: TransactionMessageBytesBase64 = "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA" as TransactionMessageBytesBase64; try { const feeResult = await rpc.getFeeForMessage(message, { commitment: 'processed' }).send(); console.log("Fee for message:", feeResult); } catch (error) { console.error("Error:", error); } } getFeeForMessageExample(); ``` ```python from solana.rpc.api import Client from solana.keypair import Keypair from solana.system_program import TransferParams, transfer from solana.transaction import Transaction from solana.publickey import PublicKey sender, receiver = Keypair.from_seed(bytes(PublicKey(1))), Keypair.from_seed(bytes(PublicKey(2))) txn = Transaction().add(transfer(TransferParams(from_pubkey=sender.public_key, to_pubkey=receiver.public_key, lamports=1000))) solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_fee_for_message(txn.compile_message())) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "id": 1, "jsonrpc": "2.0", "method": "getFeeForMessage", "params": [ "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA", { "commitment": "processed" } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "id": 1, "jsonrpc": "2.0", "method": "getFeeForMessage", "params": [ "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA", { "commitment": "processed" } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getFeeRateGovernor.mdx meta: { "title": "getFeeRateGovernor", "description": "Returns the fee rate governor information from the root bank.", "sidebar_label": "getFeeRateGovernor" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getFeeRateGovernor RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's getFeeForMessage RPC method. ## Description Returns the fee rate governor information from the root bank. ## Parameters None ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object describing the cluster fee rate at the queried blockhash * `feeRateGovernor` - A nested object that contains the current fee rate governor configuration: * `burnPercent` - The percentage of fees collected to be destroyed * `maxLamportsPerSignature` - The maximum achievable value of lamportsPerSignature for the upcoming slot * `minLamportsPerSignature` - The minimum achievable value of lamportsPerSignature for the upcoming slot * `targetLamportsPerSignature` - The target fee rate within the cluster * `targetSignaturesPerSlot` - The optimal signature rate within the cluster ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getFeeRateGovernor", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_fee_rate_governor()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getFeeRateGovernor" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getFeeRateGovernor" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getFees.mdx meta: { "title": "getFees", "description": "Returns a recent block hash from the ledger, a fee schedule that can be used to compute the cost of submitting a transaction using it, and the last slot in which the blockhash will be valid.", "sidebar_label": "getFees" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getFees RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's getFeeForMessage RPC method. ## Description Returns a recent block hash from the ledger, a fee schedule that can be used to compute the cost of submitting a transaction using it, and the last slot in which the blockhash will be valid. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns The result will be an object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object describing the cluster fee rate at the queried blockhash * `blockhash` - The blockhash for the specified transaction. This is the blockhash used to calculate the fees * `feeCalculator` - A JSON object that represents the fee calculator for the specified transaction: * `lamportsPerSignature` - The number of lamports required to process each signature in the transaction * `lastValidBlockHeight` - The last block height where a blockhash remains valid * `lastValidSlot` - The last valid slot for the specified transaction ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getFees"}' ``` ```javascript // not currently supported by solanajs const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getFees", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_fees()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getFees" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getFees" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getFirstAvailableBlock.mdx meta: { "title": "getFirstAvailableBlock", "description": "Returns the slot of the lowest confirmed block that has not been purged from the ledger", "sidebar_label": "getFirstAvailableBlock" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getFirstAvailableBlock RPC Method ## Description Returns the slot of the lowest confirmed block that has not been purged from the ledger. ## Parameters This method takes no parameters. ## Returns * `result` - An integer representing the slot of the lowest confirmed block, encoded as a u64 (64-bit unsigned integer). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getFirstAvailableBlock"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getFirstAvailableBlock()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const firstAvailableBlock = await solanaRpc.getFirstAvailableBlock().send(); console.log(Number(firstAvailableBlock)); } catch (error) { console.error("Error fetching first available block:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_first_available_block()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getFirstAvailableBlock" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getFirstAvailableBlock" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getGenesisHash.mdx meta: { "title": "getGenesisHash", "description": "Returns the genesis hash.", "sidebar_label": "getGenesisHash" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getGenesisHash RPC Method ## Description Returns the genesis hash. ## Parameters This method takes no parameters. ## Returns * `result` - The hash encoded as a base-58 string. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}' ``` ```javascript // not currently supported by solanaJS directly, using axios instead const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getGenesisHash", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const genesisHash = await solanaRpc.getGenesisHash().send(); console.log(genesisHash); } catch (error) { console.error("Error fetching genesis hash:", error); } })(); ``` ````python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_genesis_hash()) ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getGenesisHash" }) response = https.request(request) puts response.read_body ```` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getGenesisHash" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` Full Example Response ```json { "jsonrpc": "2.0", "result": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d", "id": 1 } ``` file: ./content/solana-rpc/methods/getHealth.mdx meta: { "title": "getHealth", "description": "Returns the current health of the node.", "sidebar_label": "getHealth" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getHealth RPC Method ## Description Returns the current health of the node. ## Parameters None ## Returns Returns "Ok", if the node is healthy or JSON RPC error response, if the node is unhealthy. Please note that the specifics of the error response are UNSTABLE and may change in the future. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getHealth"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getHealth", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const health = await solanaRpc.getHealth().send(); console.log(health); } catch (error) { console.error("Error fetching health:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getHealth")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getHealth" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getHealth" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getHighestSnapshotSlot.mdx meta: { "title": "getHighestSnapshotSlot", "description": "Returns the highest slot that the node has a snapshot for. This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one.", "sidebar_label": "getHighestSnapshotSlot" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getHighestSnapshotSlot RPC Method Please note that this method is only available in solana-core v1.9 or newer. Please use getSnapshotSlot for solana-core v1.8 ## Description Returns the highest slot that the node has a snapshot for. This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one. ## Parameters None ## Returns The result will be an object with the following fields: * `full` - The highest fullsnapshot slot encoded as 64-bit unsigned integer * `incremental` - The greatest incremental snapshot slot derived from the full snapshot ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getHighestSnapshotSlot"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getHighestSnapshotSlot", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const highestSnapshotSlot = await solanaRpc.getHighestSnapshotSlot().send(); console.log(highestSnapshotSlot); } catch (error) { console.error("Error fetching highest snapshot slot:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getHighestSnapshotSlot")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getHighestSnapshotSlot" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getHighestSnapshotSlot" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getIdentity.mdx meta: { "title": "getIdentity", "description": "Returns the identity pubkey for the current node.", "sidebar_label": "getIdentity" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getIdentity RPC Method ## Description Returns the identity pubkey for the current node. ## Parameters None ## Returns The result will be a JSON object with the following fields: * `identity` - The public key identity of the current node as base-58 encoded string ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getIdentity"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getIdentity", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const identity = await solanaRpc.getIdentity().send(); console.log(identity); } catch (error) { console.error("Error fetching identity:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_identity()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getIdentity" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getIdentity" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getInflationGovernor.mdx meta: { "title": "getInflationGovernor", "description": "Returns the current inflation governor.", "sidebar_label": "getInflationGovernor" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getInflationGovernor RPC Method ## Description Returns the current inflation governor. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns The result will be an object with the following fields: * `foundation` - The proportion of total inflation allocated to the foundation * `foundationTerm` - The time period in years during which the foundation allocation will be paid out * `initial` - The initial inflation percentage from time 0 * `taper` - The time period in years during which the inflation rate will gradually decrease from the initial rate to the final rate * `terminal` - The terminal inflation percentage ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getInflationGovernor()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const inflationGovernor = await solanaRpc.getInflationGovernor().send(); console.log(inflationGovernor); } catch (error) { console.error("Error fetching inflation governor:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_inflation_governor()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getInflationGovernor" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getInflationGovernor" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getInflationRate.mdx meta: { "title": "getInflationRate", "description": "Returns the specific inflation values for the current epoch.", "sidebar_label": "getInflationRate" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getInflationRate RPC Method ## Description Returns the specific inflation values for the current epoch. ## Parameters None ## Returns The result will be an object with the following fields: * `epoch` - The epoch during which these values remain valid * `foundation` - The proportion of total inflation allocated to the foundation * `total` - The total inflation * `validator` - The portion of inflation designated for validators ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getInflationRate"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getInflationRate", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const inflationRate = await solanaRpc.getInflationRate().send(); console.log(inflationRate); } catch (error) { console.error("Error fetching inflation rate:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_inflation_rate()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getInflationRate" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getInflationRate" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getInflationReward.mdx meta: { "title": "getInflationReward", "description": "Returns the inflation / staking reward for a list of addresses for an epoch.", "sidebar_label": "getInflationReward" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getInflationReward RPC Method ## Description Returns the inflation / staking reward for a list of addresses for an epoch. ## Parameters 1. `array` (string, optional) - An array of addresses to query, as base-58 encoded strings 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by supermajority of the cluster * `epoch` (integer, optional) - An epoch for which the reward occurs. If omitted, the previous epoch will be used * `minContextSlot` (integer, optional) - The minimum slot that the request can be evaluated at ## Returns The result will be JSON object with the following fields: * `epoch` - The epoch during which the reward was received * `effectiveSlot` - The slot at which the rewards become active * `amount` - The reward value in lamports * `postBalance` - The account balance after the transaction in lamports * `commission` - The commission rate of the vote account at the time the reward was credited ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getInflationReward", "params": [["ADDRESS_TO_SEARCH_1", "ADDRESS_TO_SEARCH_2"], {"epoch": 2}] }' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const pubkey1 = new web3.PublicKey("YOUR_ADDRESS_1"); const pubkey2 = new web3.PublicKey("YOUR_ADDRESS_2"); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getInflationReward([pubkey1, pubkey2])); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const pubkey1 = address("YOUR_ADDRESS_1"); const pubkey2 = address("YOUR_ADDRESS_2"); try { const inflationReward = await solanaRpc.getInflationReward([pubkey1, pubkey2]).send(); console.log(inflationReward); } catch (error) { console.error("Error fetching inflation reward:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getInflationReward", params=[["ADDRESS_TO_SEARCH_1","ADDRESS_TO_SEARCH_2"],{"epoch": 2}])) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getInflationReward", "params": [ [ "ADDRESS_TO_SEARCH_1", "ADDRESS_TO_SEARCH_2" ], { "epoch": 2 } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getInflationReward", "params": [ [ "ADDRESS_TO_SEARCH_1", "ADDRESS_TO_SEARCH_2" ], { "epoch": 2 } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getLargestAccounts.mdx meta: { "title": "getLargestAccounts", "description": "Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours).", "sidebar_label": "getLargestAccounts" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getLargestAccounts RPC Method ## Description Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours). ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `filter` (string, optional) - Filters results by account type; currently supported: `circulating` and `nonCirculating`. ## Returns * `result` - `null` if the requested account doesn’t exist; otherwise, an RpcResponse JSON object with the following fields: * `context` - Information about the current state of the program: * `apiVersion` - The version of the Solana RPC API to use. * `slot` - An integer representing the slot for which the data is retrieved. * `value` - An array of objects, each with the following fields: * `address` - The address of the account, encoded as base-58. * `lamports` - The number of lamports in the account, encoded as a u64 (64-bit unsigned integer). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getLargestAccounts"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getLargestAccounts()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const largestAccounts = await solanaRpc.getLargestAccounts().send(); console.log(largestAccounts); } catch (error) { console.error("Error fetching largest accounts:", error); } })(); ``` ```python from solana.rpc.api import Client sol casing = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_largest_accounts()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "ε…ΆδΈ­ηš„2.0", "id": 1, "method": "getLargestAccounts" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getLargestAccounts" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` Full Example Response ```json { "jsonrpc": "2.0", "result": { "context": { "apiVersion": "1.18.22", "slot": 123456789 }, "value": [ { "address": "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v2", "lamports": 5000000000000 }, { "address": "B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3", "lamports": 4500000000000 }, { "address": "C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v2W3x4", "lamports": 4000000000000 } ] }, "id": 1 } ``` file: ./content/solana-rpc/methods/getLatestBlockhash.mdx meta: { "title": "getLatestBlockhash", "description": "Returns the latest blockhash.", "sidebar_label": "getLatestBlockhash" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getLatestBlockhash RPC Method Please note that this method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8 ## Description Returns the latest blockhash. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns The RpcResponse JSON object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `blockhash` - The block hash encoded as base-58 string * `lastValidBlockHeight` - The last block height at which the blockhash will be valid ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getLatestBlockhash", "params": [{"commitment":"processed"}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getLatestBlockhash()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const latestBlockhash = await solanaRpc.getLatestBlockhash().send(); console.log(latestBlockhash); } catch (error) { console.error("Error fetching latest blockhash:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_latest_blockhash()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getLatestBlockhash", "params": [ { "commitment": "processed" } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getLatestBlockhash", "params": [ { "commitment": "processed" } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getLeaderSchedule.mdx meta: { "title": "getLeaderSchedule", "description": "Returns the leader schedule for an epoch.", "sidebar_label": "getLeaderSchedule" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getLeaderSchedule RPC Method ## Description Returns the leader schedule for an epoch. ## Parameters 1. `u64` (string, optional) - Fetches the leader schedule for the epoch that corresponds to the provided slot. If unspecified, the leader schedule for the current epoch is fetched 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `identity` (string, optional) - Only returns the results for this validator identity encoded as base-58 ## Returns Returns null if the requested epoch is not found, otherwise the result field will be a dictionary of validator identities, as base-58 encoded strings, and their corresponding leader slot indices as values (indices are relative to the first slot in the requested epoch). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getLeaderSchedule()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const slot = await solanaRpc.getSlot().send(); const leaderSchedule = await solanaRpc.getLeaderSchedule(slot).send(); console.log(leaderSchedule); } catch (error) { console.error("Error fetching leader schedule:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_leader_schedule()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getLeaderSchedule" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getLeaderSchedule" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getMaxRetransmitSlot.mdx meta: { "title": "getMaxRetransmitSlot", "description": "Get the max slot seen from retransmit stage.", "sidebar_label": "getMaxRetransmitSlot" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getMaxRetransmitSlot RPC Method ## Description Get the max slot seen from retransmit stage. ## Parameters None ## Returns Returns the slot number encoded as u64, 64-bit unsigned integer. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getMaxRetransmitSlot"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getMaxRetransmitSlot", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const maxRetransmitSlot = await solanaRpc.getMaxRetransmitSlot().send(); console.log("Max Retransmit Slot:", maxRetransmitSlot); } catch (error) { console.error("Error fetching max retransmit slot:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getMaxRetransmitSlot")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getMaxRetransmitSlot" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getMaxRetransmitSlot" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getMaxShredInsertSlot.mdx meta: { "title": "getMaxShredInsertSlot", "description": "Get the max slot seen from after shred insert.", "sidebar_label": "getMaxShredInsertSlot" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getMaxShredInsertSlot RPC Method ## Description Get the max slot seen from after shred insert. ## Parameters This method takes no parameters. ## Returns * `result` - The slot number encoded as a u64 (64-bit unsigned integer). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getMaxShredInsertSlot"}' ``` ```javascript // not currently supported by solanaJS directly, using axios instead const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getMaxShredInsertSlot", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const maxShredInsertSlot = await solanaRpc.getMaxShredInsertSlot().send(); console.log("Max Shred Insert Slot:", maxShredInsertSlot); } catch (error) { console.error("Error fetching max shred insert slot:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getMaxShredInsertSlot")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getMaxShredInsertSlot" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getMaxShredInsertSlot" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` Full Example Response ```json { "jsonrpc": "2.0", "result": 123456789, "id": 1 } ``` file: ./content/solana-rpc/methods/getMinimumBalanceForRentExemption.mdx meta: { "title": "getMinimumBalanceForRentExemption", "description": "Returns minimum balance required to make account rent exempt.", "sidebar_label": "getMinimumBalanceForRentExemption" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getMinimumBalanceForRentExemption RPC Method ## Description Returns minimum balance required to make account rent exempt. ## Parameters 1. `usize` (integer, optional) - The account data length 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns The minimum lamports required in an account to remain rent free, which is encoded as u64, 64-bit unsigned integer ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getMinimumBalanceForRentExemption", "params":[50]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getMinimumBalanceForRentExemption(50)); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const minimumBalance = await solanaRpc.getMinimumBalanceForRentExemption(BigInt(50)).send(); console.log("Minimum Balance for Rent Exemption:", minimumBalance); } catch (error) { console.error("Error fetching minimum balance for rent exemption:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_minimum_balance_for_rent_exemption(50)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getMinimumBalanceForRentExemption", "params": [ 50 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getMinimumBalanceForRentExemption", "params": [ 50 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getMultipleAccounts.mdx meta: { "title": "getMultipleAccounts", "description": "Returns the account information for a list of Pubkeys.", "sidebar_label": "getMultipleAccounts" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getMultipleAccounts RPC Method ## Description Returns the account information for a list of Pubkeys. ## Parameters 1. `array` (string, optional) - An array of Pubkeys to query encoded as base-58 strings (up to a maximum of 100) 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `encoding` (string, optional) - (default: json) The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed * `dataSlice` (string, optional) - The returned account data using the provided offset: 'usize' and length: 'usize' fields; only available for base58, base64, or base64+zstd encodings * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns Returns null if the account doesn't exist, otherwise RpcResponse JSON object with the following fields: * `context` - An object that contains metadata about the current state of the Solana network at the time the request was processed * `apiVersion` - The version of the Solana RPC API to use * `slot` - The current slot in the Solana cluster during which the transactions are processed and new blocks are added to the blockchain * `value` - An object that contains information about the requested account * `data` - The data associated with the account, either as encoded binary data or JSON format `{'program': 'state'}`, depending on encoding parameter * `executable` - A boolean value indicating whether the account holds a program and is therefore restricted to read-only access * `lamports` - The quantity of lamports allocated to this account as u64 (64-bit unsigned integer) * `owner` - The base-58 encoded public key of the program to which this account has been assigned * `rentEpoch` - The epoch, represented as a 64-bit unsigned integer (u64), at which this account will next be due for rent * `space` - The amount of storage space required to store the token account ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getMultipleAccounts","params": [["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"],{"dataSlice": {"offset": 0,"length": 0}}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const publicKey = new web3.PublicKey( "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg" ); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const publicKey2 = new web3.PublicKey( "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ); console.log(await solana.getMultipleAccountsInfo([publicKey, publicKey2])); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const publicKey1 = address("vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"); const publicKey2 = address("4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"); try { const accountsInfo = await solanaRpc.getMultipleAccounts([publicKey1, publicKey2]).send(); console.log(accountsInfo); } catch (error) { console.error("Error fetching multiple accounts info:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getMultipleAccounts", params=[["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"],{"dataSlice": {"offset": 0,"length": 0}}])) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getMultipleAccounts", "params": [ [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ], { "dataSlice": { "offset": 0, "length": 0 } } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getMultipleAccounts", "params": [ [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ], { "dataSlice": { "offset": 0, "length": 0 } } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getParsedBlock.mdx meta: { "title": "getParsedBlock", "description": "Returns identity and transaction information about a confirmed block in the ledger.", "sidebar_label": "getParsedBlock" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getParsedBlock RPC Method The getParsedTransaction method is only supported with the @solana/web3.js SDK. To use cURL or solana.py, check out the getBlock method examples where the encoding is set to jsonParsed. ## Description Returns identity and transaction information about a confirmed block in the ledger. ## Parameters 1. `slot_number` (string) - The slot number encoded as u64, 64-bit unsigned integer 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `encoding` (string) - (default: json) The encoding format for account data. It can be base58 (slow), base64, base64+zstd or jsonParsed * `transactionDetails` (string) - (default: full) It specifies the level of transaction details to include in the response. The possible values are full, signatures, and none * `rewards` (boolean) - (default: true) It determines whether to populate the rewards array or not. * `maxSupportedTransactionVersion` (boolean, optional) - The maximum transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt an error * `legacy` (boolean, optional) - The older transaction format with no additional benefit * `0` (boolean, optional) - The additional support for Address Lookup Tables ## Returns Returns null if the specified block is not confirmed, otherwise an object with the following fields: * `blockhash` - The hash of the confirmed block * `previousBlockhash` - The hash of the block's predecessor * `parentSlot` - The slot number of the block's parent * `transactions` - An array of transaction objects within the block. Each transaction object contains: * `meta` - The transaction status metadata object with the following fields: * `err` - Error code if the transaction failed or null if the transaction succeeds * `fee` - The transaction fee * `innerInstructions` - The list of inner instructions (omitted or null if inner instruction recording was not yet enabled during the transaction) * `loadedAddresses` - The list of loaded addresses objects * `logMessages` - An array of string log messages (omitted or null if log message recording was not yet enabled during the transaction) * `postBalances` - An array of u64 account balances after the transaction was processed * `postTokenBalances` - The list of token balances from after the transaction was processed * `preBalances` - An array of u64 account balances from before the transaction was processed * `preTokenBalances` - The list of token balances from before the transaction was processed * `rewards` - An array of reward objects detailing the rewards for this block (only present if rewards are requested) * `status` - The processing status of the transaction. It returns Ok if the transaction was successful and Err if the transaction failed with TransactionError * `transaction` - The transaction object with the following fields: * `message` - The transaction message containing the following fields: * `accountKeys` - An array of public keys involved in the transaction * `header` - An object containing the transaction's header * `instructions` - An array of instruction objects for the transaction * `recentBlockhash` - The most recent blockhash used for the transaction * `signatures` - An array of signatures strings corresponding to the transaction order in the block ## Code Examples ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getParsedBlock(94101948, { maxSupportedTransactionVersion: 0 }) ); })(); ``` ``` ``` file: ./content/solana-rpc/methods/getParsedTransaction.mdx meta: { "title": "getParsedTransaction", "description": "Returns transaction details for a confirmed transaction", "sidebar_label": "getParsedTransaction" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getParsedTransaction RPC Method ## Description Returns transaction details for a confirmed transaction. The getParsedTransaction method is only supported with the @solana/web3.js SDK. To use cURL or solana.py, check out the getTransaction method examples where the encoding is set to jsonParsed. ## Parameters 1. `slot` (string) - A base58-encoded transaction signature identifying the transaction to retrieve. 2. `object` (array) - The configuration object with the following fields: * `encoding` (string, optional) - The encoding format for account data. It can be `jsonParsed` or not applicable if using JS `getParsedTransaction`. * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - It is not supported for this method. * `maxSupportedTransactionVersion` (integer, optional) - The maximum transaction version to return in responses. If the requested transaction has a higher version, an error will be returned. If omitted, only legacy transactions will be returned, and any versioned transaction will prompt an error. Use `0` for versioned transactions or omit for legacy only. ## Returns The result will be `null` if the specified transaction is not confirmed; otherwise, an object with the following fields: * `slot` - The slot number in which the transaction was processed. * `parsedTransaction` - The parsed transaction object with the following fields: * `signatures` - An array of signatures on the transaction. * `parsedMessage` - The parsed message of the transaction: * `accountKeys` - An array of public keys involved in the transaction. * `instructions` - An array of instructions executed in the transaction. * `recentBlockhash` - The recent blockhash from the transaction. * `addressTableLookups` - An array of address lookups performed during execution. * `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). It’s `null` if not available. * `meta` - The transaction status metadata object with the following fields: * `err` - Error code if the transaction failed, or `null` if it succeeds. * `fee` - The fee paid by the transaction, encoded as a u64 integer. * `preBalances` - An array of lamport balances for each account before the transaction was processed. * `postBalances` - An array of lamport balances for each account after the transaction was processed. * `parsedInnerInstructions` - List of inner instructions, omitted if inner instruction recording was not enabled. * `preTokenBalances` - An array of token balances before the transaction (omitted if inner instruction recording is not enabled). * `postTokenBalances` - An array of token balances after the transaction (omitted if inner instruction recording is not enabled). * `logMessages` - An array of log messages generated by the transaction (omitted if inner instruction recording is not enabled). * `rewards` - An object containing reward information (only present if rewards are requested): * `pubkey` - The public key of the account that received the reward, encoded as a base-58 string. * `lamports` - The number of reward lamports credited or debited. * `postBalance` - The account balance in lamports after the reward was applied. * `rewardType` - The type of reward (e.g., `fee`, `rent`, `voting`, `staking`). * `commission` - The vote account commission for voting/staking rewards (if applicable). * `loadedAddresses` - The list of loaded addresses: * `readonly` - Ordered list of base-58 encoded addresses for readonly loaded accounts. * `writable` - Ordered list of base-58 encoded addresses for writable loaded accounts. * `version` - The transaction version, undefined if `maxSupportedTransactionVersion` is not set. ## Code Examples ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getParsedTransaction( "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff", { maxSupportedTransactionVersion: 0 } ) ); })(); ``` Full Example Response ````json { "slot": 12345678, "parsedTransaction": { "signatures": [ "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff" ], "parsedMessage": { "accountKeys": [ "Vote111111111111111111111111111111111111111", "SysvarRent111111111111111111111111111111111" ], "instructions": [ { "programId": "Vote111111111111111111111111111111111111111", "accounts": [ "Vote111111111111111111111111111111111111111", "SysvarRent111111111111111111111111111111111" ], "data": "abc123" } ], "recentBlockhash": "7x8y9z0a1b2c3d4e5f6g7h8i9j0k", "addressTableLookups": [] } }, "blockTime": 1696440457, "meta": { "err": null, "fee": 5000, "preBalances": [1000000000, 2000000000], "postBalances": [999995000, 2000000000], "parsedInnerInstructions": [], "preTokenBalances": [], "postTokenBalances": [], "logMessages": ["Program Vote111111111111111111111111111111111111111 invoked"], "rewards": [], "loadedAddresses": { "readonly": [], "writable": [] }, "version": 0 } }``` ```` file: ./content/solana-rpc/methods/getProgramAccounts.mdx meta: { "title": "getProgramAccounts", "description": "Returns all accounts owned by the provided program Pubkey.", "sidebar_label": "getProgramAccounts" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getProgramAccounts RPC Method ## Description Returns all accounts owned by the provided program Pubkey. ## Parameters 1. `pubkey` (string) - The Pubkey of program encoded as base-58 string 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated * `withContext` (boolean, optional) - Wraps the result in a RpcResponse JSON object * `filters` (array, optional) - Filter results using up to 4 filter objects * `dataSlice` (string, optional) - The returned account data using the provided offset: 'usize' and length: 'usize' fields; only available for base58, base64, or base64+zstd encodings * `encoding` (string) - (default: json) The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed ## Returns The result will be RpcResponse JSON object with the following fields: * `pubkey` - The public key of the node encoded as base-58 string * `account` - A JSON object with the following fields: * `lamports` - The number of lamports assigned to this account as u64 (64-bit unsigned integer) * `owner` - The base-58 encoded Pubkey of the program this account has been assigned to * `data` - The data associated with the account, either as encoded binary data or JSON format `{'program': 'state'}`, depending on encoding parameter * `executable` - A boolean indicating if the account contains a program (and is strictly read-only) * `rentEpoch` - The epoch at which this account will next owe rent, as u64 (64-bit unsigned integer) * `space` - The amount of storage space required to store the token account ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getProgramAccounts", "params": ["PROGRAM_TO_SEARCH"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const url = "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"; const solana = new web3.Connection(url); console.log( await solana.getProgramAccounts(new web3.PublicKey("YOUR_PROGRAM_ADDRESS")) ); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const url = "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"; const solanaRpc = createSolanaRpc(url); try { const programAddress = address("YOUR_PROGRAM_ADDRESS"); const programAccounts = await solanaRpc.getProgramAccounts(programAddress).send(); console.log(JSON.stringify(programAccounts, null, 2)); } catch (error) { console.error("Error fetching program accounts:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_program_accounts("YOUR_PROGRAM_ADDRESS")) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getProgramAccounts", "params": [ "PROGRAM_TO_SEARCH" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getProgramAccounts", "params": [ "PROGRAM_TO_SEARCH" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getRecentBlockhash.mdx meta: { "title": "getRecentBlockhash", "description": "Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.", "sidebar_label": "getRecentBlockhash" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getRecentBlockhash RPC Method ## Description Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it. Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method, you can use Solana's getLatestBlockhash RPC method. ## Parameters 1. `object` (array, optional) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. ## Returns * `result` - An RpcResponse JSON object with the following fields: * `context` - Metadata about the current state of the Solana network at the time of processing: * `apiVersion` - The version number. * `slot` - The current slot in the Solana cluster when the request was processed. * `value` - An object containing: * `blockhash` - The blockhash as a base-58 encoded string, used to calculate transaction fees. * `feeCalculator` - A JSON object representing the fee calculator: * `lamportsPerSignature` - The number of lamports required to process each signature in the transaction, encoded as a u64 integer. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getRecentBlockhash()); })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_recent_blockhash()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getRecentBlockhash" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getRecentBlockhash" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getRecentPerformanceSamples.mdx meta: { "title": "getRecentPerformanceSamples", "description": "Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window.", "sidebar_label": "getRecentPerformanceSamples" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getRecentPerformanceSamples RPC Method ## Description Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window. ## Parameters 1. `limit` (string, optional) - The number of samples to return (maximum 720) ## Returns A JSON object with the following fields: * `numNonVoteTransactions` - The number of non-vote transactions during the specified sample period * `numSlots` - The number of slots in the sample * `numTransactions` - The number of transactions in the sample * `samplePeriodSecs` - The number of seconds in the sample window * `slot` - The slot in which the sample was taken at ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getRecentPerformanceSamples", "params": [4]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getRecentPerformanceSamples(4)); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const performanceSamples = await solanaRpc.getRecentPerformanceSamples(4).send(); console.log(performanceSamples); } catch (error) { console.error("Error fetching recent performance samples:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getRecentPerformanceSamples", params=(4))) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getRecentPerformanceSamples", "params": [ 4 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getRecentPerformanceSamples", "params": [ 4 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getRecentPrioritizationFees.mdx meta: { "title": "getRecentPrioritizationFees", "description": "Returns a list of prioritization fees from recent blocks", "sidebar_label": "getRecentPrioritizationFees" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getRecentPrioritizationFees RPC Method ## Description Returns a list of prioritization fees from recent blocks ## Parameters 1. `address` (array, optional) - A collection of up to 128 Account addresses represented as base-58 encoded strings in an array ## Returns Returns an array of objects with the following fields: * `prioritizationFee` (integer) - The prioritization fee value * `slot` (integer) - The slot number associated with the prioritization fee ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getRecentPrioritizationFees","params":[]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getRecentPrioritizationFees()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const prioritizationFees = await solanaRpc.getRecentPrioritizationFees().send(); console.log(prioritizationFees); } catch (error) { console.error("Error fetching recent prioritization fees:", error); } })(); ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getRecentPrioritizationFees", "params": [] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getRecentPrioritizationFees", "params": [] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSignatureStatuses.mdx meta: { "title": "getSignatureStatuses", "description": "Returns the statuses of a list of signatures. Unless the searchTransactionHistory configuration parameter is included, this method only searches the recent status cache of signatures, which retains statuses for all active slots plus MAX_RECENT_BLOCKHASHES rooted slots.", "sidebar_label": "getSignatureStatuses" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSignatureStatuses RPC Method ## Description Returns the statuses of a list of signatures. Unless the searchTransactionHistory configuration parameter is included, this method only searches the recent status cache of signatures, which retains statuses for all active slots plus MAX\_RECENT\_BLOCKHASHES rooted slots. ## Parameters 1. `tx signatures` (string) - An array of transaction signatures to confirm encoded as base-58 strings 2. `object` (array) - The configuration object with the following fields: * `searchTransactionHistory` (boolean) - (default: false) If true, the search includes the entire transaction history. If false, the search only includes recent transactions in the latest confirmed block ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `confirmationStatus` - The transaction's cluster confirmation status. It can either be processed, confirmed, or finalized * `confirmations` - The number of confirmations a transaction has received. If the transaction is finalized (i.e., confirmed at the highest level of commitment), the value will be null * `err` - Error code if the transaction failed or null if the transaction succeeds * `slot` - The slot number in which the transaction was confirmed * `status` - The processing status of the transaction. It returns Ok if the transaction was successful and Err if the transaction failed with TransactionError ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getSignatureStatuses","params": [["5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS","D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"],{"searchTransactionHistory": true}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const accountOne = "5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS"; const accountTwo = "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"; const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getSignatureStatuses([accountOne, accountTwo], { searchTransactionHistory: true, }) ); })(); ``` ```javascript import { createSolanaRpc, signature } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const signatureOne = "5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS"; const signatureTwo = "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"; try { const signatureStatuses = await solanaRpc.getSignatureStatuses([ signature(signatureOne), signature(signatureTwo) ], { searchTransactionHistory: true }).send(); console.log(signatureStatuses); } catch (error) { console.error("Error fetching signature statuses:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") signatures = [ "5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS", "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff" ] print(solana_client.get_signature_statuses(signatures,search_transaction_history=True)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": [ [ "5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS", "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff" ], { "searchTransactionHistory": true } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": [ [ "5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS", "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff" ], { "searchTransactionHistory": true } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSignaturesForAddress.mdx meta: { "title": "getSignaturesForAddress", "description": "Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block.", "sidebar_label": "getSignaturesForAddress" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSignaturesForAddress RPC Method Please note that the parameter minContextSlot is not a filter on historical transactions. You can use the before or until parameter to filter historical transactions. ## Description Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block. ## Parameters 1. `account_address` (string, required) - The account address encoded as base-58 string 2. `object` (array, optional) - The configuration object with the following fields: * `limit` (integer) - The maximum number of transaction signatures to return (between 1 and 1000). The default value is 1000 * `before` (string, optional) - Start searching backward from this transaction signature. If not provided, the search starts from the top of the highest max confirmed block * `until` (string, optional) - Searches until this transaction signature, if found before limit reached * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns A JSON object with the following fields: * `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). Null if not available * `confirmationStatus` - The transaction's cluster confirmation status. The status can either be processed, confirmed, or finalized * `err` - Error code if the transaction failed or null if the transaction succeeds * `memo` - The memo associated with the transaction and null if no memo is present * `signature` - The base58-encoded signature of the transaction * `slot` - The slot number in which the transaction was confirmed ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ -d $' { "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": ["Vote111111111111111111111111111111111111111",{"limit": 1}] } ' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const publicKey = new web3.PublicKey( "Vote111111111111111111111111111111111111111" ); console.log(await solana.getSignaturesForAddress(publicKey, { limit: 1 })); })(); ``` ```python import base58 from solana.rpc.api import Client from solders.pubkey import Pubkey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") encoded_pubkey = "Vote111111111111111111111111111111111111111" decoded_pubkey = base58.b58decode(encoded_pubkey) print(len(decoded_pubkey)) #32 bytes address = Pubkey(decoded_pubkey) print(solana_client.get_signatures_for_address(address, limit=1)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": [ "Vote111111111111111111111111111111111111111", { "limit": 1 } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": [ "Vote111111111111111111111111111111111111111", { "limit": 1 } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSlot.mdx meta: { "title": "getSlot", "description": "Returns the slot that has reached the given or default commitment level.", "sidebar_label": "getSlot" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSlot RPC Method With Endpoint Armor, you can define specific restrictions on this method when called. Learn more about Endpoint Armor here ## Description Returns the slot that has reached the given or default commitment level. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns Returns the current slot number ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getSlot"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getSlot()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const slot = await solanaRpc.getSlot().send(); console.log(slot); } catch (error) { console.error("Error fetching slot:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_slot()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSlot" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSlot" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSlotLeader.mdx meta: { "title": "getSlotLeader", "description": "Returns the current slot leader.", "sidebar_label": "getSlotLeader" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSlotLeader RPC Method ## Description Returns the current slot leader. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns The current slot leader as base-58 encoded string ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getSlotLeader"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getSlotLeader()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const slotLeader = await solanaRpc.getSlotLeader().send(); console.log(slotLeader); } catch (error) { console.error("Error fetching slot leader:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_slot_leader()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSlotLeader" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSlotLeader" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSlotLeaders.mdx meta: { "title": "getSlotLeaders", "description": "Returns the slot leaders for a given slot range.", "sidebar_label": "getSlotLeaders" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSlotLeaders RPC Method ## Description Returns the slot leaders for a given slot range. ## Parameters 1. `start_slot` (string, required) - The start slot encoded as u64, 64-bit unsigned integer 2. `limit` (string) - The limit encoded as u64, 64-bit unsigned integer ## Returns Returns the slot leaders for the specified slot range. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getSlotLeaders", "params":[140630426, 10]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getSlotLeaders(140630426, 10)); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const currentSlot = await solanaRpc.getSlot().send(); const slotLeaders = await solanaRpc.getSlotLeaders(currentSlot, 10).send(); console.log("Slot Leaders:", slotLeaders); } catch (error) { console.error("Error fetching slot leaders:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getSlotLeaders", params=(140630426, 10))) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSlotLeaders", "params": [ 140630426, 10 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSlotLeaders", "params": [ 140630426, 10 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getSnapshotSlot.mdx meta: { "title": "getSnapshotSlot", "description": "Returns the highest slot that the node has a snapshot for.", "sidebar_label": "getSnapshotSlot" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSnapshotSlot RPC Method Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method you can use Solana's getHighestSnapshotSlot RPC method. ## Description Returns the highest slot that the node has a snapshot for. ## Parameters None ## Returns The highest slot number for which a snapshot is available ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getSnapshotSlot"}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getSnapshotSlot", }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getSnapshotSlot")) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSnapshotSlot" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSnapshotSlot" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getStakeActivation.mdx meta: { "title": "getStakeActivation", "description": "Returns epoch activation information for a stake account.", "sidebar_label": "getStakeActivation" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getStakeActivation RPC Method ## Description Returns epoch activation information for a stake account. Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method, you can use Solana's getAccountInfo RPC method. ## Parameters 1. `pubkey` (string) - The Pubkey of the stake account to query, encoded as a base-58 string. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated. * `epoch` (integer, optional) - The epoch for which the stake activation information is to be retrieved. ## Returns * `result` - An object with the following fields: * `context` - Information about the current state of the program: * `apiVersion` - The version of the Solana RPC API to use. * `slot` - An integer representing the slot for which the data is retrieved. * `value` - A JSON object with the following fields: * `active` - The amount of stake that is active, expressed in lamports. * `inactive` - The amount of stake that is inactive, expressed in lamports. * `state` - The stake activation state, which can be one of: `inactive`, `activating`, `active`, or `deactivating`. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getStakeActivation", "params": ["Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const stakeKey = new web3.PublicKey( "Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ" ); const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getStakeActivation(stakeKey)); })(); ``` ```python import base58 from solana.rpc.api import Client from solders.pubkey import Pubkey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") encoded_pubkey = "Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ" decoded_pubkey = base58.b58decode(encoded_pubkey) print(len(decoded_pubkey)) # 32 bytes address = Pubkey(decoded_pubkey) print(solana_client.get_stake_activation(address)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getStakeActivation", "params": [ "Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getStakeActivation", "params": [ "Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getStakeMinimumDelegation.mdx meta: { "title": "getStakeMinimumDelegation", "description": "Returns the stake minimum delegation in lamports.", "sidebar_label": "getStakeMinimumDelegation" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getStakeMinimumDelegation RPC Method ## Description Returns the stake minimum delegation in lamports. ## Parameters 1. `object` (array, optional) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `recent` - The node will query the minimum delegation commitment status for recent transactions. * `single` - The node will query the minimum delegation commitment status for a single transaction. * `singleGossip` - The node will query the minimum delegation commitment status for a single transaction via gossip. * `root` - The node will query the minimum delegation commitment status at the root. * `max` - The node will query the maximum commitment status for minimum delegation. ## Returns * `result` - An object with the following field: * `value` - The stake minimum delegation in lamports, encoded as a u64 (64-bit unsigned integer). ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getStakeMinimumDelegation","params":[]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getStakeMinimumDelegation()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const stakeMinimumDelegation = await solanaRpc.getStakeMinimumDelegation().send(); console.log("Stake Minimum Delegation:", stakeMinimumDelegation); } catch (error) { console.error("Error fetching stake minimum delegation:", error); } })(); ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getStakeMinimumDelegation", "params": [] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getStakeMinimumDelegation", "params": [] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getSupply.mdx meta: { "title": "getSupply", "description": "Returns information about the current supply.", "sidebar_label": "getSupply" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getSupply RPC Method ## Description Returns information about the current supply. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `circulating` - The total circulating supply of SOL tokens, encoded as u64 integer * `nonCirculating` - The total non-circulating supply of SOL tokens, encoded as u64 integer * `nonCirculatingAccounts` - An array containing the public keys (addresses) of accounts holding non-circulating tokens * `total` - The total amount of SOL tokens ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getSupply"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getSupply()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const supply = await solanaRpc.getSupply().send(); console.log(supply); } catch (error) { console.error("Error fetching supply:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_supply()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getSupply" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getSupply" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getTokenAccountBalance.mdx meta: { "title": "getTokenAccountBalance", "description": "Returns the token balance of an SPL Token account.", "sidebar_label": "getTokenAccountBalance" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTokenAccountBalance RPC Method ## Description Returns the token balance of an SPL Token account. ## Parameters 1. `pubkey` (string) - The Pubkey of the SPL Token account to query, encoded as a base-58 string. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. ## Returns * `result` - An object with the following fields: * `context` - Information about the current state of the program: * `apiVersion` - The version of the Solana RPC API to use. * `slot` - An integer representing the slot for which the data is retrieved. * `value` - A JSON object with the following fields: * `amount` - The raw total token supply without decimals, a string representation of a u64 integer. * `decimals` - An integer value representing the number of decimal places used by the token. * `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED). * `uiAmountString` - The total token supply as a string using mint-prescribed decimals. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenAccountBalance", "params": ["DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getTokenAccountBalance( new web3.PublicKey("DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN") ) ); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const publicKey = address("DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN"); try { const tokenAccountBalance = await solanaRpc.getTokenAccountBalance(publicKey).send(); console.log(tokenAccountBalance); } catch (error) { console.error("Error fetching token account balance:", error); } })(); ``` ```python import base58 from solana.rpc.api import Client from solders.pubkey import Pubkey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") encoded_pubkey = "DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN" decoded_pubkey = base58.b58decode(encoded_pubkey) print(len(decoded_pubkey)) # 32 bytes address = Pubkey(decoded_pubkey) print(solana_client.get_token_account_balance(address)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountBalance", "params": [ "DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountBalance", "params": [ "DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getTokenAccountsByDelegate.mdx meta: { "title": "getTokenAccountsByDelegate", "description": "Returns all SPL Token accounts by approved Delegate.", "sidebar_label": "getTokenAccountsByDelegate" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTokenAccountsByDelegate RPC Method ## Description Returns all SPL Token accounts by approved Delegate. ## Parameters 1. `pubkey` (string) - The Pubkey of account delegate to query encoded as base-58 string 2. `object` (array) - The JSON object with the following fields: * `mint` (string) - The Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string * `programId` (string) - The Pubkey of the Token program ID that owns the accounts, as base-58 encoded string 3. `object` (array) - The JSON object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `encoding` (string) - The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed * `dataSlice` (string, optional) - The returned account data using the provided offset: 'usize' and length: 'usize' fields; only available for base58, base64, or base64+zstd encodings * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `account` - An address on the Solana blockchain that is used to store assets * `data` - A string containing the encoded data to be passed to the instruction * `program` - The program that manages the token * `parsed` - An array of parsed instructions that were executed in the block's transactions * `info` - An array of information objects that provide additional details about the transactions in the block * `tokenAmount` - The balance of the token in the token account * `delegate` - The public address of the delegate from which the account tokens are to be retrieved encoded as base-58 string * `delegateAmount` - The configuration object with the following fields * `isNative` - A boolean value indicating whether the token is a native token of the Solana blockchain * `mint` - Provides information about the creation of new tokens * `owner` - The base-58 encoded Pubkey of the program this account has been assigned to * `state` - The current state of the token account * `pubkey` - The public key associated with the token account ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getTokenAccountsByDelegate","params": ["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",{"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding": "jsonParsed"}]}' ``` ```javascript // not currently supported by solanaJS const axios = require("axios"); (() => { const config = { headers: { "Content-Type": "application/json", }, }; const data = { jsonrpc: "2.0", id: 1, method: "getTokenAccountsByDelegate", params: [ "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", { programId: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", }, { encoding: "jsonParsed", }, ], }; axios .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", data, config) .then(function (response) { // handle success console.log(response.data); }) .catch((err) => { // handle error console.log(err); }); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const delegateAddress = address("4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T"); const programId = address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"); try { const tokenAccounts = await solanaRpc.getTokenAccountsByDelegate( delegateAddress, { programId: programId }, { encoding: "jsonParsed" } ).send(); console.log(tokenAccounts); } catch (error) { console.error("Error fetching token accounts by delegate:", error); } })(); ``` ```python from solana.rpc.api import Client from solana.publickey import PublicKey from solana.rpc.types import TokenAccountOpts solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") pub_key = PublicKey("4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T") token_acc = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" print(solana_client.get_token_accounts_by_delegate(pub_key,TokenAccountOpts(program_id=token_acc))) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByDelegate", "params": [ "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", { "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "encoding": "jsonParsed" } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByDelegate", "params": [ "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", { "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "encoding": "jsonParsed" } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getTokenAccountsByOwner.mdx meta: { "title": "getTokenAccountsByOwner", "description": "Returns all SPL Token accounts by token owner.", "sidebar_label": "getTokenAccountsByOwner" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTokenAccountsByOwner RPC Method ## Description Returns all SPL Token accounts by token owner. ## Parameters 1. `pubkey` (string) - The Pubkey of account delegate to query encoded as base-58 string 2. `object` (array) - The JSON object with the following fields: (Either 'mint' or 'programId' can be used at a time) * `mint` (string) - The Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string * `programId` (string) - The Pubkey of the Token program ID that owns the accounts, as base-58 encoded string 3. `object` (array) - The JSON object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `encoding` (string) - The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed * `dataSlice` (string, optional) - The returned account data using the provided offset: 'usize' and length: 'usize' fields; only available for base58, base64, or base64+zstd encodings * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `account` - An address on the Solana blockchain that is used to store assets * `data` - A string containing the encoded data to be passed to the instruction * `parsed` - An array of parsed instructions that were executed in the block's transactions * `info` - An array of information objects that provide additional details about the transactions in the block * `isNative` - A boolean value indicating whether the token is a native token of the Solana blockchain * `mint` - Provides information about the creation of new tokens * `owner` - The base-58 encoded Pubkey of the program this account has been assigned to * `state` - The current state of the token account * `tokenAmount` - The balance of the token in the token account * `amount` - The raw total token supply without decimals, a string representation of a u64 integer * `decimals` - An integer value representing the number of decimal places used by the token * `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED) * `uiAmountString` - The total token supply as a string using mint-prescribed decimals * `program` - The program that manages the token * `space` - The amount of storage space required to store the token account * `executable` - A boolean indicating if the account contains a program (and is strictly read-only) * `lamports` - The number of lamports assigned to this account as u64 (64-bit unsigned integer) * `owner` - The base-58 encoded Pubkey of the program this account has been assigned to * `rentEpoch` - The epoch at which the token account's storage will be subject to rent * `space` - The amount of storage space required to store the token account * `pubkey` - The public key associated with the token account ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getTokenAccountsByOwner","params": ["GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa",{"mint": "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"},{"encoding": "jsonParsed"}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const accountPublicKey = new web3.PublicKey( "GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa" ); const mintAccount = new web3.PublicKey( "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" ); console.log( await solana.getTokenAccountsByOwner(accountPublicKey, { mint: mintAccount, }) ); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const ownerPublicKey = address("GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa"); const mintAccount = address("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"); try { const tokenAccounts = await solanaRpc.getTokenAccountsByOwner( ownerPublicKey, { mint: mintAccount }, { encoding: "jsonParsed" } ).send(); console.log(tokenAccounts); } catch (error) { console.error("Error fetching token accounts by owner:", error); } })(); ``` ```python from solana.rpc.api import Client from solana.publickey import PublicKey from solana.rpc.types import TokenAccountOpts solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") pub_key = PublicKey("GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa") mint_account = "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" print(solana_client.get_token_accounts_by_owner(pub_key,TokenAccountOpts(mint=mint_account))) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByOwner", "params": [ "GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa", { "mint": "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" }, { "encoding": "jsonParsed" } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByOwner", "params": [ "GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa", { "mint": "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" }, { "encoding": "jsonParsed" } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getTokenLargestAccounts.mdx meta: { "title": "getTokenLargestAccounts", "description": "Returns the 20 largest accounts of a particular SPL Token type.", "sidebar_label": "getTokenLargestAccounts" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTokenLargestAccounts RPC Method Please note that, in addition to the plan-level rate limits, the getTokenLargestAccounts method has a specific rate limit of 50 requests per second. This limit may change without notice to ensure system stability. For high-demand use cases, please reach out to discuss potential solutions. ## Description Returns the 20 largest accounts of a particular SPL Token type. ## Parameters 1. `pubkey` (string) - The Pubkey of token Mint to query encoded as base-58 string 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete ## Returns An object with the following fields: * `context` - The information about the current state of the program * `apiVersion` - The version of the Solana RPC API to use * `slot` - An integer representing the slot for which to retrieve the fee calculator * `value` - A JSON object with the following fields: * `address` - The address of the token account * `amount` - The raw total token supply without decimals, a string representation of a u64 integer * `decimals` - An integer value representing the number of decimal places used by the token * `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED) * `uiAmountString` - The total token supply as a string using mint-prescribed decimals ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenLargestAccounts", "params": ["1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const url = "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"; const solana = new web3.Connection(url); console.log( await solana.getTokenLargestAccounts( new web3.PublicKey("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE") ) ); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const mintAccount = address("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"); try { const largestAccounts = await solanaRpc.getTokenLargestAccounts(mintAccount).send(); console.log(largestAccounts); } catch (error) { console.error("Error fetching token largest accounts:", error); } })(); ``` ```python import base58 from solana.rpc.api import Client from solders.pubkey import Pubkey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") encoded_pubkey = "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" decoded_pubkey = base58.b58decode(encoded_pubkey) print(len(decoded_pubkey)) #32 bytes address = Pubkey(decoded_pubkey) print(solana_client.get_token_largest_accounts(address)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": [ "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": [ "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getTokenSupply.mdx meta: { "title": "getTokenSupply", "description": "Returns the total supply of an SPL Token type.", "sidebar_label": "getTokenSupply" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTokenSupply RPC Method ## Description Returns the total supply of an SPL Token type. ## Parameters 1. `pubkey` (string) - The Pubkey of the SPL Token mint to query, encoded as a base-58 string. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. ## Returns * `result` - An object with the following fields: * `context` - Information about the current state of the program: * `apiVersion` - The version of the Solana RPC API to use. * `slot` - An integer representing the slot for which the data is retrieved. * `value` - A JSON object with the following fields: * `amount` - The raw total token supply without decimals, a string representation of a u64 integer. * `decimals` - An integer value representing the number of decimal places used by the token. * `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED). * `uiAmountString` - The total token supply as a string using mint-prescribed decimals. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenSupply", "params": ["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getTokenSupply( new web3.PublicKey("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU") ) ); })(); ``` ```javascript import { createSolanaRpc, address } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const mintAccount = address("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"); try { const tokenSupply = await solanaRpc.getTokenSupply(mintAccount).send(); console.log(tokenSupply); } catch (error) { console.error("Error fetching token supply:", error); } })(); ``` ```python from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE", json=request("getTokenSupply", params=["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"])) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenSupply", "params": [ "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenSupply", "params": [ "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/getTransaction.mdx meta: { "title": "getTransaction", "description": "Returns transaction details for a confirmed transaction.", "sidebar_label": "getTransaction" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTransaction RPC Method ## Description Returns transaction details for a confirmed transaction. ## Parameters 1. `tx_sig` (string) - The transaction signature as base-58 encoded string 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `maxSupportedTransactionVersion` (integer, optional) - The maximum transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt an error ## Returns Returns null if the specified block is not confirmed, otherwise RpcResponse JSON object with the following fields: * `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). It's null if not available * `meta` - The transaction status metadata object, which contains additional information about the block and its transactions. The meta object can be null, or it may contain the following fields: * `err` - Error code if the transaction failed or null if the transaction succeeds * `fee` - The total fees paid by all transactions in the block encoded as u64 integer * `innerInstructions` - An array of objects representing the inner instructions of all transactions in the block (omitted if inner instruction recording is not enabled) * `logMessages` - An array of strings containing any log messages generated by the block's transactions (omitted if inner instruction recording is not enabled) * `postBalances` - An array of lamport balances for each account in the block after the transactions were processed * `postTokenBalances` - An array of token balances for each token account in the block after the transactions were processed * `preBalances` - An array of lamport balances for each account in the block before the transactions were processed * `preTokenBalances` - An array of token balances for each token account in the block before the transactions were processed * `rewards` - An object containing information about the rewards earned by the block's validators (only present if the rewards are requested) * `status` - The status of the transaction. If the transaction was successful, returns Ok and if the transaction failed with TransactionError, returns Err * `slot` - The slot number to retrieve block production information * `transaction` - The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter * `version` - The transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log( await solana.getTransaction( "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff", { maxSupportedTransactionVersion: 0 } ) ); })(); ``` ```javascript import { createSolanaRpc, signature } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const txSignature = signature("D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"); try { const transaction = await solanaRpc.getTransaction(txSignature, { maxSupportedTransactionVersion: 0, }).send(); console.log(transaction); } catch (error) { console.error("Error fetching transaction:", error); } })(); ``` ```python from solana.rpc.api import Client from solders.signature import Signature solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") sig = Signature.from_string("D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff") print(solana_client.get_transaction(sig, "jsonParsed", max_supported_transaction_version=0)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": [ "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff", { "encoding": "jsonParsed", "maxSupportedTransactionVersion": 0 } ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": [ "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff", { "encoding": "jsonParsed", "maxSupportedTransactionVersion": 0 } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getTransactionCount.mdx meta: { "title": "getTransactionCount", "description": "Returns the current transaction count from the ledger.", "sidebar_label": "getTransactionCount" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getTransactionCount RPC Method ## Description Returns the current transaction count from the ledger. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns Returns the current transaction count from the ledger. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getTransactionCount()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const transactionCount = await solanaRpc.getTransactionCount().send(); console.log(transactionCount); } catch (error) { console.error("Error fetching transaction count:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_transaction_count()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTransactionCount" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTransactionCount" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getVersion.mdx meta: { "title": "getVersion", "description": "Returns the current solana version running on the node.", "sidebar_label": "getVersion" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getVersion RPC Method ## Description Returns the current solana version running on the node. ## Parameters None ## Returns A JSON object with the following fields: * `solana-core` - The software version of solana-core * `feature-set` - The unique identifier of the current software's feature set ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getVersion"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getVersion()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const version = await solanaRpc.getVersion().send(); console.log(version); } catch (error) { console.error("Error fetching version:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_version()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getVersion" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getVersion" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/getVoteAccounts.mdx meta: { "title": "getVoteAccounts", "description": "Returns the account info and associated stake for all the voting accounts in the current bank.", "sidebar_label": "getVoteAccounts" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # getVoteAccounts RPC Method ## Description Returns the account info and associated stake for all the voting accounts in the current bank. ## Parameters 1. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `votePubkey` (string, optional) - Only return results for this validator vote address (base-58 encoded) * `keepUnstakedDelinquents` (boolean, optional) - The boolean value that determines whether or not to filter out delinquent validators with no stake * `delinquentSlotDistance` (u64, optional) - Specify the number of slots behind the tip that a validator must fall to be considered delinquent. The parameter is passed as an integer and it's not recommended to specify this argument ## Returns A JSON object of current and delinquent accounts, each containing an array of JSON objects with the following fields: * `current` - The current account with the following fields: * `activatedStake` - The stake, in lamports, delegated to this vote account and active in this epoch. Represented as an u64 integer * `commission` - The percentage (0-100) of rewards payout owed to the vote account * `epochCredits` - The latest history of earned credits for up to five epochs, as an array of arrays containing: epoch, credits, previousCredits * `epochVoteAccount` - Boolean value, whether the vote account is staked for this epoch * `lastVote` - Most recent slot voted on by this vote account * `nodePubkey` - The validator identity as base-58 encoded string * `rootSlot` - The current root slot for this vote account * `votePubkey` - The vote account address as base-58 encoded string * `delinquent` - The delinquent account with the following fields: * `activatedStake` - The stake, in lamports, delegated to this vote account and active in this epoch. Represented as an u64 integer * `commission` - The percentage (0-100) of rewards payout owed to the vote account * `epochCredits` - The latest history of earned credits for up to five epochs, as an array of arrays containing: epoch, credits, previousCredits * `epochVoteAccount` - Boolean value, whether the vote account is staked for this epoch * `lastVote` - Most recent slot voted on by this vote account * `nodePubkey` - The validator identity as base-58 encoded string * `rootSlot` - The current root slot for this vote account * `votePubkey` - The vote account address as base-58 encoded string ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getVoteAccounts()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const voteAccounts = await solanaRpc.getVoteAccounts().send(); console.log(voteAccounts); } catch (error) { console.error("Error fetching vote accounts:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_vote_accounts()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getVoteAccounts" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getVoteAccounts" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/isBlockhashValid.mdx meta: { "title": "isBlockhashValid", "description": "Returns whether a blockhash is still valid or not", "sidebar_label": "isBlockhashValid" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # isBlockhashValid RPC Method ## Description Returns whether a blockhash is still valid or not. ## Parameters 1. `blockhash` (string) - The hash of the block, encoded as a base-58 string. Required. 2. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated. ## Returns * `result` - A boolean: `true` if the blockhash is still valid, `false` otherwise. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ -d '{"id":45,"jsonrpc":"2.0","method":"isBlockhashValid","params":["ENTER_BLOCKHASH_ID_HERE",{"commitment":"processed"}]}' ``` ```javascript import { createSolanaRpc, blockhash } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const blockHash = blockhash("EPnQzurHhxLXGtk73B5zvWaRoGpkzd5tU9ZGVAULbQoJ"); try { const isValid = await solanaRpc.isBlockhashValid(blockHash, { commitment: "processed" }).send(); console.log("Is blockhash valid:", isValid); } catch (error) { console.error("Error checking blockhash validity:", error); } })(); ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "id": 45, "jsonrpc": "2.0", "method": "isBlockhashValid", "params": [ "ENTER_BLOCKHASH_ID_HERE", { "commitment": "processed" } ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/minimumLedgerSlot.mdx meta: { "title": "minimumLedgerSlot", "description": "Returns the lowest slot that the node has information of in its ledger.", "sidebar_label": "minimumLedgerSlot" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # minimumLedgerSlot RPC Method ## Description Returns the lowest slot that the node has information of in its ledger. ## Parameters None ## Returns `u64` - The lowest slot that the node has information of. This number may increase over time if the node is purging older ledger data ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"minimumLedgerSlot","params":[],"id":1,"jsonrpc":"2.0"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log(await solana.getMinimumLedgerSlot()); })(); ``` ```javascript import { createSolanaRpc } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); try { const minimumLedgerSlot = await solanaRpc.minimumLedgerSlot().send(); console.log("Minimum Ledger Slot:", minimumLedgerSlot); } catch (error) { console.error("Error fetching minimum ledger slot:", error); } })(); ``` ```python from solana.rpc.api import Client solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.get_minimum_ledger_slot()) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "minimumLedgerSlot", "params": [], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "method": "minimumLedgerSlot", "params": [], "id": 1, "jsonrpc": "2.0" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/requestAirdrop.mdx meta: { "title": "requestAirdrop", "description": "Requests an airdrop of lamports to a Pubkey (does not work on mainnet-beta).", "sidebar_label": "requestAirdrop" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # requestAirdrop RPC Method ## Description Requests an airdrop of lamports to a Pubkey (does not work on mainnet-beta). Please note that the Airdrop method is subject to limits set by Solana. ## Parameters 1. `pubkey` (string) - The Pubkey of the account to receive lamports, encoded as a base-58 string. 2. `lamports` (integer) - The number of lamports to airdrop, encoded as a u64. 3. `object` (array) - The configuration object with the following fields: * `commitment` (string, optional) - The level of commitment required for the query. Options: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster. * `processed` - The node will query its most recent block. Note that the block may not be complete. ## Returns * `result` - The transaction signature of the airdrop, encoded as a base-58 string. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"requestAirdrop", "params": ["YOUR_WALLET_ADDRESS", 1000000000]}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const url = "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"; const solana = new web3.Connection(url); console.log( await solana.requestAirdrop( new web3.PublicKey("YOUR_WALLET_ADDRESS"), 1000000000 ) ); })(); ``` ```javascript import { createSolanaRpc, address, lamports } from "@solana/web3.js"; (async () => { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); const walletAddress = address("YOUR_WALLET_ADDRESS"); const airdropAmount = lamports(BigInt(1_000_000_000)); try { const airdropSignature = await solanaRpc.requestAirdrop(walletAddress, airdropAmount).send(); console.log(airdropSignature); } catch (error) { console.error("Error requesting airdrop:", error); } })(); ``` ```python from solana.rpc.api import Client from solana.publickey import PublicKey solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") print(solana_client.request_airdrop(PublicKey("YOUR_WALLET_ADDRESS"), 1000000000)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "requestAirdrop", "params": [ "YOUR_WALLET_ADDRESS", 1000000000 ] }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "requestAirdrop", "params": [ "YOUR_WALLET_ADDRESS", 1000000000 ] } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` file: ./content/solana-rpc/methods/sendTransaction.mdx meta: { "title": "sendTransaction", "description": "Submits a signed transaction to the cluster for processing.", "sidebar_label": "sendTransaction" } import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # sendTransaction RPC Method ## Description Submits a signed transaction to the cluster for processing. ## Parameters 1. `transaction` (string) - The transaction as an encoded string. 2. `object` (array) - The configuration object with the following fields: * `skipPreflight` (boolean) - (default: false) If true, skip the preflight transaction checks * `preflightCommitment` (string) - (default: finalized) The commitment level to use for preflight * `encoding` (string) - The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed * `maxRetries` (usize, optional) - The maximum number of times for the RPC node to retry sending the transaction to the leader. If this parameter is not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated ## Returns The First Transaction Signature embedded in the transaction, as base-58 encoded string (transaction id) ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"sendTransaction","params":["ENTER_ENCODED_TRANSACTION_ID"],"id":1,"jsonrpc":"2.0"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); // Replace fromWallet with your public/secret keypair, wallet must have funds to pay transaction fees. const fromWallet = web3.Keypair.generate(); const toWallet = web3.Keypair.generate(); const transaction = new web3.Transaction().add( web3.SystemProgram.transfer({ fromPubkey: fromWallet.publicKey, toPubkey: toWallet.publicKey, lamports: web3.LAMPORTS_PER_SOL / 100, }) ); console.log(await solana.sendTransaction(transaction, [fromWallet])); })(); ``` ```javascript import { createSolanaRpc, generateKeyPairSigner, lamports, sendAndConfirmTransactionFactory, pipe, createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstruction, signTransactionMessageWithSigners, getSignatureFromTransaction, } from "@solana/web3.js"; import { getTransferSolInstruction } from "@solana-program/system"; const LAMPORTS_PER_SOL = BigInt(1_000_000_000); (async () => { try { const rpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); // 2 - Generate signers const user1 = await generateKeyPairSigner(); console.log(`βœ… - New user1 address created: ${user1.address}`); const user2 = await generateKeyPairSigner(); console.log(`βœ… - New user2 address created: ${user2.address}`); // 3 - Airdrop SOL to user1 const airdropTx = await rpc.requestAirdrop( user1.address, lamports(LAMPORTS_PER_SOL), { commitment: 'processed' } ).send(); console.log(`βœ… - Airdropped 1 SOL to user1. Transaction: ${airdropTx}`); // 4 - Create transfer transaction const { value: latestBlockhash } = await rpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), tx => setTransactionMessageFeePayer(user1.address, tx), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => appendTransactionMessageInstruction( getTransferSolInstruction({ amount: lamports(LAMPORTS_PER_SOL / BigInt(2)), destination: user2.address, source: user1, }), tx ) ); // 5 - Sign and send transaction const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions }); await sendAndConfirmTransaction( signedTransaction, { commitment: 'confirmed', skipPreflight: true } ); const signature = getSignatureFromTransaction(signedTransaction); console.log(`βœ… - Transfer transaction signature: ${signature}`); } catch (error) { console.error('Error occurred:', error); } })(); ``` ```python from solana.rpc.api import Client from solana.account import Account from solana.system_program import TransferParams, transfer from solana.transaction import Transaction #Make sure to paste sender, reciever addresses and public key. solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") sender, reciever = Account(1), Account(2) json_request = solana_client.get_recent_blockhash() recent_blockhash = json_request["result"]["value"]["blockhash"] txn = Transaction(fee_payer=sender.public_key(), recent_blockhash=recent_blockhash) txn.add( transfer( TransferParams( from_pubkey=sender.public_key(), to_pubkey=reciever.public_key(), lamports=1000 ) ) ) txn.sign(sender) print(solana_client.send_transaction(txn, sender)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "sendTransaction", "params": [ "ENTER_ENCODED_TRANSACTION_ID" ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "method": "sendTransaction", "params": [ "ENTER_ENCODED_TRANSACTION_ID" ], "id": 1, "jsonrpc": "2.0" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ``` file: ./content/solana-rpc/methods/simulateTransaction.mdx meta: { "title": "simulateTransaction", "description": "Simulate sending a transaction.", "sidebar_label": "simulateTransaction" } import { Tab, Tabs } from "fumadocs-ui/components/tabs"; # simulateTransaction RPC Method ## Description Simulate sending a transaction. ## Parameters 1. `transaction` (string) - The transaction as an encoded string. The transaction must have a valid blockhash, but is not required to be signed 2. `object` (array) - The configuration object with the following fields: * `commitment` (string) - (default: finalized) The level of commitment required for the query. The options include: * `finalized` - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized * `confirmed` - The node will query the most recent block that has been voted on by the supermajority of the cluster * `processed` - The node will query its most recent block. Note that the block may not be complete * `sigVerify` (boolean) - (default: false) If true, the transaction signatures will be verified (conflicts with replaceRecentBlockhash) * `replaceRecentBlockhash` (boolean) - (default: false) If true, the transaction recent blockhash will be replaced with the most recent blockhash (conflicts with sigVerify) * `encoding` (string) - (default: base58) The encoding format for account data. It can be either base58 (slow, DEPRECATED) or base64 * `minContextSlot` (integer, optional) - The minimum slot at which the request can be evaluated * `innerInstructions` (boolean) - (default: false) If true the response will include inner instructions. These inner instructions will be jsonParsed where possible, otherwise json. * `accounts` (object, optional) - The accounts configuration object containing the following fields: * `addresses` (string, optional) - An array of accounts to return, as base-58 encoded strings * `encoding` (string) - The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed ## Returns Returns null if the account doesn't exist, otherwise an RpcResponse JSON object with the following fields: * `context` - An object that contains metadata about the current state of the Solana network at the time the request was processed * `apiVersion` - The version number * `slot` - The current slot in the Solana cluster during which the transactions are processed and new blocks are added to the blockchain * `err` - Error code if the transaction failed or null if the transaction succeeds * `logs` - An array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure) * `accounts` - An array of accounts with the same length as the accounts.addresses array in the request * `null` - If the account doesn't exist or if err is not null * `object` - otherwise, a JSON object containing: * `lamports` - The number of lamports assigned to this account as u64 (64-bit unsigned integer) * `owner` - The base-58 encoded Pubkey of the program this account has been assigned to * `data` - The data associated with the account, either as encoded binary data or JSON format `{'program': 'state'}`, depending on encoding parameter * `executable` - A boolean indicating if the account contains a program (and is strictly read-only) * `rentEpoch` - The epoch at which this account will next owe rent, as u64 (64-bit unsigned integer) * `unitsConsumed` - The number of compute budget units consumed during the processing of this transaction * `returnData` - The most-recent return data generated by an instruction in the transaction, with the following fields: * `programId` (string) - The program that generated the return data, as base-58 encoded Pubkey * `data` - The return data itself, as base-64 encoded binary data * `innerInstructions` - The value is a list of inner instructions. ## Code Examples ```bash curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"simulateTransaction","params":["ENTER_ENCODED_TRANSACTION_ID"],"id":1,"jsonrpc":"2.0"}' ``` ```javascript const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); // Replace with your public/secret keypair, wallet must have funds to pay transaction fees. const fromWallet = web3.Keypair.generate(); const toWallet = web3.Keypair.generate(); const transaction = new web3.Transaction().add( web3.SystemProgram.transfer({ fromPubkey: fromWallet.publicKey, toPubkey: toWallet.publicKey, lamports: web3.LAMPORTS_PER_SOL / 100, }) ); console.log(await solana.simulateTransaction(transaction, [fromWallet])); })(); ``` ```javascript import { createSolanaRpc, generateKeyPairSigner, lamports, pipe, createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstruction, signTransactionMessageWithSigners, } from "@solana/web3.js"; import { getTransferSolInstruction } from "@solana-program/system"; const LAMPORTS_PER_SOL = BigInt(1_000_000_000); (async () => { try { const solanaRpc = createSolanaRpc("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE"); console.log("βœ… - Connected to Solana mainnet"); const fromWallet = await generateKeyPairSigner(); const toWallet = await generateKeyPairSigner(); const { value: latestBlockhash } = await solanaRpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), tx => setTransactionMessageFeePayer(fromWallet.address, tx), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => appendTransactionMessageInstruction( getTransferSolInstruction({ amount: lamports(LAMPORTS_PER_SOL / BigInt(100)), destination: toWallet.address, source: fromWallet, }), tx ) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); const simulateResult = await solanaRpc.simulateTransaction(signedTransaction).send(); console.log('Simulate Transaction Result:', simulateResult); } catch (error) { console.error('Error occurred:', error); } })(); ``` ```python from solana.rpc.api import Client from solana.account import Account from solana.system_program import TransferParams, transfer from solana.transaction import Transaction #Make sure to paste sender, reciever addresses and public key. solana_client = Client("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") sender, reciever = Account(1), Account(2) json_request = solana_client.get_recent_blockhash() recent_blockhash = json_request["result"]["value"]["blockhash"] txn = Transaction(fee_payer=sender.public_key(), recent_blockhash=recent_blockhash) txn.add( transfer( TransferParams( from_pubkey=sender.public_key(), to_pubkey=reciever.public_key(), lamports=1000 ) ) ) txn.sign(sender) print(solana_client.simulate_transaction(txn)) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "simulateTransaction", "params": [ "ENTER_ENCODED_TRANSACTION_ID" ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body ``` ```rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "method": "simulateTransaction", "params": [ "ENTER_ENCODED_TRANSACTION_ID" ], "id": 1, "jsonrpc": "2.0" } "#; let response = client .post("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` ``` ```