@dzapio/sdk 1.0.3 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +3 -1
- package/dist/artifacts/ERC20Permit.d.ts +38 -0
- package/dist/artifacts/Permit2Proxy.d.ts +416 -0
- package/dist/artifacts/default/Permit2Abi.d.ts +700 -70
- package/dist/chains/definitions/arthera.d.ts +35 -0
- package/dist/chains/definitions/fiveIre.d.ts +35 -0
- package/dist/chains/definitions/hyperEvm.d.ts +35 -0
- package/dist/chains/definitions/hyperliquid.d.ts +35 -0
- package/dist/chains/index.d.ts +143 -0
- package/dist/constants/address.d.ts +0 -1
- package/dist/constants/approval.d.ts +3 -1
- package/dist/constants/chains.d.ts +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/permit.d.ts +25 -1
- package/dist/constants/urlConstants.d.ts +2 -0
- package/dist/dZapClient/index.d.ts +717 -103
- package/dist/enums/index.d.ts +7 -5
- package/dist/index.d.ts +7 -9
- package/dist/index.js +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/transactionHandlers/permit.d.ts +48 -47
- package/dist/transactionHandlers/trade.d.ts +9 -1
- package/dist/types/eip-2612.d.ts +19 -1
- package/dist/types/index.d.ts +182 -16
- package/dist/types/permit.d.ts +191 -0
- package/dist/types/zap/build.d.ts +6 -6
- package/dist/types/zap/quote.d.ts +5 -1
- package/dist/utils/eip-2612/eip2612Permit.d.ts +23 -0
- package/dist/utils/erc20.d.ts +17 -15
- package/dist/utils/index.d.ts +734 -104
- package/dist/utils/permit2/domain.d.ts +2 -0
- package/dist/utils/permit2/index.d.ts +4 -0
- package/dist/utils/permit2/nonce.d.ts +15 -0
- package/dist/utils/permit2/permitData.d.ts +23 -0
- package/dist/utils/permit2/values.d.ts +54 -0
- package/dist/utils/permit2/witnessData.d.ts +4 -0
- package/dist/utils/signIntent/custom.d.ts +11 -0
- package/dist/utils/signIntent/gasless.d.ts +12 -0
- package/package.json +12 -2
- package/dist/utils/chains.d.ts +0 -2
- package/dist/utils/permit/permit2Methods.d.ts +0 -33
- package/dist/utils/permit/permitMethods.d.ts +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { TransactionReceipt, WalletClient } from 'viem';
|
|
2
|
+
import { Prettify, TransactionReceipt, WalletClient } from 'viem';
|
|
3
3
|
import { ContractVersion, StatusCodes, TxnStatus } from '../enums';
|
|
4
|
-
import { ApprovalMode, AvailableDZapServices, CalculatePointsRequest, ChainData,
|
|
4
|
+
import { ApprovalMode, AvailableDZapServices, CalculatePointsRequest, ChainData, EvmTxData, GaslessTradeBuildTxnResponse, GasSignatureParams, HexString, OtherAvailableAbis, PermitMode, SignPermitResponse, TokenInfo, TokenResponse, TradeBuildTxnRequest, TradeBuildTxnResponse, TradeQuotesRequest, TradeQuotesResponse, TradeStatusResponse } from '../types';
|
|
5
5
|
import { ZapBuildTxnRequest, ZapBuildTxnResponse, ZapChains, ZapPoolDetails, ZapPoolDetailsRequest, ZapPoolsRequest, ZapPoolsResponse, ZapPositionsRequest, ZapPositionsResponse, ZapProviders, ZapQuoteRequest, ZapQuoteResponse, ZapStatusRequest, ZapStatusResponse, ZapTransactionStep } from '../types/zap';
|
|
6
6
|
import { BatchCallParams } from '../utils/eip-5792';
|
|
7
7
|
declare class DZapClient {
|
|
@@ -13,76 +13,706 @@ declare class DZapClient {
|
|
|
13
13
|
static getInstance(apiKey?: string, rpcUrlsByChainId?: Record<number, string[]>): DZapClient;
|
|
14
14
|
static getChainConfig(): Promise<ChainData>;
|
|
15
15
|
static getDZapAbi(service: AvailableDZapServices, version: ContractVersion): import("viem").Abi;
|
|
16
|
-
static getOtherAbi: (name: OtherAvailableAbis) =>
|
|
17
|
-
inputs: {
|
|
18
|
-
internalType:
|
|
19
|
-
name:
|
|
20
|
-
type:
|
|
21
|
-
}
|
|
22
|
-
name:
|
|
23
|
-
type:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
inputs: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
16
|
+
static getOtherAbi: (name: OtherAvailableAbis) => readonly [{
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly internalType: "uint256";
|
|
19
|
+
readonly name: "deadline";
|
|
20
|
+
readonly type: "uint256";
|
|
21
|
+
}];
|
|
22
|
+
readonly name: "AllowanceExpired";
|
|
23
|
+
readonly type: "error";
|
|
24
|
+
}, {
|
|
25
|
+
readonly inputs: readonly [];
|
|
26
|
+
readonly name: "ExcessiveInvalidation";
|
|
27
|
+
readonly type: "error";
|
|
28
|
+
}, {
|
|
29
|
+
readonly inputs: readonly [{
|
|
30
|
+
readonly internalType: "uint256";
|
|
31
|
+
readonly name: "amount";
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
}];
|
|
34
|
+
readonly name: "InsufficientAllowance";
|
|
35
|
+
readonly type: "error";
|
|
36
|
+
}, {
|
|
37
|
+
readonly inputs: readonly [{
|
|
38
|
+
readonly internalType: "uint256";
|
|
39
|
+
readonly name: "maxAmount";
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}];
|
|
42
|
+
readonly name: "InvalidAmount";
|
|
43
|
+
readonly type: "error";
|
|
44
|
+
}, {
|
|
45
|
+
readonly inputs: readonly [];
|
|
46
|
+
readonly name: "InvalidContractSignature";
|
|
47
|
+
readonly type: "error";
|
|
48
|
+
}, {
|
|
49
|
+
readonly inputs: readonly [];
|
|
50
|
+
readonly name: "InvalidNonce";
|
|
51
|
+
readonly type: "error";
|
|
52
|
+
}, {
|
|
53
|
+
readonly inputs: readonly [];
|
|
54
|
+
readonly name: "InvalidSignature";
|
|
55
|
+
readonly type: "error";
|
|
56
|
+
}, {
|
|
57
|
+
readonly inputs: readonly [];
|
|
58
|
+
readonly name: "InvalidSignatureLength";
|
|
59
|
+
readonly type: "error";
|
|
60
|
+
}, {
|
|
61
|
+
readonly inputs: readonly [];
|
|
62
|
+
readonly name: "InvalidSigner";
|
|
63
|
+
readonly type: "error";
|
|
64
|
+
}, {
|
|
65
|
+
readonly inputs: readonly [];
|
|
66
|
+
readonly name: "LengthMismatch";
|
|
67
|
+
readonly type: "error";
|
|
68
|
+
}, {
|
|
69
|
+
readonly inputs: readonly [{
|
|
70
|
+
readonly internalType: "uint256";
|
|
71
|
+
readonly name: "signatureDeadline";
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
}];
|
|
74
|
+
readonly name: "SignatureExpired";
|
|
75
|
+
readonly type: "error";
|
|
76
|
+
}, {
|
|
77
|
+
readonly anonymous: false;
|
|
78
|
+
readonly inputs: readonly [{
|
|
79
|
+
readonly indexed: true;
|
|
80
|
+
readonly internalType: "address";
|
|
81
|
+
readonly name: "owner";
|
|
82
|
+
readonly type: "address";
|
|
83
|
+
}, {
|
|
84
|
+
readonly indexed: true;
|
|
85
|
+
readonly internalType: "address";
|
|
86
|
+
readonly name: "token";
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
}, {
|
|
89
|
+
readonly indexed: true;
|
|
90
|
+
readonly internalType: "address";
|
|
91
|
+
readonly name: "spender";
|
|
92
|
+
readonly type: "address";
|
|
93
|
+
}, {
|
|
94
|
+
readonly indexed: false;
|
|
95
|
+
readonly internalType: "uint160";
|
|
96
|
+
readonly name: "amount";
|
|
97
|
+
readonly type: "uint160";
|
|
98
|
+
}, {
|
|
99
|
+
readonly indexed: false;
|
|
100
|
+
readonly internalType: "uint48";
|
|
101
|
+
readonly name: "expiration";
|
|
102
|
+
readonly type: "uint48";
|
|
103
|
+
}];
|
|
104
|
+
readonly name: "Approval";
|
|
105
|
+
readonly type: "event";
|
|
106
|
+
}, {
|
|
107
|
+
readonly anonymous: false;
|
|
108
|
+
readonly inputs: readonly [{
|
|
109
|
+
readonly indexed: true;
|
|
110
|
+
readonly internalType: "address";
|
|
111
|
+
readonly name: "owner";
|
|
112
|
+
readonly type: "address";
|
|
113
|
+
}, {
|
|
114
|
+
readonly indexed: false;
|
|
115
|
+
readonly internalType: "address";
|
|
116
|
+
readonly name: "token";
|
|
117
|
+
readonly type: "address";
|
|
118
|
+
}, {
|
|
119
|
+
readonly indexed: false;
|
|
120
|
+
readonly internalType: "address";
|
|
121
|
+
readonly name: "spender";
|
|
122
|
+
readonly type: "address";
|
|
123
|
+
}];
|
|
124
|
+
readonly name: "Lockdown";
|
|
125
|
+
readonly type: "event";
|
|
126
|
+
}, {
|
|
127
|
+
readonly anonymous: false;
|
|
128
|
+
readonly inputs: readonly [{
|
|
129
|
+
readonly indexed: true;
|
|
130
|
+
readonly internalType: "address";
|
|
131
|
+
readonly name: "owner";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
}, {
|
|
134
|
+
readonly indexed: true;
|
|
135
|
+
readonly internalType: "address";
|
|
136
|
+
readonly name: "token";
|
|
137
|
+
readonly type: "address";
|
|
138
|
+
}, {
|
|
139
|
+
readonly indexed: true;
|
|
140
|
+
readonly internalType: "address";
|
|
141
|
+
readonly name: "spender";
|
|
142
|
+
readonly type: "address";
|
|
143
|
+
}, {
|
|
144
|
+
readonly indexed: false;
|
|
145
|
+
readonly internalType: "uint48";
|
|
146
|
+
readonly name: "newNonce";
|
|
147
|
+
readonly type: "uint48";
|
|
148
|
+
}, {
|
|
149
|
+
readonly indexed: false;
|
|
150
|
+
readonly internalType: "uint48";
|
|
151
|
+
readonly name: "oldNonce";
|
|
152
|
+
readonly type: "uint48";
|
|
153
|
+
}];
|
|
154
|
+
readonly name: "NonceInvalidation";
|
|
155
|
+
readonly type: "event";
|
|
156
|
+
}, {
|
|
157
|
+
readonly anonymous: false;
|
|
158
|
+
readonly inputs: readonly [{
|
|
159
|
+
readonly indexed: true;
|
|
160
|
+
readonly internalType: "address";
|
|
161
|
+
readonly name: "owner";
|
|
162
|
+
readonly type: "address";
|
|
163
|
+
}, {
|
|
164
|
+
readonly indexed: true;
|
|
165
|
+
readonly internalType: "address";
|
|
166
|
+
readonly name: "token";
|
|
167
|
+
readonly type: "address";
|
|
168
|
+
}, {
|
|
169
|
+
readonly indexed: true;
|
|
170
|
+
readonly internalType: "address";
|
|
171
|
+
readonly name: "spender";
|
|
172
|
+
readonly type: "address";
|
|
173
|
+
}, {
|
|
174
|
+
readonly indexed: false;
|
|
175
|
+
readonly internalType: "uint160";
|
|
176
|
+
readonly name: "amount";
|
|
177
|
+
readonly type: "uint160";
|
|
178
|
+
}, {
|
|
179
|
+
readonly indexed: false;
|
|
180
|
+
readonly internalType: "uint48";
|
|
181
|
+
readonly name: "expiration";
|
|
182
|
+
readonly type: "uint48";
|
|
183
|
+
}, {
|
|
184
|
+
readonly indexed: false;
|
|
185
|
+
readonly internalType: "uint48";
|
|
186
|
+
readonly name: "nonce";
|
|
187
|
+
readonly type: "uint48";
|
|
188
|
+
}];
|
|
189
|
+
readonly name: "Permit";
|
|
190
|
+
readonly type: "event";
|
|
191
|
+
}, {
|
|
192
|
+
readonly anonymous: false;
|
|
193
|
+
readonly inputs: readonly [{
|
|
194
|
+
readonly indexed: true;
|
|
195
|
+
readonly internalType: "address";
|
|
196
|
+
readonly name: "owner";
|
|
197
|
+
readonly type: "address";
|
|
198
|
+
}, {
|
|
199
|
+
readonly indexed: false;
|
|
200
|
+
readonly internalType: "uint256";
|
|
201
|
+
readonly name: "word";
|
|
202
|
+
readonly type: "uint256";
|
|
203
|
+
}, {
|
|
204
|
+
readonly indexed: false;
|
|
205
|
+
readonly internalType: "uint256";
|
|
206
|
+
readonly name: "mask";
|
|
207
|
+
readonly type: "uint256";
|
|
208
|
+
}];
|
|
209
|
+
readonly name: "UnorderedNonceInvalidation";
|
|
210
|
+
readonly type: "event";
|
|
211
|
+
}, {
|
|
212
|
+
readonly inputs: readonly [];
|
|
213
|
+
readonly name: "DOMAIN_SEPARATOR";
|
|
214
|
+
readonly outputs: readonly [{
|
|
215
|
+
readonly internalType: "bytes32";
|
|
216
|
+
readonly name: "";
|
|
217
|
+
readonly type: "bytes32";
|
|
218
|
+
}];
|
|
219
|
+
readonly stateMutability: "view";
|
|
220
|
+
readonly type: "function";
|
|
221
|
+
}, {
|
|
222
|
+
readonly inputs: readonly [{
|
|
223
|
+
readonly internalType: "address";
|
|
224
|
+
readonly name: "";
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
}, {
|
|
227
|
+
readonly internalType: "address";
|
|
228
|
+
readonly name: "";
|
|
229
|
+
readonly type: "address";
|
|
230
|
+
}, {
|
|
231
|
+
readonly internalType: "address";
|
|
232
|
+
readonly name: "";
|
|
233
|
+
readonly type: "address";
|
|
234
|
+
}];
|
|
235
|
+
readonly name: "allowance";
|
|
236
|
+
readonly outputs: readonly [{
|
|
237
|
+
readonly internalType: "uint160";
|
|
238
|
+
readonly name: "amount";
|
|
239
|
+
readonly type: "uint160";
|
|
240
|
+
}, {
|
|
241
|
+
readonly internalType: "uint48";
|
|
242
|
+
readonly name: "expiration";
|
|
243
|
+
readonly type: "uint48";
|
|
244
|
+
}, {
|
|
245
|
+
readonly internalType: "uint48";
|
|
246
|
+
readonly name: "nonce";
|
|
247
|
+
readonly type: "uint48";
|
|
248
|
+
}];
|
|
249
|
+
readonly stateMutability: "view";
|
|
250
|
+
readonly type: "function";
|
|
251
|
+
}, {
|
|
252
|
+
readonly inputs: readonly [{
|
|
253
|
+
readonly internalType: "address";
|
|
254
|
+
readonly name: "token";
|
|
255
|
+
readonly type: "address";
|
|
256
|
+
}, {
|
|
257
|
+
readonly internalType: "address";
|
|
258
|
+
readonly name: "spender";
|
|
259
|
+
readonly type: "address";
|
|
260
|
+
}, {
|
|
261
|
+
readonly internalType: "uint160";
|
|
262
|
+
readonly name: "amount";
|
|
263
|
+
readonly type: "uint160";
|
|
264
|
+
}, {
|
|
265
|
+
readonly internalType: "uint48";
|
|
266
|
+
readonly name: "expiration";
|
|
267
|
+
readonly type: "uint48";
|
|
268
|
+
}];
|
|
269
|
+
readonly name: "approve";
|
|
270
|
+
readonly outputs: readonly [];
|
|
271
|
+
readonly stateMutability: "nonpayable";
|
|
272
|
+
readonly type: "function";
|
|
273
|
+
}, {
|
|
274
|
+
readonly inputs: readonly [{
|
|
275
|
+
readonly internalType: "address";
|
|
276
|
+
readonly name: "token";
|
|
277
|
+
readonly type: "address";
|
|
278
|
+
}, {
|
|
279
|
+
readonly internalType: "address";
|
|
280
|
+
readonly name: "spender";
|
|
281
|
+
readonly type: "address";
|
|
282
|
+
}, {
|
|
283
|
+
readonly internalType: "uint48";
|
|
284
|
+
readonly name: "newNonce";
|
|
285
|
+
readonly type: "uint48";
|
|
286
|
+
}];
|
|
287
|
+
readonly name: "invalidateNonces";
|
|
288
|
+
readonly outputs: readonly [];
|
|
289
|
+
readonly stateMutability: "nonpayable";
|
|
290
|
+
readonly type: "function";
|
|
291
|
+
}, {
|
|
292
|
+
readonly inputs: readonly [{
|
|
293
|
+
readonly internalType: "uint256";
|
|
294
|
+
readonly name: "wordPos";
|
|
295
|
+
readonly type: "uint256";
|
|
296
|
+
}, {
|
|
297
|
+
readonly internalType: "uint256";
|
|
298
|
+
readonly name: "mask";
|
|
299
|
+
readonly type: "uint256";
|
|
300
|
+
}];
|
|
301
|
+
readonly name: "invalidateUnorderedNonces";
|
|
302
|
+
readonly outputs: readonly [];
|
|
303
|
+
readonly stateMutability: "nonpayable";
|
|
304
|
+
readonly type: "function";
|
|
305
|
+
}, {
|
|
306
|
+
readonly inputs: readonly [{
|
|
307
|
+
readonly components: readonly [{
|
|
308
|
+
readonly internalType: "address";
|
|
309
|
+
readonly name: "token";
|
|
310
|
+
readonly type: "address";
|
|
311
|
+
}, {
|
|
312
|
+
readonly internalType: "address";
|
|
313
|
+
readonly name: "spender";
|
|
314
|
+
readonly type: "address";
|
|
315
|
+
}];
|
|
316
|
+
readonly internalType: "struct IAllowanceTransfer.TokenSpenderPair[]";
|
|
317
|
+
readonly name: "approvals";
|
|
318
|
+
readonly type: "tuple[]";
|
|
319
|
+
}];
|
|
320
|
+
readonly name: "lockdown";
|
|
321
|
+
readonly outputs: readonly [];
|
|
322
|
+
readonly stateMutability: "nonpayable";
|
|
323
|
+
readonly type: "function";
|
|
324
|
+
}, {
|
|
325
|
+
readonly inputs: readonly [{
|
|
326
|
+
readonly internalType: "address";
|
|
327
|
+
readonly name: "";
|
|
328
|
+
readonly type: "address";
|
|
329
|
+
}, {
|
|
330
|
+
readonly internalType: "uint256";
|
|
331
|
+
readonly name: "";
|
|
332
|
+
readonly type: "uint256";
|
|
333
|
+
}];
|
|
334
|
+
readonly name: "nonceBitmap";
|
|
335
|
+
readonly outputs: readonly [{
|
|
336
|
+
readonly internalType: "uint256";
|
|
337
|
+
readonly name: "";
|
|
338
|
+
readonly type: "uint256";
|
|
339
|
+
}];
|
|
340
|
+
readonly stateMutability: "view";
|
|
341
|
+
readonly type: "function";
|
|
342
|
+
}, {
|
|
343
|
+
readonly inputs: readonly [{
|
|
344
|
+
readonly internalType: "address";
|
|
345
|
+
readonly name: "owner";
|
|
346
|
+
readonly type: "address";
|
|
347
|
+
}, {
|
|
348
|
+
readonly components: readonly [{
|
|
349
|
+
readonly components: readonly [{
|
|
350
|
+
readonly internalType: "address";
|
|
351
|
+
readonly name: "token";
|
|
352
|
+
readonly type: "address";
|
|
353
|
+
}, {
|
|
354
|
+
readonly internalType: "uint160";
|
|
355
|
+
readonly name: "amount";
|
|
356
|
+
readonly type: "uint160";
|
|
357
|
+
}, {
|
|
358
|
+
readonly internalType: "uint48";
|
|
359
|
+
readonly name: "expiration";
|
|
360
|
+
readonly type: "uint48";
|
|
361
|
+
}, {
|
|
362
|
+
readonly internalType: "uint48";
|
|
363
|
+
readonly name: "nonce";
|
|
364
|
+
readonly type: "uint48";
|
|
365
|
+
}];
|
|
366
|
+
readonly internalType: "struct IAllowanceTransfer.PermitDetails[]";
|
|
367
|
+
readonly name: "details";
|
|
368
|
+
readonly type: "tuple[]";
|
|
369
|
+
}, {
|
|
370
|
+
readonly internalType: "address";
|
|
371
|
+
readonly name: "spender";
|
|
372
|
+
readonly type: "address";
|
|
373
|
+
}, {
|
|
374
|
+
readonly internalType: "uint256";
|
|
375
|
+
readonly name: "sigDeadline";
|
|
376
|
+
readonly type: "uint256";
|
|
377
|
+
}];
|
|
378
|
+
readonly internalType: "struct IAllowanceTransfer.PermitBatch";
|
|
379
|
+
readonly name: "permitBatch";
|
|
380
|
+
readonly type: "tuple";
|
|
381
|
+
}, {
|
|
382
|
+
readonly internalType: "bytes";
|
|
383
|
+
readonly name: "signature";
|
|
384
|
+
readonly type: "bytes";
|
|
385
|
+
}];
|
|
386
|
+
readonly name: "permit";
|
|
387
|
+
readonly outputs: readonly [];
|
|
388
|
+
readonly stateMutability: "nonpayable";
|
|
389
|
+
readonly type: "function";
|
|
390
|
+
}, {
|
|
391
|
+
readonly inputs: readonly [{
|
|
392
|
+
readonly internalType: "address";
|
|
393
|
+
readonly name: "owner";
|
|
394
|
+
readonly type: "address";
|
|
395
|
+
}, {
|
|
396
|
+
readonly components: readonly [{
|
|
397
|
+
readonly components: readonly [{
|
|
398
|
+
readonly internalType: "address";
|
|
399
|
+
readonly name: "token";
|
|
400
|
+
readonly type: "address";
|
|
401
|
+
}, {
|
|
402
|
+
readonly internalType: "uint160";
|
|
403
|
+
readonly name: "amount";
|
|
404
|
+
readonly type: "uint160";
|
|
405
|
+
}, {
|
|
406
|
+
readonly internalType: "uint48";
|
|
407
|
+
readonly name: "expiration";
|
|
408
|
+
readonly type: "uint48";
|
|
409
|
+
}, {
|
|
410
|
+
readonly internalType: "uint48";
|
|
411
|
+
readonly name: "nonce";
|
|
412
|
+
readonly type: "uint48";
|
|
413
|
+
}];
|
|
414
|
+
readonly internalType: "struct IAllowanceTransfer.PermitDetails";
|
|
415
|
+
readonly name: "details";
|
|
416
|
+
readonly type: "tuple";
|
|
417
|
+
}, {
|
|
418
|
+
readonly internalType: "address";
|
|
419
|
+
readonly name: "spender";
|
|
420
|
+
readonly type: "address";
|
|
421
|
+
}, {
|
|
422
|
+
readonly internalType: "uint256";
|
|
423
|
+
readonly name: "sigDeadline";
|
|
424
|
+
readonly type: "uint256";
|
|
425
|
+
}];
|
|
426
|
+
readonly internalType: "struct IAllowanceTransfer.PermitSingle";
|
|
427
|
+
readonly name: "permitSingle";
|
|
428
|
+
readonly type: "tuple";
|
|
429
|
+
}, {
|
|
430
|
+
readonly internalType: "bytes";
|
|
431
|
+
readonly name: "signature";
|
|
432
|
+
readonly type: "bytes";
|
|
433
|
+
}];
|
|
434
|
+
readonly name: "permit";
|
|
435
|
+
readonly outputs: readonly [];
|
|
436
|
+
readonly stateMutability: "nonpayable";
|
|
437
|
+
readonly type: "function";
|
|
438
|
+
}, {
|
|
439
|
+
readonly inputs: readonly [{
|
|
440
|
+
readonly components: readonly [{
|
|
441
|
+
readonly components: readonly [{
|
|
442
|
+
readonly internalType: "address";
|
|
443
|
+
readonly name: "token";
|
|
444
|
+
readonly type: "address";
|
|
445
|
+
}, {
|
|
446
|
+
readonly internalType: "uint256";
|
|
447
|
+
readonly name: "amount";
|
|
448
|
+
readonly type: "uint256";
|
|
449
|
+
}];
|
|
450
|
+
readonly internalType: "struct ISignatureTransfer.TokenPermissions";
|
|
451
|
+
readonly name: "permitted";
|
|
452
|
+
readonly type: "tuple";
|
|
453
|
+
}, {
|
|
454
|
+
readonly internalType: "uint256";
|
|
455
|
+
readonly name: "nonce";
|
|
456
|
+
readonly type: "uint256";
|
|
457
|
+
}, {
|
|
458
|
+
readonly internalType: "uint256";
|
|
459
|
+
readonly name: "deadline";
|
|
460
|
+
readonly type: "uint256";
|
|
461
|
+
}];
|
|
462
|
+
readonly internalType: "struct ISignatureTransfer.PermitTransferFrom";
|
|
463
|
+
readonly name: "permit";
|
|
464
|
+
readonly type: "tuple";
|
|
465
|
+
}, {
|
|
466
|
+
readonly components: readonly [{
|
|
467
|
+
readonly internalType: "address";
|
|
468
|
+
readonly name: "to";
|
|
469
|
+
readonly type: "address";
|
|
470
|
+
}, {
|
|
471
|
+
readonly internalType: "uint256";
|
|
472
|
+
readonly name: "requestedAmount";
|
|
473
|
+
readonly type: "uint256";
|
|
474
|
+
}];
|
|
475
|
+
readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails";
|
|
476
|
+
readonly name: "transferDetails";
|
|
477
|
+
readonly type: "tuple";
|
|
478
|
+
}, {
|
|
479
|
+
readonly internalType: "address";
|
|
480
|
+
readonly name: "owner";
|
|
481
|
+
readonly type: "address";
|
|
482
|
+
}, {
|
|
483
|
+
readonly internalType: "bytes";
|
|
484
|
+
readonly name: "signature";
|
|
485
|
+
readonly type: "bytes";
|
|
486
|
+
}];
|
|
487
|
+
readonly name: "permitTransferFrom";
|
|
488
|
+
readonly outputs: readonly [];
|
|
489
|
+
readonly stateMutability: "nonpayable";
|
|
490
|
+
readonly type: "function";
|
|
491
|
+
}, {
|
|
492
|
+
readonly inputs: readonly [{
|
|
493
|
+
readonly components: readonly [{
|
|
494
|
+
readonly components: readonly [{
|
|
495
|
+
readonly internalType: "address";
|
|
496
|
+
readonly name: "token";
|
|
497
|
+
readonly type: "address";
|
|
498
|
+
}, {
|
|
499
|
+
readonly internalType: "uint256";
|
|
500
|
+
readonly name: "amount";
|
|
501
|
+
readonly type: "uint256";
|
|
502
|
+
}];
|
|
503
|
+
readonly internalType: "struct ISignatureTransfer.TokenPermissions[]";
|
|
504
|
+
readonly name: "permitted";
|
|
505
|
+
readonly type: "tuple[]";
|
|
506
|
+
}, {
|
|
507
|
+
readonly internalType: "uint256";
|
|
508
|
+
readonly name: "nonce";
|
|
509
|
+
readonly type: "uint256";
|
|
510
|
+
}, {
|
|
511
|
+
readonly internalType: "uint256";
|
|
512
|
+
readonly name: "deadline";
|
|
513
|
+
readonly type: "uint256";
|
|
514
|
+
}];
|
|
515
|
+
readonly internalType: "struct ISignatureTransfer.PermitBatchTransferFrom";
|
|
516
|
+
readonly name: "permit";
|
|
517
|
+
readonly type: "tuple";
|
|
518
|
+
}, {
|
|
519
|
+
readonly components: readonly [{
|
|
520
|
+
readonly internalType: "address";
|
|
521
|
+
readonly name: "to";
|
|
522
|
+
readonly type: "address";
|
|
523
|
+
}, {
|
|
524
|
+
readonly internalType: "uint256";
|
|
525
|
+
readonly name: "requestedAmount";
|
|
526
|
+
readonly type: "uint256";
|
|
527
|
+
}];
|
|
528
|
+
readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails[]";
|
|
529
|
+
readonly name: "transferDetails";
|
|
530
|
+
readonly type: "tuple[]";
|
|
531
|
+
}, {
|
|
532
|
+
readonly internalType: "address";
|
|
533
|
+
readonly name: "owner";
|
|
534
|
+
readonly type: "address";
|
|
535
|
+
}, {
|
|
536
|
+
readonly internalType: "bytes";
|
|
537
|
+
readonly name: "signature";
|
|
538
|
+
readonly type: "bytes";
|
|
539
|
+
}];
|
|
540
|
+
readonly name: "permitTransferFrom";
|
|
541
|
+
readonly outputs: readonly [];
|
|
542
|
+
readonly stateMutability: "nonpayable";
|
|
543
|
+
readonly type: "function";
|
|
544
|
+
}, {
|
|
545
|
+
readonly inputs: readonly [{
|
|
546
|
+
readonly components: readonly [{
|
|
547
|
+
readonly components: readonly [{
|
|
548
|
+
readonly internalType: "address";
|
|
549
|
+
readonly name: "token";
|
|
550
|
+
readonly type: "address";
|
|
551
|
+
}, {
|
|
552
|
+
readonly internalType: "uint256";
|
|
553
|
+
readonly name: "amount";
|
|
554
|
+
readonly type: "uint256";
|
|
555
|
+
}];
|
|
556
|
+
readonly internalType: "struct ISignatureTransfer.TokenPermissions";
|
|
557
|
+
readonly name: "permitted";
|
|
558
|
+
readonly type: "tuple";
|
|
559
|
+
}, {
|
|
560
|
+
readonly internalType: "uint256";
|
|
561
|
+
readonly name: "nonce";
|
|
562
|
+
readonly type: "uint256";
|
|
563
|
+
}, {
|
|
564
|
+
readonly internalType: "uint256";
|
|
565
|
+
readonly name: "deadline";
|
|
566
|
+
readonly type: "uint256";
|
|
567
|
+
}];
|
|
568
|
+
readonly internalType: "struct ISignatureTransfer.PermitTransferFrom";
|
|
569
|
+
readonly name: "permit";
|
|
570
|
+
readonly type: "tuple";
|
|
571
|
+
}, {
|
|
572
|
+
readonly components: readonly [{
|
|
573
|
+
readonly internalType: "address";
|
|
574
|
+
readonly name: "to";
|
|
575
|
+
readonly type: "address";
|
|
576
|
+
}, {
|
|
577
|
+
readonly internalType: "uint256";
|
|
578
|
+
readonly name: "requestedAmount";
|
|
579
|
+
readonly type: "uint256";
|
|
580
|
+
}];
|
|
581
|
+
readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails";
|
|
582
|
+
readonly name: "transferDetails";
|
|
583
|
+
readonly type: "tuple";
|
|
584
|
+
}, {
|
|
585
|
+
readonly internalType: "address";
|
|
586
|
+
readonly name: "owner";
|
|
587
|
+
readonly type: "address";
|
|
588
|
+
}, {
|
|
589
|
+
readonly internalType: "bytes32";
|
|
590
|
+
readonly name: "witness";
|
|
591
|
+
readonly type: "bytes32";
|
|
592
|
+
}, {
|
|
593
|
+
readonly internalType: "string";
|
|
594
|
+
readonly name: "witnessTypeString";
|
|
595
|
+
readonly type: "string";
|
|
596
|
+
}, {
|
|
597
|
+
readonly internalType: "bytes";
|
|
598
|
+
readonly name: "signature";
|
|
599
|
+
readonly type: "bytes";
|
|
600
|
+
}];
|
|
601
|
+
readonly name: "permitWitnessTransferFrom";
|
|
602
|
+
readonly outputs: readonly [];
|
|
603
|
+
readonly stateMutability: "nonpayable";
|
|
604
|
+
readonly type: "function";
|
|
605
|
+
}, {
|
|
606
|
+
readonly inputs: readonly [{
|
|
607
|
+
readonly components: readonly [{
|
|
608
|
+
readonly components: readonly [{
|
|
609
|
+
readonly internalType: "address";
|
|
610
|
+
readonly name: "token";
|
|
611
|
+
readonly type: "address";
|
|
612
|
+
}, {
|
|
613
|
+
readonly internalType: "uint256";
|
|
614
|
+
readonly name: "amount";
|
|
615
|
+
readonly type: "uint256";
|
|
616
|
+
}];
|
|
617
|
+
readonly internalType: "struct ISignatureTransfer.TokenPermissions[]";
|
|
618
|
+
readonly name: "permitted";
|
|
619
|
+
readonly type: "tuple[]";
|
|
620
|
+
}, {
|
|
621
|
+
readonly internalType: "uint256";
|
|
622
|
+
readonly name: "nonce";
|
|
623
|
+
readonly type: "uint256";
|
|
624
|
+
}, {
|
|
625
|
+
readonly internalType: "uint256";
|
|
626
|
+
readonly name: "deadline";
|
|
627
|
+
readonly type: "uint256";
|
|
628
|
+
}];
|
|
629
|
+
readonly internalType: "struct ISignatureTransfer.PermitBatchTransferFrom";
|
|
630
|
+
readonly name: "permit";
|
|
631
|
+
readonly type: "tuple";
|
|
632
|
+
}, {
|
|
633
|
+
readonly components: readonly [{
|
|
634
|
+
readonly internalType: "address";
|
|
635
|
+
readonly name: "to";
|
|
636
|
+
readonly type: "address";
|
|
637
|
+
}, {
|
|
638
|
+
readonly internalType: "uint256";
|
|
639
|
+
readonly name: "requestedAmount";
|
|
640
|
+
readonly type: "uint256";
|
|
641
|
+
}];
|
|
642
|
+
readonly internalType: "struct ISignatureTransfer.SignatureTransferDetails[]";
|
|
643
|
+
readonly name: "transferDetails";
|
|
644
|
+
readonly type: "tuple[]";
|
|
645
|
+
}, {
|
|
646
|
+
readonly internalType: "address";
|
|
647
|
+
readonly name: "owner";
|
|
648
|
+
readonly type: "address";
|
|
649
|
+
}, {
|
|
650
|
+
readonly internalType: "bytes32";
|
|
651
|
+
readonly name: "witness";
|
|
652
|
+
readonly type: "bytes32";
|
|
653
|
+
}, {
|
|
654
|
+
readonly internalType: "string";
|
|
655
|
+
readonly name: "witnessTypeString";
|
|
656
|
+
readonly type: "string";
|
|
657
|
+
}, {
|
|
658
|
+
readonly internalType: "bytes";
|
|
659
|
+
readonly name: "signature";
|
|
660
|
+
readonly type: "bytes";
|
|
661
|
+
}];
|
|
662
|
+
readonly name: "permitWitnessTransferFrom";
|
|
663
|
+
readonly outputs: readonly [];
|
|
664
|
+
readonly stateMutability: "nonpayable";
|
|
665
|
+
readonly type: "function";
|
|
666
|
+
}, {
|
|
667
|
+
readonly inputs: readonly [{
|
|
668
|
+
readonly components: readonly [{
|
|
669
|
+
readonly internalType: "address";
|
|
670
|
+
readonly name: "from";
|
|
671
|
+
readonly type: "address";
|
|
672
|
+
}, {
|
|
673
|
+
readonly internalType: "address";
|
|
674
|
+
readonly name: "to";
|
|
675
|
+
readonly type: "address";
|
|
676
|
+
}, {
|
|
677
|
+
readonly internalType: "uint160";
|
|
678
|
+
readonly name: "amount";
|
|
679
|
+
readonly type: "uint160";
|
|
680
|
+
}, {
|
|
681
|
+
readonly internalType: "address";
|
|
682
|
+
readonly name: "token";
|
|
683
|
+
readonly type: "address";
|
|
684
|
+
}];
|
|
685
|
+
readonly internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]";
|
|
686
|
+
readonly name: "transferDetails";
|
|
687
|
+
readonly type: "tuple[]";
|
|
688
|
+
}];
|
|
689
|
+
readonly name: "transferFrom";
|
|
690
|
+
readonly outputs: readonly [];
|
|
691
|
+
readonly stateMutability: "nonpayable";
|
|
692
|
+
readonly type: "function";
|
|
693
|
+
}, {
|
|
694
|
+
readonly inputs: readonly [{
|
|
695
|
+
readonly internalType: "address";
|
|
696
|
+
readonly name: "from";
|
|
697
|
+
readonly type: "address";
|
|
698
|
+
}, {
|
|
699
|
+
readonly internalType: "address";
|
|
700
|
+
readonly name: "to";
|
|
701
|
+
readonly type: "address";
|
|
702
|
+
}, {
|
|
703
|
+
readonly internalType: "uint160";
|
|
704
|
+
readonly name: "amount";
|
|
705
|
+
readonly type: "uint160";
|
|
706
|
+
}, {
|
|
707
|
+
readonly internalType: "address";
|
|
708
|
+
readonly name: "token";
|
|
709
|
+
readonly type: "address";
|
|
710
|
+
}];
|
|
711
|
+
readonly name: "transferFrom";
|
|
712
|
+
readonly outputs: readonly [];
|
|
713
|
+
readonly stateMutability: "nonpayable";
|
|
714
|
+
readonly type: "function";
|
|
715
|
+
}] | readonly [{
|
|
86
716
|
readonly constant: true;
|
|
87
717
|
readonly inputs: readonly [];
|
|
88
718
|
readonly name: "name";
|
|
@@ -257,7 +887,7 @@ declare class DZapClient {
|
|
|
257
887
|
getAllSupportedChains(): Promise<ChainData>;
|
|
258
888
|
getAllTokens(chainId: number, source?: string, account?: string): Promise<any>;
|
|
259
889
|
getTokenDetails(tokenAddress: string, chainId: number, account?: string, includeBalance?: boolean, includePrice?: boolean): Promise<TokenInfo>;
|
|
260
|
-
getTokensDetails(tokenAddresses: string[], chainId: number, account?: string, includeBalance?: boolean, includePrice?: boolean): Promise<Record<string, TokenInfo
|
|
890
|
+
getTokensDetails(tokenAddresses: string[], chainId: number, account?: string, includeBalance?: boolean, includePrice?: boolean): Promise<Record<string, TokenInfo> | TokenInfo>;
|
|
261
891
|
getTokenPrices(tokenAddresses: string[], chainId: number): Promise<Record<string, string | null>>;
|
|
262
892
|
trade({ request, signer, txnData, batchTransaction, rpcUrls, }: {
|
|
263
893
|
request: TradeBuildTxnRequest;
|
|
@@ -266,10 +896,15 @@ declare class DZapClient {
|
|
|
266
896
|
batchTransaction?: boolean;
|
|
267
897
|
rpcUrls?: string[];
|
|
268
898
|
}): Promise<import("../types").DZapTransactionResponse>;
|
|
269
|
-
|
|
899
|
+
tradeGasless({ request, signer, txnData, }: {
|
|
900
|
+
request: TradeBuildTxnRequest;
|
|
901
|
+
signer: Signer | WalletClient;
|
|
902
|
+
txnData?: GaslessTradeBuildTxnResponse;
|
|
903
|
+
}): Promise<import("../types").DZapTransactionResponse>;
|
|
904
|
+
sendTransaction({ chainId, signer, txnData }: {
|
|
270
905
|
chainId: number;
|
|
271
906
|
signer: Signer | WalletClient;
|
|
272
|
-
txnData:
|
|
907
|
+
txnData: EvmTxData;
|
|
273
908
|
}): Promise<{
|
|
274
909
|
status: TxnStatus;
|
|
275
910
|
error: any;
|
|
@@ -283,7 +918,7 @@ declare class DZapClient {
|
|
|
283
918
|
waitForBatchTransactionReceipt({ walletClient, batchHash }: {
|
|
284
919
|
walletClient: WalletClient;
|
|
285
920
|
batchHash: HexString;
|
|
286
|
-
}): Promise<import("
|
|
921
|
+
}): Promise<import("../types/wallet").WalletCallReceipt>;
|
|
287
922
|
decodeTxnData({ data, service, chainId }: {
|
|
288
923
|
data: TransactionReceipt;
|
|
289
924
|
service: AvailableDZapServices;
|
|
@@ -335,7 +970,7 @@ declare class DZapClient {
|
|
|
335
970
|
status: TxnStatus;
|
|
336
971
|
};
|
|
337
972
|
address: HexString;
|
|
338
|
-
}) => Promise<TxnStatus |
|
|
973
|
+
}) => Promise<TxnStatus | null>;
|
|
339
974
|
service: AvailableDZapServices;
|
|
340
975
|
spender?: HexString;
|
|
341
976
|
rpcUrls?: string[];
|
|
@@ -344,33 +979,12 @@ declare class DZapClient {
|
|
|
344
979
|
status: TxnStatus;
|
|
345
980
|
code: StatusCodes;
|
|
346
981
|
}>;
|
|
347
|
-
sign(
|
|
348
|
-
chainId: number;
|
|
349
|
-
sender: HexString;
|
|
350
|
-
tokens: {
|
|
351
|
-
address: HexString;
|
|
352
|
-
amount: string;
|
|
353
|
-
}[];
|
|
354
|
-
service: AvailableDZapServices;
|
|
355
|
-
signer: WalletClient | Signer;
|
|
982
|
+
sign(params: Prettify<Omit<GasSignatureParams, 'spender' | 'permitType' | 'rpcUrls' | 'gasless' | 'contractVersion'> & {
|
|
356
983
|
spender?: HexString;
|
|
357
|
-
rpcUrls?: string[];
|
|
358
984
|
permitType?: PermitMode;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
amount: string;
|
|
363
|
-
permitType: PermitMode;
|
|
364
|
-
}) => Promise<void>;
|
|
365
|
-
}): Promise<{
|
|
366
|
-
status: TxnStatus;
|
|
367
|
-
tokens: {
|
|
368
|
-
address: HexString;
|
|
369
|
-
permitData?: HexString;
|
|
370
|
-
amount: string;
|
|
371
|
-
}[];
|
|
372
|
-
code: StatusCodes;
|
|
373
|
-
}>;
|
|
985
|
+
rpcUrls?: string[];
|
|
986
|
+
service: AvailableDZapServices;
|
|
987
|
+
}>): Promise<SignPermitResponse>;
|
|
374
988
|
zap({ request, steps, signer }: {
|
|
375
989
|
request: ZapBuildTxnRequest;
|
|
376
990
|
signer: WalletClient | Signer;
|
|
@@ -383,7 +997,7 @@ declare class DZapClient {
|
|
|
383
997
|
buildZapTxn(request: ZapBuildTxnRequest): Promise<ZapBuildTxnResponse>;
|
|
384
998
|
getZapQuote(request: ZapQuoteRequest): Promise<ZapQuoteResponse>;
|
|
385
999
|
getZapTxnStatus(request: ZapStatusRequest): Promise<ZapStatusResponse>;
|
|
386
|
-
getBalances(chainId: number, account: string): Promise<
|
|
1000
|
+
getBalances(chainId: number, account: string): Promise<TokenResponse>;
|
|
387
1001
|
sendBatchCalls({ walletClient, calls }: {
|
|
388
1002
|
walletClient: WalletClient;
|
|
389
1003
|
calls: BatchCallParams[];
|