@dzapio/sdk 2.0.15 → 2.0.17

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.
Files changed (108) hide show
  1. package/dist/{dZapClient/index.d.ts → index.d.mts} +912 -12
  2. package/dist/index.d.ts +1919 -17
  3. package/dist/index.js +16331 -2
  4. package/dist/index.mjs +16287 -0
  5. package/package.json +13 -31
  6. package/dist/api/index.d.ts +0 -31
  7. package/dist/artifacts/ERC20Permit.d.ts +0 -374
  8. package/dist/artifacts/Permit2.d.ts +0 -700
  9. package/dist/artifacts/Permit2Proxy.d.ts +0 -416
  10. package/dist/artifacts/default/DZapCoreAbi.d.ts +0 -2
  11. package/dist/artifacts/default/DZapCoreV2Abi.d.ts +0 -2
  12. package/dist/artifacts/default/DZapDcaAbi.d.ts +0 -2
  13. package/dist/artifacts/default/Permit2Abi.d.ts +0 -700
  14. package/dist/artifacts/default/erc20Abi.d.ts +0 -165
  15. package/dist/artifacts/default/index.d.ts +0 -6
  16. package/dist/artifacts/index.d.ts +0 -2
  17. package/dist/artifacts/staging/DZapCoreSwapAbi.d.ts +0 -2
  18. package/dist/artifacts/staging/index.d.ts +0 -2
  19. package/dist/axios/baseClient.d.ts +0 -2
  20. package/dist/axios/index.d.ts +0 -8
  21. package/dist/chains/definitions/arthera.d.ts +0 -44
  22. package/dist/chains/definitions/fiveIre.d.ts +0 -44
  23. package/dist/chains/definitions/hyperEvm.d.ts +0 -44
  24. package/dist/chains/definitions/hyperliquid.d.ts +0 -44
  25. package/dist/chains/definitions/pushTestnet.d.ts +0 -44
  26. package/dist/chains/definitions/stable.d.ts +0 -45
  27. package/dist/chains/index.d.ts +0 -268
  28. package/dist/config/index.d.ts +0 -36
  29. package/dist/constants/address.d.ts +0 -13
  30. package/dist/constants/approval.d.ts +0 -7
  31. package/dist/constants/axios.d.ts +0 -2
  32. package/dist/constants/chains.d.ts +0 -32
  33. package/dist/constants/contract.d.ts +0 -6
  34. package/dist/constants/erc20.d.ts +0 -25
  35. package/dist/constants/httpMethods.d.ts +0 -2
  36. package/dist/constants/index.d.ts +0 -48
  37. package/dist/constants/permit.d.ts +0 -29
  38. package/dist/constants/permit2.d.ts +0 -2
  39. package/dist/constants/rpc.d.ts +0 -2
  40. package/dist/constants/urlConstants.d.ts +0 -16
  41. package/dist/enums/index.d.ts +0 -47
  42. package/dist/index.js.map +0 -1
  43. package/dist/index.m.js +0 -2
  44. package/dist/index.m.js.map +0 -1
  45. package/dist/index.umd.js +0 -2
  46. package/dist/index.umd.js.map +0 -1
  47. package/dist/service/cache/cacheProvider.d.ts +0 -10
  48. package/dist/service/cache/constant.d.ts +0 -2
  49. package/dist/service/price/index.d.ts +0 -16
  50. package/dist/service/price/provider/coingecko/config.d.ts +0 -6
  51. package/dist/service/price/provider/coingecko/index.d.ts +0 -9
  52. package/dist/service/price/provider/defiLlama/config.d.ts +0 -3
  53. package/dist/service/price/provider/defiLlama/index.d.ts +0 -9
  54. package/dist/service/price/provider/defiLlama/types.d.ts +0 -11
  55. package/dist/service/price/provider/dzap/index.d.ts +0 -6
  56. package/dist/service/price/types/IPriceProvider.d.ts +0 -14
  57. package/dist/transactionHandlers/generic.d.ts +0 -24
  58. package/dist/transactionHandlers/permit.d.ts +0 -61
  59. package/dist/transactionHandlers/trade.d.ts +0 -26
  60. package/dist/transactionHandlers/zap.d.ts +0 -37
  61. package/dist/types/axiosClient.d.ts +0 -6
  62. package/dist/types/btc.d.ts +0 -45
  63. package/dist/types/chains.d.ts +0 -3
  64. package/dist/types/contract.d.ts +0 -14
  65. package/dist/types/eip-2612.d.ts +0 -24
  66. package/dist/types/index.d.ts +0 -497
  67. package/dist/types/permit.d.ts +0 -191
  68. package/dist/types/wallet.d.ts +0 -2
  69. package/dist/types/zap/broadcast.d.ts +0 -15
  70. package/dist/types/zap/build.d.ts +0 -44
  71. package/dist/types/zap/index.d.ts +0 -34
  72. package/dist/types/zap/path.d.ts +0 -33
  73. package/dist/types/zap/pool.d.ts +0 -39
  74. package/dist/types/zap/position.d.ts +0 -27
  75. package/dist/types/zap/quote.d.ts +0 -7
  76. package/dist/types/zap/status.d.ts +0 -28
  77. package/dist/types/zap/step.d.ts +0 -30
  78. package/dist/utils/amount.d.ts +0 -82
  79. package/dist/utils/axios.d.ts +0 -13
  80. package/dist/utils/date.d.ts +0 -1
  81. package/dist/utils/decoder/swap/abis.d.ts +0 -643
  82. package/dist/utils/decoder/swap/inputDataDecoder.d.ts +0 -14
  83. package/dist/utils/eip-2612/eip2612Permit.d.ts +0 -23
  84. package/dist/utils/eip-5792/batchApproveTokens.d.ts +0 -21
  85. package/dist/utils/eip-5792/index.d.ts +0 -3
  86. package/dist/utils/eip-5792/isBatchTxnSupportedByWallet.d.ts +0 -6
  87. package/dist/utils/eip-5792/sendBatchCalls.d.ts +0 -10
  88. package/dist/utils/eip-5792/waitForBatchTransactionReceipt.d.ts +0 -4
  89. package/dist/utils/encodeApproveCall.d.ts +0 -6
  90. package/dist/utils/erc20.d.ts +0 -65
  91. package/dist/utils/errors.d.ts +0 -17
  92. package/dist/utils/index.d.ts +0 -4562
  93. package/dist/utils/multicall.d.ts +0 -14
  94. package/dist/utils/permit2/domain.d.ts +0 -2
  95. package/dist/utils/permit2/index.d.ts +0 -4
  96. package/dist/utils/permit2/nonce.d.ts +0 -15
  97. package/dist/utils/permit2/permitData.d.ts +0 -23
  98. package/dist/utils/permit2/values.d.ts +0 -54
  99. package/dist/utils/permit2/witnessData.d.ts +0 -4
  100. package/dist/utils/signIntent/custom.d.ts +0 -11
  101. package/dist/utils/signIntent/gasless.d.ts +0 -12
  102. package/dist/utils/signTypedData.d.ts +0 -11
  103. package/dist/utils/tokens.d.ts +0 -8
  104. package/dist/utils/updateQuotes.d.ts +0 -3
  105. package/dist/zap/constants/index.d.ts +0 -2
  106. package/dist/zap/constants/path.d.ts +0 -8
  107. package/dist/zap/constants/step.d.ts +0 -3
  108. package/dist/zap/constants/urls.d.ts +0 -13
