tx-indexer 0.5.0 → 0.5.2

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
@@ -37,6 +37,18 @@ console.log(tx.classification.sender); // sender address
37
37
  console.log(tx.classification.receiver); // receiver address
38
38
  ```
39
39
 
40
+ ## RPC Compatibility
41
+
42
+ The SDK works with any Solana RPC for core features (transactions, balances, classification).
43
+
44
+ NFT metadata enrichment requires a DAS-compatible RPC (Helius, Triton, etc.). If using a standard RPC, disable it:
45
+
46
+ ```typescript
47
+ const txs = await indexer.getTransactions(address, {
48
+ enrichNftMetadata: false
49
+ });
50
+ ```
51
+
40
52
  ## Transaction Types
41
53
 
42
54
  - `transfer` - Wallet-to-wallet transfers
@@ -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.
@@ -215,4 +231,4 @@ interface TxIndexer {
215
231
  }
216
232
  declare function createIndexer(options: TxIndexerOptions): TxIndexer;
217
233
 
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 };
234
+ 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';
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-DdzTiKZ4.js';
3
3
  import './classification.types-Cn9IGtEC.js';
4
4
  import 'zod';