@elsoul/erpc-sdk 0.5.0 → 0.7.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/dist/index.d.ts CHANGED
@@ -79,6 +79,206 @@ declare class AccountClient {
79
79
  getTokenBalance(options?: RpcSendOptions): Promise<TokenBalance>;
80
80
  }
81
81
 
82
+ type TokenRepresentationKind = "native" | "issued" | "wrapped" | "bridged" | "unclassified";
83
+ type TokenStandard = "native" | "erc20" | "spl-token" | "spl-token-2022";
84
+ type TokenStatus = "active" | "legacy" | "winding-down" | "retired";
85
+ type TokenStableCurrency = "USD" | "EUR" | "JPY" | null;
86
+ interface TokenAsset {
87
+ readonly assetId: string;
88
+ readonly name: string;
89
+ readonly representationKind: TokenRepresentationKind;
90
+ readonly stableCurrency: TokenStableCurrency;
91
+ readonly underlyingAssetId: string | null;
92
+ readonly economicReferenceAssetId: string | null;
93
+ }
94
+ interface TokenDeployment {
95
+ readonly deploymentId: string;
96
+ readonly assetId: string;
97
+ readonly name: string;
98
+ readonly representationKind: TokenRepresentationKind;
99
+ readonly stableCurrency: TokenStableCurrency;
100
+ readonly underlyingAssetId: string | null;
101
+ readonly economicReferenceAssetId: string | null;
102
+ readonly chainId: TokenChainId;
103
+ readonly symbol: string;
104
+ readonly decimals: number;
105
+ readonly standard: TokenStandard;
106
+ readonly address: string | null;
107
+ readonly status: TokenStatus;
108
+ readonly replacedByDeploymentId: string | null;
109
+ }
110
+ interface TokenAlias {
111
+ readonly namespace: string;
112
+ readonly name: string;
113
+ readonly deploymentId: string;
114
+ }
115
+ declare const TOKEN_CATALOG_VERSION: "1.0.0";
116
+ declare const TOKEN_CATALOG_AS_OF_DATE: "2026-09-15";
117
+ declare const TOKEN_CATALOG_CONTENT_DIGEST: "28318f4f6a6bc2cdeef51368eeb17c86685c6f12d1723b0b4dd27f7e54d7235d";
118
+ declare const TOKEN_CHAIN_IDS: {
119
+ readonly ethereumMainnet: "eip155:1";
120
+ readonly solanaMainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
121
+ readonly avalancheCMainnet: "eip155:43114";
122
+ };
123
+ type TokenChainId = (typeof TOKEN_CHAIN_IDS)[keyof typeof TOKEN_CHAIN_IDS];
124
+ declare const tokens: Readonly<{
125
+ readonly avalancheC: {
126
+ readonly AUSD: "deployment-0035";
127
+ readonly AVAX: "deployment-0003";
128
+ readonly DISCOVERED_0A7F98C8752F15EE: "discovered-token-0a7f98c8752f15ee02ce0d801f25df8ff78864a1d70aff7e204f7bdb3f8a0692";
129
+ readonly DISCOVERED_1847342426B765AD: "discovered-token-1847342426b765add3c8b4feb724c6b15121f25097cb7917c967c285ca77e804";
130
+ readonly DISCOVERED_288036A90EE0FA72: "discovered-token-288036a90ee0fa72a2751a78a6934cc6ced9e16de91c97ae8e109e2ee6189bc5";
131
+ readonly DISCOVERED_323D07C442F0D089: "discovered-token-323d07c442f0d089197ae7eea9b3ebb829910177c5b780161a7623aaed5e4371";
132
+ readonly DISCOVERED_9F9965CC065C9BEC: "discovered-token-9f9965cc065c9becf8d2cb58071524baafea37d27fda9bf683a93ea85f2e653d";
133
+ readonly EURC: "deployment-0012";
134
+ readonly EUROP: "deployment-0045";
135
+ readonly GHO: "deployment-0030";
136
+ readonly JOE: "deployment-0059";
137
+ readonly JPYC: "deployment-0039";
138
+ readonly LINK: "deployment-0058";
139
+ readonly USDC: "deployment-0009";
140
+ readonly USDC_E: "deployment-0018";
141
+ readonly USDT: "deployment-0015";
142
+ readonly WAVAX: "deployment-0004";
143
+ };
144
+ readonly ethereum: {
145
+ readonly AAVE: "deployment-0056";
146
+ readonly AUSD: "deployment-0034";
147
+ readonly DAI: "deployment-0019";
148
+ readonly DISCOVERED_054D80A64E1F36A7: "discovered-token-054d80a64e1f36a756129763ca2f1e7a140b50b04c83876ff01dd5fd497a74c5";
149
+ readonly DISCOVERED_611597BD13DAA43D: "discovered-token-611597bd13daa43d01a23caa9cca6a98797c64be7fb5b2677370ddbcdeaf01ec";
150
+ readonly DISCOVERED_69519FD08E31445C: "discovered-token-69519fd08e31445cad84b0c17a5346b7ee9c5692e270602af9308ca6d8943bb6";
151
+ readonly DISCOVERED_B475569F6A15E97A: "discovered-token-b475569f6a15e97ac04e531dd813e9dcc902521c098d60d6ae4d21d53baf1395";
152
+ readonly DISCOVERED_E375086901067FE3: "discovered-token-e375086901067fe3de023bcdc70f1bafca798e1719ed7e676a98f57de3350a07";
153
+ readonly ETH: "deployment-0001";
154
+ readonly EURA: "deployment-0051";
155
+ readonly EURAU: "deployment-0042";
156
+ readonly EURC: "deployment-0011";
157
+ readonly EURCV: "deployment-0040";
158
+ readonly EURE: "deployment-0054";
159
+ readonly EURE_V1: "deployment-0053";
160
+ readonly EUROP: "deployment-0044";
161
+ readonly EURS: "deployment-0052";
162
+ readonly EURT: "deployment-0017";
163
+ readonly FDUSD: "deployment-0031";
164
+ readonly GHO: "deployment-0029";
165
+ readonly GYEN: "deployment-0047";
166
+ readonly JPYC: "deployment-0038";
167
+ readonly LINK: "deployment-0057";
168
+ readonly PYUSD: "deployment-0022";
169
+ readonly RLUSD: "deployment-0033";
170
+ readonly UNI: "deployment-0055";
171
+ readonly USDC: "deployment-0008";
172
+ readonly USDE: "deployment-0028";
173
+ readonly USDG: "deployment-0024";
174
+ readonly USDP: "deployment-0026";
175
+ readonly USDS: "deployment-0020";
176
+ readonly USDT: "deployment-0014";
177
+ readonly WETH: "deployment-0002";
178
+ readonly ZUSD: "deployment-0049";
179
+ };
180
+ readonly solana: {
181
+ readonly AUSD: "deployment-0036";
182
+ readonly EURAU: "deployment-0043";
183
+ readonly EURC: "deployment-0013";
184
+ readonly EURCV: "deployment-0041";
185
+ readonly EUROP: "deployment-0046";
186
+ readonly FDUSD: "deployment-0032";
187
+ readonly GYEN: "deployment-0048";
188
+ readonly JUP: "deployment-0060";
189
+ readonly JUPUSD: "deployment-0037";
190
+ readonly PYUSD: "deployment-0023";
191
+ readonly SOL: "deployment-0005";
192
+ readonly USDC: "deployment-0010";
193
+ readonly USDG: "deployment-0025";
194
+ readonly USDP: "deployment-0027";
195
+ readonly USDS: "deployment-0021";
196
+ readonly USDT: "deployment-0016";
197
+ readonly WSOL: "deployment-0006";
198
+ readonly WSOL_TOKEN_2022: "deployment-0007";
199
+ readonly ZUSD: "deployment-0050";
200
+ };
201
+ }>;
202
+ declare const TOKEN_ASSETS: readonly TokenAsset[];
203
+ declare const TOKEN_DEPLOYMENTS: readonly TokenDeployment[];
204
+ declare const TOKEN_ALIASES: readonly TokenAlias[];
205
+
206
+ /** Stable currencies represented by the catalog's stablecoin metadata. */
207
+ type StableCurrency = 'USD' | 'EUR' | 'JPY';
208
+ interface ListTokenDeploymentsOptions {
209
+ readonly chainId?: TokenChainId;
210
+ readonly stableCurrency?: StableCurrency;
211
+ }
212
+ /**
213
+ * Return an asset by its opaque, exact asset ID.
214
+ *
215
+ * IDs are intentionally treated as opaque strings. No chain or symbol is
216
+ * inferred from the value.
217
+ */
218
+ declare function getTokenAsset(assetId: string): TokenAsset | undefined;
219
+ /** Return a deployment by its opaque, exact deployment ID. */
220
+ declare function getTokenDeployment(deploymentId: string): TokenDeployment | undefined;
221
+ /**
222
+ * List all catalog deployments, optionally restricted by chain and stable
223
+ * currency. Every status remains visible in the result.
224
+ */
225
+ declare function listTokenDeployments(options?: ListTokenDeploymentsOptions): readonly TokenDeployment[];
226
+ /**
227
+ * Find every exact-case symbol match on a chain, ordered by deployment ID.
228
+ */
229
+ declare function findTokenDeploymentsBySymbol(chainId: TokenChainId, symbol: string): readonly TokenDeployment[];
230
+ /**
231
+ * Find a deployment by address. EVM addresses are ASCII hex and are matched
232
+ * case-insensitively; Solana addresses are matched byte-for-byte as strings.
233
+ */
234
+ declare function findTokenDeploymentByAddress(chainId: TokenChainId, address: string): TokenDeployment | undefined;
235
+ /** Find the chain's native deployment. Native deployments use address null. */
236
+ declare function getNativeTokenDeployment(chainId: TokenChainId): TokenDeployment | undefined;
237
+
238
+ type TokenRankingMetric = 'onchain-total-supply-value-native' | 'global-circulating-market-cap-usd';
239
+ type TokenRankingStatus = 'unconfigured' | 'complete' | 'partial';
240
+ interface TokenRankingCoverage {
241
+ readonly chainId: string;
242
+ readonly totalDeployments: number;
243
+ readonly rankedDeployments: number;
244
+ readonly unrankedDeployments: number;
245
+ readonly observedAt: string | null;
246
+ }
247
+ interface TokenRankingMetadata {
248
+ readonly schemaVersion: 1;
249
+ readonly metric: TokenRankingMetric | null;
250
+ readonly asOf: string | null;
251
+ readonly contentDigest: string;
252
+ readonly status: TokenRankingStatus;
253
+ readonly coverage: readonly TokenRankingCoverage[];
254
+ readonly sourceIds: readonly string[];
255
+ }
256
+ interface TokenRanking {
257
+ readonly rank: number;
258
+ readonly chainId: string;
259
+ readonly deploymentIds: readonly string[];
260
+ readonly metric: TokenRankingMetric;
261
+ readonly valueNumerator: string;
262
+ readonly valueDenominator: string;
263
+ readonly quoteCurrency: 'native' | 'USD';
264
+ readonly quoteDeploymentId: string | null;
265
+ readonly observedAt: string;
266
+ readonly sourceId: string;
267
+ readonly sourceAssetId: string | null;
268
+ }
269
+ declare const TOKEN_RANKINGS_METADATA: TokenRankingMetadata;
270
+ declare const TOKEN_RANKINGS: readonly TokenRanking[];
271
+ declare const TOKEN_RANKINGS_CONTENT_DIGEST: string;
272
+ declare const TOKEN_RANKINGS_BY_CHAIN: Readonly<Record<string, readonly TokenRanking[]>>;
273
+
274
+ /**
275
+ * Return the bundled token rankings for an exact chain ID.
276
+ *
277
+ * Rankings are an offline snapshot. An unknown or empty chain ID is a safe,
278
+ * immutable empty result; no chain aliases or network lookups are inferred.
279
+ */
280
+ declare function listTokenRankings(chainId: string): readonly TokenRanking[];
281
+
82
282
  type CloudResourceKind = 'bare-metal' | 'solana-grpc' | 'solana-shredstream' | 'vps';
