@swapkit/types 0.0.0-nightly-20240208140027

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.
@@ -0,0 +1,496 @@
1
+ export const TCEthereumVaultAbi = [
2
+ {
3
+ inputs: [{ internalType: 'address', name: 'rune', type: 'address' }],
4
+ stateMutability: 'nonpayable',
5
+ type: 'constructor',
6
+ },
7
+ {
8
+ anonymous: false,
9
+ inputs: [
10
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
11
+ { indexed: true, internalType: 'address', name: 'asset', type: 'address' },
12
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
13
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
14
+ ],
15
+ name: 'Deposit',
16
+ type: 'event',
17
+ },
18
+ {
19
+ anonymous: false,
20
+ inputs: [
21
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
22
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
23
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
24
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
25
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
26
+ ],
27
+ name: 'TransferAllowance',
28
+ type: 'event',
29
+ },
30
+ {
31
+ anonymous: false,
32
+ inputs: [
33
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
34
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
35
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
36
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
37
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
38
+ ],
39
+ name: 'TransferOut',
40
+ type: 'event',
41
+ },
42
+ {
43
+ anonymous: false,
44
+ inputs: [
45
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
46
+ { indexed: false, internalType: 'address', name: 'target', type: 'address' },
47
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
48
+ { indexed: false, internalType: 'address', name: 'finalAsset', type: 'address' },
49
+ { indexed: false, internalType: 'address', name: 'to', type: 'address' },
50
+ { indexed: false, internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
51
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
52
+ ],
53
+ name: 'TransferOutAndCall',
54
+ type: 'event',
55
+ },
56
+ {
57
+ anonymous: false,
58
+ inputs: [
59
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
60
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
61
+ {
62
+ components: [
63
+ { internalType: 'address', name: 'asset', type: 'address' },
64
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
65
+ ],
66
+ indexed: false,
67
+ internalType: 'struct THORChain_Router.Coin[]',
68
+ name: 'coins',
69
+ type: 'tuple[]',
70
+ },
71
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
72
+ ],
73
+ name: 'VaultTransfer',
74
+ type: 'event',
75
+ },
76
+ {
77
+ inputs: [],
78
+ name: 'RUNE',
79
+ outputs: [{ internalType: 'address', name: '', type: 'address' }],
80
+ stateMutability: 'view',
81
+ type: 'function',
82
+ },
83
+ {
84
+ inputs: [
85
+ { internalType: 'address payable', name: 'vault', type: 'address' },
86
+ { internalType: 'address', name: 'asset', type: 'address' },
87
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
88
+ { internalType: 'string', name: 'memo', type: 'string' },
89
+ ],
90
+ name: 'deposit',
91
+ outputs: [],
92
+ stateMutability: 'payable',
93
+ type: 'function',
94
+ },
95
+ {
96
+ inputs: [
97
+ { internalType: 'address payable', name: 'vault', type: 'address' },
98
+ { internalType: 'address', name: 'asset', type: 'address' },
99
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
100
+ { internalType: 'string', name: 'memo', type: 'string' },
101
+ { internalType: 'uint256', name: 'expiration', type: 'uint256' },
102
+ ],
103
+ name: 'depositWithExpiry',
104
+ outputs: [],
105
+ stateMutability: 'payable',
106
+ type: 'function',
107
+ },
108
+ {
109
+ inputs: [
110
+ { internalType: 'address', name: 'router', type: 'address' },
111
+ { internalType: 'address payable', name: 'asgard', type: 'address' },
112
+ {
113
+ components: [
114
+ { internalType: 'address', name: 'asset', type: 'address' },
115
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
116
+ ],
117
+ internalType: 'struct THORChain_Router.Coin[]',
118
+ name: 'coins',
119
+ type: 'tuple[]',
120
+ },
121
+ { internalType: 'string', name: 'memo', type: 'string' },
122
+ ],
123
+ name: 'returnVaultAssets',
124
+ outputs: [],
125
+ stateMutability: 'payable',
126
+ type: 'function',
127
+ },
128
+ {
129
+ inputs: [
130
+ { internalType: 'address', name: 'router', type: 'address' },
131
+ { internalType: 'address', name: 'newVault', type: 'address' },
132
+ { internalType: 'address', name: 'asset', type: 'address' },
133
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
134
+ { internalType: 'string', name: 'memo', type: 'string' },
135
+ ],
136
+ name: 'transferAllowance',
137
+ outputs: [],
138
+ stateMutability: 'nonpayable',
139
+ type: 'function',
140
+ },
141
+ {
142
+ inputs: [
143
+ { internalType: 'address payable', name: 'to', type: 'address' },
144
+ { internalType: 'address', name: 'asset', type: 'address' },
145
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
146
+ { internalType: 'string', name: 'memo', type: 'string' },
147
+ ],
148
+ name: 'transferOut',
149
+ outputs: [],
150
+ stateMutability: 'payable',
151
+ type: 'function',
152
+ },
153
+ {
154
+ inputs: [
155
+ { internalType: 'address payable', name: 'aggregator', type: 'address' },
156
+ { internalType: 'address', name: 'finalToken', type: 'address' },
157
+ { internalType: 'address', name: 'to', type: 'address' },
158
+ { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
159
+ { internalType: 'string', name: 'memo', type: 'string' },
160
+ ],
161
+ name: 'transferOutAndCall',
162
+ outputs: [],
163
+ stateMutability: 'payable',
164
+ type: 'function',
165
+ },
166
+ {
167
+ inputs: [
168
+ { internalType: 'address', name: 'vault', type: 'address' },
169
+ { internalType: 'address', name: 'token', type: 'address' },
170
+ ],
171
+ name: 'vaultAllowance',
172
+ outputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
173
+ stateMutability: 'view',
174
+ type: 'function',
175
+ },
176
+ ];
177
+
178
+ export const TCAvalancheDepositABI = [
179
+ { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
180
+ {
181
+ anonymous: false,
182
+ inputs: [
183
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
184
+ { indexed: true, internalType: 'address', name: 'asset', type: 'address' },
185
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
186
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
187
+ ],
188
+ name: 'Deposit',
189
+ type: 'event',
190
+ },
191
+ {
192
+ anonymous: false,
193
+ inputs: [
194
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
195
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
196
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
197
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
198
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
199
+ ],
200
+ name: 'TransferAllowance',
201
+ type: 'event',
202
+ },
203
+ {
204
+ anonymous: false,
205
+ inputs: [
206
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
207
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
208
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
209
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
210
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
211
+ ],
212
+ name: 'TransferOut',
213
+ type: 'event',
214
+ },
215
+ {
216
+ anonymous: false,
217
+ inputs: [
218
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
219
+ { indexed: false, internalType: 'address', name: 'target', type: 'address' },
220
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
221
+ { indexed: false, internalType: 'address', name: 'finalAsset', type: 'address' },
222
+ { indexed: false, internalType: 'address', name: 'to', type: 'address' },
223
+ { indexed: false, internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
224
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
225
+ ],
226
+ name: 'TransferOutAndCall',
227
+ type: 'event',
228
+ },
229
+ {
230
+ anonymous: false,
231
+ inputs: [
232
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
233
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
234
+ {
235
+ components: [
236
+ { internalType: 'address', name: 'asset', type: 'address' },
237
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
238
+ ],
239
+ indexed: false,
240
+ internalType: 'struct AvaxRouter.Coin[]',
241
+ name: 'coins',
242
+ type: 'tuple[]',
243
+ },
244
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
245
+ ],
246
+ name: 'VaultTransfer',
247
+ type: 'event',
248
+ },
249
+ {
250
+ inputs: [
251
+ { internalType: 'address payable', name: 'vault', type: 'address' },
252
+ { internalType: 'address', name: 'asset', type: 'address' },
253
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
254
+ { internalType: 'string', name: 'memo', type: 'string' },
255
+ ],
256
+ name: 'deposit',
257
+ outputs: [],
258
+ stateMutability: 'payable',
259
+ type: 'function',
260
+ },
261
+ {
262
+ inputs: [
263
+ { internalType: 'address payable', name: 'vault', type: 'address' },
264
+ { internalType: 'address', name: 'asset', type: 'address' },
265
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
266
+ { internalType: 'string', name: 'memo', type: 'string' },
267
+ { internalType: 'uint256', name: 'expiration', type: 'uint256' },
268
+ ],
269
+ name: 'depositWithExpiry',
270
+ outputs: [],
271
+ stateMutability: 'payable',
272
+ type: 'function',
273
+ },
274
+ {
275
+ inputs: [
276
+ { internalType: 'address', name: 'router', type: 'address' },
277
+ { internalType: 'address payable', name: 'asgard', type: 'address' },
278
+ {
279
+ components: [
280
+ { internalType: 'address', name: 'asset', type: 'address' },
281
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
282
+ ],
283
+ internalType: 'struct AvaxRouter.Coin[]',
284
+ name: 'coins',
285
+ type: 'tuple[]',
286
+ },
287
+ { internalType: 'string', name: 'memo', type: 'string' },
288
+ ],
289
+ name: 'returnVaultAssets',
290
+ outputs: [],
291
+ stateMutability: 'payable',
292
+ type: 'function',
293
+ },
294
+ {
295
+ inputs: [
296
+ { internalType: 'address', name: 'router', type: 'address' },
297
+ { internalType: 'address', name: 'newVault', type: 'address' },
298
+ { internalType: 'address', name: 'asset', type: 'address' },
299
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
300
+ { internalType: 'string', name: 'memo', type: 'string' },
301
+ ],
302
+ name: 'transferAllowance',
303
+ outputs: [],
304
+ stateMutability: 'nonpayable',
305
+ type: 'function',
306
+ },
307
+ {
308
+ inputs: [
309
+ { internalType: 'address payable', name: 'to', type: 'address' },
310
+ { internalType: 'address', name: 'asset', type: 'address' },
311
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
312
+ { internalType: 'string', name: 'memo', type: 'string' },
313
+ ],
314
+ name: 'transferOut',
315
+ outputs: [],
316
+ stateMutability: 'payable',
317
+ type: 'function',
318
+ },
319
+ {
320
+ inputs: [
321
+ { internalType: 'address payable', name: 'target', type: 'address' },
322
+ { internalType: 'address', name: 'finalToken', type: 'address' },
323
+ { internalType: 'address', name: 'to', type: 'address' },
324
+ { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
325
+ { internalType: 'string', name: 'memo', type: 'string' },
326
+ ],
327
+ name: 'transferOutAndCall',
328
+ outputs: [],
329
+ stateMutability: 'payable',
330
+ type: 'function',
331
+ },
332
+ {
333
+ inputs: [
334
+ { internalType: 'address', name: 'vault', type: 'address' },
335
+ { internalType: 'address', name: 'token', type: 'address' },
336
+ ],
337
+ name: 'vaultAllowance',
338
+ outputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
339
+ stateMutability: 'view',
340
+ type: 'function',
341
+ },
342
+ ];
343
+
344
+ export const TCBscDepositABI = [
345
+ { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
346
+ {
347
+ anonymous: false,
348
+ inputs: [
349
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
350
+ { indexed: true, internalType: 'address', name: 'asset', type: 'address' },
351
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
352
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
353
+ ],
354
+ name: 'Deposit',
355
+ type: 'event',
356
+ },
357
+ {
358
+ anonymous: false,
359
+ inputs: [
360
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
361
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
362
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
363
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
364
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
365
+ ],
366
+ name: 'TransferAllowance',
367
+ type: 'event',
368
+ },
369
+ {
370
+ anonymous: false,
371
+ inputs: [
372
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
373
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
374
+ { indexed: false, internalType: 'address', name: 'asset', type: 'address' },
375
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
376
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
377
+ ],
378
+ name: 'TransferOut',
379
+ type: 'event',
380
+ },
381
+ {
382
+ anonymous: false,
383
+ inputs: [
384
+ { indexed: true, internalType: 'address', name: 'vault', type: 'address' },
385
+ { indexed: false, internalType: 'address', name: 'target', type: 'address' },
386
+ { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
387
+ { indexed: false, internalType: 'address', name: 'finalAsset', type: 'address' },
388
+ { indexed: false, internalType: 'address', name: 'to', type: 'address' },
389
+ { indexed: false, internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
390
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
391
+ ],
392
+ name: 'TransferOutAndCall',
393
+ type: 'event',
394
+ },
395
+ {
396
+ anonymous: false,
397
+ inputs: [
398
+ { indexed: true, internalType: 'address', name: 'oldVault', type: 'address' },
399
+ { indexed: true, internalType: 'address', name: 'newVault', type: 'address' },
400
+ {
401
+ components: [
402
+ { internalType: 'address', name: 'asset', type: 'address' },
403
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
404
+ ],
405
+ indexed: false,
406
+ internalType: 'struct THORChain_Router.Coin[]',
407
+ name: 'coins',
408
+ type: 'tuple[]',
409
+ },
410
+ { indexed: false, internalType: 'string', name: 'memo', type: 'string' },
411
+ ],
412
+ name: 'VaultTransfer',
413
+ type: 'event',
414
+ },
415
+ {
416
+ inputs: [
417
+ { internalType: 'address payable', name: 'vault', type: 'address' },
418
+ { internalType: 'address', name: 'asset', type: 'address' },
419
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
420
+ { internalType: 'string', name: 'memo', type: 'string' },
421
+ { internalType: 'uint256', name: 'expiration', type: 'uint256' },
422
+ ],
423
+ name: 'depositWithExpiry',
424
+ outputs: [],
425
+ stateMutability: 'payable',
426
+ type: 'function',
427
+ },
428
+ {
429
+ inputs: [
430
+ { internalType: 'address', name: 'router', type: 'address' },
431
+ { internalType: 'address payable', name: 'asgard', type: 'address' },
432
+ {
433
+ components: [
434
+ { internalType: 'address', name: 'asset', type: 'address' },
435
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
436
+ ],
437
+ internalType: 'struct THORChain_Router.Coin[]',
438
+ name: 'coins',
439
+ type: 'tuple[]',
440
+ },
441
+ { internalType: 'string', name: 'memo', type: 'string' },
442
+ ],
443
+ name: 'returnVaultAssets',
444
+ outputs: [],
445
+ stateMutability: 'payable',
446
+ type: 'function',
447
+ },
448
+ {
449
+ inputs: [
450
+ { internalType: 'address', name: 'router', type: 'address' },
451
+ { internalType: 'address', name: 'newVault', type: 'address' },
452
+ { internalType: 'address', name: 'asset', type: 'address' },
453
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
454
+ { internalType: 'string', name: 'memo', type: 'string' },
455
+ ],
456
+ name: 'transferAllowance',
457
+ outputs: [],
458
+ stateMutability: 'nonpayable',
459
+ type: 'function',
460
+ },
461
+ {
462
+ inputs: [
463
+ { internalType: 'address payable', name: 'to', type: 'address' },
464
+ { internalType: 'address', name: 'asset', type: 'address' },
465
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
466
+ { internalType: 'string', name: 'memo', type: 'string' },
467
+ ],
468
+ name: 'transferOut',
469
+ outputs: [],
470
+ stateMutability: 'payable',
471
+ type: 'function',
472
+ },
473
+ {
474
+ inputs: [
475
+ { internalType: 'address payable', name: 'target', type: 'address' },
476
+ { internalType: 'address', name: 'finalToken', type: 'address' },
477
+ { internalType: 'address', name: 'to', type: 'address' },
478
+ { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
479
+ { internalType: 'string', name: 'memo', type: 'string' },
480
+ ],
481
+ name: 'transferOutAndCall',
482
+ outputs: [],
483
+ stateMutability: 'payable',
484
+ type: 'function',
485
+ },
486
+ {
487
+ inputs: [
488
+ { internalType: 'address', name: 'vault', type: 'address' },
489
+ { internalType: 'address', name: 'token', type: 'address' },
490
+ ],
491
+ name: 'vaultAllowance',
492
+ outputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
493
+ stateMutability: 'view',
494
+ type: 'function',
495
+ },
496
+ ];
@@ -0,0 +1,30 @@
1
+ export type GetAddressAndPubKeyResponse = {
2
+ bech32_address: string;
3
+ compressed_pk: any;
4
+ error_message: string;
5
+ return_code: number;
6
+ };
7
+
8
+ export type Signature = {
9
+ pub_key: {
10
+ type: string;
11
+ value: string;
12
+ };
13
+ sequence: string;
14
+ signature: string;
15
+ };
16
+
17
+ export enum ErrorCode {
18
+ NoError = 0x9000,
19
+ }
20
+
21
+ export enum MemoType {
22
+ BOND = 'BOND',
23
+ DEPOSIT = '+',
24
+ LEAVE = 'LEAVE',
25
+ THORNAME_REGISTER = '~',
26
+ UNBOND = 'UNBOND',
27
+ WITHDRAW = '-',
28
+ OPEN_LOAN = '$+',
29
+ CLOSE_LOAN = '$-',
30
+ }
@@ -0,0 +1,148 @@
1
+ import type { Chain, CosmosChain, EVMChain, UTXOChain } from './network.ts';
2
+ import type { WalletOption } from './wallet.ts';
3
+
4
+ type ConnectMethodNames =
5
+ | 'connectEVMWallet'
6
+ | 'connectKeplr'
7
+ | 'connectKeystore'
8
+ | 'connectKeepkey'
9
+ | 'connectLedger'
10
+ | 'connectOkx'
11
+ | 'connectTrezor'
12
+ | 'connectWalletconnect'
13
+ | 'connectXDEFI';
14
+
15
+ type ChainWallet = {
16
+ address: string;
17
+ balance: any[];
18
+ walletType: WalletOption;
19
+ };
20
+
21
+ export type ConnectConfig = {
22
+ stagenet?: boolean;
23
+ /**
24
+ * @required
25
+ */
26
+ thorswapApiKey?: string;
27
+ /**
28
+ * @required for AVAX & BSC
29
+ */
30
+ covalentApiKey?: string;
31
+ /**
32
+ * @required for ETH
33
+ */
34
+ ethplorerApiKey?: string;
35
+ /**
36
+ * @required for BTC, BCH, LTC, DOGE
37
+ */
38
+ blockchairApiKey?: string;
39
+ /**
40
+ * @deprecated - use blockchairApiKey instead
41
+ */
42
+ utxoApiKey?: string;
43
+ /**
44
+ * @required for Walletconnect
45
+ */
46
+ walletConnectProjectId?: string;
47
+ /**
48
+ * @optional for Trezor config
49
+ */
50
+ trezorManifest?: {
51
+ email: string;
52
+ appUrl: string;
53
+ };
54
+ /**
55
+ * @optional for KeepKey config
56
+ */
57
+ keepkeyConfig?: {
58
+ apiKey: string;
59
+ pairingInfo: {
60
+ name: string;
61
+ imageUrl: string;
62
+ basePath: string;
63
+ url: string;
64
+ };
65
+ };
66
+ };
67
+
68
+ export type AddChainWalletParams = {
69
+ chain: Chain;
70
+ wallet: ChainWallet;
71
+ walletMethods: any;
72
+ };
73
+
74
+ export type Witness = {
75
+ value: number;
76
+ script: Buffer;
77
+ };
78
+
79
+ type ApisType = { [key in UTXOChain]?: string | any } & {
80
+ [key in EVMChain]?: string | any;
81
+ } & {
82
+ [key in CosmosChain]?: string;
83
+ };
84
+
85
+ export type ConnectWalletParams = {
86
+ addChain: (params: AddChainWalletParams) => void;
87
+ config: ConnectConfig;
88
+ rpcUrls: { [chain in Chain]?: string };
89
+ apis: ApisType;
90
+ };
91
+
92
+ export type ExtendParams<WalletConnectMethodNames = ''> = {
93
+ excludedChains?: Chain[];
94
+ config?: ConnectConfig;
95
+ rpcUrls?: { [chain in Chain]?: string };
96
+ apis?: ApisType;
97
+ wallets: {
98
+ connectMethodName: ConnectMethodNames | WalletConnectMethodNames;
99
+ connect: (params: ConnectWalletParams) => (...params: any) => Promise<any>;
100
+ }[];
101
+ };
102
+
103
+ export enum QuoteMode {
104
+ TC_SUPPORTED_TO_TC_SUPPORTED = 'TC-TC',
105
+ TC_SUPPORTED_TO_ETH = 'TC-ERC20',
106
+ TC_SUPPORTED_TO_AVAX = 'TC-ARC20',
107
+ TC_SUPPORTED_TO_BSC = 'TC-BEP20',
108
+ ETH_TO_TC_SUPPORTED = 'ERC20-TC',
109
+ ETH_TO_ETH = 'ERC20-ERC20',
110
+ ETH_TO_AVAX = 'ERC20-ARC20',
111
+ ETH_TO_BSC = 'ERC20-BEP20',
112
+ AVAX_TO_TC_SUPPORTED = 'ARC20-TC',
113
+ AVAX_TO_ETH = 'ARC20-ERC20',
114
+ AVAX_TO_AVAX = 'ARC20-ARC20',
115
+ AVAX_TO_BSC = 'ARC20-BEP20',
116
+ BSC_TO_TC_SUPPORTED = 'BEP20-TC',
117
+ BSC_TO_ETH = 'BEP20-ERC20',
118
+ BSC_TO_AVAX = 'BEP20-ARC20',
119
+ BSC_TO_BSC = 'BEP20-BEP20',
120
+ }
121
+
122
+ export type Asset = {
123
+ chain: Chain;
124
+ symbol: string;
125
+ ticker: string;
126
+ synth?: boolean;
127
+ };
128
+
129
+ export const AGG_SWAP = [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC];
130
+
131
+ export const SWAP_IN = [
132
+ QuoteMode.ETH_TO_TC_SUPPORTED,
133
+ QuoteMode.ETH_TO_AVAX,
134
+ QuoteMode.ETH_TO_BSC,
135
+ QuoteMode.AVAX_TO_TC_SUPPORTED,
136
+ QuoteMode.AVAX_TO_ETH,
137
+ QuoteMode.AVAX_TO_BSC,
138
+ QuoteMode.BSC_TO_TC_SUPPORTED,
139
+ QuoteMode.BSC_TO_ETH,
140
+ QuoteMode.BSC_TO_AVAX,
141
+ ];
142
+
143
+ export const SWAP_OUT = [
144
+ QuoteMode.TC_SUPPORTED_TO_TC_SUPPORTED,
145
+ QuoteMode.TC_SUPPORTED_TO_ETH,
146
+ QuoteMode.TC_SUPPORTED_TO_AVAX,
147
+ QuoteMode.TC_SUPPORTED_TO_BSC,
148
+ ];