tx-indexer 0.5.1 → 0.5.3

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/README.md CHANGED
@@ -84,11 +84,11 @@ The SDK is lightweight and tree-shakeable:
84
84
 
85
85
  | Import | Size (minified + brotli) |
86
86
  |--------|----------|
87
- | Full SDK | ~20 KB |
88
- | `createIndexer` only | ~20 KB |
89
- | `classifyTransaction` | ~3 KB |
90
- | `fetchTransaction` | ~4 KB |
91
- | `transactionToLegs` | ~4 KB |
87
+ | Full SDK | 11.34 KB |
88
+ | `createIndexer` only | 11.34 KB |
89
+ | `classifyTransaction` | 6.39 KB |
90
+ | `fetchTransaction` | 7.39 KB |
91
+ | `transactionToLegs` | 7.3 KB |
92
92
 
93
93
  Check current sizes:
94
94
  ```bash
@@ -1,5 +1,5 @@
1
1
  import { Rpc, GetBalanceApi, GetTokenAccountsByOwnerApi, GetSignaturesForAddressApi, GetTransactionApi, RpcSubscriptions, Address, Signature } from '@solana/kit';
2
- import { R as RawTransaction, T as TxLeg, a as TransactionClassification } from './classification.types-Cn9IGtEC.js';
2
+ import { R as RawTransaction, T as TxLeg, a as TransactionClassification } from './classification.types-h046WjuF.js';
3
3
 
4
4
  /**
5
5
  * Union type of all RPC APIs used by the transaction indexer.
@@ -32,11 +32,27 @@ declare function parseAddress(addr: string): Address;
32
32
  */
33
33
  declare function parseSignature(sig: string): Signature;
34
34
 
35
+ interface RetryConfig {
36
+ maxAttempts?: number;
37
+ baseDelayMs?: number;
38
+ maxDelayMs?: number;
39
+ }
40
+
35
41
  interface FetchTransactionsConfig {
36
42
  limit?: number;
37
43
  before?: Signature;
38
44
  until?: Signature;
39
45
  }
46
+ interface FetchTransactionOptions {
47
+ commitment?: "confirmed" | "finalized";
48
+ retry?: RetryConfig;
49
+ }
50
+ interface FetchBatchOptions {
51
+ commitment?: "confirmed" | "finalized";
52
+ concurrency?: number;
53
+ retry?: RetryConfig;
54
+ onFetchError?: (signature: Signature, error: Error) => void;
55
+ }
40
56
  /**
41
57
  * Fetches transaction signatures for a wallet address.
42
58
  *
@@ -51,19 +67,19 @@ declare function fetchWalletSignatures(rpc: Rpc<GetSignaturesForAddressApi>, wal
51
67
  *
52
68
  * @param rpc - Solana RPC client
53
69
  * @param signature - Transaction signature
54
- * @param commitment - Commitment level for fetching
55
- * @returns Full raw transaction with program IDs
70
+ * @param options - Fetch options including commitment level and retry config
71
+ * @returns Full raw transaction with program IDs, or null if not found
56
72
  */
57
- declare function fetchTransaction(rpc: Rpc<GetTransactionApi>, signature: Signature, commitment?: "confirmed" | "finalized"): Promise<RawTransaction | null>;
73
+ declare function fetchTransaction(rpc: Rpc<GetTransactionApi>, signature: Signature, options?: FetchTransactionOptions): Promise<RawTransaction | null>;
58
74
  /**
59
- * Fetches multiple transactions in parallel.
75
+ * Fetches multiple transactions with controlled concurrency.
60
76
  *
61
77
  * @param rpc - Solana RPC client
62
- * @param signatures - Array of transaction signatures
63
- * @param commitment - Commitment level for fetching
64
- * @returns Array of full raw transactions (nulls filtered out)
78
+ * @param signatures - Array of transaction signatures to fetch
79
+ * @param options - Fetch options including commitment level, concurrency limit, and retry config
80
+ * @returns Array of successfully fetched transactions (nulls and errors filtered out)
65
81
  */
66
- declare function fetchTransactionsBatch(rpc: Rpc<GetTransactionApi>, signatures: Signature[], commitment?: "confirmed" | "finalized"): Promise<RawTransaction[]>;
82
+ declare function fetchTransactionsBatch(rpc: Rpc<GetTransactionApi>, signatures: Signature[], options?: FetchBatchOptions): Promise<RawTransaction[]>;
67
83
 
68
84
  /**
69
85
  * Converts a raw Solana transaction into a double-entry accounting ledger.
@@ -195,9 +211,21 @@ interface GetTransactionsOptions {
195
211
  filterSpam?: boolean;
196
212
  spamConfig?: SpamFilterConfig;
197
213
  enrichNftMetadata?: boolean;
214
+ /**
215
+ * Enrich token metadata from Jupiter API.
216
+ * Replaces "Unknown Token" placeholders with actual token names/symbols/logos.
217
+ * Defaults to true.
218
+ */
219
+ enrichTokenMetadata?: boolean;
198
220
  }
199
221
  interface GetTransactionOptions {
200
222
  enrichNftMetadata?: boolean;
223
+ /**
224
+ * Enrich token metadata from Jupiter API.
225
+ * Replaces "Unknown Token" placeholders with actual token names/symbols/logos.
226
+ * Defaults to true.
227
+ */
228
+ enrichTokenMetadata?: boolean;
201
229
  }
202
230
  interface ClassifiedTransaction {
203
231
  tx: RawTransaction;
@@ -215,4 +243,4 @@ interface TxIndexer {
215
243
  }
216
244
  declare function createIndexer(options: TxIndexerOptions): TxIndexer;
217
245
 
218
- export { type ClassifiedTransaction as C, type FetchTransactionsConfig as F, type GetTransactionsOptions as G, type IndexerRpcApi as I, type NftMetadata as N, type SolanaClient as S, type TxIndexer as T, type WalletBalance as W, type TxIndexerOptions as a, type GetTransactionOptions as b, createIndexer as c, createSolanaClient as d, parseSignature as e, fetchWalletBalance as f, type TokenAccountBalance as g, fetchWalletSignatures as h, fetchTransaction as i, fetchTransactionsBatch as j, isSpamTransaction as k, filterSpamTransactions as l, type SpamFilterConfig as m, fetchNftMetadata as n, fetchNftMetadataBatch as o, parseAddress as p, transactionToLegs as t };
246
+ export { type ClassifiedTransaction as C, type FetchTransactionsConfig as F, type GetTransactionsOptions as G, type IndexerRpcApi as I, type NftMetadata as N, type RetryConfig as R, type SolanaClient as S, type TxIndexer as T, type WalletBalance as W, type TxIndexerOptions as a, type GetTransactionOptions as b, createIndexer as c, createSolanaClient as d, parseSignature as e, fetchWalletBalance as f, type TokenAccountBalance as g, fetchWalletSignatures as h, fetchTransaction as i, fetchTransactionsBatch as j, type FetchBatchOptions as k, type FetchTransactionOptions as l, isSpamTransaction as m, filterSpamTransactions as n, type SpamFilterConfig as o, parseAddress as p, fetchNftMetadata as q, fetchNftMetadataBatch as r, transactionToLegs as t };
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@solana/kit';
2
- export { C as ClassifiedTransaction, F as FetchTransactionsConfig, b as GetTransactionOptions, G as GetTransactionsOptions, T as TxIndexer, a as TxIndexerOptions, c as createIndexer } from './client-iLW2_DnL.js';
3
- import './classification.types-Cn9IGtEC.js';
2
+ export { C as ClassifiedTransaction, F as FetchTransactionsConfig, b as GetTransactionOptions, G as GetTransactionsOptions, T as TxIndexer, a as TxIndexerOptions, c as createIndexer } from './client-xmDVjOy4.js';
3
+ import './classification.types-h046WjuF.js';
4
4
  import 'zod';