83
283
  type CloudResourceMode = 'dedicated' | 'direct' | 'shared';
84
284
  /** A credential-free projection of an ERPC Cloud resource. */
@@ -226,6 +426,23 @@ declare class PriceClient {
226
426
  streamPriceUpdates(options: PriceStreamOptions, sendOptions?: RpcSendOptions): AsyncGenerator<PriceStreamEvent, void, undefined>;
227
427
  }
228
428
 
429
+ interface HttpTransportConfig {
430
+ readonly apiKey: string;
431
+ readonly endpoint: URL;
432
+ readonly fetch: typeof globalThis.fetch;
433
+ readonly headers: Readonly<Record<string, string>>;
434
+ readonly maxBatchSize?: number;
435
+ readonly timeoutMs: number;
436
+ }
437
+ declare class HttpJsonRpcTransport {
438
+ #private;
439
+ readonly endpoint: string;
440
+ readonly maxBatchSize: number;
441
+ constructor(config: HttpTransportConfig);
442
+ request<TResult>(method: string, params?: JsonRpcParams, options?: RpcSendOptions): Promise<TResult>;
443
+ batch<TResult extends readonly unknown[]>(calls: readonly RpcBatchCall[], options?: RpcSendOptions): Promise<TResult>;
444
+ }
445
+
229
446
  interface JsonRpcTransport {
230
447
  readonly endpoint: string;
231
448
  readonly maxBatchSize: number;
@@ -370,6 +587,177 @@ interface EthereumClient {
370
587
  readonly rpc: RpcNamespace<EthereumRpcSchema>;
371
588
  }
372
589
 
590
+ interface AvalancheEncodingParams {
591
+ readonly encoding?: string;
592
+ }
593
+ interface AvalancheUtxoParams extends AvalancheEncodingParams {
594
+ readonly addresses: readonly string[];
595
+ readonly limit?: number | string;
596
+ readonly sourceChain?: string;
597
+ readonly startIndex?: Readonly<Record<string, JsonValue>>;
598
+ }
599
+ interface AvalancheAvaxSchema {
600
+ readonly getAtomicTx: RpcMethodSpec<AvalancheEncodingParams & {
601
+ readonly txID: string;
602
+ }, JsonValue>;
603
+ readonly getAtomicTxStatus: RpcMethodSpec<{
604
+ readonly txID: string;
605
+ }, JsonValue>;
606
+ readonly getUTXOs: RpcMethodSpec<AvalancheUtxoParams & {
607
+ readonly sourceChain: string;
608
+ }, JsonValue>;
609
+ readonly issueTx: RpcMethodSpec<AvalancheEncodingParams & {
610
+ readonly tx: string;
611
+ }, JsonValue>;
612
+ }
613
+ interface AvalancheXChainSchema {
614
+ readonly buildGenesis: RpcMethodSpec<AvalancheEncodingParams & {
615
+ readonly genesisData: Readonly<Record<string, JsonValue>>;
616
+ readonly networkId: number | string;
617
+ }, JsonValue>;
618
+ readonly getAllBalances: RpcMethodSpec<{
619
+ readonly address: string;
620
+ }, JsonValue>;
621
+ readonly getAssetDescription: RpcMethodSpec<{
622
+ readonly assetID: string;
623
+ }, JsonValue>;
624
+ readonly getBalance: RpcMethodSpec<{
625
+ readonly address: string;
626
+ readonly assetID: string;
627
+ }, JsonValue>;
628
+ readonly getBlockByHeight: RpcMethodSpec<AvalancheEncodingParams & {
629
+ readonly height: number | string;
630
+ }, JsonValue>;
631
+ readonly getHeight: RpcMethodSpec<undefined, JsonValue>;
632
+ readonly getTx: RpcMethodSpec<AvalancheEncodingParams & {
633
+ readonly txID: string;
634
+ }, JsonValue>;
635
+ readonly getTxFee: RpcMethodSpec<undefined, JsonValue>;
636
+ readonly getTxStatus: RpcMethodSpec<{
637
+ readonly txID: string;
638
+ }, JsonValue>;
639
+ readonly getUTXOs: RpcMethodSpec<AvalancheUtxoParams, JsonValue>;
640
+ readonly issueTx: RpcMethodSpec<AvalancheEncodingParams & {
641
+ readonly tx: string;
642
+ }, JsonValue>;
643
+ }
644
+ interface AvalanchePChainSchema {
645
+ readonly getAllValidatorsAt: RpcMethodSpec<{
646
+ readonly height: number | string;
647
+ }, JsonValue>;
648
+ readonly getBalance: RpcMethodSpec<{
649
+ readonly addresses?: readonly string[];
650
+ }, JsonValue>;
651
+ readonly getBlockchainStatus: RpcMethodSpec<{
652
+ readonly blockchainID?: string;
653
+ }, JsonValue>;
654
+ readonly getBlockchains: RpcMethodSpec<undefined, JsonValue>;
655
+ readonly getCurrentSupply: RpcMethodSpec<undefined, JsonValue>;
656
+ readonly getCurrentValidators: RpcMethodSpec<{
657
+ readonly nodeIDs?: readonly string[];
658
+ readonly subnetID?: string;
659
+ }, JsonValue>;
660
+ readonly getFeeConfig: RpcMethodSpec<undefined, JsonValue>;
661
+ readonly getFeeState: RpcMethodSpec<undefined, JsonValue>;
662
+ readonly getHeight: RpcMethodSpec<undefined, JsonValue>;
663
+ readonly getMinStake: RpcMethodSpec<undefined, JsonValue>;
664
+ readonly getRewardUTXOs: RpcMethodSpec<AvalancheEncodingParams & {
665
+ readonly txID?: string;
666
+ }, JsonValue>;
667
+ readonly getStake: RpcMethodSpec<AvalancheEncodingParams & {
668
+ readonly addresses?: readonly string[];
669
+ readonly validatorsOnly?: boolean;
670
+ }, JsonValue>;
671
+ readonly getStakingAssetID: RpcMethodSpec<{
672
+ readonly subnetID?: string;
673
+ }, JsonValue>;
674
+ readonly getSubnets: RpcMethodSpec<{
675
+ readonly ids?: readonly string[];
676
+ }, JsonValue>;
677
+ readonly getTimestamp: RpcMethodSpec<undefined, JsonValue>;
678
+ readonly getTotalStake: RpcMethodSpec<{
679
+ readonly subnetID?: string;
680
+ }, JsonValue>;
681
+ readonly getTx: RpcMethodSpec<AvalancheEncodingParams & {
682
+ readonly txID: string;
683
+ }, JsonValue>;
684
+ readonly getTxStatus: RpcMethodSpec<{
685
+ readonly txID: string;
686
+ }, JsonValue>;
687
+ readonly getUTXOs: RpcMethodSpec<AvalancheUtxoParams, JsonValue>;
688
+ readonly getValidatorFeeConfig: RpcMethodSpec<undefined, JsonValue>;
689
+ readonly getValidatorFeeState: RpcMethodSpec<undefined, JsonValue>;
690
+ readonly getValidatorsAt: RpcMethodSpec<{
691
+ readonly height: number | string;
692
+ readonly subnetID?: string;
693
+ }, JsonValue>;
694
+ readonly issueTx: RpcMethodSpec<AvalancheEncodingParams & {
695
+ readonly tx: string;
696
+ }, JsonValue>;
697
+ readonly sampleValidators: RpcMethodSpec<{
698
+ readonly size: number | string;
699
+ readonly subnetID?: string;
700
+ }, JsonValue>;
701
+ readonly validatedBy: RpcMethodSpec<{
702
+ readonly blockchainID: string;
703
+ }, JsonValue>;
704
+ readonly validates: RpcMethodSpec<{
705
+ readonly subnetID: string;
706
+ }, JsonValue>;
707
+ }
708
+ interface AvalancheProposerVmSchema {
709
+ readonly getCurrentEpoch: RpcMethodSpec<undefined, JsonValue>;
710
+ readonly getProposedHeight: RpcMethodSpec<undefined, JsonValue>;
711
+ }
712
+ interface AvalancheInfoSchema {
713
+ readonly upgrades: RpcMethodSpec<undefined, JsonValue>;
714
+ }
715
+ interface AvalancheIndexSchema {
716
+ readonly getContainerByID: RpcMethodSpec<AvalancheEncodingParams & {
717
+ readonly id: string;
718
+ }, JsonValue>;
719
+ readonly getContainerByIndex: RpcMethodSpec<AvalancheEncodingParams & {
720
+ readonly index: number | string;
721
+ }, JsonValue>;
722
+ readonly getContainerRange: RpcMethodSpec<AvalancheEncodingParams & {
723
+ readonly numToFetch: number | string;
724
+ readonly startIndex: number | string;
725
+ }, JsonValue>;
726
+ readonly getIndex: RpcMethodSpec<AvalancheEncodingParams & {
727
+ readonly containerID: string;
728
+ }, JsonValue>;
729
+ readonly getLastAccepted: RpcMethodSpec<AvalancheEncodingParams, JsonValue>;
730
+ readonly isAccepted: RpcMethodSpec<AvalancheEncodingParams & {
731
+ readonly containerID: string;
732
+ }, JsonValue>;
733
+ }
734
+ declare const AVALANCHE_AVAX_METHODS: readonly ["avax.getAtomicTx", "avax.getAtomicTxStatus", "avax.getUTXOs", "avax.issueTx"];
735
+ declare const AVALANCHE_X_CHAIN_METHODS: readonly ["avm.buildGenesis", "avm.getAllBalances", "avm.getAssetDescription", "avm.getBalance", "avm.getBlockByHeight", "avm.getHeight", "avm.getTx", "avm.getTxFee", "avm.getTxStatus", "avm.getUTXOs", "avm.issueTx"];
736
+ declare const AVALANCHE_P_CHAIN_METHODS: readonly ["platform.getAllValidatorsAt", "platform.getBalance", "platform.getBlockchainStatus", "platform.getBlockchains", "platform.getCurrentSupply", "platform.getCurrentValidators", "platform.getFeeConfig", "platform.getFeeState", "platform.getHeight", "platform.getMinStake", "platform.getRewardUTXOs", "platform.getStake", "platform.getStakingAssetID", "platform.getSubnets", "platform.getTimestamp", "platform.getTotalStake", "platform.getTx", "platform.getTxStatus", "platform.getUTXOs", "platform.getValidatorFeeConfig", "platform.getValidatorFeeState", "platform.getValidatorsAt", "platform.issueTx", "platform.sampleValidators", "platform.validatedBy", "platform.validates"];
737
+ declare const AVALANCHE_PROPOSER_VM_METHODS: readonly ["proposervm.getCurrentEpoch", "proposervm.getProposedHeight"];
738
+ declare const AVALANCHE_INFO_METHODS: readonly ["info.upgrades"];
739
+ declare const AVALANCHE_INDEX_METHODS: readonly ["index.getContainerByID", "index.getContainerByIndex", "index.getContainerRange", "index.getIndex", "index.getLastAccepted", "index.isAccepted"];
740
+ interface AvalancheIndexClient {
741
+ readonly cChainBlocks: RpcNamespace<AvalancheIndexSchema>;
742
+ readonly pChainBlocks: RpcNamespace<AvalancheIndexSchema>;
743
+ readonly xChainBlocks: RpcNamespace<AvalancheIndexSchema>;
744
+ readonly xChainTransactions: RpcNamespace<AvalancheIndexSchema>;
745
+ }
746
+ interface AvalancheClient extends EthereumClient {
747
+ readonly avax: RpcNamespace<AvalancheAvaxSchema>;
748
+ readonly index: AvalancheIndexClient;
749
+ readonly info: RpcNamespace<AvalancheInfoSchema>;
750
+ readonly pChain: RpcNamespace<AvalanchePChainSchema>;
751
+ readonly proposerVm: RpcNamespace<AvalancheProposerVmSchema>;
752
+ readonly xChain: RpcNamespace<AvalancheXChainSchema>;
753
+ }
754
+ interface AvalancheIndexTransports {
755
+ readonly cChainBlocks: HttpJsonRpcTransport;
756
+ readonly pChainBlocks: HttpJsonRpcTransport;
757
+ readonly xChainBlocks: HttpJsonRpcTransport;
758
+ readonly xChainTransactions: HttpJsonRpcTransport;
759
+ }
760
+
373
761
  type SolanaCommitment = 'confirmed' | 'finalized' | 'processed';
374
762
  type SolanaEncoding = 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
375
763
  type SolanaConfig = Readonly<Record<string, unknown>>;
@@ -796,6 +1184,52 @@ declare class SolanaSubscriptions {
796
1184
  rawSubscribe<TResult = unknown>(subscribeMethod: string, params: readonly unknown[], unsubscribeMethod: string, listener: SubscriptionListener<TResult>): Promise<RpcSubscription>;
797
1185
  }
798
1186
 
1187
+ type SwapQuoteErrorCode = 'SWAP_INVALID_ARGUMENT' | 'SWAP_UNSUPPORTED_CHAIN' | 'SWAP_UNKNOWN_POOL' | 'SWAP_UNKNOWN_TOKEN' | 'SWAP_TOKEN_NOT_ACTIVE' | 'SWAP_UNSUPPORTED_TOKEN_STANDARD' | 'SWAP_UNSUPPORTED_ADAPTER' | 'SWAP_UNSUPPORTED_TOKEN' | 'SWAP_CHAIN_MISMATCH' | 'SWAP_POOL_TOKEN_MISMATCH' | 'SWAP_PROGRAM_MISMATCH' | 'SWAP_INVALID_POOL_STATE' | 'SWAP_STATE_STALE' | 'SWAP_INSUFFICIENT_LIQUIDITY' | 'SWAP_ARITHMETIC';
1188
+ declare const SWAP_QUOTE_ERROR_MESSAGES: Readonly<Record<SwapQuoteErrorCode, string>>;
1189
+ declare class SwapQuoteError extends Error {
1190
+ readonly code: SwapQuoteErrorCode;
1191
+ constructor(code: SwapQuoteErrorCode);
1192
+ }
1193
+ interface SwapFreshness {
1194
+ readonly maxBlockAgeSeconds?: number;
1195
+ readonly maxBlockLag?: number;
1196
+ readonly maxClockSkewSeconds?: number;
1197
+ }
1198
+ interface ExactInputQuoteRequest {
1199
+ readonly chainId: string;
1200
+ readonly poolDefinitionId: string;
1201
+ readonly inputTokenDeploymentId: string;
1202
+ readonly outputTokenDeploymentId: string;
1203
+ readonly amountIn: string;
1204
+ readonly freshness?: SwapFreshness;
1205
+ }
1206
+ interface ExactInputQuoteResult {
1207
+ readonly quoteKind: 'exact-input';
1208
+ readonly chainId: string;
1209
+ readonly poolDefinitionId: string;
1210
+ readonly dexDeploymentId: string;
1211
+ readonly adapterKind: string;
1212
+ readonly inputTokenDeploymentId: string;
1213
+ readonly outputTokenDeploymentId: string;
1214
+ readonly amountIn: string;
1215
+ readonly amountOut: string;
1216
+ readonly fee: {
1217
+ readonly numerator: string;
1218
+ readonly denominator: string;
1219
+ };
1220
+ readonly snapshot: {
1221
+ readonly kind: 'evm-block';
1222
+ readonly blockNumber: string;
1223
+ readonly blockHash: string;
1224
+ readonly blockTimestamp: string;
1225
+ };
1226
+ readonly tokenCatalogDigest: string;
1227
+ readonly dexCatalogDigest: string;
1228
+ }
1229
+ interface SwapClient {
1230
+ readonly quoteExactInput: (request: ExactInputQuoteRequest, options?: RpcSendOptions) => Promise<ExactInputQuoteResult>;
1231
+ }
1232
+
799
1233
  interface MonthlyApiKeyMethodUsage {
800
1234
  readonly count: number;
801
1235
  readonly creditCost: number;
@@ -845,18 +1279,134 @@ interface ErpcSolanaClient extends SolanaClient {
845
1279
  interface ErpcEthereumClient extends EthereumClient {
846
1280
  readonly subscriptions: EthereumSubscriptions;
847
1281
  }
848
- type ErpcAvalancheClient = ErpcEthereumClient;
1282
+ interface ErpcAvalancheClient extends AvalancheClient {
1283
+ readonly subscriptions: EthereumSubscriptions;
1284
+ }
849
1285
  interface ErpcClient {
850
1286
  readonly account: AccountClient;
851
1287
  readonly avalanche: ErpcAvalancheClient;
852
1288
  readonly ethereum: ErpcEthereumClient;
853
1289
  readonly price: PriceClient;
854
1290
  readonly solana: ErpcSolanaClient;
1291
+ readonly swap: SwapClient;
855
1292
  readonly usage: UsageClient;
856
1293
  close(): void;
857
1294
  }
858
1295
  declare const createErpcClient: (config: ErpcClientConfig) => ErpcClient;
859
1296
 
1297
+ type DexStatus = 'active' | 'legacy' | 'winding-down' | 'retired';
1298
+ type DexChainId = string;
1299
+ interface DexDeployment {
1300
+ readonly dexDeploymentId: string;
1301
+ readonly protocolId: string;
1302
+ readonly name: string;
1303
+ readonly chainId: DexChainId;
1304
+ readonly programAddress: string;
1305
+ readonly adapterKind: string;
1306
+ readonly status: DexStatus;
1307
+ readonly replacedByDexDeploymentId: string | null;
1308
+ }
1309
+ interface PoolAdapter {
1310
+ readonly kind: string;
1311
+ readonly feeNumerator: string | null;
1312
+ readonly feeDenominator: string | null;
1313
+ }
1314
+ interface PoolDefinition {
1315
+ readonly poolDefinitionId: string;
1316
+ readonly dexDeploymentId: string;
1317
+ readonly chainId: DexChainId;
1318
+ readonly address: string;
1319
+ readonly token0DeploymentId: string;
1320
+ readonly token1DeploymentId: string;
1321
+ readonly adapter: Readonly<PoolAdapter>;
1322
+ readonly status: DexStatus;
1323
+ readonly replacedByPoolDefinitionId: string | null;
1324
+ }
1325
+ interface NativeWrapDefinition {
1326
+ readonly nativeWrapDefinitionId: string;
1327
+ readonly chainId: DexChainId;
1328
+ readonly nativeTokenDeploymentId: string;
1329
+ readonly wrappedTokenDeploymentId: string;
1330
+ readonly status: DexStatus;
1331
+ }
1332
+ interface DexAlias {
1333
+ readonly namespace: string;
1334
+ readonly name: string;
1335
+ readonly dexDeploymentId: string | null;
1336
+ readonly poolDefinitionId: string | null;
1337
+ }
1338
+ declare const DEX_CATALOG_VERSION: "1.0.0";
1339
+ declare const DEX_CATALOG_AS_OF_DATE: "2026-09-15";
1340
+ declare const DEX_CATALOG_CONTENT_DIGEST: "caccde1f997648dfa045af41d4f8b7f93a051c59d098cc770bd3a2757185aac1";
1341
+ declare const DEX_CHAIN_IDS: {
1342
+ readonly ethereum: "eip155:1";
1343
+ readonly solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
1344
+ readonly avalancheC: "eip155:43114";
1345
+ };
1346
+ declare const dexes: {
1347
+ readonly ethereum: {
1348
+ readonly UNISWAP_V2: "dex-deployment-0001";
1349
+ };
1350
+ readonly solana: {
1351
+ readonly ORCA_WHIRLPOOLS: "dex-deployment-0003";
1352
+ readonly RAYDIUM_CLMM: "dex-deployment-0004";
1353
+ };
1354
+ readonly avalancheC: {
1355
+ readonly LFJ_LEGACY: "dex-deployment-0002";
1356
+ };
1357
+ };
1358
+ declare const pools: {
1359
+ readonly ethereum: {
1360
+ readonly DISCOVERED_POOL_1B98A5F24A364E05: "discovered-pool-1b98a5f24a364e05b3d56a9702c3560fc3a71f84b2195c486cfc5f8a956cc0b7";
1361
+ readonly DISCOVERED_POOL_6428A1E5DA293B2E: "discovered-pool-6428a1e5da293b2ef62027ec823ba27532219a40784def3930feee56a623b809";
1362
+ readonly DISCOVERED_POOL_866F890448D13C07: "discovered-pool-866f890448d13c078e217a894ebd47430da5941fe5bff7e382fc095916b4614d";
1363
+ readonly DISCOVERED_POOL_90805F8995C1D0B8: "discovered-pool-90805f8995c1d0b85a45fcd4587928a00066b1f14407baee4e8ed1b634c07804";
1364
+ readonly DISCOVERED_POOL_A7F9E600A86951F4: "discovered-pool-a7f9e600a86951f40472ff779fae467db8a6bbbc6076356058f427e97d4ae429";
1365
+ readonly DISCOVERED_POOL_B8F972F8BAE36C82: "discovered-pool-b8f972f8bae36c82b51ed2aeed070d3ef3e7642e2a708c7d3c0c134e6e1946ed";
1366
+ readonly DISCOVERED_POOL_E702B0CB56528418: "discovered-pool-e702b0cb56528418b4ce089dfc001c6241c94e92aabde72f1a340c4601541780";
1367
+ readonly UNISWAP_V2_USDC_WETH: "pool-0001";
1368
+ };
1369
+ readonly solana: {
1370
+ readonly ORCA_WHIRLPOOLS_WSOL_EURC: "pool-0003";
1371
+ readonly RAYDIUM_CLMM_WSOL_EURC: "pool-0004";
1372
+ };
1373
+ readonly avalancheC: {
1374
+ readonly DISCOVERED_POOL_1568E761C62F7DC5: "discovered-pool-1568e761c62f7dc58207a77f2dc32153805efe03a8d9cce9366ce68efdf276c4";
1375
+ readonly DISCOVERED_POOL_3C1E38D02092D16E: "discovered-pool-3c1e38d02092d16e396d2f3a22b2bfae55246a1c566831d31f211670e45bd562";
1376
+ readonly DISCOVERED_POOL_3F840A40991E755E: "discovered-pool-3f840a40991e755e42d242188bd8deb85cd5b9655308269b00c220f5237710cf";
1377
+ readonly DISCOVERED_POOL_5D7AA6A767A0C6EA: "discovered-pool-5d7aa6a767a0c6ea9ddeb06d1289bd12d85018935d5b25724b165dc8b9832252";
1378
+ readonly DISCOVERED_POOL_9E4ED76F76904A4A: "discovered-pool-9e4ed76f76904a4ae271946bb1a4b2dc7428e343040b05a42707071bbfac9462";
1379
+ readonly DISCOVERED_POOL_A2480F3D4EA5CE12: "discovered-pool-a2480f3d4ea5ce12252126acf64b174b9fe678b0f0fda8936a12fef180ae08cd";
1380
+ readonly DISCOVERED_POOL_ECE9088CF3894443: "discovered-pool-ece9088cf38944438897ff9fb2a1abc6855a687b5a3f0d6ab98dfe06c1a6dfef";
1381
+ readonly DISCOVERED_POOL_FB02E85806CD9079: "discovered-pool-fb02e85806cd907920126af935137b0775a858ddf04a28d7ca144f761fd7579e";
1382
+ readonly LFJ_LEGACY_WAVAX_USDC: "pool-0002";
1383
+ };
1384
+ };
1385
+ declare const DEX_DEPLOYMENTS: ReadonlyArray<Readonly<DexDeployment>>;
1386
+ declare const POOL_DEFINITIONS: ReadonlyArray<Readonly<PoolDefinition>>;
1387
+ declare const NATIVE_WRAP_DEFINITIONS: ReadonlyArray<Readonly<NativeWrapDefinition>>;
1388
+ declare const DEX_ALIASES: ReadonlyArray<Readonly<DexAlias>>;
1389
+
1390
+ type DexNamespace = 'ethereum' | 'solana' | 'avalancheC';
1391
+ interface ListPoolDefinitionsOptions {
1392
+ readonly chainId?: DexChainId;
1393
+ readonly tokenDeploymentId?: string;
1394
+ readonly adapterKind?: string;
1395
+ }
1396
+
1397
+ /** Return a DEX deployment by its exact opaque ID. */
1398
+ declare function getDexDeployment(dexDeploymentId: string): DexDeployment | undefined;
1399
+ /** Return a pool definition by its exact opaque ID. */
1400
+ declare function getPoolDefinition(poolDefinitionId: string): PoolDefinition | undefined;
1401
+ /** Find a pool by its chain-qualified address. */
1402
+ declare function findPoolDefinitionByAddress(chainId: DexChainId, address: string): PoolDefinition | undefined;
1403
+ /** Find all pools for an unordered token pair in stable pool-ID order. */
1404
+ declare function findPoolDefinitionsByPair(chainId: DexChainId, tokenADeploymentId: string, tokenBDeploymentId: string): readonly PoolDefinition[];
1405
+ /** List pool definitions using the optional exact filters. */
1406
+ declare function listPoolDefinitions(options?: ListPoolDefinitionsOptions): readonly PoolDefinition[];
1407
+ /** Return the active or historical native-to-wrapped relationship for a token. */
1408
+ declare function getNativeWrapDefinition(nativeTokenDeploymentId: string): NativeWrapDefinition | undefined;
1409
+
860
1410
  type CloudCreditAlertLevel = 'critical' | 'normal' | 'suspended' | 'warning';
861
1411
  interface CloudCredit {
862
1412
  readonly alertLevel: CloudCreditAlertLevel;
@@ -922,4 +1472,4 @@ declare class ErpcBatchPolicyError extends ErpcError {
922
1472
  constructor(message: string);
923
1473
  }
924
1474
 
925
- export { AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_AVALANCHE_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, type ErpcAvalancheClient, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, type NumericFilter, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type SubscriptionId, type SubscriptionListener, type TokenBalance, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient };
1475
+ export { AVALANCHE_AVAX_METHODS, AVALANCHE_INDEX_METHODS, AVALANCHE_INFO_METHODS, AVALANCHE_PROPOSER_VM_METHODS, AVALANCHE_P_CHAIN_METHODS, AVALANCHE_X_CHAIN_METHODS, AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type AvalancheAvaxSchema, type AvalancheClient, type AvalancheEncodingParams, type AvalancheIndexClient, type AvalancheIndexSchema, type AvalancheIndexTransports, type AvalancheInfoSchema, type AvalanchePChainSchema, type AvalancheProposerVmSchema, type AvalancheUtxoParams, type AvalancheXChainSchema, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_AVALANCHE_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, DEX_ALIASES, DEX_CATALOG_AS_OF_DATE, DEX_CATALOG_CONTENT_DIGEST, DEX_CATALOG_VERSION, DEX_CHAIN_IDS, DEX_DEPLOYMENTS, type DexAlias, type DexChainId, type DexDeployment, type DexNamespace, type DexStatus, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, type ErpcAvalancheClient, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type ExactInputQuoteRequest, type ExactInputQuoteResult, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type ListPoolDefinitionsOptions, type ListTokenDeploymentsOptions, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, NATIVE_WRAP_DEFINITIONS, type NativeWrapDefinition, type NumericFilter, POOL_DEFINITIONS, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PoolDefinition, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, SWAP_QUOTE_ERROR_MESSAGES, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type StableCurrency, type SubscriptionId, type SubscriptionListener, type SwapClient, type SwapFreshness, SwapQuoteError, type SwapQuoteErrorCode, TOKEN_ALIASES, TOKEN_ASSETS, TOKEN_CATALOG_AS_OF_DATE, TOKEN_CATALOG_CONTENT_DIGEST, TOKEN_CATALOG_VERSION, TOKEN_CHAIN_IDS, TOKEN_DEPLOYMENTS, TOKEN_RANKINGS, TOKEN_RANKINGS_BY_CHAIN, TOKEN_RANKINGS_CONTENT_DIGEST, TOKEN_RANKINGS_METADATA, type TokenAlias, type TokenAsset, type TokenBalance, type TokenChainId, type TokenDeployment, type TokenRanking, type TokenRankingCoverage, type TokenRankingMetadata, type TokenRankingMetric, type TokenRankingStatus, type TokenRepresentationKind, type TokenStandard, type TokenStatus, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient, dexes, findPoolDefinitionByAddress, findPoolDefinitionsByPair, findTokenDeploymentByAddress, findTokenDeploymentsBySymbol, getDexDeployment, getNativeTokenDeployment, getNativeWrapDefinition, getPoolDefinition, getTokenAsset, getTokenDeployment, listPoolDefinitions, listTokenDeployments, listTokenRankings, pools, tokens };