tx-indexer 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.0] - 2025-01-09
9
+
10
+ ### Added
11
+
12
+ - **RPC Request Profiler**: Test utility to measure HTTP requests during SDK operations
13
+ - Run with: `RPC_URL=<url> PROFILE_WALLET=<addr> bun test rpc-profiler`
14
+
15
+ - **RPC Optimization Options**: New options for rate-limited RPC environments
16
+ - `overfetchMultiplier` - Controls signature overfetch (default: 2, use 1 for strict rate limits)
17
+ - `minPageSize` - Minimum page size for fetching (default: 20)
18
+ - `maxTokenAccounts` - Limit ATA queries (default: 5)
19
+
20
+ ### Changed
21
+
22
+ - **Token Account Fetching**: Optimized signature retrieval
23
+ - Sequential wallet → ATA fetching to avoid rate limit errors
24
+ - Only fetch ATAs when wallet signatures aren't sufficient
25
+ - Parallel fetching of wallet and token account signatures where safe
26
+
27
+ - **Performance Improvements**: Significantly reduced RPC calls for rate-limited environments
28
+ - Load time improvements from ~105s to ~7s in constrained environments
29
+ - Disabled JSON-RPC batching (not supported on most free tier RPCs)
30
+
31
+ ### Fixed
32
+
33
+ - Rate limit handling for Helius free tier (10 req/sec) and similar constrained RPCs
34
+
8
35
  ## [1.0.0] - 2025-01-09
9
36
 
10
37
  ### Added
package/README.md CHANGED
@@ -150,6 +150,30 @@ const txs = await indexer.getTransactions(address, {
150
150
  });
151
151
  ```
152
152
 
153
+ ## RPC Optimization
154
+
155
+ For rate-limited RPCs (like Helius free tier at 10 req/sec), the SDK provides optimization options to reduce RPC calls:
156
+
157
+ ```typescript
158
+ const indexer = createIndexer({
159
+ rpcUrl: "https://api.mainnet-beta.solana.com",
160
+ // Optimization options for rate-limited environments
161
+ overfetchMultiplier: 1, // Default: 2, reduces signature overfetch
162
+ minPageSize: 10, // Default: 20, matches page size to your limit
163
+ maxTokenAccounts: 3, // Default: 5, limits ATA queries
164
+ });
165
+ ```
166
+
167
+ **Options:**
168
+
169
+ | Option | Default | Description |
170
+ | --------------------- | ------- | ------------------------------------------------ |
171
+ | `overfetchMultiplier` | `2` | Multiplier for signature overfetch (1 = minimal) |
172
+ | `minPageSize` | `20` | Minimum page size for RPC calls |
173
+ | `maxTokenAccounts` | `5` | Maximum token accounts to query for signatures |
174
+
175
+ These optimizations can reduce load time from ~105s to ~7s in rate-limited environments.
176
+
153
177
  ## Transaction Schema
154
178
 
155
179
  A `ClassifiedTransaction` has three parts:
package/STABILITY.md CHANGED
@@ -23,6 +23,7 @@ APIs in this tier are production-ready and follow semantic versioning strictly:
23
23
  - All core types (`ClassifiedTransaction`, `RawTransaction`, `TxLeg`, etc.)
24
24
  - JSON serialization helpers (`toJsonClassifiedTransaction`, etc.)
25
25
  - Token registry (`getTokenInfo`, `KNOWN_TOKENS`, etc.)
26
+ - RPC optimization options (`overfetchMultiplier`, `minPageSize`, `maxTokenAccounts`)
26
27
 
27
28
  ### Advanced (`tx-indexer/advanced`)
28
29
 
@@ -78,7 +79,8 @@ When we deprecate an API:
78
79
 
79
80
  ## Version History
80
81
 
81
- | Version | Tier Changes |
82
- | ------- | --------------------------------------- |
83
- | 1.0.0 | Initial stable release with tier system |
84
- | 0.x.x | Pre-release, no stability guarantees |
82
+ | Version | Tier Changes |
83
+ | ------- | --------------------------------------------- |
84
+ | 1.1.0 | Added RPC optimization options to stable tier |
85
+ | 1.0.0 | Initial stable release with tier system |
86
+ | 0.x.x | Pre-release, no stability guarantees |
@@ -1,4 +1,4 @@
1
- export { j as FetchBatchOptions, k as FetchTransactionOptions, I as IndexerRpcApi, N as NftMetadata, R as RetryConfig, S as SolanaClient, a as SpamFilterConfig, T as TokenAccountBalance, W as WalletBalance, c as createSolanaClient, n as fetchNftMetadata, o as fetchNftMetadataBatch, h as fetchTransaction, i as fetchTransactionsBatch, g as fetchWalletAndTokenSignatures, f as fetchWalletBalance, d as fetchWalletSignatures, e as fetchWalletTokenAccounts, m as filterSpamTransactions, l as isSpamTransaction, t as transactionToLegs } from './nft-CJ3sVLxf.js';
1
+ export { j as FetchBatchOptions, k as FetchTransactionOptions, I as IndexerRpcApi, N as NftMetadata, R as RetryConfig, S as SolanaClient, a as SpamFilterConfig, T as TokenAccountBalance, W as WalletBalance, c as createSolanaClient, n as fetchNftMetadata, o as fetchNftMetadataBatch, h as fetchTransaction, i as fetchTransactionsBatch, g as fetchWalletAndTokenSignatures, f as fetchWalletBalance, d as fetchWalletSignatures, e as fetchWalletTokenAccounts, m as filterSpamTransactions, l as isSpamTransaction, t as transactionToLegs } from './nft-AaDY3qte.js';
2
2
  import { TxLeg, RawTransaction, TransactionClassification, ProtocolInfo, TokenInfo } from './types.js';
3
3
  import { z } from 'zod';
4
4
  import { Address } from '@solana/kit';
package/dist/advanced.js CHANGED
@@ -923,7 +923,9 @@ async function fetchTransactionsBatch(rpc, signatures, options = {}) {
923
923
  commitment = "confirmed",
924
924
  concurrency = 5,
925
925
  retry,
926
- onFetchError
926
+ onFetchError,
927
+ rpcUrl,
928
+ batchSize = 100
927
929
  } = options;
928
930
  if (signatures.length === 0) {
929
931
  return [];