tx-indexer 1.3.0 → 1.3.1

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
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Make client type more flexible for custom Solana clients:
8
+ - Replace `SolanaClient` with `IndexerClient` interface (only requires `rpc`)
9
+ - Export `IndexerClient` and `IndexerRpcApi` types for custom integrations
10
+ - Allows integration with `@solana/react-core` and other Solana clients
11
+
12
+ Example usage with custom client:
13
+
14
+ ```typescript
15
+ import { createIndexer, type IndexerClient } from "tx-indexer";
16
+
17
+ const indexer = createIndexer({
18
+ client: { rpc: myCustomRpc } as IndexerClient,
19
+ });
20
+ ```
21
+
3
22
  ## 1.3.0
4
23
 
5
24
  ### Minor Changes
@@ -1,5 +1,5 @@
1
- import { C as Cluster } from './nft-B6SuayJ1.js';
2
- 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-B6SuayJ1.js';
1
+ import { C as Cluster } from './nft-DaDavopU.js';
2
+ export { i as FetchBatchOptions, j as FetchTransactionOptions, I as IndexerRpcApi, N as NftMetadata, R as RetryConfig, k as SolanaClient, S as SpamFilterConfig, T as TokenAccountBalance, W as WalletBalance, c as createSolanaClient, n as fetchNftMetadata, o as fetchNftMetadataBatch, g as fetchTransaction, h as fetchTransactionsBatch, e as fetchWalletAndTokenSignatures, f as fetchWalletBalance, b as fetchWalletSignatures, d as fetchWalletTokenAccounts, m as filterSpamTransactions, l as isSpamTransaction, t as transactionToLegs } from './nft-DaDavopU.js';
3
3
  import { TxLeg, RawTransaction, TransactionClassification, ProtocolInfo, TokenInfo } from './types.js';
4
4
  import { z } from 'zod';
5
5
  import { Address } from '@solana/kit';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Address, Signature } from '@solana/kit';
2
- import { C as Cluster, S as SolanaClient, c as createSolanaClient, W as WalletBalance, a as SpamFilterConfig, R as RetryConfig, t as transactionToLegs, N as NftMetadata } from './nft-B6SuayJ1.js';
3
- export { F as FetchTransactionsConfig, p as parseAddress, b as parseSignature } from './nft-B6SuayJ1.js';
1
+ import { Rpc, Address, Signature } from '@solana/kit';
2
+ import { C as Cluster, I as IndexerRpcApi, c as createSolanaClient, W as WalletBalance, S as SpamFilterConfig, R as RetryConfig, t as transactionToLegs, N as NftMetadata } from './nft-DaDavopU.js';
3
+ export { F as FetchTransactionsConfig, p as parseAddress, a as parseSignature } from './nft-DaDavopU.js';
4
4
  import { TokenInfo, RawTransaction, TransactionClassification, ProtocolInfo, TokenBalance, TxPrimaryType, Counterparty, TxLegSide, TxLegRole } from './types.js';
5
5
  export { Categorization, CategorizationSchema, CounterpartySchema, FiatValue, MoneyAmount, ProtocolInfoSchema, RawTransactionSchema, TokenBalanceSchema, TransactionClassificationSchema, TxCategory, TxCategorySchema, TxDirection, TxDirectionSchema, TxLeg, TxLegSchema, TxPrimaryTypeSchema } from './types.js';
6
6
  import 'zod';
@@ -50,11 +50,19 @@ interface TxIndexerBaseOptions {
50
50
  */
51
51
  customTokens?: Record<string, TokenInfo>;
52
52
  }
53
+ /**
54
+ * Minimal client interface required by the indexer.
55
+ * Any client that provides an RPC with the required methods can be used.
56
+ * This allows integration with custom Solana clients (e.g., from @solana/react-core).
57
+ */
58
+ interface IndexerClient {
59
+ rpc: Rpc<IndexerRpcApi>;
60
+ }
53
61
  type TxIndexerOptions = (TxIndexerBaseOptions & {
54
62
  rpcUrl: string;
55
63
  wsUrl?: string;
56
64
  }) | (TxIndexerBaseOptions & {
57
- client: SolanaClient;
65
+ client: IndexerClient;
58
66
  });
59
67
  interface GetTransactionsOptions {
60
68
  limit?: number;
@@ -760,4 +768,4 @@ declare function getNewATAsForOwner(tx: RawTransaction, ownerAddress: string): D
760
768
  */
761
769
  declare function detectNewATAsBatch(transactions: RawTransaction[]): Map<string, DetectedATA[]>;
762
770
 
763
- export { type AddressInput, type ClassifiedTransaction, Cluster, ConfigurationError, Counterparty, DEVNET_KNOWN_TOKENS, DEVNET_TOKEN_INFO, type DetectedATA, type GetSignaturesOptions, type GetSignaturesResult, type GetTransactionOptions, type GetTransactionsBySignaturesOptions, type GetTransactionsOptions, InvalidInputError, type JsonClassifiedTransaction, type JsonCounterparty, type JsonFiatValue, type JsonMoneyAmount, type JsonProtocolInfo, type JsonRawTransaction, type JsonTokenBalance, type JsonTokenInfo, type JsonTransactionClassification, type JsonTxLeg, KNOWN_TOKENS, LIQUID_STAKING_TOKENS, NetworkError, NftMetadataError, ProtocolInfo, RateLimitError, RawTransaction, RpcError, SUPPORTED_STABLECOINS, type SignatureInfo, type SignatureInput, TOKEN_INFO, TokenBalance, TokenInfo, TransactionClassification, type TxIndexer, TxIndexerError, type TxIndexerOptions, TxLegRole, TxLegSide, TxPrimaryType, createIndexer, createUnknownToken, detectNewATAs, detectNewATAsBatch, getNewATAsForOwner, getTokenInfo, hasNewATAForOwner, isRetryableError, isTxIndexerError, toJsonClassifiedTransaction, toJsonClassifiedTransactions, wrapError };
771
+ export { type AddressInput, type ClassifiedTransaction, Cluster, ConfigurationError, Counterparty, DEVNET_KNOWN_TOKENS, DEVNET_TOKEN_INFO, type DetectedATA, type GetSignaturesOptions, type GetSignaturesResult, type GetTransactionOptions, type GetTransactionsBySignaturesOptions, type GetTransactionsOptions, type IndexerClient, IndexerRpcApi, InvalidInputError, type JsonClassifiedTransaction, type JsonCounterparty, type JsonFiatValue, type JsonMoneyAmount, type JsonProtocolInfo, type JsonRawTransaction, type JsonTokenBalance, type JsonTokenInfo, type JsonTransactionClassification, type JsonTxLeg, KNOWN_TOKENS, LIQUID_STAKING_TOKENS, NetworkError, NftMetadataError, ProtocolInfo, RateLimitError, RawTransaction, RpcError, SUPPORTED_STABLECOINS, type SignatureInfo, type SignatureInput, TOKEN_INFO, TokenBalance, TokenInfo, TransactionClassification, type TxIndexer, TxIndexerError, type TxIndexerOptions, TxLegRole, TxLegSide, TxPrimaryType, createIndexer, createUnknownToken, detectNewATAs, detectNewATAsBatch, getNewATAsForOwner, getTokenInfo, hasNewATAForOwner, isRetryableError, isTxIndexerError, toJsonClassifiedTransaction, toJsonClassifiedTransactions, wrapError };