package/dist/index.d.ts CHANGED
@@ -1,17 +1,1919 @@
1
- import { OtherAbis, QuoteFilters, Services, STATUS } from './constants';
2
- import { ApprovalModes } from './constants/approval';
3
- import { erc20Functions } from './constants/erc20';
4
- import { PermitTypes } from './constants/permit';
5
- import { SignatureExpiryInSecs } from './constants/permit2';
6
- import DZapClient from './dZapClient';
7
- import { DZapPermitMode, StatusCodes, TxnStatus } from './enums';
8
- import { ApiRpcResponse, ApprovalMode, BatchPermitCallbackParams, BtcTxData, Chain, ChainData, contractErrorActions, ContractErrorResponse, DZapTransactionResponse, EvmTxData, Fee, FeeDetails, GaslessTradeBuildTxnResponse, HexString, ParamQuotes, PermitMode, ProviderDetails, QuoteFilter, SignatureCallbackParams, SignPermitResponse, SinglePermitCallbackParams, SvmTxData, SwapInfo, Token, TokenInfo, TokenPermitData, TokenResponse, TradeBuildTxnRequest, TradeBuildTxnRequestData, TradeBuildTxnResponse, TradeGasBuildTxnResponse, TradePath, TradeQuotesRequest, TradeQuotesRequestData, TradeQuotesResponse, TradeStatusResponse, TradeStep } from './types';
9
- import { PsbtInput, PsbtOutput } from './types/btc';
10
- import { ZapIntegratorConfig, ZapStatusResponse } from './types/zap';
11
- import { getTokensPairKey } from './utils';
12
- import { SwapInputDataDecoder } from './utils/decoder/swap/inputDataDecoder';
13
- import { checkEIP2612PermitSupport } from './utils/eip-2612/eip2612Permit';
14
- import { formatToken } from './utils/tokens';
15
- export * from './types/zap';
16
- export * from './zap/constants';
17
- export { ApiRpcResponse, ApprovalMode, ApprovalModes, BatchPermitCallbackParams, BtcTxData, Chain, ChainData, checkEIP2612PermitSupport, contractErrorActions, ContractErrorResponse, DZapClient, DZapPermitMode, DZapTransactionResponse, erc20Functions, EvmTxData, Fee, FeeDetails, formatToken, GaslessTradeBuildTxnResponse, getTokensPairKey, HexString, OtherAbis, ParamQuotes, PermitMode, PermitTypes, ProviderDetails, PsbtInput, PsbtOutput, QuoteFilter, QuoteFilters, Services, SignatureCallbackParams, SignatureExpiryInSecs, SignPermitResponse, SinglePermitCallbackParams, STATUS, StatusCodes, SvmTxData, SwapInfo, SwapInputDataDecoder, Token, TokenInfo, TokenPermitData, TokenResponse, TradeBuildTxnRequest, TradeBuildTxnRequestData, TradeBuildTxnResponse, TradeGasBuildTxnResponse, TradePath, TradeQuotesRequest, TradeQuotesRequestData, TradeQuotesResponse, TradeStatusResponse, TradeStep, TxnStatus, ZapIntegratorConfig, ZapStatusResponse, };
1
+ import * as viem from 'viem';
2
+ import { WalletCallReceipt as WalletCallReceipt$1, TypedDataDomain, Prettify, WalletClient, TransactionReceipt } from 'viem';
3
+ import { Signer } from 'ethers';
4
+
5
+ declare const STATUS: {
6
+ pending: string;
7
+ inProgress: string;
8
+ success: string;
9
+ rejected: string;
10
+ error: string;
11
+ };
12
+ declare const OtherAbis: {
13
+ readonly permit2: "permit2";
14
+ readonly erc20: "erc20";
15
+ };
16
+ declare const Services: {
17
+ readonly trade: "trade";
18
+ readonly dca: "dca";
19
+ readonly zap: "zap";
20
+ };
21
+ declare const GaslessTxType: {
22
+ readonly swap: "swap";
23
+ readonly bridge: "bridge";
24
+ };
25
+ declare const QuoteFilters: {
26
+ readonly fastest: "fastest";
27
+ readonly best: "best";
28
+ readonly all: "all";
29
+ };
30
+ declare const STATUS_RESPONSE: {
31
+ readonly COMPLETED: "COMPLETED";
32
+ readonly FAILED: "FAILED";
33
+ readonly PENDING: "PENDING";
34
+ readonly PARTIAL: "PARTIAL";
35
+ readonly REFUNDED: "REFUNDED";
36
+ };
37
+
38
+ declare const ApprovalModes: {
39
+ readonly Default: "Default";
40
+ readonly PermitSingle: "PermitSingle";
41
+ readonly PermitWitnessTransferFrom: "PermitWitnessTransferFrom";
42
+ readonly PermitBatchWitnessTransferFrom: "PermitBatchWitnessTransferFrom";
43
+ readonly AutoPermit: "AutoPermit";
44
+ };
45
+
46
+ declare const erc20Functions: {
47
+ readonly name: "name";
48
+ readonly allowance: "allowance";
49
+ readonly approve: "approve";
50
+ readonly transfer: "transfer";
51
+ readonly transferFrom: "transferFrom";
52
+ readonly balanceOf: "balanceOf";
53
+ readonly decimals: "decimals";
54
+ readonly symbol: "symbol";
55
+ readonly version: "version";
56
+ readonly nonces: "nonces";
57
+ readonly domainSeparator: "DOMAIN_SEPARATOR";
58
+ };
59
+
60
+ declare enum DZapPermitMode {
61
+ PERMIT = 0,
62
+ PERMIT2_APPROVE = 1,
63
+ PERMIT2_WITNESS_TRANSFER = 2,
64
+ BATCH_PERMIT2_WITNESS_TRANSFER = 3
65
+ }
66
+ declare enum ContractVersion {
67
+ v1 = "v1",
68
+ v2 = "v2"
69
+ }
70
+ declare enum TxnStatus {
71
+ mining = "mining",
72
+ success = "success",
73
+ rejected = "rejected",
74
+ error = "error",
75
+ reverted = "reverted",
76
+ pendingWalletConfirmation = "pendingWalletConfirmation",
77
+ partialSuccess = "partialSuccess",
78
+ waitingForExecution = "waitingForExecution"
79
+ }
80
+ declare enum StatusCodes {
81
+ UserRejectedRequest = 4001,
82
+ Success = 200,
83
+ FunctionNotFound = 32771,
84
+ Error = 500,
85
+ WalletRPCFailure = 429,
86
+ SimulationFailure = 417,
87
+ ContractExecutionError = -500
88
+ }
89
+
90
+ declare const PermitTypes: {
91
+ readonly PermitSingle: "PermitSingle";
92
+ readonly PermitWitnessTransferFrom: "PermitWitnessTransferFrom";
93
+ readonly PermitBatchWitnessTransferFrom: "PermitBatchWitnessTransferFrom";
94
+ readonly EIP2612Permit: "EIP2612Permit";
95
+ readonly AutoPermit: "AutoPermit";
96
+ };
97
+
98
+ declare const SignatureExpiryInSecs = 1800;
99
+
100
+ type WalletCallReceipt = WalletCallReceipt$1<bigint, 'success' | 'reverted'>;
101
+
102
+ type Witness = {
103
+ value: number;
104
+ script: string;
105
+ };
106
+ type PsbtInputP2PKH = {
107
+ scriptType: 'p2pkh';
108
+ nonWitnessUtxo: Buffer;
109
+ redeemScript?: never;
110
+ };
111
+ type PsbtInputP2SH = {
112
+ scriptType: 'p2sh';
113
+ witnessUtxo: Witness;
114
+ redeemScript: Buffer;
115
+ redeemScriptArgumentByteLengths?: number[];
116
+ };
117
+ type PsbtInputP2WPKH = {
118
+ scriptType: 'p2wpkh';
119
+ witnessUtxo: Witness;
120
+ redeemScript?: never;
121
+ };
122
+ type PsbtInputP2WSH = {
123
+ scriptType: 'p2wsh';
124
+ witnessUtxo: Witness;
125
+ witnessScript: Buffer;
126
+ };
127
+ type PsbtInputP2TR = {
128
+ scriptType: 'p2tr';
129
+ witnessUtxo: Witness;
130
+ tapInternalKey: Buffer;
131
+ };
132
+ type PsbtInput = {
133
+ hash: string;
134
+ index: number;
135
+ sequence: number;
136
+ value: number;
137
+ } & (PsbtInputP2PKH | PsbtInputP2SH | PsbtInputP2WPKH | PsbtInputP2TR | PsbtInputP2WSH);
138
+ type PsbtOutput = {
139
+ address: string;
140
+ script?: Buffer;
141
+ value: number;
142
+ } | {
143
+ script: string;
144
+ value: number;
145
+ };
146
+
147
+ type HexString = `0x${string}`;
148
+ type StatusResponse = keyof typeof STATUS_RESPONSE;
149
+ type ChainData = {
150
+ [key in number]: Chain;
151
+ };
152
+ type NativeTokenInfo = {
153
+ contract: string;
154
+ symbol: string;
155
+ decimals: number;
156
+ name: string;
157
+ balance: string;
158
+ price?: string;
159
+ logo: string;
160
+ };
161
+ declare const contractErrorActions: {
162
+ readonly TRY_ANOTHER_ROUTE: "TRY_ANOTHER_ROUTE";
163
+ readonly INCREASE_SLIPPAGE: "INCREASE_SLIPPAGE";
164
+ readonly INCREASE_ALLOWANCE: "INCREASE_ALLOWANCE";
165
+ };
166
+ type ContractErrorResponse = {
167
+ status: string;
168
+ txId: string;
169
+ code: number;
170
+ message: string;
171
+ error: unknown;
172
+ action: keyof typeof contractErrorActions;
173
+ details?: unknown;
174
+ };
175
+ type CalculatePointsRequest = {
176
+ srcTokens: {
177
+ amount: string;
178
+ address: string;
179
+ decimals: number;
180
+ }[];
181
+ destTokens: {
182
+ amount: string;
183
+ address: string;
184
+ decimals: number;
185
+ }[];
186
+ providers: string[];
187
+ chainId: number;
188
+ account: string;
189
+ txType: 'swap' | 'bridge';
190
+ };
191
+ type Chain = {
192
+ coinKey: string;
193
+ chainId: number;
194
+ chainType: string;
195
+ name: string;
196
+ coin: string;
197
+ dcaContract: string;
198
+ swapBridgeContract: string;
199
+ logo: string;
200
+ tokenlistUrl?: string;
201
+ multicallAddress?: HexString;
202
+ blockExplorerUrl: string;
203
+ nativeToken: NativeTokenInfo;
204
+ rpcProviders: ApiRpcResponse[];
205
+ pricingAvailable: boolean;
206
+ balanceAvailable: boolean;
207
+ supportedAs: {
208
+ source: boolean;
209
+ destination: boolean;
210
+ };
211
+ contracts?: Partial<{
212
+ router: string;
213
+ dca: string;
214
+ zap: string;
215
+ }>;
216
+ coingecko?: {
217
+ chainKey: string;
218
+ nativeTokenKey: string;
219
+ };
220
+ defiLlama?: {
221
+ chainKey: string;
222
+ nativeTokenKey: string;
223
+ };
224
+ disableMultiTxn: boolean;
225
+ isEnabled: boolean;
226
+ mainnet: boolean;
227
+ tags?: Tag[];
228
+ version?: ContractVersion;
229
+ };
230
+ type ApiRpcResponse = {
231
+ url: string;
232
+ keyRequired: boolean;
233
+ keyType?: 'ALCHEMY_KEY' | 'BLASTAPI_KEY';
234
+ };
235
+ type ProviderDetails = {
236
+ id: string;
237
+ name: string;
238
+ icon: string;
239
+ };
240
+ type FeeDetails = {
241
+ address: string;
242
+ decimals: number;
243
+ chainId: number;
244
+ symbol: string;
245
+ logo?: string;
246
+ amount: string;
247
+ amountUSD: string;
248
+ included: boolean;
249
+ };
250
+ type Fee = {
251
+ gasFee: FeeDetails[];
252
+ protocolFee: FeeDetails[];
253
+ providerFee: FeeDetails[];
254
+ };
255
+ type QuoteFilter = keyof typeof QuoteFilters;
256
+ type ProtocolFilter = {
257
+ allow?: string[];
258
+ deny?: string[];
259
+ };
260
+ type TradeQuotesRequest = {
261
+ fromChain: number;
262
+ gasless?: boolean;
263
+ data: TradeQuotesRequestData[];
264
+ disableEstimation?: boolean;
265
+ account?: string;
266
+ bridges?: ProtocolFilter;
267
+ dexes?: ProtocolFilter;
268
+ filter?: QuoteFilter;
269
+ timingStrategy?: Partial<{
270
+ minWaitTimeMs: number;
271
+ maxWaitTimeMs: number;
272
+ subsequentDelayMs: number;
273
+ preferredResultCount: number;
274
+ relaxMinSuccessOnDelay: boolean;
275
+ }>;
276
+ };
277
+ type TradeQuotesRequestData = {
278
+ amount: string;
279
+ srcToken: string;
280
+ srcDecimals?: number;
281
+ destToken: string;
282
+ destDecimals?: number;
283
+ toChain: number;
284
+ slippage: number;
285
+ selectedSource?: string;
286
+ };
287
+ type TradeStep = {
288
+ type: string;
289
+ exchange: {
290
+ logo: string;
291
+ name: string;
292
+ };
293
+ };
294
+ type TradePath = {
295
+ type: string;
296
+ exchange: ProviderDetails;
297
+ srcToken: Token;
298
+ srcAmount: string;
299
+ srcAmountUSD: string;
300
+ destToken: Token;
301
+ destAmount: string;
302
+ destAmountUSD: string;
303
+ fee: Fee;
304
+ };
305
+ type Tag = {
306
+ title: string;
307
+ link?: string;
308
+ message?: string;
309
+ };
310
+ type TradeQuote = {
311
+ bridgeDetails?: ProviderDetails;
312
+ providerDetails: ProviderDetails;
313
+ srcAmount: string;
314
+ srcAmountUSD: string;
315
+ destAmount: string;
316
+ destAmountUSD: string;
317
+ minDestAmount: string;
318
+ swapPerUnit: string;
319
+ srcToken: Token;
320
+ destToken: Token;
321
+ fee: Fee;
322
+ priceImpactPercent: string;
323
+ duration: string;
324
+ gasless: boolean;
325
+ steps: TradeStep[];
326
+ path: TradePath[];
327
+ tags?: Tag[];
328
+ additionalInfo?: AdditionalInfo;
329
+ };
330
+ type TradeQuotesByProviderId = {
331
+ [providerAndBridge: string]: TradeQuote;
332
+ };
333
+ type TradeQuotesResponse = {
334
+ [pair: string]: {
335
+ status?: string;
336
+ message?: string;
337
+ recommendedSource: string;
338
+ fastestSource?: string;
339
+ bestReturnSource: string;
340
+ questSource?: string;
341
+ quoteRates?: TradeQuotesByProviderId;
342
+ tokensWithoutPrice: Record<number, string[]>;
343
+ };
344
+ };
345
+ type AdditionalInfo = {
346
+ [key: string]: unknown;
347
+ };
348
+ type Token = {
349
+ address: HexString;
350
+ decimals: number;
351
+ chainId: number;
352
+ logo: string;
353
+ symbol: string;
354
+ price?: string;
355
+ };
356
+ type TokenPermitData = {
357
+ eip2612: {
358
+ supported: boolean;
359
+ data?: {
360
+ domain?: TypedDataDomain;
361
+ };
362
+ };
363
+ permit2: {
364
+ supported: boolean;
365
+ };
366
+ };
367
+ type TokenInfo = Prettify<NativeTokenInfo & {
368
+ chainId: number;
369
+ balanceInUsd?: number | null;
370
+ isDisabledOnSwapBridge?: {
371
+ source: boolean;
372
+ destination: boolean;
373
+ };
374
+ isDisabledOnZap?: {
375
+ source: boolean;
376
+ destination: boolean;
377
+ };
378
+ permit?: TokenPermitData;
379
+ }>;
380
+ type TokenResponse = {
381
+ [key: string]: TokenInfo;
382
+ };
383
+ type TradeBuildTxnRequest = {
384
+ sender: HexString;
385
+ refundee: HexString;
386
+ fromChain: number;
387
+ gasless: boolean;
388
+ disableEstimation?: boolean;
389
+ data: TradeBuildTxnRequestData[];
390
+ hasPermit2ApprovalForAllTokens?: boolean;
391
+ publicKey?: string;
392
+ };
393
+ type TradeBuildTxnRequestData = {
394
+ amount: string;
395
+ srcToken: string;
396
+ srcDecimals?: number;
397
+ destToken: string;
398
+ destDecimals?: number;
399
+ toChain: number;
400
+ protocol: string;
401
+ recipient: string;
402
+ slippage: number;
403
+ additionalInfo?: AdditionalInfo;
404
+ permitData?: string;
405
+ permit?: TokenPermitData;
406
+ };
407
+ type ParamQuotes = {
408
+ additionalInfo?: Record<string, unknown>;
409
+ destAmount: string;
410
+ provider: string;
411
+ minDestAmount: string;
412
+ };
413
+ type EvmTxData = {
414
+ from: HexString;
415
+ data: HexString;
416
+ to: HexString;
417
+ value: string;
418
+ gasLimit: string;
419
+ };
420
+ type SvmTxData = {
421
+ from: string;
422
+ data: string;
423
+ blockhash?: string;
424
+ lastValidBlockHeight?: number;
425
+ };
426
+ type BtcTxData = {
427
+ from: string;
428
+ data: string;
429
+ inputs: PsbtInput[];
430
+ outputs: PsbtOutput[];
431
+ feeRate: number;
432
+ };
433
+ type TxData = EvmTxData | SvmTxData | BtcTxData;
434
+ type TxRequestData<T> = {
435
+ status: typeof STATUS.success;
436
+ txId: string;
437
+ chainId: number;
438
+ transaction: T;
439
+ };
440
+ type TradeGasBuildTxnResponse<T = TxData> = TxRequestData<T> & {
441
+ quotes: Record<string, ParamQuotes>;
442
+ gasless: false;
443
+ };
444
+ type TradeBuildTxnResponse = TradeGasBuildTxnResponse & {
445
+ data: string;
446
+ from: string;
447
+ to?: string;
448
+ value?: string;
449
+ gasLimit?: string;
450
+ svmTxData?: {
451
+ blockhash: string;
452
+ lastValidBlockHeight: number;
453
+ };
454
+ btcTxData?: {
455
+ inputs: PsbtInput[];
456
+ outputs: PsbtOutput[];
457
+ feeRate: number;
458
+ };
459
+ additionalInfo: Record<string, Record<string, unknown>>;
460
+ updatedQuotes: Record<string, string>;
461
+ };
462
+ type BridgeGaslessTxData = {
463
+ executorFeesHash: HexString;
464
+ swapDataHash?: HexString;
465
+ adapterDataHash: HexString;
466
+ txType: typeof GaslessTxType.bridge;
467
+ value: string;
468
+ };
469
+ type SwapGaslessTxData = {
470
+ executorFeesHash: HexString;
471
+ swapDataHash: HexString;
472
+ txType: typeof GaslessTxType.swap;
473
+ value: string;
474
+ };
475
+ type GaslessTradeBuildTxnResponse = {
476
+ status: 'success';
477
+ txId: HexString;
478
+ transaction: BridgeGaslessTxData | SwapGaslessTxData;
479
+ quotes: Record<string, ParamQuotes>;
480
+ gasless: true;
481
+ onlySwapData: false;
482
+ };
483
+ type AvailableDZapServices = (typeof Services)[keyof typeof Services];
484
+ type OtherAvailableAbis = (typeof OtherAbis)[keyof typeof OtherAbis];
485
+ type DZapTransactionResponse = {
486
+ status: TxnStatus;
487
+ errorMsg?: string;
488
+ code: StatusCodes | number;
489
+ action?: keyof typeof contractErrorActions;
490
+ txnHash?: HexString;
491
+ error?: unknown;
492
+ additionalInfo?: Record<string, unknown>;
493
+ updatedQuotes?: Record<string, string>;
494
+ };
495
+ type SwapInfo = {
496
+ dex: string;
497
+ fromToken: string;
498
+ fromAmount: bigint;
499
+ toToken: string;
500
+ returnToAmount: bigint;
501
+ };
502
+ type StatusAsset = {
503
+ contract: string;
504
+ chainId: number;
505
+ name?: string;
506
+ symbol?: string;
507
+ decimals?: number;
508
+ logo?: string | undefined;
509
+ };
510
+ type TransactionInfo = {
511
+ asset: StatusAsset;
512
+ amount: string;
513
+ amountUSD: number;
514
+ txHash: string;
515
+ account: string;
516
+ };
517
+ type TxStatusForPair = {
518
+ source: TransactionInfo;
519
+ destination: TransactionInfo & {
520
+ timestamp?: number;
521
+ };
522
+ expected?: Omit<TransactionInfo, 'txHash' | 'status'>;
523
+ status: StatusResponse;
524
+ provider: ProviderDetails;
525
+ allowUserTxOnDestChain: boolean;
526
+ message?: string;
527
+ protocolExplorerLink?: string;
528
+ };
529
+ type TradeStatusResponse = {
530
+ status: StatusResponse;
531
+ gasless: boolean;
532
+ txHash: string;
533
+ chainId: number;
534
+ timestamp: number;
535
+ transactions: TxStatusForPair[];
536
+ };
537
+ type PermitMode = keyof typeof PermitTypes;
538
+ type ApprovalMode = Exclude<keyof typeof ApprovalModes, 'EIP2612Permit'>;
539
+ type SinglePermitCallbackParams = {
540
+ permitData: HexString;
541
+ srcToken: HexString;
542
+ amount: string;
543
+ permitType: Exclude<PermitMode, keyof typeof PermitTypes.PermitBatchWitnessTransferFrom>;
544
+ };
545
+ type BatchPermitCallbackParams = {
546
+ batchPermitData: HexString;
547
+ tokens: {
548
+ address: HexString;
549
+ amount: string;
550
+ }[];
551
+ permitType: typeof PermitTypes.PermitBatchWitnessTransferFrom;
552
+ };
553
+ type SignatureCallbackParams = SinglePermitCallbackParams | BatchPermitCallbackParams;
554
+ type SignatureParamsBase = {
555
+ chainId: number;
556
+ sender: HexString;
557
+ signer: WalletClient | Signer;
558
+ tokens: {
559
+ address: HexString;
560
+ permitData?: HexString;
561
+ amount: string;
562
+ permit?: TokenPermitData;
563
+ }[];
564
+ spender: HexString;
565
+ rpcUrls: string[];
566
+ permitType: PermitMode;
567
+ isBatchPermitAllowed?: boolean;
568
+ signatureCallback?: (params: SignatureCallbackParams) => Promise<void>;
569
+ service: AvailableDZapServices;
570
+ contractVersion: ContractVersion;
571
+ };
572
+ type GasSignatureParams = SignatureParamsBase & {
573
+ gasless: false;
574
+ };
575
+ type SignPermitResponse = {
576
+ status: TxnStatus.success;
577
+ code: StatusCodes;
578
+ tokens: {
579
+ address: HexString;
580
+ permitData?: HexString;
581
+ amount: string;
582
+ }[];
583
+ permitType: PermitMode;
584
+ } | {
585
+ status: TxnStatus.success;
586
+ code: StatusCodes;
587
+ batchPermitData: HexString;
588
+ permitType: typeof PermitTypes.PermitBatchWitnessTransferFrom;
589
+ } | {
590
+ status: Exclude<TxnStatus, typeof TxnStatus.success>;
591
+ code: StatusCodes;
592
+ permitType: PermitMode;
593
+ };
594
+ type BroadcastTxData = string;
595
+ type BroadcastTxParams = {
596
+ txId: string;
597
+ chainId: number;
598
+ txData: BroadcastTxData;
599
+ };
600
+ type BroadcastTxResponse = {
601
+ status: TxnStatus.success;
602
+ txnHash: string;
603
+ } | {
604
+ status: Exclude<TxnStatus, typeof TxnStatus.success>;
605
+ message: string;
606
+ };
607
+
608
+ declare const zapPathAction: {
609
+ readonly swap: "swap";
610
+ readonly bridge: "bridge";
611
+ readonly deposit: "deposit";
612
+ readonly withdraw: "withdraw";
613
+ readonly stake: "stake";
614
+ readonly unstake: "unstake";
615
+ };
616
+
617
+ type ZapPathAction = keyof typeof zapPathAction;
618
+ type ZapPathAsset = {
619
+ chainId: number;
620
+ address: HexString;
621
+ symbol: string;
622
+ logo: string;
623
+ decimals: number;
624
+ price: string;
625
+ type: string;
626
+ name: string;
627
+ provider?: ProviderDetails;
628
+ underlyingTokens?: ZapUnderlyingToken[];
629
+ };
630
+ type ZapPath = {
631
+ action: ZapPathAction;
632
+ protocol: ProviderDetails;
633
+ fee: ZapFee[];
634
+ estimatedDuration: number;
635
+ input: {
636
+ asset: ZapPathAsset;
637
+ amount: string;
638
+ amountUSD: string;
639
+ }[];
640
+ output: {
641
+ asset: ZapPathAsset;
642
+ amount: string;
643
+ amountUSD: string;
644
+ dust?: boolean;
645
+ }[];
646
+ };
647
+
648
+ declare const chainTypes: {
649
+ readonly evm: "evm";
650
+ readonly bvm: "bvm";
651
+ readonly svm: "svm";
652
+ readonly aptosvm: "aptosvm";
653
+ readonly cosmos: "cosmos";
654
+ readonly nearvm: "nearvm";
655
+ readonly starknetvm: "starknetvm";
656
+ readonly stellarvm: "stellarvm";
657
+ readonly suivm: "suivm";
658
+ readonly tonvm: "tonvm";
659
+ readonly tronvm: "tronvm";
660
+ };
661
+
662
+ declare const zapStepAction: {
663
+ readonly execute: "execute";
664
+ };
665
+
666
+ type StepAction = keyof typeof zapStepAction;
667
+ type ZapEvmTxnDetails = {
668
+ type: typeof chainTypes.evm;
669
+ txnId: HexString;
670
+ callData: HexString;
671
+ callTo: HexString;
672
+ value: string;
673
+ estimatedGas: string;
674
+ };
675
+ type ZapBvmTxnDetails = {
676
+ type: typeof chainTypes.bvm;
677
+ txnId: HexString;
678
+ data: string;
679
+ };
680
+ type SVMTxnDetails = {
681
+ type: typeof chainTypes.svm;
682
+ txnId: HexString;
683
+ data: string[];
684
+ estimatedGas: string;
685
+ isJitoTx?: boolean;
686
+ };
687
+ type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
688
+ type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
689
+ action: StepAction;
690
+ data: T;
691
+ };
692
+ type ZapStep = ZapTransactionStep;
693
+
694
+ type ZapRouteRequestPositionDetails = {
695
+ nftId: string;
696
+ };
697
+ type ZapRouteRequestPoolDetails = {
698
+ lowerTick: number;
699
+ upperTick: number;
700
+ metadata?: unknown;
701
+ };
702
+ type ZapIntegratorConfig = {
703
+ id: string;
704
+ feeBps: number;
705
+ wallet: string;
706
+ };
707
+ type ZapBuildTxnResponse = {
708
+ amountOut: string;
709
+ approvalData: {
710
+ callTo: HexString;
711
+ approveTo: HexString;
712
+ amount: string;
713
+ } | null;
714
+ steps: ZapStep[];
715
+ path: ZapPath[];
716
+ };
717
+ type ZapBuildTxnRequest = {
718
+ srcToken: string;
719
+ srcChainId: number;
720
+ destToken: string;
721
+ destChainId: number;
722
+ recipient: string;
723
+ refundee: string;
724
+ slippage: number;
725
+ account: string;
726
+ integrator?: ZapIntegratorConfig;
727
+ permitData?: string;
728
+ amount?: string;
729
+ estimateGas?: boolean;
730
+ positionDetails?: ZapRouteRequestPositionDetails;
731
+ poolDetails?: ZapRouteRequestPoolDetails;
732
+ allowedBridges?: string[];
733
+ allowedDexes?: string[];
734
+ };
735
+
736
+ type ZapPoolDetailsRequest = {
737
+ address: HexString;
738
+ chainId: number;
739
+ provider: string;
740
+ };
741
+ type ZapPoolsRequest = {
742
+ chainId: number;
743
+ provider: string;
744
+ limit?: number;
745
+ offset?: number;
746
+ };
747
+ type ZapPoolsResponse = {
748
+ pools: ZapPool[];
749
+ pages: number;
750
+ limit: number;
751
+ offset: number;
752
+ };
753
+ type ZapPool = {
754
+ address: string;
755
+ chainId: number;
756
+ name: string;
757
+ provider: string;
758
+ underlyingAssets: ZapUnderlyingToken[];
759
+ tvl: string;
760
+ apr: number;
761
+ metadata?: unknown;
762
+ symbol: string;
763
+ decimals: number;
764
+ };
765
+ type ZapPoolDetails = {
766
+ address: string;
767
+ slot0: {
768
+ sqrtPriceX96: string;
769
+ tick: number;
770
+ tickSpacing: number;
771
+ };
772
+ };
773
+
774
+ type ZapPositionsRequest = {
775
+ account: HexString;
776
+ chainId: number;
777
+ provider: string;
778
+ };
779
+ type ZapPosition = {
780
+ underlyingAssets: ZapUnderlyingTokenWithAmount[];
781
+ address: string;
782
+ apr: number;
783
+ name: string;
784
+ chainId: number;
785
+ provider: string;
786
+ amount: string;
787
+ amountUSD: string;
788
+ nftDetails?: {
789
+ id: string;
790
+ manager: HexString;
791
+ };
792
+ metadata?: unknown;
793
+ decimals: number;
794
+ };
795
+ type ZapPositionsResponse = {
796
+ positions: ZapPosition[];
797
+ count: number;
798
+ };
799
+
800
+ type ZapQuoteResponse = Omit<ZapBuildTxnResponse, 'steps'>;
801
+ type ZapQuoteRequest = Omit<ZapBuildTxnRequest, 'refundee' | 'recipient' | 'account'> & Partial<{
802
+ refundee: string;
803
+ recipient: string;
804
+ account: string;
805
+ }>;
806
+
807
+ type ZapStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REFUNDED';
808
+ type ZapStatusAsset = {
809
+ asset: ZapPathAsset;
810
+ amount: string;
811
+ amountUSD: string;
812
+ };
813
+ type ZapStatusStep = {
814
+ chainId: number;
815
+ hash?: string;
816
+ status: ZapStatus;
817
+ action: string;
818
+ protocol: ProviderDetails;
819
+ input: ZapStatusAsset[];
820
+ output: ZapStatusAsset[];
821
+ };
822
+ type ZapStatusResponse = {
823
+ status: ZapStatus;
824
+ steps: ZapStatusStep[];
825
+ recipient: string;
826
+ timestamp: number;
827
+ completedAt: number;
828
+ };
829
+ type ZapStatusRequest = {
830
+ chainId: number;
831
+ txnHash: string;
832
+ };
833
+
834
+ type ZapProviders = Record<string, ProviderDetails>;
835
+ type ZapChains = {
836
+ [key: string]: {
837
+ name: string;
838
+ supportedProviders: string[];
839
+ };
840
+ };
841
+ type ZapFee = {
842
+ amount: string;
843
+ amountUSD: string;
844
+ asset: ZapPathAsset;
845
+ included: boolean;
846
+ };
847
+ type ZapUnderlyingToken = {
848
+ chainId: number;
849
+ address: HexString;
850
+ name?: string;
851
+ symbol: string;
852
+ decimals: number;
853
+ logo?: string | null;
854
+ };
855
+ type ZapUnderlyingTokenWithAmount = ZapUnderlyingToken & {
856
+ amount: string;
857
+ amountUSD: string;
858
+ };
859
+
860
+ type BatchCallParams = {
861
+ to: HexString;
862
+ data: HexString;
863
+ value?: bigint;
864
+ };
865
+
866
+ declare class DZapClient {
867
+ private static instance;
868
+ private cancelTokenSource;
869
+ private static chainConfig;
870
+ private priceService;
871
+ private constructor();
872
+ static getInstance(apiKey?: string, rpcUrlsByChainId?: Record<number, string[]>): DZapClient;
873
+ static getChainConfig(): Promise<ChainData>;
874
+ static getDZapAbi(service: AvailableDZapServices, version: ContractVersion): viem.Abi;
875
+ static getOtherAbi: (name: OtherAvailableAbis) => readonly [{
876
+ readonly inputs: readonly [{
877
+ readonly internalType: "uint256";
878
+ readonly name: "deadline";
879
+ readonly type: "uint256";
880
+ }];
881
+ readonly name: "AllowanceExpired";
882
+ readonly type: "error";
883
+ }, {
884
+ readonly inputs: readonly [];
885
+ readonly name: "ExcessiveInvalidation";
886
+ readonly type: "error";
887
+ }, {
888
+ readonly inputs: readonly [{
889
+ readonly internalType: "uint256";
890
+ readonly name: "amount";
891
+ readonly type: "uint256";
892
+ }];
893
+ readonly name: "InsufficientAllowance";
894
+ readonly type: "error";
895
+ }, {
896
+ readonly inputs: readonly [{
897
+ readonly internalType: "uint256";
898
+ readonly name: "maxAmount";
899
+ readonly type: "uint256";
900
+ }];
901
+ readonly name: "InvalidAmount";
902
+ readonly type: "error";
903
+ }, {
904
+ readonly inputs: readonly [];
905
+ readonly name: "InvalidContractSignature";
906
+ readonly type: "error";
907
+ }, {
908
+ readonly inputs: readonly [];
909
+ readonly name: "InvalidNonce";
910
+ readonly type: "error";
911
+ }, {
912
+ readonly inputs: readonly [];
913
+ readonly name: "InvalidSignature";
914
+ readonly type: "error";
915
+ }, {
916
+ readonly inputs: readonly [];
917
+ readonly name: "InvalidSignatureLength";
918
+ readonly type: "error";
919
+ }, {
920
+ readonly inputs: readonly [];
921
+ readonly name: "InvalidSigner";
922
+ readonly type: "error";
923
+ }, {
924
+ readonly inputs: readonly [];
925
+ readonly name: "LengthMismatch";
926
+ readonly type: "error";
927
+ }, {
928
+ readonly inputs: readonly [{
929
+ readonly internalType: "uint256";
930
+ readonly name: "signatureDeadline";
931
+ readonly type: "uint256";
932
+ }];
933
+ readonly name: "SignatureExpired";
934
+ readonly type: "error";
935
+ }, {
936
+ readonly anonymous: false;
937
+ readonly inputs: readonly [{
938
+ readonly indexed: true;
939
+ readonly internalType: "address";
940
+ readonly name: "owner";
941
+ readonly type: "address";
942
+ }, {
943
+ readonly indexed: true;
944
+ readonly internalType: "address";
945
+ readonly name: "token";
946
+ readonly type: "address";
947
+ }, {
948
+ readonly indexed: true;
949
+ readonly internalType: "address";
950
+ readonly name: "spender";
951
+ readonly type: "address";
952
+ }, {
953
+ readonly indexed: false;
954
+ readonly internalType: "uint160";
955
+ readonly name: "amount";
956
+ readonly type: "uint160";
957
+ }, {
958
+ readonly indexed: false;
959
+ readonly internalType: "uint48";
960
+ readonly name: "expiration";
961
+ readonly type: "uint48";
962
+ }];
963
+ readonly name: "Approval";
964
+ readonly type: "event";
965
+ }, {
966
+ readonly anonymous: false;
967
+ readonly inputs: readonly [{
968
+ readonly indexed: true;
969
+ readonly internalType: "address";
970
+ readonly name: "owner";
971
+ readonly type: "address";
972
+ }, {
973
+ readonly indexed: false;
974
+ readonly internalType: "address";
975
+ readonly name: "token";
976
+ readonly type: "address";
977
+ }, {
978
+ readonly indexed: false;
979
+ readonly internalType: "address";
980
+ readonly name: "spender";
981
+ readonly type: "address";
982
+ }];
983
+ readonly name: "Lockdown";
984
+ readonly type: "event";
985
+ }, {
986
+ readonly anonymous: false;
987
+ readonly inputs: readonly [{
988
+ readonly indexed: true;
989
+ readonly internalType: "address";
990
+ readonly name: "owner";
991
+ readonly type: "address";
992
+ }, {
993
+ readonly indexed: true;
994
+ readonly internalType: "address";
995
+ readonly name: "token";
996
+ readonly type: "address";
997
+ }, {
998
+ readonly indexed: true;
999
+ readonly internalType: "address";
1000
+ readonly name: "spender";
1001
+ readonly type: "address";
1002
+ }, {
1003
+ readonly indexed: false;
1004
+ readonly internalType: "uint48";
1005
+ readonly name: "newNonce";
1006
+ readonly type: "uint48";
1007
+ }, {
1008
+ readonly indexed: false;
1009
+ readonly internalType: "uint48";
1010
+ readonly name: "oldNonce";
1011
+ readonly type: "uint48";
1012
+ }];
1013
+ readonly name: "NonceInvalidation";
1014
+ readonly type: "event";
1015
+ }, {
1016
+ readonly anonymous: false;
1017
+ readonly inputs: readonly [{
1018
+ readonly indexed: true;
1019
+ readonly internalType: "address";
1020
+ readonly name: "owner";
1021
+ readonly type: "address";
1022
+ }, {
1023
+ readonly indexed: true;
1024
+ readonly internalType: "address";
1025
+ readonly name: "token";
1026
+ readonly type: "address";
1027
+ }, {
1028
+ readonly indexed: true;
1029
+ readonly internalType: "address";
1030
+ readonly name: "spender";
1031
+ readonly type: "address";
1032
+ }, {
1033
+ readonly indexed: false;
1034
+ readonly internalType: "uint160";
1035
+ readonly name: "amount";
1036
+ readonly type: "uint160";
1037
+ }, {
1038
+ readonly indexed: false;
1039
+ readonly internalType: "uint48";
1040
+ readonly name: "expiration";
1041
+ readonly type: "uint48";
1042
+ }, {
1043
+ readonly indexed: false;
1044
+ readonly internalType: "uint48";
1045
+ readonly name: "nonce";
1046
+ readonly type: "uint48";
1047
+ }];
1048
+ readonly name: "Permit";
1049
+ readonly type: "event";
1050
+ }, {
1051
+ readonly anonymous: false;
1052
+ readonly inputs: readonly [{
1053
+ readonly indexed: true;
1054
+ readonly internalType: "address";
1055
+ readonly name: "owner";
1056
+ readonly type: "address";
1057
+ }, {
1058
+ readonly indexed: false;
1059
+ readonly internalType: "uint256";
1060
+ readonly name: "word";
1061
+ readonly type: "uint256";
1062
+ }, {
1063
+ readonly indexed: false;
1064
+ readonly internalType: "uint256";
1065
+ readonly name: "mask";
1066
+ readonly type: "uint256";
1067
+ }];
1068
+ readonly name: "UnorderedNonceInvalidation";
1069
+ readonly type: "event";
1070
+ }, {
1071
+ readonly inputs: readonly [];
1072
+ readonly name: "DOMAIN_SEPARATOR";
1073
+ readonly outputs: readonly [{
1074
+ readonly internalType: "bytes32";
1075
+ readonly name: "";
1076
+ readonly type: "bytes32";
1077
+ }];
1078
+ readonly stateMutability: "view";
1079
+ readonly type: "function";
1080
+ }, {
1081
+ readonly inputs: readonly [{
1082
+ readonly internalType: "address";
1083
+ readonly name: "";
1084
+ readonly type: "address";
1085
+ }, {
1086
+ readonly internalType: "address";
1087
+ readonly name: "";
1088
+ readonly type: "address";
1089
+ }, {
1090
+ readonly internalType: "address";
1091
+ readonly name: "";
1092
+ readonly type: "address";
1093
+ }];
1094
+ readonly name: "allowance";
1095
+ readonly outputs: readonly [{
1096
+ readonly internalType: "uint160";
1097
+ readonly name: "amount";
1098
+ readonly type: "uint160";
1099
+ }, {
1100
+ readonly internalType: "uint48";
1101
+ readonly name: "expiration";
1102
+ readonly type: "uint48";
1103
+ }, {
1104
+ readonly internalType: "uint48";
1105
+ readonly name: "nonce";
1106
+ readonly type: "uint48";
1107
+ }];
1108
+ readonly stateMutability: "view";
1109
+ readonly type: "function";
1110
+ }, {
1111
+ readonly inputs: readonly [{
1112
+ readonly internalType: "address";
1113
+ readonly name: "token";
1114
+ readonly type: "address";
1115
+ }, {
1116
+ readonly internalType: "address";
1117
+ readonly name: "spender";
1118
+ readonly type: "address";
1119
+ }, {
1120
+ readonly internalType: "uint160";
1121
+ readonly name: "amount";
1122
+ readonly type: "uint160";
1123
+ }, {
1124
+ readonly internalType: "uint48";
1125
+ readonly name: "expiration";
1126
+ readonly type: "uint48";
1127
+ }];
1128
+ readonly name: "approve";
1129
+ readonly outputs: readonly [];
1130
+ readonly stateMutability: "nonpayable";
1131
+ readonly type: "function";
1132
+ }, {
1133
+ readonly inputs: readonly [{
1134
+ readonly internalType: "address";
1135
+ readonly name: "token";
1136
+ readonly type: "address";
1137
+ }, {
1138
+ readonly internalType: "address";
1139
+ readonly name: "spender";
1140
+ readonly type: "address";
1141
+ }, {
1142
+ readonly internalType: "uint48";
1143
+ readonly name: "newNonce";
1144
+ readonly type: "uint48";
1145
+ }];
1146
+ readonly name: "invalidateNonces";
1147
+ readonly outputs: readonly [];
1148
+ readonly stateMutability: "nonpayable";
1149
+ readonly type: "function";
1150
+ }, {
1151
+ readonly inputs: readonly [{
1152
+ readonly internalType: "uint256";
1153
+ readonly name: "wordPos";
1154
+ readonly type: "uint256";
1155
+ }, {
1156
+ readonly internalType: "uint256";
1157
+ readonly name: "mask";
1158
+ readonly type: "uint256";
1159
+ }];
1160
+ readonly name: "invalidateUnorderedNonces";
1161
+ readonly outputs: readonly [];
1162
+ readonly stateMutability: "nonpayable";
1163
+ readonly type: "function";
1164
+ }, {
1165
+ readonly inputs: readonly [{
1166
+ readonly components: readonly [{
1167
+ readonly internalType: "address";
1168
+ readonly name: "token";
1169
+ readonly type: "address";
1170
+ }, {
1171
+ readonly internalType: "address";
1172
+ readonly name: "spender";
1173
+ readonly type: "address";
1174
+ }];
1175
+ readonly internalType: "struct IAllowanceTransfer.TokenSpenderPair[]";
1176
+ readonly name: "approvals";
1177
+ readonly type: "tuple[]";
1178
+ }];
1179
+ readonly name: "lockdown";
1180
+ readonly outputs: readonly [];
1181
+ readonly stateMutability: "nonpayable";
1182
+ readonly type: "function";
1183
+ }, {
1184
+ readonly inputs: readonly [{
1185
+ readonly internalType: "address";
1186
+ readonly name: "";
1187
+ readonly type: "address";
1188
+ }, {
1189
+ readonly internalType: "uint256";
1190
+ readonly name: "";
1191
+ readonly type: "uint256";
1192
+ }];
1193
+ readonly name: "nonceBitmap";
1194
+ readonly outputs: readonly [{
1195
+ readonly internalType: "uint256";
1196
+ readonly name: "";
1197
+ readonly type: "uint256";
1198
+ }];
1199
+ readonly stateMutability: "view";
1200
+ readonly type: "function";
1201
+ }, {
1202
+ readonly inputs: readonly [{
1203
+ readonly internalType: "address";
1204
+ readonly name: "owner";
1205
+ readonly type: "address";
1206
+ }, {
1207
+ readonly components: readonly [{
1208
+ readonly components: readonly [{
1209
+ readonly internalType: "address";
1210
+ readonly name: "token";
1211
+ readonly type: "address";
1212
+ }, {
1213
+ readonly internalType: "uint160";
1214
+ readonly name: "amount";
1215
+ readonly type: "uint160";
1216
+ }, {
1217
+ readonly internalType: "uint48";
1218
+ readonly name: "expiration";
1219
+ readonly type: "uint48";
1220
+ }, {
1221
+ readonly internalType: "uint48";
1222
+ readonly name: "nonce";
1223
+ readonly type: "uint48";
1224
+ }];
1225
+ readonly internalType: "struct IAllowanceTransfer.PermitDetails[]";
1226
+ readonly name: "details";
1227
+ readonly type: "tuple[]";
1228
+ }, {
1229
+ readonly internalType: "address";
1230
+ readonly name: "spender";
1231
+ readonly type: "address";
1232
+ }, {
1233
+ readonly internalType: "uint256";
1234
+ readonly name: "sigDeadline";
1235
+ readonly type: "uint256";
1236
+ }];
1237
+ readonly internalType: "struct IAllowanceTransfer.PermitBatch";
1238
+ readonly name: "permitBatch";
1239
+ readonly type: "tuple";
1240
+ }, {
1241
+ readonly internalType: "bytes";
1242
+ readonly name: "signature";
1243
+ readonly type: "bytes";
1244
+ }];
1245
+ readonly name: "permit";
1246
+ readonly outputs: readonly [];
1247
+ readonly stateMutability: "nonpayable";
1248
+ readonly type: "function";
1249
+ }, {
1250
+ readonly inputs: readonly [{
1251
+ readonly internalType: "address";
1252
+ readonly name: "owner";
1253
+ readonly type: "address";
1254
+ }, {
1255
+ readonly components: readonly [{
1256
+ readonly components: readonly [{
1257
+ readonly internalType: "address";
1258
+ readonly name: "token";
1259
+ readonly type: "address";
1260
+ }, {
1261
+ readonly internalType: "uint160";
1262
+ readonly name: "amount";
1263
+ readonly type: "uint160";
1264
+ }, {
1265
+ readonly internalType: "uint48";
1266
+ readonly name: "expiration";
1267
+ readonly type: "uint48";
1268
+ }, {
1269
+ readonly internalType: "uint48";
1270
+ readonly name: "nonce";
1271
+ readonly type: "uint48";
1272
+ }];
1273
+ readonly internalType: "struct IAllowanceTransfer.PermitDetails";
1274
+ readonly name: "details";
1275
+ readonly type: "tuple";
1276
+ }, {
1277
+ readonly internalType: "address";
1278
+ readonly name: "spender";
1279
+ readonly type: "address";
1280
+ }, {
1281
+ readonly internalType: "uint256";
1282
+ readonly name: "sigDeadline";
1283
+ readonly type: "uint256";
1284
+ }];
1285
+ readonly internalType: "struct IAllowanceTransfer.PermitSingle";
1286
+ readonly name: "permitSingle";
1287
+ readonly type: "tuple";
1288
+ }, {
1289
+ readonly internalType: "bytes";
1290
+ readonly name: "signature";
1291
+ readonly type: "bytes";
1292
+ }];
1293
+ readonly name: "permit";
1294
+ readonly outputs: readonly [];
1295
+ readonly stateMutability: "nonpayable";
1296
+ readonly type: "function";
1297
+ }, {
1298
+ readonly inputs: readonly [{
1299
+ readonly components: readonly [{
1300
+ readonly components: readonly [{
1301
+ readonly internalType: "address";
1302
+ readonly name: "token";
1303
+ readonly type: "address";
1304
+ }, {
1305
+ readonly internalType: "uint256";
1306
+ readonly name: "amount";
1307
+ readonly type: "uint256";
1308
+ }];
1309
+ readonly internalType: "struct ISignatureTransfer.TokenPermissions";
1310
+ readonly name: "permitted";
1311
+ readonly type: "tuple";
1312
+ }, {
1313
+ readonly internalType: "uint256";
1314
+ readonly name: "nonce";
1315
+ readonly type: "uint256";
1316
+ }, {
1317
+ readonly internalType: "uint256";
1318
+ readonly name: "deadline";
1319
+ readonly type: "uint256";
1320
+ }];
1321
+ readonly internalType: "struct ISignatureTransfer.PermitTransferFrom";
1322
+ readonly name: "permit";
1323
+ readonly type: "tuple";
1324
+ }, {
1325
+ readonly components: readonly [{
1326
+ readonly internalType: "address";
1327
+ readonly name: "to";
1328
+ readonly type: "address";
1329
+ }, {
1330
+ readonly internalType: "uint256";
1331
+ readonly name: "requestedAmount";
1332
+ readonly type: "uint256";
1333
+ }];
1334
+ readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails";
1335
+ readonly name: "transferDetails";
1336
+ readonly type: "tuple";
1337
+ }, {
1338
+ readonly internalType: "address";
1339
+ readonly name: "owner";
1340
+ readonly type: "address";
1341
+ }, {
1342
+ readonly internalType: "bytes";
1343
+ readonly name: "signature";
1344
+ readonly type: "bytes";
1345
+ }];
1346
+ readonly name: "permitTransferFrom";
1347
+ readonly outputs: readonly [];
1348
+ readonly stateMutability: "nonpayable";
1349
+ readonly type: "function";
1350
+ }, {
1351
+ readonly inputs: readonly [{
1352
+ readonly components: readonly [{
1353
+ readonly components: readonly [{
1354
+ readonly internalType: "address";
1355
+ readonly name: "token";
1356
+ readonly type: "address";
1357
+ }, {
1358
+ readonly internalType: "uint256";
1359
+ readonly name: "amount";
1360
+ readonly type: "uint256";
1361
+ }];
1362
+ readonly internalType: "struct ISignatureTransfer.TokenPermissions[]";
1363
+ readonly name: "permitted";
1364
+ readonly type: "tuple[]";
1365
+ }, {
1366
+ readonly internalType: "uint256";
1367
+ readonly name: "nonce";
1368
+ readonly type: "uint256";
1369
+ }, {
1370
+ readonly internalType: "uint256";
1371
+ readonly name: "deadline";
1372
+ readonly type: "uint256";
1373
+ }];
1374
+ readonly internalType: "struct ISignatureTransfer.PermitBatchTransferFrom";
1375
+ readonly name: "permit";
1376
+ readonly type: "tuple";
1377
+ }, {
1378
+ readonly components: readonly [{
1379
+ readonly internalType: "address";
1380
+ readonly name: "to";
1381
+ readonly type: "address";
1382
+ }, {
1383
+ readonly internalType: "uint256";
1384
+ readonly name: "requestedAmount";
1385
+ readonly type: "uint256";
1386
+ }];
1387
+ readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails[]";
1388
+ readonly name: "transferDetails";
1389
+ readonly type: "tuple[]";
1390
+ }, {
1391
+ readonly internalType: "address";
1392
+ readonly name: "owner";
1393
+ readonly type: "address";
1394
+ }, {
1395
+ readonly internalType: "bytes";
1396
+ readonly name: "signature";
1397
+ readonly type: "bytes";
1398
+ }];
1399
+ readonly name: "permitTransferFrom";
1400
+ readonly outputs: readonly [];
1401
+ readonly stateMutability: "nonpayable";
1402
+ readonly type: "function";
1403
+ }, {
1404
+ readonly inputs: readonly [{
1405
+ readonly components: readonly [{
1406
+ readonly components: readonly [{
1407
+ readonly internalType: "address";
1408
+ readonly name: "token";
1409
+ readonly type: "address";
1410
+ }, {
1411
+ readonly internalType: "uint256";
1412
+ readonly name: "amount";
1413
+ readonly type: "uint256";
1414
+ }];
1415
+ readonly internalType: "struct ISignatureTransfer.TokenPermissions";
1416
+ readonly name: "permitted";
1417
+ readonly type: "tuple";
1418
+ }, {
1419
+ readonly internalType: "uint256";
1420
+ readonly name: "nonce";
1421
+ readonly type: "uint256";
1422
+ }, {
1423
+ readonly internalType: "uint256";
1424
+ readonly name: "deadline";
1425
+ readonly type: "uint256";
1426
+ }];
1427
+ readonly internalType: "struct ISignatureTransfer.PermitTransferFrom";
1428
+ readonly name: "permit";
1429
+ readonly type: "tuple";
1430
+ }, {
1431
+ readonly components: readonly [{
1432
+ readonly internalType: "address";
1433
+ readonly name: "to";
1434
+ readonly type: "address";
1435
+ }, {
1436
+ readonly internalType: "uint256";
1437
+ readonly name: "requestedAmount";
1438
+ readonly type: "uint256";
1439
+ }];
1440
+ readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails";
1441
+ readonly name: "transferDetails";
1442
+ readonly type: "tuple";
1443
+ }, {
1444
+ readonly internalType: "address";
1445
+ readonly name: "owner";
1446
+ readonly type: "address";
1447
+ }, {
1448
+ readonly internalType: "bytes32";
1449
+ readonly name: "witness";
1450
+ readonly type: "bytes32";
1451
+ }, {
1452
+ readonly internalType: "string";
1453
+ readonly name: "witnessTypeString";
1454
+ readonly type: "string";
1455
+ }, {
1456
+ readonly internalType: "bytes";
1457
+ readonly name: "signature";
1458
+ readonly type: "bytes";
1459
+ }];
1460
+ readonly name: "permitWitnessTransferFrom";
1461
+ readonly outputs: readonly [];
1462
+ readonly stateMutability: "nonpayable";
1463
+ readonly type: "function";
1464
+ }, {
1465
+ readonly inputs: readonly [{
1466
+ readonly components: readonly [{
1467
+ readonly components: readonly [{
1468
+ readonly internalType: "address";
1469
+ readonly name: "token";
1470
+ readonly type: "address";
1471
+ }, {
1472
+ readonly internalType: "uint256";
1473
+ readonly name: "amount";
1474
+ readonly type: "uint256";
1475
+ }];
1476
+ readonly internalType: "struct ISignatureTransfer.TokenPermissions[]";
1477
+ readonly name: "permitted";
1478
+ readonly type: "tuple[]";
1479
+ }, {
1480
+ readonly internalType: "uint256";
1481
+ readonly name: "nonce";
1482
+ readonly type: "uint256";
1483
+ }, {
1484
+ readonly internalType: "uint256";
1485
+ readonly name: "deadline";
1486
+ readonly type: "uint256";
1487
+ }];
1488
+ readonly internalType: "struct ISignatureTransfer.PermitBatchTransferFrom";
1489
+ readonly name: "permit";
1490
+ readonly type: "tuple";
1491
+ }, {
1492
+ readonly components: readonly [{
1493
+ readonly internalType: "address";
1494
+ readonly name: "to";
1495
+ readonly type: "address";
1496
+ }, {
1497
+ readonly internalType: "uint256";
1498
+ readonly name: "requestedAmount";
1499
+ readonly type: "uint256";
1500
+ }];
1501
+ readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails[]";
1502
+ readonly name: "transferDetails";
1503
+ readonly type: "tuple[]";
1504
+ }, {
1505
+ readonly internalType: "address";
1506
+ readonly name: "owner";
1507
+ readonly type: "address";
1508
+ }, {
1509
+ readonly internalType: "bytes32";
1510
+ readonly name: "witness";
1511
+ readonly type: "bytes32";
1512
+ }, {
1513
+ readonly internalType: "string";
1514
+ readonly name: "witnessTypeString";
1515
+ readonly type: "string";
1516
+ }, {
1517
+ readonly internalType: "bytes";
1518
+ readonly name: "signature";
1519
+ readonly type: "bytes";
1520
+ }];
1521
+ readonly name: "permitWitnessTransferFrom";
1522
+ readonly outputs: readonly [];
1523
+ readonly stateMutability: "nonpayable";
1524
+ readonly type: "function";
1525
+ }, {
1526
+ readonly inputs: readonly [{
1527
+ readonly components: readonly [{
1528
+ readonly internalType: "address";
1529
+ readonly name: "from";
1530
+ readonly type: "address";
1531
+ }, {
1532
+ readonly internalType: "address";
1533
+ readonly name: "to";
1534
+ readonly type: "address";
1535
+ }, {
1536
+ readonly internalType: "uint160";
1537
+ readonly name: "amount";
1538
+ readonly type: "uint160";
1539
+ }, {
1540
+ readonly internalType: "address";
1541
+ readonly name: "token";
1542
+ readonly type: "address";
1543
+ }];
1544
+ readonly internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]";
1545
+ readonly name: "transferDetails";
1546
+ readonly type: "tuple[]";
1547
+ }];
1548
+ readonly name: "transferFrom";
1549
+ readonly outputs: readonly [];
1550
+ readonly stateMutability: "nonpayable";
1551
+ readonly type: "function";
1552
+ }, {
1553
+ readonly inputs: readonly [{
1554
+ readonly internalType: "address";
1555
+ readonly name: "from";
1556
+ readonly type: "address";
1557
+ }, {
1558
+ readonly internalType: "address";
1559
+ readonly name: "to";
1560
+ readonly type: "address";
1561
+ }, {
1562
+ readonly internalType: "uint160";
1563
+ readonly name: "amount";
1564
+ readonly type: "uint160";
1565
+ }, {
1566
+ readonly internalType: "address";
1567
+ readonly name: "token";
1568
+ readonly type: "address";
1569
+ }];
1570
+ readonly name: "transferFrom";
1571
+ readonly outputs: readonly [];
1572
+ readonly stateMutability: "nonpayable";
1573
+ readonly type: "function";
1574
+ }] | readonly [{
1575
+ readonly constant: true;
1576
+ readonly inputs: readonly [];
1577
+ readonly name: "name";
1578
+ readonly outputs: readonly [{
1579
+ readonly name: "";
1580
+ readonly type: "string";
1581
+ }];
1582
+ readonly payable: false;
1583
+ readonly stateMutability: "view";
1584
+ readonly type: "function";
1585
+ }, {
1586
+ readonly constant: false;
1587
+ readonly inputs: readonly [{
1588
+ readonly name: "_spender";
1589
+ readonly type: "address";
1590
+ }, {
1591
+ readonly name: "_value";
1592
+ readonly type: "uint256";
1593
+ }];
1594
+ readonly name: "approve";
1595
+ readonly outputs: readonly [];
1596
+ readonly payable: false;
1597
+ readonly stateMutability: "nonpayable";
1598
+ readonly type: "function";
1599
+ }, {
1600
+ readonly constant: true;
1601
+ readonly inputs: readonly [];
1602
+ readonly name: "totalSupply";
1603
+ readonly outputs: readonly [{
1604
+ readonly name: "";
1605
+ readonly type: "uint256";
1606
+ }];
1607
+ readonly payable: false;
1608
+ readonly stateMutability: "view";
1609
+ readonly type: "function";
1610
+ }, {
1611
+ readonly constant: false;
1612
+ readonly inputs: readonly [{
1613
+ readonly name: "_from";
1614
+ readonly type: "address";
1615
+ }, {
1616
+ readonly name: "_to";
1617
+ readonly type: "address";
1618
+ }, {
1619
+ readonly name: "_value";
1620
+ readonly type: "uint256";
1621
+ }];
1622
+ readonly name: "transferFrom";
1623
+ readonly outputs: readonly [{
1624
+ readonly name: "";
1625
+ readonly type: "bool";
1626
+ }];
1627
+ readonly payable: false;
1628
+ readonly stateMutability: "nonpayable";
1629
+ readonly type: "function";
1630
+ }, {
1631
+ readonly constant: true;
1632
+ readonly inputs: readonly [];
1633
+ readonly name: "decimals";
1634
+ readonly outputs: readonly [{
1635
+ readonly name: "";
1636
+ readonly type: "uint8";
1637
+ }];
1638
+ readonly payable: false;
1639
+ readonly stateMutability: "view";
1640
+ readonly type: "function";
1641
+ }, {
1642
+ readonly constant: true;
1643
+ readonly inputs: readonly [{
1644
+ readonly name: "_owner";
1645
+ readonly type: "address";
1646
+ }];
1647
+ readonly name: "balanceOf";
1648
+ readonly outputs: readonly [{
1649
+ readonly name: "balance";
1650
+ readonly type: "uint256";
1651
+ }];
1652
+ readonly payable: false;
1653
+ readonly stateMutability: "view";
1654
+ readonly type: "function";
1655
+ }, {
1656
+ readonly constant: true;
1657
+ readonly inputs: readonly [];
1658
+ readonly name: "symbol";
1659
+ readonly outputs: readonly [{
1660
+ readonly name: "";
1661
+ readonly type: "string";
1662
+ }];
1663
+ readonly payable: false;
1664
+ readonly stateMutability: "view";
1665
+ readonly type: "function";
1666
+ }, {
1667
+ readonly constant: false;
1668
+ readonly inputs: readonly [{
1669
+ readonly name: "_to";
1670
+ readonly type: "address";
1671
+ }, {
1672
+ readonly name: "_value";
1673
+ readonly type: "uint256";
1674
+ }];
1675
+ readonly name: "transfer";
1676
+ readonly outputs: readonly [{
1677
+ readonly name: "";
1678
+ readonly type: "bool";
1679
+ }];
1680
+ readonly payable: false;
1681
+ readonly stateMutability: "nonpayable";
1682
+ readonly type: "function";
1683
+ }, {
1684
+ readonly constant: true;
1685
+ readonly inputs: readonly [{
1686
+ readonly name: "_owner";
1687
+ readonly type: "address";
1688
+ }, {
1689
+ readonly name: "_spender";
1690
+ readonly type: "address";
1691
+ }];
1692
+ readonly name: "allowance";
1693
+ readonly outputs: readonly [{
1694
+ readonly name: "";
1695
+ readonly type: "uint256";
1696
+ }];
1697
+ readonly payable: false;
1698
+ readonly stateMutability: "view";
1699
+ readonly type: "function";
1700
+ }, {
1701
+ readonly payable: true;
1702
+ readonly stateMutability: "payable";
1703
+ readonly type: "fallback";
1704
+ }, {
1705
+ readonly anonymous: false;
1706
+ readonly inputs: readonly [{
1707
+ readonly indexed: true;
1708
+ readonly name: "owner";
1709
+ readonly type: "address";
1710
+ }, {
1711
+ readonly indexed: true;
1712
+ readonly name: "spender";
1713
+ readonly type: "address";
1714
+ }, {
1715
+ readonly indexed: false;
1716
+ readonly name: "value";
1717
+ readonly type: "uint256";
1718
+ }];
1719
+ readonly name: "Approval";
1720
+ readonly type: "event";
1721
+ }, {
1722
+ readonly anonymous: false;
1723
+ readonly inputs: readonly [{
1724
+ readonly indexed: true;
1725
+ readonly name: "from";
1726
+ readonly type: "address";
1727
+ }, {
1728
+ readonly indexed: true;
1729
+ readonly name: "to";
1730
+ readonly type: "address";
1731
+ }, {
1732
+ readonly indexed: false;
1733
+ readonly name: "value";
1734
+ readonly type: "uint256";
1735
+ }];
1736
+ readonly name: "Transfer";
1737
+ readonly type: "event";
1738
+ }];
1739
+ getTradeQuotes(request: TradeQuotesRequest): Promise<TradeQuotesResponse>;
1740
+ buildTradeTxn(request: TradeBuildTxnRequest): Promise<TradeBuildTxnResponse>;
1741
+ getTradeTxnStatus({ txHash, chainId }: {
1742
+ txHash: string;
1743
+ chainId: number;
1744
+ }): Promise<TradeStatusResponse>;
1745
+ getTradeMultiTxnStatus({ txHashes, chainIds }: {
1746
+ txHashes: string;
1747
+ chainIds: string;
1748
+ }): Promise<TradeStatusResponse[]>;
1749
+ getAllSupportedChains(): Promise<ChainData>;
1750
+ getAllTokens(chainId: number, source?: string, account?: string): Promise<any>;
1751
+ getTokenDetails(tokenAddress: string, chainId: number, account?: string, includeBalance?: boolean, includePrice?: boolean): Promise<TokenInfo>;
1752
+ getTokensDetails(tokenAddresses: string[], chainId: number, account?: string, includeBalance?: boolean, includePrice?: boolean): Promise<Record<string, TokenInfo> | TokenInfo>;
1753
+ getTokenPrices(tokenAddresses: string[], chainId: number): Promise<Record<string, string | null>>;
1754
+ trade({ request, signer, txnData, batchTransaction, rpcUrls, }: {
1755
+ request: TradeBuildTxnRequest;
1756
+ signer: Signer | WalletClient;
1757
+ txnData?: TradeBuildTxnResponse;
1758
+ batchTransaction?: boolean;
1759
+ rpcUrls?: string[];
1760
+ }): Promise<DZapTransactionResponse>;
1761
+ tradeGasless({ request, signer, txnData, txnStatusCallback, }: {
1762
+ request: TradeBuildTxnRequest;
1763
+ signer: Signer | WalletClient;
1764
+ txnData?: GaslessTradeBuildTxnResponse;
1765
+ txnStatusCallback?: (status: TxnStatus) => void;
1766
+ }): Promise<DZapTransactionResponse>;
1767
+ sendTransaction({ chainId, signer, txnData }: {
1768
+ chainId: number;
1769
+ signer: Signer | WalletClient;
1770
+ txnData: EvmTxData;
1771
+ }): Promise<{
1772
+ status: TxnStatus;
1773
+ error: any;
1774
+ errorMsg: any;
1775
+ code: StatusCodes;
1776
+ } | {
1777
+ status: TxnStatus;
1778
+ code: StatusCodes;
1779
+ txnHash: HexString;
1780
+ }>;
1781
+ waitForBatchTransactionReceipt({ walletClient, batchHash }: {
1782
+ walletClient: WalletClient;
1783
+ batchHash: HexString;
1784
+ }): Promise<WalletCallReceipt>;
1785
+ decodeTxnData({ data, service, chainId }: {
1786
+ data: TransactionReceipt;
1787
+ service: AvailableDZapServices;
1788
+ chainId: number;
1789
+ }): Promise<{
1790
+ swapFailPairs: string[];
1791
+ swapInfo: SwapInfo | SwapInfo[];
1792
+ }>;
1793
+ calculatePoints(request: CalculatePointsRequest): Promise<{
1794
+ points: number;
1795
+ }>;
1796
+ getDZapContractAddress({ chainId, service }: {
1797
+ chainId: number;
1798
+ service: AvailableDZapServices;
1799
+ }): Promise<string>;
1800
+ getAllowance({ chainId, sender, tokens, service, rpcUrls, spender, mode, }: {
1801
+ chainId: number;
1802
+ sender: HexString;
1803
+ tokens: {
1804
+ address: HexString;
1805
+ amount: string;
1806
+ }[];
1807
+ service: AvailableDZapServices;
1808
+ rpcUrls?: string[];
1809
+ spender?: HexString;
1810
+ mode?: ApprovalMode;
1811
+ }): Promise<{
1812
+ status: TxnStatus;
1813
+ code: StatusCodes;
1814
+ data: {
1815
+ [key: string]: {
1816
+ allowance: bigint;
1817
+ approvalNeeded: boolean;
1818
+ signatureNeeded: boolean;
1819
+ };
1820
+ };
1821
+ }>;
1822
+ approve({ chainId, signer, tokens, approvalTxnCallback, service, mode, rpcUrls, spender, }: {
1823
+ chainId: number;
1824
+ signer: WalletClient | Signer;
1825
+ tokens: {
1826
+ address: HexString;
1827
+ amount: string;
1828
+ }[];
1829
+ approvalTxnCallback?: ({ txnDetails, address, }: {
1830
+ txnDetails: {
1831
+ txnHash: string;
1832
+ code: StatusCodes;
1833
+ status: TxnStatus;
1834
+ };
1835
+ address: HexString;
1836
+ }) => Promise<TxnStatus | null>;
1837
+ service: AvailableDZapServices;
1838
+ spender?: HexString;
1839
+ rpcUrls?: string[];
1840
+ mode?: ApprovalMode;
1841
+ }): Promise<{
1842
+ status: TxnStatus;
1843
+ code: StatusCodes;
1844
+ }>;
1845
+ sign(params: Prettify<Omit<GasSignatureParams, 'spender' | 'permitType' | 'rpcUrls' | 'gasless' | 'contractVersion'> & {
1846
+ spender?: HexString;
1847
+ permitType?: PermitMode;
1848
+ rpcUrls?: string[];
1849
+ service: AvailableDZapServices;
1850
+ }>): Promise<SignPermitResponse>;
1851
+ zap({ request, steps, signer }: {
1852
+ request: ZapBuildTxnRequest;
1853
+ signer: WalletClient | Signer;
1854
+ steps?: ZapTransactionStep[];
1855
+ }): Promise<DZapTransactionResponse | {
1856
+ status: TxnStatus.success;
1857
+ code: StatusCodes | number;
1858
+ txnHash: HexString;
1859
+ }>;
1860
+ buildZapTxn(request: ZapBuildTxnRequest): Promise<ZapBuildTxnResponse>;
1861
+ getZapQuote(request: ZapQuoteRequest): Promise<ZapQuoteResponse>;
1862
+ getZapTxnStatus(request: ZapStatusRequest): Promise<ZapStatusResponse>;
1863
+ getBalances(chainId: number, account: string): Promise<TokenResponse>;
1864
+ sendBatchCalls({ walletClient, calls }: {
1865
+ walletClient: WalletClient;
1866
+ calls: BatchCallParams[];
1867
+ }): Promise<{
1868
+ id: string;
1869
+ } | null>;
1870
+ getZapPositions(request: ZapPositionsRequest): Promise<ZapPositionsResponse>;
1871
+ getZapPools(request: ZapPoolsRequest): Promise<ZapPoolsResponse>;
1872
+ getZapPoolDetails(request: ZapPoolDetailsRequest): Promise<ZapPoolDetails>;
1873
+ getZapChains(): Promise<ZapChains>;
1874
+ getZapProviders(): Promise<ZapProviders>;
1875
+ broadcastTradeTx(request: BroadcastTxParams): Promise<BroadcastTxResponse>;
1876
+ broadcastZapTx(request: BroadcastTxParams): Promise<BroadcastTxResponse>;
1877
+ }
1878
+
1879
+ declare function getTokensPairKey({ srcToken, destToken, srcChainId, destChainId, srcChainNativeAddress, destChainNativeAddress, }: {
1880
+ srcToken: string;
1881
+ destToken: string;
1882
+ srcChainId: number;
1883
+ destChainId: number;
1884
+ srcChainNativeAddress?: string;
1885
+ destChainNativeAddress?: string;
1886
+ }): string;
1887
+
1888
+ declare class SwapInputDataDecoder {
1889
+ private decodeSingleSwapData;
1890
+ private decodeMultiSwapData;
1891
+ private decodeBatchPermitSwapData;
1892
+ private decodeGaslessExecuteMultiSwapData;
1893
+ private decodeGaslessExecuteMultiSwapWithWitnessData;
1894
+ private decodeGaslessExecuteSwapData;
1895
+ private readonly swapFunctionSignatureWithInputTokenIndex;
1896
+ updateSwapInfo: ({ data, eventSwapInfo, }: {
1897
+ eventSwapInfo?: SwapInfo[] | SwapInfo;
1898
+ data?: HexString;
1899
+ }) => SwapInfo[] | SwapInfo | undefined;
1900
+ }
1901
+
1902
+ declare const checkEIP2612PermitSupport: ({ address, chainId, rpcUrls, owner, permit, }: {
1903
+ chainId: number;
1904
+ address: HexString;
1905
+ rpcUrls?: string[];
1906
+ owner: HexString;
1907
+ permit?: TokenPermitData;
1908
+ }) => Promise<{
1909
+ supportsPermit: boolean;
1910
+ data?: {
1911
+ version: string;
1912
+ name: string;
1913
+ nonce: bigint;
1914
+ };
1915
+ }>;
1916
+
1917
+ declare const formatToken: <T extends HexString | string = string>(token: T, nativeTokenAddress?: T) => T;
1918
+
1919
+ export { type ApiRpcResponse, type ApprovalMode, ApprovalModes, type BatchPermitCallbackParams, type BtcTxData, type Chain, type ChainData, type ContractErrorResponse, DZapClient, DZapPermitMode, type DZapTransactionResponse, type EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, type ProviderDetails, type PsbtInput, type PsbtOutput, type QuoteFilter, QuoteFilters, STATUS, type SVMTxnDetails, Services, type SignPermitResponse, type SignatureCallbackParams, SignatureExpiryInSecs, type SinglePermitCallbackParams, StatusCodes, type StepAction, type SvmTxData, type SwapInfo, SwapInputDataDecoder, type Token, type TokenInfo, type TokenPermitData, type TokenResponse, type TradeBuildTxnRequest, type TradeBuildTxnRequestData, type TradeBuildTxnResponse, type TradeGasBuildTxnResponse, type TradePath, type TradeQuotesRequest, type TradeQuotesRequestData, type TradeQuotesResponse, type TradeStatusResponse, type TradeStep, TxnStatus, type ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapIntegratorConfig, type ZapPath, type ZapPathAction, type ZapPathAsset, type ZapPool, type ZapPoolDetails, type ZapPoolDetailsRequest, type ZapPoolsRequest, type ZapPoolsResponse, type ZapPosition, type ZapPositionsRequest, type ZapPositionsResponse, type ZapProviders, type ZapQuoteRequest, type ZapQuoteResponse, type ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusAsset, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, checkEIP2612PermitSupport, contractErrorActions, erc20Functions, formatToken, getTokensPairKey, zapPathAction, zapStepAction };