@elsoul/erpc-sdk 0.7.0 → 0.8.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/README.md +154 -5
- package/dist/index.cjs +2484 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +235 -5
- package/dist/index.d.ts +235 -5
- package/dist/index.js +2470 -102
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,11 +46,12 @@ interface RpcBatchCall {
|
|
|
46
46
|
type QueryValue = boolean | number | readonly string[] | string | undefined;
|
|
47
47
|
type Query = Readonly<Record<string, QueryValue>>;
|
|
48
48
|
interface RestTransportConfig {
|
|
49
|
-
readonly apiKey
|
|
49
|
+
readonly apiKey?: string;
|
|
50
50
|
readonly endpoint: URL;
|
|
51
51
|
readonly fetch: typeof globalThis.fetch;
|
|
52
52
|
readonly headers: Readonly<Record<string, string>>;
|
|
53
53
|
readonly timeoutMs: number;
|
|
54
|
+
readonly unavailableNamespace?: string;
|
|
54
55
|
}
|
|
55
56
|
interface RestStreamResponse {
|
|
56
57
|
readonly response: Response;
|
|
@@ -343,13 +344,26 @@ declare const DEFAULT_AVALANCHE_ENDPOINT = "https://ava-rpc.erpc.global";
|
|
|
343
344
|
declare const DEFAULT_ACCOUNT_ENDPOINT = "https://solana-rpc.erpc.global";
|
|
344
345
|
declare const DEFAULT_USER_ENDPOINT = "https://user-api.erpc.global";
|
|
345
346
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
347
|
+
interface RpcEndpointConfig {
|
|
348
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
349
|
+
readonly httpUrl: string;
|
|
350
|
+
readonly webSocketUrl?: string;
|
|
351
|
+
}
|
|
352
|
+
interface ResolvedRpcEndpointConfig {
|
|
353
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
354
|
+
readonly httpUrl: URL;
|
|
355
|
+
readonly webSocketUrl?: URL;
|
|
356
|
+
}
|
|
346
357
|
interface ErpcClientConfig {
|
|
347
358
|
readonly accountEndpoint?: string;
|
|
348
|
-
readonly apiKey
|
|
359
|
+
readonly apiKey?: string;
|
|
349
360
|
readonly avalancheEndpoint?: string;
|
|
361
|
+
readonly avalancheCRpc?: RpcEndpointConfig;
|
|
350
362
|
readonly endpoint?: string;
|
|
363
|
+
readonly ethereumRpc?: RpcEndpointConfig;
|
|
351
364
|
readonly fetch?: typeof globalThis.fetch;
|
|
352
365
|
readonly headers?: Readonly<Record<string, string>>;
|
|
366
|
+
readonly solanaRpc?: RpcEndpointConfig;
|
|
353
367
|
readonly timeoutMs?: number;
|
|
354
368
|
readonly userEndpoint?: string;
|
|
355
369
|
readonly webSocket?: typeof globalThis.WebSocket;
|
|
@@ -427,12 +441,14 @@ declare class PriceClient {
|
|
|
427
441
|
}
|
|
428
442
|
|
|
429
443
|
interface HttpTransportConfig {
|
|
430
|
-
readonly apiKey
|
|
444
|
+
readonly apiKey?: string;
|
|
445
|
+
readonly direct?: boolean;
|
|
431
446
|
readonly endpoint: URL;
|
|
432
447
|
readonly fetch: typeof globalThis.fetch;
|
|
433
448
|
readonly headers: Readonly<Record<string, string>>;
|
|
434
449
|
readonly maxBatchSize?: number;
|
|
435
450
|
readonly timeoutMs: number;
|
|
451
|
+
readonly unavailableNamespace?: string;
|
|
436
452
|
}
|
|
437
453
|
declare class HttpJsonRpcTransport {
|
|
438
454
|
#private;
|
|
@@ -1132,7 +1148,9 @@ type RpcNotificationListener = (notification: RpcNotification) => void;
|
|
|
1132
1148
|
interface WebSocketTransportConfig {
|
|
1133
1149
|
readonly endpoint: URL;
|
|
1134
1150
|
readonly maxBatchSize?: number;
|
|
1151
|
+
readonly redactionHeaders?: Readonly<Record<string, string>>;
|
|
1135
1152
|
readonly timeoutMs: number;
|
|
1153
|
+
readonly unavailableNamespace?: string;
|
|
1136
1154
|
readonly webSocket?: typeof globalThis.WebSocket;
|
|
1137
1155
|
}
|
|
1138
1156
|
declare class WebSocketJsonRpcTransport implements JsonRpcTransport {
|
|
@@ -1190,6 +1208,12 @@ declare class SwapQuoteError extends Error {
|
|
|
1190
1208
|
readonly code: SwapQuoteErrorCode;
|
|
1191
1209
|
constructor(code: SwapQuoteErrorCode);
|
|
1192
1210
|
}
|
|
1211
|
+
type SwapExecutionErrorCode = 'SWAP_EXECUTION_INVALID_ARGUMENT' | 'SWAP_UNSUPPORTED_EXECUTION' | 'SWAP_PROGRAM_MISMATCH' | 'SWAP_INSUFFICIENT_ALLOWANCE' | 'SWAP_SIMULATION_REVERTED' | 'SWAP_INVALID_SIMULATION';
|
|
1212
|
+
declare const SWAP_EXECUTION_ERROR_MESSAGES: Readonly<Record<SwapExecutionErrorCode, string>>;
|
|
1213
|
+
declare class SwapExecutionError extends Error {
|
|
1214
|
+
readonly code: SwapExecutionErrorCode;
|
|
1215
|
+
constructor(code: SwapExecutionErrorCode);
|
|
1216
|
+
}
|
|
1193
1217
|
interface SwapFreshness {
|
|
1194
1218
|
readonly maxBlockAgeSeconds?: number;
|
|
1195
1219
|
readonly maxBlockLag?: number;
|
|
@@ -1226,8 +1250,66 @@ interface ExactInputQuoteResult {
|
|
|
1226
1250
|
readonly tokenCatalogDigest: string;
|
|
1227
1251
|
readonly dexCatalogDigest: string;
|
|
1228
1252
|
}
|
|
1253
|
+
interface PrepareExactInputSwapRequest extends ExactInputQuoteRequest {
|
|
1254
|
+
readonly sender: string;
|
|
1255
|
+
readonly recipient: string;
|
|
1256
|
+
readonly slippageBps: number;
|
|
1257
|
+
readonly deadline: string;
|
|
1258
|
+
}
|
|
1259
|
+
/** Alias for callers that prefer a shorter execution request name. */
|
|
1260
|
+
type ExactInputSwapRequest = PrepareExactInputSwapRequest;
|
|
1261
|
+
interface ExactInputSwapPathEntry {
|
|
1262
|
+
readonly tokenDeploymentId: string;
|
|
1263
|
+
readonly address: string;
|
|
1264
|
+
readonly standard: 'erc20';
|
|
1265
|
+
readonly representationKind: TokenDeployment['representationKind'];
|
|
1266
|
+
}
|
|
1267
|
+
interface ExactInputSwapPreparation {
|
|
1268
|
+
readonly preparationKind: 'evm-router-v2-exact-input';
|
|
1269
|
+
readonly executionCapabilityId: string;
|
|
1270
|
+
readonly executionCapabilityDigest: string;
|
|
1271
|
+
readonly quote: ExactInputQuoteResult;
|
|
1272
|
+
readonly minimumAmountOut: string;
|
|
1273
|
+
readonly slippageBps: number;
|
|
1274
|
+
readonly deadline: string;
|
|
1275
|
+
readonly recipient: string;
|
|
1276
|
+
readonly path: readonly [ExactInputSwapPathEntry, ExactInputSwapPathEntry];
|
|
1277
|
+
readonly transaction: {
|
|
1278
|
+
readonly kind: 'evm-unsigned-transaction';
|
|
1279
|
+
readonly chainId: string;
|
|
1280
|
+
readonly from: string;
|
|
1281
|
+
readonly to: string;
|
|
1282
|
+
readonly data: string;
|
|
1283
|
+
readonly value: '0';
|
|
1284
|
+
};
|
|
1285
|
+
readonly allowance: {
|
|
1286
|
+
readonly tokenDeploymentId: string;
|
|
1287
|
+
readonly tokenAddress: string;
|
|
1288
|
+
readonly owner: string;
|
|
1289
|
+
readonly spender: string;
|
|
1290
|
+
readonly requiredAmount: string;
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
interface ExactInputSwapSimulation {
|
|
1294
|
+
readonly simulationKind: 'evm-call';
|
|
1295
|
+
readonly preparation: ExactInputSwapPreparation;
|
|
1296
|
+
readonly snapshot: ExactInputQuoteResult['snapshot'];
|
|
1297
|
+
readonly currentAllowance: string;
|
|
1298
|
+
readonly amounts: readonly [string, string];
|
|
1299
|
+
readonly amountOut: string;
|
|
1300
|
+
}
|
|
1301
|
+
/** Alias for callers that prefer the method-name result spelling. */
|
|
1302
|
+
type PrepareExactInputSwapResult = ExactInputSwapPreparation;
|
|
1303
|
+
/** Alias for callers that use the generic preparation name. */
|
|
1304
|
+
type SwapPreparation = ExactInputSwapPreparation;
|
|
1305
|
+
/** Alias for callers that prefer the method-name result spelling. */
|
|
1306
|
+
type SimulateExactInputSwapResult = ExactInputSwapSimulation;
|
|
1307
|
+
/** Alias for callers that use the generic simulation name. */
|
|
1308
|
+
type SwapSimulation = ExactInputSwapSimulation;
|
|
1229
1309
|
interface SwapClient {
|
|
1230
1310
|
readonly quoteExactInput: (request: ExactInputQuoteRequest, options?: RpcSendOptions) => Promise<ExactInputQuoteResult>;
|
|
1311
|
+
readonly prepareExactInputSwap: (request: PrepareExactInputSwapRequest, options?: RpcSendOptions) => Promise<ExactInputSwapPreparation>;
|
|
1312
|
+
readonly simulateExactInputSwap: (request: PrepareExactInputSwapRequest, options?: RpcSendOptions) => Promise<ExactInputSwapSimulation>;
|
|
1231
1313
|
}
|
|
1232
1314
|
|
|
1233
1315
|
interface MonthlyApiKeyMethodUsage {
|
|
@@ -1294,6 +1376,12 @@ interface ErpcClient {
|
|
|
1294
1376
|
}
|
|
1295
1377
|
declare const createErpcClient: (config: ErpcClientConfig) => ErpcClient;
|
|
1296
1378
|
|
|
1379
|
+
declare const SWAP_EXECUTION_CAPABILITIES_JSON: "[{\"swapExecutionCapabilityId\":\"swap-execution-0001\",\"chainId\":\"eip155:1\",\"dexDeploymentId\":\"dex-deployment-0001\",\"poolDefinitionId\":\"pool-0001\",\"factoryAddress\":\"0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f\",\"routerAddress\":\"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\",\"routerKind\":\"uniswap-v2-router02\",\"adapterKind\":\"evm-constant-product-v2\",\"token0DeploymentId\":\"deployment-0008\",\"token0Address\":\"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"token0Standard\":\"erc20\",\"token1DeploymentId\":\"deployment-0002\",\"token1Address\":\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"token1Standard\":\"erc20\",\"wrappedNativeTokenDeploymentId\":\"deployment-0002\",\"wrappedNativeTokenAddress\":\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"wrappedNativeFunctionSelector\":\"0xad5c4648\",\"functionKind\":\"exact-input-erc20-to-erc20\",\"functionSignature\":\"swapExactTokensForTokens(uint256,uint256,address[],address,uint256)\",\"functionSelector\":\"0x38ed1739\",\"status\":\"active\"},{\"swapExecutionCapabilityId\":\"swap-execution-0002\",\"chainId\":\"eip155:43114\",\"dexDeploymentId\":\"dex-deployment-0002\",\"poolDefinitionId\":\"pool-0002\",\"factoryAddress\":\"0x9ad6c38be94206ca50bb0d90783181662f0cfa10\",\"routerAddress\":\"0x60ae616a2155ee3d9a68541ba4544862310933d4\",\"routerKind\":\"joe-v1-router02\",\"adapterKind\":\"evm-constant-product-v2\",\"token0DeploymentId\":\"deployment-0004\",\"token0Address\":\"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7\",\"token0Standard\":\"erc20\",\"token1DeploymentId\":\"deployment-0009\",\"token1Address\":\"0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\",\"token1Standard\":\"erc20\",\"wrappedNativeTokenDeploymentId\":\"deployment-0004\",\"wrappedNativeTokenAddress\":\"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7\",\"wrappedNativeFunctionSelector\":\"0x73b295c2\",\"functionKind\":\"exact-input-erc20-to-erc20\",\"functionSignature\":\"swapExactTokensForTokens(uint256,uint256,address[],address,uint256)\",\"functionSelector\":\"0x38ed1739\",\"status\":\"active\"}]";
|
|
1380
|
+
declare const SWAP_EXECUTION_CAPABILITIES_CONTENT_DIGEST: "84424dc48687e2cb1dd0c9a2446f820efd2c311e71ce5acacfeb6e882811875f";
|
|
1381
|
+
declare const SWAP_EXECUTION_CAPABILITIES_AS_OF_DATE: "2026-09-16";
|
|
1382
|
+
declare const SWAP_EXECUTION_FUNCTION_SIGNATURE: "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)";
|
|
1383
|
+
declare const SWAP_EXECUTION_FUNCTION_SELECTOR: "0x38ed1739";
|
|
1384
|
+
|
|
1297
1385
|
type DexStatus = 'active' | 'legacy' | 'winding-down' | 'retired';
|
|
1298
1386
|
type DexChainId = string;
|
|
1299
1387
|
interface DexDeployment {
|
|
@@ -1438,7 +1526,145 @@ interface ErpcCloudClient {
|
|
|
1438
1526
|
declare const createErpcCloudClient: (config: ErpcCloudClientConfig) => ErpcCloudClient;
|
|
1439
1527
|
type ErpcCloudRequestOptions = RpcSendOptions;
|
|
1440
1528
|
|
|
1441
|
-
|
|
1529
|
+
declare const BRIDGE_CAPABILITIES_JSON: "[{\"bridgeCapabilityId\":\"bridge-mayan-swift-v2-eurc-eth-sol\",\"providerId\":\"mayan-swift-v2\",\"capabilityKind\":\"external-provider-dynamic\",\"sourceChainId\":\"eip155:1\",\"destinationChainId\":\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",\"sourceTokenDeploymentId\":\"deployment-0011\",\"destinationTokenDeploymentId\":\"deployment-0013\",\"sourceTokenAddress\":\"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c\",\"destinationTokenAddress\":\"HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",\"sourceTokenStandard\":\"erc20\",\"destinationTokenStandard\":\"spl-token\",\"sourceTokenDecimals\":6,\"destinationTokenDecimals\":6,\"sourceProviderChainName\":\"ethereum\",\"destinationProviderChainName\":\"solana\",\"sourceProviderChainId\":1,\"destinationProviderChainId\":0,\"sourceWormholeChainId\":2,\"destinationWormholeChainId\":1,\"sourceUsdcDeploymentId\":\"deployment-0008\",\"sourceUsdcAddress\":\"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"sourceUsdcStandard\":\"erc20\",\"sourceUsdcDecimals\":6,\"swiftContract\":\"0x40ffe85a28dc9993541449464d7529a922142960\",\"forwarderAddress\":\"0x337685fdab40d39bd02028545a4ffa7d287cc3e2\",\"forwarderFunctionSelector\":\"0x30dedc57\",\"jupiterProgramAddress\":null,\"builderEndpoint\":\"https://tx-builder.mayan.finance\",\"explorerEndpoint\":\"https://explorer-api.mayan.finance/v3\",\"dependencies\":[\"mayan-hosted-quote-api\",\"mayan-hosted-transaction-builder\",\"mayan-hosted-source-swap-builder\",\"swift-auction-solvers\",\"relayers\",\"wormhole-guardian-messaging\",\"mayan-explorer-indexer\"],\"status\":\"active\"},{\"bridgeCapabilityId\":\"bridge-mayan-swift-v2-eurc-sol-eth\",\"providerId\":\"mayan-swift-v2\",\"capabilityKind\":\"external-provider-dynamic\",\"sourceChainId\":\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",\"destinationChainId\":\"eip155:1\",\"sourceTokenDeploymentId\":\"deployment-0013\",\"destinationTokenDeploymentId\":\"deployment-0011\",\"sourceTokenAddress\":\"HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",\"destinationTokenAddress\":\"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c\",\"sourceTokenStandard\":\"spl-token\",\"destinationTokenStandard\":\"erc20\",\"sourceTokenDecimals\":6,\"destinationTokenDecimals\":6,\"sourceProviderChainName\":\"solana\",\"destinationProviderChainName\":\"ethereum\",\"sourceProviderChainId\":0,\"destinationProviderChainId\":1,\"sourceWormholeChainId\":1,\"destinationWormholeChainId\":2,\"sourceUsdcDeploymentId\":\"deployment-0010\",\"sourceUsdcAddress\":\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\"sourceUsdcStandard\":\"spl-token\",\"sourceUsdcDecimals\":6,\"swiftContract\":\"mayan34VedncxdK2XobtvWFDXQASUTBXhUVzt2kKgny\",\"forwarderAddress\":null,\"forwarderFunctionSelector\":null,\"jupiterProgramAddress\":\"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\",\"builderEndpoint\":\"https://tx-builder.mayan.finance\",\"explorerEndpoint\":\"https://explorer-api.mayan.finance/v3\",\"dependencies\":[\"mayan-hosted-quote-api\",\"mayan-hosted-transaction-builder\",\"mayan-hosted-source-swap-builder\",\"swift-auction-solvers\",\"relayers\",\"wormhole-guardian-messaging\",\"mayan-explorer-indexer\",\"jupiter-v6-source-swap\"],\"status\":\"active\"}]";
|
|
1530
|
+
declare const BRIDGE_CAPABILITIES_CONTENT_DIGEST: "fe698f99218057f8cb40b3e24421d1d78e4e2cd7508cf6e3eb2457b329e5141b";
|
|
1531
|
+
declare const BRIDGE_CAPABILITIES_AS_OF_DATE: "2026-09-16";
|
|
1532
|
+
|
|
1533
|
+
type BridgeErrorCode = 'BRIDGE_INVALID_ARGUMENT' | 'BRIDGE_UNSUPPORTED_ROUTE' | 'BRIDGE_PROVIDER_AUTH_REQUIRED' | 'BRIDGE_PROVIDER_TRANSPORT' | 'BRIDGE_PROVIDER_HTTP' | 'BRIDGE_PROVIDER_INVALID_RESPONSE' | 'BRIDGE_QUOTE_UNAVAILABLE' | 'BRIDGE_QUOTE_EXPIRED' | 'BRIDGE_QUOTE_MISMATCH' | 'BRIDGE_BUILD_INVALID' | 'BRIDGE_STATUS_NOT_FOUND' | 'BRIDGE_TIMEOUT' | 'BRIDGE_ABORTED';
|
|
1534
|
+
declare const BRIDGE_ERROR_MESSAGES: Readonly<Record<BridgeErrorCode, string>>;
|
|
1535
|
+
declare class BridgeError extends Error {
|
|
1536
|
+
readonly code: BridgeErrorCode;
|
|
1537
|
+
readonly status?: number;
|
|
1538
|
+
constructor(code: BridgeErrorCode, status?: number);
|
|
1539
|
+
}
|
|
1540
|
+
interface MayanSwiftV2BridgeConfig {
|
|
1541
|
+
readonly builderEndpoint?: string;
|
|
1542
|
+
readonly explorerEndpoint?: string;
|
|
1543
|
+
readonly builderApiKey?: string;
|
|
1544
|
+
readonly allowUnauthenticatedBuild?: boolean;
|
|
1545
|
+
readonly minimumQuoteValiditySeconds?: number;
|
|
1546
|
+
readonly timeoutMs?: number;
|
|
1547
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
1548
|
+
}
|
|
1549
|
+
interface BridgeRequestOptions {
|
|
1550
|
+
readonly signal?: AbortSignal;
|
|
1551
|
+
}
|
|
1552
|
+
interface MayanSwiftV2QuoteRequest {
|
|
1553
|
+
readonly sourceChainId: string;
|
|
1554
|
+
readonly destinationChainId: string;
|
|
1555
|
+
readonly sourceTokenDeploymentId: string;
|
|
1556
|
+
readonly destinationTokenDeploymentId: string;
|
|
1557
|
+
readonly amountIn: string;
|
|
1558
|
+
readonly slippageBps: number;
|
|
1559
|
+
}
|
|
1560
|
+
interface MayanSwiftV2SourceSwap {
|
|
1561
|
+
readonly required: true;
|
|
1562
|
+
readonly inputTokenDeploymentId: string;
|
|
1563
|
+
readonly intermediateTokenDeploymentId: string;
|
|
1564
|
+
readonly intermediateTokenAddress: string;
|
|
1565
|
+
readonly intermediateTokenStandard: string;
|
|
1566
|
+
readonly intermediateTokenDecimals: 6;
|
|
1567
|
+
readonly providerMinimumAmount: string;
|
|
1568
|
+
readonly routerKind: 'provider-selected-evm' | 'jupiter-v6';
|
|
1569
|
+
readonly routerAddress: string;
|
|
1570
|
+
}
|
|
1571
|
+
interface MayanSwiftV2Quote {
|
|
1572
|
+
readonly quoteKind: 'mayan-swift-v2';
|
|
1573
|
+
readonly providerId: 'mayan-swift-v2';
|
|
1574
|
+
readonly sourceChainId: string;
|
|
1575
|
+
readonly destinationChainId: string;
|
|
1576
|
+
readonly sourceTokenDeploymentId: string;
|
|
1577
|
+
readonly destinationTokenDeploymentId: string;
|
|
1578
|
+
readonly amountIn: string;
|
|
1579
|
+
readonly expectedAmountOut: string;
|
|
1580
|
+
readonly minimumAmountOut: string;
|
|
1581
|
+
readonly minimumReceived: string;
|
|
1582
|
+
readonly deadline: string;
|
|
1583
|
+
readonly slippageBps: number;
|
|
1584
|
+
readonly quoteId: string;
|
|
1585
|
+
readonly providerSignature: string;
|
|
1586
|
+
readonly sourceSwap: MayanSwiftV2SourceSwap;
|
|
1587
|
+
readonly dependencies: readonly string[];
|
|
1588
|
+
readonly quoteVerification: 'provider-signed-not-locally-verified';
|
|
1589
|
+
readonly rawSignedQuoteJson: string;
|
|
1590
|
+
}
|
|
1591
|
+
type MayanSwiftV2QuoteResult = readonly MayanSwiftV2Quote[];
|
|
1592
|
+
interface MayanEvmUnsignedTransaction {
|
|
1593
|
+
readonly kind: 'evm-unsigned-transaction';
|
|
1594
|
+
readonly chainId: 'eip155:1';
|
|
1595
|
+
readonly from: string;
|
|
1596
|
+
readonly to: string;
|
|
1597
|
+
readonly data: string;
|
|
1598
|
+
readonly value: '0';
|
|
1599
|
+
}
|
|
1600
|
+
interface MayanSolanaUnsignedTransaction {
|
|
1601
|
+
readonly kind: 'solana-v0-unsigned-transaction';
|
|
1602
|
+
readonly chainId: typeof TOKEN_CHAIN_IDS.solanaMainnet;
|
|
1603
|
+
readonly feePayer: string;
|
|
1604
|
+
readonly transactionBase64: string;
|
|
1605
|
+
}
|
|
1606
|
+
type MayanSwiftV2UnsignedTransaction = MayanEvmUnsignedTransaction | MayanSolanaUnsignedTransaction;
|
|
1607
|
+
interface MayanSwiftV2BuildValidation {
|
|
1608
|
+
readonly level: 'structural';
|
|
1609
|
+
readonly quoteSignatureLocallyVerified: false;
|
|
1610
|
+
readonly transactionSemanticsLocallyVerified: false;
|
|
1611
|
+
readonly settlementLocallyVerified: false;
|
|
1612
|
+
}
|
|
1613
|
+
interface MayanSwiftV2Build {
|
|
1614
|
+
readonly buildKind: 'mayan-swift-v2-unsigned';
|
|
1615
|
+
readonly providerId: 'mayan-swift-v2';
|
|
1616
|
+
readonly quote: MayanSwiftV2Quote;
|
|
1617
|
+
readonly sourceChainId: string;
|
|
1618
|
+
readonly destinationChainId: string;
|
|
1619
|
+
readonly transaction: MayanSwiftV2UnsignedTransaction;
|
|
1620
|
+
readonly allowance: {
|
|
1621
|
+
readonly tokenDeploymentId: 'deployment-0011';
|
|
1622
|
+
readonly tokenAddress: string;
|
|
1623
|
+
readonly owner: string;
|
|
1624
|
+
readonly spender: string;
|
|
1625
|
+
readonly requiredAmount: string;
|
|
1626
|
+
} | null;
|
|
1627
|
+
readonly validation: MayanSwiftV2BuildValidation;
|
|
1628
|
+
readonly rawProviderBuildJson: string;
|
|
1629
|
+
}
|
|
1630
|
+
type MayanSwiftV2BuildResult = MayanSwiftV2Build;
|
|
1631
|
+
interface MayanSwiftV2StatusRequest {
|
|
1632
|
+
readonly sourceChainId: string;
|
|
1633
|
+
readonly sourceTransactionHash: string;
|
|
1634
|
+
}
|
|
1635
|
+
interface MayanSwiftV2Status {
|
|
1636
|
+
readonly statusKind: 'mayan-explorer-index';
|
|
1637
|
+
readonly providerId: 'mayan-swift-v2';
|
|
1638
|
+
readonly sourceChainId: string;
|
|
1639
|
+
readonly sourceTransactionHash: string;
|
|
1640
|
+
readonly state: 'in-progress' | 'completed' | 'refunded' | 'unknown';
|
|
1641
|
+
readonly providerClientStatus: string;
|
|
1642
|
+
readonly providerStatus: string | null;
|
|
1643
|
+
readonly statusVerification: 'provider-indexed-not-locally-verified';
|
|
1644
|
+
readonly rawProviderStatusJson: string;
|
|
1645
|
+
}
|
|
1646
|
+
type MayanSwiftV2StatusResult = MayanSwiftV2Status;
|
|
1647
|
+
type BridgeClient = MayanSwiftV2BridgeClient;
|
|
1648
|
+
interface MayanSwiftV2BuildRequest {
|
|
1649
|
+
readonly quote: MayanSwiftV2Quote;
|
|
1650
|
+
readonly swapperAddress: string;
|
|
1651
|
+
readonly destinationAddress: string;
|
|
1652
|
+
readonly refundAddress?: string;
|
|
1653
|
+
}
|
|
1654
|
+
type MayanSwiftV2BuildUnsignedRequest = MayanSwiftV2BuildRequest;
|
|
1655
|
+
interface MayanSwiftV2BridgeClient {
|
|
1656
|
+
quoteExactInput(request: MayanSwiftV2QuoteRequest, options?: BridgeRequestOptions): Promise<readonly MayanSwiftV2Quote[]>;
|
|
1657
|
+
buildUnsigned(request: MayanSwiftV2BuildRequest, options?: BridgeRequestOptions): Promise<MayanSwiftV2Build>;
|
|
1658
|
+
getStatus(request: MayanSwiftV2StatusRequest, options?: BridgeRequestOptions): Promise<MayanSwiftV2Status>;
|
|
1659
|
+
close(): void;
|
|
1660
|
+
}
|
|
1661
|
+
declare class MayanSwiftV2BridgeClient implements MayanSwiftV2BridgeClient {
|
|
1662
|
+
#private;
|
|
1663
|
+
constructor(config?: MayanSwiftV2BridgeConfig);
|
|
1664
|
+
}
|
|
1665
|
+
declare const createMayanSwiftV2BridgeClient: (config?: MayanSwiftV2BridgeConfig) => MayanSwiftV2BridgeClient;
|
|
1666
|
+
|
|
1667
|
+
type ErpcErrorCode = 'ERPC_ABORTED' | 'ERPC_BATCH_POLICY' | 'ERPC_CONFIG' | 'ERPC_HTTP' | 'ERPC_INVALID_RESPONSE' | 'ERPC_NOT_CONFIGURED' | 'ERPC_RPC' | 'ERPC_TIMEOUT' | 'ERPC_TRANSPORT';
|
|
1442
1668
|
declare class ErpcError extends Error {
|
|
1443
1669
|
readonly code: ErpcErrorCode;
|
|
1444
1670
|
constructor(code: ErpcErrorCode, message: string, options?: ErrorOptions);
|
|
@@ -1446,6 +1672,10 @@ declare class ErpcError extends Error {
|
|
|
1446
1672
|
declare class ErpcConfigError extends ErpcError {
|
|
1447
1673
|
constructor(message: string);
|
|
1448
1674
|
}
|
|
1675
|
+
declare class ErpcNotConfiguredError extends ErpcError {
|
|
1676
|
+
readonly namespace: string;
|
|
1677
|
+
constructor(namespace: string);
|
|
1678
|
+
}
|
|
1449
1679
|
declare class ErpcTransportError extends ErpcError {
|
|
1450
1680
|
constructor(message: string, options?: ErrorOptions);
|
|
1451
1681
|
}
|
|
@@ -1472,4 +1702,4 @@ declare class ErpcBatchPolicyError extends ErpcError {
|
|
|
1472
1702
|
constructor(message: string);
|
|
1473
1703
|
}
|
|
1474
1704
|
|
|
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 };
|
|
1705
|
+
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, BRIDGE_CAPABILITIES_AS_OF_DATE, BRIDGE_CAPABILITIES_CONTENT_DIGEST, BRIDGE_CAPABILITIES_JSON, BRIDGE_ERROR_MESSAGES, type BinaryUpdate, type BridgeClient, BridgeError, type BridgeErrorCode, type BridgeRequestOptions, 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, ErpcNotConfiguredError, 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 ExactInputSwapPathEntry, type ExactInputSwapPreparation, type ExactInputSwapRequest, type ExactInputSwapSimulation, 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 MayanEvmUnsignedTransaction, type MayanSolanaUnsignedTransaction, MayanSwiftV2BridgeClient, type MayanSwiftV2BridgeConfig, type MayanSwiftV2Build, type MayanSwiftV2BuildRequest, type MayanSwiftV2BuildResult, type MayanSwiftV2BuildUnsignedRequest, type MayanSwiftV2BuildValidation, type MayanSwiftV2Quote, type MayanSwiftV2QuoteRequest, type MayanSwiftV2QuoteResult, type MayanSwiftV2SourceSwap, type MayanSwiftV2Status, type MayanSwiftV2StatusRequest, type MayanSwiftV2StatusResult, type MayanSwiftV2UnsignedTransaction, 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 PrepareExactInputSwapRequest, type PrepareExactInputSwapResult, 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 ResolvedRpcEndpointConfig, type RpcBatchCall, type RpcEndpointConfig, 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_EXECUTION_CAPABILITIES_AS_OF_DATE, SWAP_EXECUTION_CAPABILITIES_CONTENT_DIGEST, SWAP_EXECUTION_CAPABILITIES_JSON, SWAP_EXECUTION_ERROR_MESSAGES, SWAP_EXECUTION_FUNCTION_SELECTOR, SWAP_EXECUTION_FUNCTION_SIGNATURE, SWAP_QUOTE_ERROR_MESSAGES, type SimulateExactInputSwapResult, 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, SwapExecutionError, type SwapExecutionErrorCode, type SwapFreshness, type SwapPreparation, SwapQuoteError, type SwapQuoteErrorCode, type SwapSimulation, 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, createMayanSwiftV2BridgeClient, dexes, findPoolDefinitionByAddress, findPoolDefinitionsByPair, findTokenDeploymentByAddress, findTokenDeploymentsBySymbol, getDexDeployment, getNativeTokenDeployment, getNativeWrapDefinition, getPoolDefinition, getTokenAsset, getTokenDeployment, listPoolDefinitions, listTokenDeployments, listTokenRankings, pools, tokens };
|