Code examples for integrating UltraSearch RPC API into your Solana applications
UltraSearch Examples is a comprehensive collection of code examples demonstrating how to use the UltraSearch RPC API for searching and filtering Solana blockchain transactions. Whether you're building a DeFi dashboard, analyzing on-chain data, or tracking specific wallet activities, these examples will help you get started quickly.
UltraSearch is a high-performance Solana RPC API that enables developers to search and filter blockchain transactions with precision. Unlike traditional RPC methods, UltraSearch provides:
- Flexible Filtering: Search by accounts, block ranges, transaction status
- High Performance: Optimized queries for fast data retrieval
- Developer-Friendly: Simple JSON-RPC interface with TypeScript support
- π Transaction Search: Find transactions by account addresses, block ranges, and more
- π Flexible Filtering: Include, exclude, or require specific accounts in search results
- π― Sorting & Pagination: Control result order and efficiently paginate through large datasets
- π¦ TypeScript Support: Fully typed interfaces and enums for type-safe development
- π Real-World Examples: Production-ready code snippets for common use cases
- π Comprehensive Documentation: Detailed guides and API references
- Node.js 16+ and npm/yarn
- Basic knowledge of TypeScript and Solana blockchain
- UltraSearch API key (Get yours here)
# Clone the repository
git clone https://github.com/Shyft-to/ultrasearch-examples.git
cd ultrasearch-examples
# Navigate to TypeScript examples
cd examples/typescript
# Install dependencies
npm install
# Run examples
npm run startimport axios from "axios";
import { SearchTransactionsRpcRequest } from "./types";
const RPC_URL = "https://rpc.shyft.to?api_key=YOUR_API_KEY";
async function fetchLatestTransactions() {
const request: SearchTransactionsRpcRequest = {
jsonrpc: "2.0",
id: 1,
method: "searchTransactions",
params: {
transactionDetails: "full",
limit: 10
}
};
const response = await axios.post(RPC_URL, request);
console.log(response.data.result);
}Our example collection covers common use cases for blockchain data retrieval:
| Example | Description | Use Case |
|---|---|---|
| Basic Search | Fetch latest transaction signatures | Getting started, recent activity |
| Full Transactions | Retrieve complete transaction data | Detailed analysis, audit logs |
| Pagination | Handle large result sets efficiently | Data exports, batch processing |
- Token Transfer Tracker
- DeFi Transaction Dashboard
- Monitoring Pump.fun Trading Activity
The searchTransactions method accepts the following parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
accountInclude |
string[] |
Include transactions involving any of these accounts | undefined |
accountExclude |
string[] |
Exclude transactions involving these accounts | undefined |
accountRequired |
string[] |
Only include transactions with ALL these accounts | undefined |
fromBlock |
number |
Starting block number (inclusive). Must be paired with toBlock β providing only one is an error. When both are omitted a default 5000-block window is used. |
See note |
toBlock |
number |
Ending block number (inclusive). Must be paired with fromBlock β providing only one is an error. When both are omitted a default 5000-block window is used. |
See note |
vote |
boolean |
Include/exclude vote transactions | undefined |
failed |
boolean |
Include/exclude failed transactions | undefined |
sort |
"ASC" | "DESC" |
Sort order by slot number | "DESC" |
limit |
number |
Maximum results per request | 1000 (signatures), 100 (full) |
paginationToken |
string |
Token for fetching next page | undefined |
transactionDetails |
"signatures" | "full" |
Level of detail in response | "signatures" |
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [...],
"paginationToken": "394941095:1232" // null if no more pages
}
}Block range default behavior (when fromBlock/toBlock are both omitted):
| Condition | sort: "DESC" (default) |
sort: "ASC" |
|---|---|---|
No paginationToken |
Last 5000 blocks | First indexed block β +5000 |
With paginationToken |
paginationToken slot β 5000 β slot |
paginationToken slot β slot + 5000 |
View Full API Documentation β
We welcome contributions! Whether it's:
- π Bug fixes
- β¨ New examples
- π Documentation improvements
- π‘ Feature suggestions
Please read our Contributing Guide to get started.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-example) - Commit your changes (
git commit -m 'Add amazing example') - Push to the branch (
git push origin feature/amazing-example) - Open a Pull Request
- π Documentation
- π¬ Discord Community
- π¦ π
- π§ Email: genesis@shyft.to
Q: How do I get an API key? A: Visit shyft.to and sign up for a trial/paid plan.
Q: What are the rate limits? A: Rate limits depend on your subscription tier. Check your dashboard for details.
Q: Can I use this in production? A: Yes! These examples are production-ready. Just ensure you follow security best practices.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with TypeScript
- Powered by Shyft
- Inspired by the Solana developer community
Made with β€οΈ by the Solana community