@swapkit/helpers 1.0.0-rc.84 → 1.0.0-rc.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,12 +6,972 @@ var __require = ((x) => typeof require !== "undefined" ? require : typeof Proxy
6
6
  throw Error('Dynamic require of "' + x + '" is not supported');
7
7
  });
8
8
 
9
- // src/index.ts
10
- export * from "@swapkit/api";
9
+ // src/types/abis/erc20.ts
10
+ var erc20ABI = [
11
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
12
+ {
13
+ anonymous: false,
14
+ inputs: [
15
+ { indexed: true, internalType: "address", name: "owner", type: "address" },
16
+ { indexed: true, internalType: "address", name: "spender", type: "address" },
17
+ { indexed: false, internalType: "uint256", name: "value", type: "uint256" }
18
+ ],
19
+ name: "Approval",
20
+ type: "event"
21
+ },
22
+ {
23
+ anonymous: false,
24
+ inputs: [
25
+ { indexed: true, internalType: "address", name: "from", type: "address" },
26
+ { indexed: true, internalType: "address", name: "to", type: "address" },
27
+ { indexed: false, internalType: "uint256", name: "value", type: "uint256" }
28
+ ],
29
+ name: "Transfer",
30
+ type: "event"
31
+ },
32
+ {
33
+ inputs: [
34
+ { internalType: "address", name: "", type: "address" },
35
+ { internalType: "address", name: "", type: "address" }
36
+ ],
37
+ name: "allowance",
38
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
39
+ stateMutability: "view",
40
+ type: "function"
41
+ },
42
+ {
43
+ inputs: [
44
+ { internalType: "address", name: "spender", type: "address" },
45
+ { internalType: "uint256", name: "value", type: "uint256" }
46
+ ],
47
+ name: "approve",
48
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
49
+ stateMutability: "nonpayable",
50
+ type: "function"
51
+ },
52
+ {
53
+ inputs: [{ internalType: "address", name: "", type: "address" }],
54
+ name: "balanceOf",
55
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
56
+ stateMutability: "view",
57
+ type: "function"
58
+ },
59
+ {
60
+ inputs: [],
61
+ name: "decimals",
62
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
63
+ stateMutability: "view",
64
+ type: "function"
65
+ },
66
+ {
67
+ inputs: [],
68
+ name: "name",
69
+ outputs: [{ internalType: "string", name: "", type: "string" }],
70
+ stateMutability: "view",
71
+ type: "function"
72
+ },
73
+ {
74
+ inputs: [],
75
+ name: "symbol",
76
+ outputs: [{ internalType: "string", name: "", type: "string" }],
77
+ stateMutability: "view",
78
+ type: "function"
79
+ },
80
+ {
81
+ inputs: [],
82
+ name: "totalSupply",
83
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
84
+ stateMutability: "view",
85
+ type: "function"
86
+ },
87
+ {
88
+ inputs: [
89
+ { internalType: "address", name: "to", type: "address" },
90
+ { internalType: "uint256", name: "value", type: "uint256" }
91
+ ],
92
+ name: "transfer",
93
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
94
+ stateMutability: "nonpayable",
95
+ type: "function"
96
+ },
97
+ {
98
+ inputs: [
99
+ { internalType: "address", name: "from", type: "address" },
100
+ { internalType: "address", name: "to", type: "address" },
101
+ { internalType: "uint256", name: "value", type: "uint256" }
102
+ ],
103
+ name: "transferFrom",
104
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
105
+ stateMutability: "nonpayable",
106
+ type: "function"
107
+ }
108
+ ];
109
+ // src/types/abis/tcEthVault.ts
110
+ var TCEthereumVaultAbi = [
111
+ {
112
+ inputs: [{ internalType: "address", name: "rune", type: "address" }],
113
+ stateMutability: "nonpayable",
114
+ type: "constructor"
115
+ },
116
+ {
117
+ anonymous: false,
118
+ inputs: [
119
+ { indexed: true, internalType: "address", name: "to", type: "address" },
120
+ { indexed: true, internalType: "address", name: "asset", type: "address" },
121
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
122
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
123
+ ],
124
+ name: "Deposit",
125
+ type: "event"
126
+ },
127
+ {
128
+ anonymous: false,
129
+ inputs: [
130
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
131
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
132
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
133
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
134
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
135
+ ],
136
+ name: "TransferAllowance",
137
+ type: "event"
138
+ },
139
+ {
140
+ anonymous: false,
141
+ inputs: [
142
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
143
+ { indexed: true, internalType: "address", name: "to", type: "address" },
144
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
145
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
146
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
147
+ ],
148
+ name: "TransferOut",
149
+ type: "event"
150
+ },
151
+ {
152
+ anonymous: false,
153
+ inputs: [
154
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
155
+ { indexed: false, internalType: "address", name: "target", type: "address" },
156
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
157
+ { indexed: false, internalType: "address", name: "finalAsset", type: "address" },
158
+ { indexed: false, internalType: "address", name: "to", type: "address" },
159
+ { indexed: false, internalType: "uint256", name: "amountOutMin", type: "uint256" },
160
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
161
+ ],
162
+ name: "TransferOutAndCall",
163
+ type: "event"
164
+ },
165
+ {
166
+ anonymous: false,
167
+ inputs: [
168
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
169
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
170
+ {
171
+ components: [
172
+ { internalType: "address", name: "asset", type: "address" },
173
+ { internalType: "uint256", name: "amount", type: "uint256" }
174
+ ],
175
+ indexed: false,
176
+ internalType: "struct THORChain_Router.Coin[]",
177
+ name: "coins",
178
+ type: "tuple[]"
179
+ },
180
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
181
+ ],
182
+ name: "VaultTransfer",
183
+ type: "event"
184
+ },
185
+ {
186
+ inputs: [],
187
+ name: "RUNE",
188
+ outputs: [{ internalType: "address", name: "", type: "address" }],
189
+ stateMutability: "view",
190
+ type: "function"
191
+ },
192
+ {
193
+ inputs: [
194
+ { internalType: "address payable", name: "vault", type: "address" },
195
+ { internalType: "address", name: "asset", type: "address" },
196
+ { internalType: "uint256", name: "amount", type: "uint256" },
197
+ { internalType: "string", name: "memo", type: "string" }
198
+ ],
199
+ name: "deposit",
200
+ outputs: [],
201
+ stateMutability: "payable",
202
+ type: "function"
203
+ },
204
+ {
205
+ inputs: [
206
+ { internalType: "address payable", name: "vault", type: "address" },
207
+ { internalType: "address", name: "asset", type: "address" },
208
+ { internalType: "uint256", name: "amount", type: "uint256" },
209
+ { internalType: "string", name: "memo", type: "string" },
210
+ { internalType: "uint256", name: "expiration", type: "uint256" }
211
+ ],
212
+ name: "depositWithExpiry",
213
+ outputs: [],
214
+ stateMutability: "payable",
215
+ type: "function"
216
+ },
217
+ {
218
+ inputs: [
219
+ { internalType: "address", name: "router", type: "address" },
220
+ { internalType: "address payable", name: "asgard", type: "address" },
221
+ {
222
+ components: [
223
+ { internalType: "address", name: "asset", type: "address" },
224
+ { internalType: "uint256", name: "amount", type: "uint256" }
225
+ ],
226
+ internalType: "struct THORChain_Router.Coin[]",
227
+ name: "coins",
228
+ type: "tuple[]"
229
+ },
230
+ { internalType: "string", name: "memo", type: "string" }
231
+ ],
232
+ name: "returnVaultAssets",
233
+ outputs: [],
234
+ stateMutability: "payable",
235
+ type: "function"
236
+ },
237
+ {
238
+ inputs: [
239
+ { internalType: "address", name: "router", type: "address" },
240
+ { internalType: "address", name: "newVault", type: "address" },
241
+ { internalType: "address", name: "asset", type: "address" },
242
+ { internalType: "uint256", name: "amount", type: "uint256" },
243
+ { internalType: "string", name: "memo", type: "string" }
244
+ ],
245
+ name: "transferAllowance",
246
+ outputs: [],
247
+ stateMutability: "nonpayable",
248
+ type: "function"
249
+ },
250
+ {
251
+ inputs: [
252
+ { internalType: "address payable", name: "to", type: "address" },
253
+ { internalType: "address", name: "asset", type: "address" },
254
+ { internalType: "uint256", name: "amount", type: "uint256" },
255
+ { internalType: "string", name: "memo", type: "string" }
256
+ ],
257
+ name: "transferOut",
258
+ outputs: [],
259
+ stateMutability: "payable",
260
+ type: "function"
261
+ },
262
+ {
263
+ inputs: [
264
+ { internalType: "address payable", name: "aggregator", type: "address" },
265
+ { internalType: "address", name: "finalToken", type: "address" },
266
+ { internalType: "address", name: "to", type: "address" },
267
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
268
+ { internalType: "string", name: "memo", type: "string" }
269
+ ],
270
+ name: "transferOutAndCall",
271
+ outputs: [],
272
+ stateMutability: "payable",
273
+ type: "function"
274
+ },
275
+ {
276
+ inputs: [
277
+ { internalType: "address", name: "vault", type: "address" },
278
+ { internalType: "address", name: "token", type: "address" }
279
+ ],
280
+ name: "vaultAllowance",
281
+ outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
282
+ stateMutability: "view",
283
+ type: "function"
284
+ }
285
+ ];
286
+ var TCAvalancheDepositABI = [
287
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
288
+ {
289
+ anonymous: false,
290
+ inputs: [
291
+ { indexed: true, internalType: "address", name: "to", type: "address" },
292
+ { indexed: true, internalType: "address", name: "asset", type: "address" },
293
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
294
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
295
+ ],
296
+ name: "Deposit",
297
+ type: "event"
298
+ },
299
+ {
300
+ anonymous: false,
301
+ inputs: [
302
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
303
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
304
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
305
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
306
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
307
+ ],
308
+ name: "TransferAllowance",
309
+ type: "event"
310
+ },
311
+ {
312
+ anonymous: false,
313
+ inputs: [
314
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
315
+ { indexed: true, internalType: "address", name: "to", type: "address" },
316
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
317
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
318
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
319
+ ],
320
+ name: "TransferOut",
321
+ type: "event"
322
+ },
323
+ {
324
+ anonymous: false,
325
+ inputs: [
326
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
327
+ { indexed: false, internalType: "address", name: "target", type: "address" },
328
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
329
+ { indexed: false, internalType: "address", name: "finalAsset", type: "address" },
330
+ { indexed: false, internalType: "address", name: "to", type: "address" },
331
+ { indexed: false, internalType: "uint256", name: "amountOutMin", type: "uint256" },
332
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
333
+ ],
334
+ name: "TransferOutAndCall",
335
+ type: "event"
336
+ },
337
+ {
338
+ anonymous: false,
339
+ inputs: [
340
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
341
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
342
+ {
343
+ components: [
344
+ { internalType: "address", name: "asset", type: "address" },
345
+ { internalType: "uint256", name: "amount", type: "uint256" }
346
+ ],
347
+ indexed: false,
348
+ internalType: "struct AvaxRouter.Coin[]",
349
+ name: "coins",
350
+ type: "tuple[]"
351
+ },
352
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
353
+ ],
354
+ name: "VaultTransfer",
355
+ type: "event"
356
+ },
357
+ {
358
+ inputs: [
359
+ { internalType: "address payable", name: "vault", type: "address" },
360
+ { internalType: "address", name: "asset", type: "address" },
361
+ { internalType: "uint256", name: "amount", type: "uint256" },
362
+ { internalType: "string", name: "memo", type: "string" }
363
+ ],
364
+ name: "deposit",
365
+ outputs: [],
366
+ stateMutability: "payable",
367
+ type: "function"
368
+ },
369
+ {
370
+ inputs: [
371
+ { internalType: "address payable", name: "vault", type: "address" },
372
+ { internalType: "address", name: "asset", type: "address" },
373
+ { internalType: "uint256", name: "amount", type: "uint256" },
374
+ { internalType: "string", name: "memo", type: "string" },
375
+ { internalType: "uint256", name: "expiration", type: "uint256" }
376
+ ],
377
+ name: "depositWithExpiry",
378
+ outputs: [],
379
+ stateMutability: "payable",
380
+ type: "function"
381
+ },
382
+ {
383
+ inputs: [
384
+ { internalType: "address", name: "router", type: "address" },
385
+ { internalType: "address payable", name: "asgard", type: "address" },
386
+ {
387
+ components: [
388
+ { internalType: "address", name: "asset", type: "address" },
389
+ { internalType: "uint256", name: "amount", type: "uint256" }
390
+ ],
391
+ internalType: "struct AvaxRouter.Coin[]",
392
+ name: "coins",
393
+ type: "tuple[]"
394
+ },
395
+ { internalType: "string", name: "memo", type: "string" }
396
+ ],
397
+ name: "returnVaultAssets",
398
+ outputs: [],
399
+ stateMutability: "payable",
400
+ type: "function"
401
+ },
402
+ {
403
+ inputs: [
404
+ { internalType: "address", name: "router", type: "address" },
405
+ { internalType: "address", name: "newVault", type: "address" },
406
+ { internalType: "address", name: "asset", type: "address" },
407
+ { internalType: "uint256", name: "amount", type: "uint256" },
408
+ { internalType: "string", name: "memo", type: "string" }
409
+ ],
410
+ name: "transferAllowance",
411
+ outputs: [],
412
+ stateMutability: "nonpayable",
413
+ type: "function"
414
+ },
415
+ {
416
+ inputs: [
417
+ { internalType: "address payable", name: "to", type: "address" },
418
+ { internalType: "address", name: "asset", type: "address" },
419
+ { internalType: "uint256", name: "amount", type: "uint256" },
420
+ { internalType: "string", name: "memo", type: "string" }
421
+ ],
422
+ name: "transferOut",
423
+ outputs: [],
424
+ stateMutability: "payable",
425
+ type: "function"
426
+ },
427
+ {
428
+ inputs: [
429
+ { internalType: "address payable", name: "target", type: "address" },
430
+ { internalType: "address", name: "finalToken", type: "address" },
431
+ { internalType: "address", name: "to", type: "address" },
432
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
433
+ { internalType: "string", name: "memo", type: "string" }
434
+ ],
435
+ name: "transferOutAndCall",
436
+ outputs: [],
437
+ stateMutability: "payable",
438
+ type: "function"
439
+ },
440
+ {
441
+ inputs: [
442
+ { internalType: "address", name: "vault", type: "address" },
443
+ { internalType: "address", name: "token", type: "address" }
444
+ ],
445
+ name: "vaultAllowance",
446
+ outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
447
+ stateMutability: "view",
448
+ type: "function"
449
+ }
450
+ ];
451
+ var TCBscDepositABI = [
452
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
453
+ {
454
+ anonymous: false,
455
+ inputs: [
456
+ { indexed: true, internalType: "address", name: "to", type: "address" },
457
+ { indexed: true, internalType: "address", name: "asset", type: "address" },
458
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
459
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
460
+ ],
461
+ name: "Deposit",
462
+ type: "event"
463
+ },
464
+ {
465
+ anonymous: false,
466
+ inputs: [
467
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
468
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
469
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
470
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
471
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
472
+ ],
473
+ name: "TransferAllowance",
474
+ type: "event"
475
+ },
476
+ {
477
+ anonymous: false,
478
+ inputs: [
479
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
480
+ { indexed: true, internalType: "address", name: "to", type: "address" },
481
+ { indexed: false, internalType: "address", name: "asset", type: "address" },
482
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
483
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
484
+ ],
485
+ name: "TransferOut",
486
+ type: "event"
487
+ },
488
+ {
489
+ anonymous: false,
490
+ inputs: [
491
+ { indexed: true, internalType: "address", name: "vault", type: "address" },
492
+ { indexed: false, internalType: "address", name: "target", type: "address" },
493
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
494
+ { indexed: false, internalType: "address", name: "finalAsset", type: "address" },
495
+ { indexed: false, internalType: "address", name: "to", type: "address" },
496
+ { indexed: false, internalType: "uint256", name: "amountOutMin", type: "uint256" },
497
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
498
+ ],
499
+ name: "TransferOutAndCall",
500
+ type: "event"
501
+ },
502
+ {
503
+ anonymous: false,
504
+ inputs: [
505
+ { indexed: true, internalType: "address", name: "oldVault", type: "address" },
506
+ { indexed: true, internalType: "address", name: "newVault", type: "address" },
507
+ {
508
+ components: [
509
+ { internalType: "address", name: "asset", type: "address" },
510
+ { internalType: "uint256", name: "amount", type: "uint256" }
511
+ ],
512
+ indexed: false,
513
+ internalType: "struct THORChain_Router.Coin[]",
514
+ name: "coins",
515
+ type: "tuple[]"
516
+ },
517
+ { indexed: false, internalType: "string", name: "memo", type: "string" }
518
+ ],
519
+ name: "VaultTransfer",
520
+ type: "event"
521
+ },
522
+ {
523
+ inputs: [
524
+ { internalType: "address payable", name: "vault", type: "address" },
525
+ { internalType: "address", name: "asset", type: "address" },
526
+ { internalType: "uint256", name: "amount", type: "uint256" },
527
+ { internalType: "string", name: "memo", type: "string" },
528
+ { internalType: "uint256", name: "expiration", type: "uint256" }
529
+ ],
530
+ name: "depositWithExpiry",
531
+ outputs: [],
532
+ stateMutability: "payable",
533
+ type: "function"
534
+ },
535
+ {
536
+ inputs: [
537
+ { internalType: "address", name: "router", type: "address" },
538
+ { internalType: "address payable", name: "asgard", type: "address" },
539
+ {
540
+ components: [
541
+ { internalType: "address", name: "asset", type: "address" },
542
+ { internalType: "uint256", name: "amount", type: "uint256" }
543
+ ],
544
+ internalType: "struct THORChain_Router.Coin[]",
545
+ name: "coins",
546
+ type: "tuple[]"
547
+ },
548
+ { internalType: "string", name: "memo", type: "string" }
549
+ ],
550
+ name: "returnVaultAssets",
551
+ outputs: [],
552
+ stateMutability: "payable",
553
+ type: "function"
554
+ },
555
+ {
556
+ inputs: [
557
+ { internalType: "address", name: "router", type: "address" },
558
+ { internalType: "address", name: "newVault", type: "address" },
559
+ { internalType: "address", name: "asset", type: "address" },
560
+ { internalType: "uint256", name: "amount", type: "uint256" },
561
+ { internalType: "string", name: "memo", type: "string" }
562
+ ],
563
+ name: "transferAllowance",
564
+ outputs: [],
565
+ stateMutability: "nonpayable",
566
+ type: "function"
567
+ },
568
+ {
569
+ inputs: [
570
+ { internalType: "address payable", name: "to", type: "address" },
571
+ { internalType: "address", name: "asset", type: "address" },
572
+ { internalType: "uint256", name: "amount", type: "uint256" },
573
+ { internalType: "string", name: "memo", type: "string" }
574
+ ],
575
+ name: "transferOut",
576
+ outputs: [],
577
+ stateMutability: "payable",
578
+ type: "function"
579
+ },
580
+ {
581
+ inputs: [
582
+ { internalType: "address payable", name: "target", type: "address" },
583
+ { internalType: "address", name: "finalToken", type: "address" },
584
+ { internalType: "address", name: "to", type: "address" },
585
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
586
+ { internalType: "string", name: "memo", type: "string" }
587
+ ],
588
+ name: "transferOutAndCall",
589
+ outputs: [],
590
+ stateMutability: "payable",
591
+ type: "function"
592
+ },
593
+ {
594
+ inputs: [
595
+ { internalType: "address", name: "vault", type: "address" },
596
+ { internalType: "address", name: "token", type: "address" }
597
+ ],
598
+ name: "vaultAllowance",
599
+ outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
600
+ stateMutability: "view",
601
+ type: "function"
602
+ }
603
+ ];
604
+ // src/types/network.ts
605
+ var RPCUrl;
606
+ (function(RPCUrl2) {
607
+ RPCUrl2["Arbitrum"] = "https://arb1.arbitrum.io/rpc";
608
+ RPCUrl2["Avalanche"] = "https://node-router.thorswap.net/avalanche-c";
609
+ RPCUrl2["Binance"] = "";
610
+ RPCUrl2["BinanceSmartChain"] = "https://bsc-dataseed.binance.org";
611
+ RPCUrl2["Bitcoin"] = "https://node-router.thorswap.net/bitcoin";
612
+ RPCUrl2["BitcoinCash"] = "https://node-router.thorswap.net/bitcoin-cash";
613
+ RPCUrl2["Chainflip"] = "wss://mainnet-archive.chainflip.io";
614
+ RPCUrl2["Cosmos"] = "https://node-router.thorswap.net/cosmos/rpc";
615
+ RPCUrl2["Dash"] = "https://node-router.thorswap.net/dash";
616
+ RPCUrl2["Dogecoin"] = "https://node-router.thorswap.net/dogecoin";
617
+ RPCUrl2["Ethereum"] = "https://node-router.thorswap.net/ethereum";
618
+ RPCUrl2["Kujira"] = "https://rpc-kujira.synergynodes.com/";
619
+ RPCUrl2["Litecoin"] = "https://node-router.thorswap.net/litecoin";
620
+ RPCUrl2["Maya"] = "https://tendermint.mayachain.info";
621
+ RPCUrl2["MayaStagenet"] = "https://stagenet.tendermint.mayachain.info";
622
+ RPCUrl2["Optimism"] = "https://mainnet.optimism.io";
623
+ RPCUrl2["Polkadot"] = "wss://rpc.polkadot.io";
624
+ RPCUrl2["Polygon"] = "https://polygon-rpc.com";
625
+ RPCUrl2["THORChain"] = "https://rpc.thorswap.net";
626
+ RPCUrl2["THORChainStagenet"] = "https://stagenet-rpc.ninerealms.com";
627
+ })(RPCUrl || (RPCUrl = {}));
628
+ var ExplorerUrl;
629
+ (function(ExplorerUrl2) {
630
+ ExplorerUrl2["Arbitrum"] = "https://arbiscan.io";
631
+ ExplorerUrl2["Avalanche"] = "https://snowtrace.io";
632
+ ExplorerUrl2["Binance"] = "https://explorer.binance.org";
633
+ ExplorerUrl2["BinanceSmartChain"] = "https://bscscan.com";
634
+ ExplorerUrl2["Bitcoin"] = "https://blockchair.com/bitcoin";
635
+ ExplorerUrl2["BitcoinCash"] = "https://www.blockchair.com/bitcoin-cash";
636
+ ExplorerUrl2["Chainflip"] = "https://explorer.polkascan.io/polkadot";
637
+ ExplorerUrl2["Cosmos"] = "https://www.mintscan.io/cosmos";
638
+ ExplorerUrl2["Dash"] = "https://blockchair.com/dash";
639
+ ExplorerUrl2["Dogecoin"] = "https://blockchair.com/dogecoin";
640
+ ExplorerUrl2["Ethereum"] = "https://etherscan.io";
641
+ ExplorerUrl2["Kujira"] = "https://finder.kujira.network/kaiyo-1";
642
+ ExplorerUrl2["Litecoin"] = "https://blockchair.com/litecoin";
643
+ ExplorerUrl2["Maya"] = "https://www.mayascan.org";
644
+ ExplorerUrl2["Optimism"] = "https://optimistic.etherscan.io";
645
+ ExplorerUrl2["Polkadot"] = "https://polkadot.subscan.io/";
646
+ ExplorerUrl2["Polygon"] = "https://polygonscan.com";
647
+ ExplorerUrl2["THORChain"] = "https://runescan.io";
648
+ })(ExplorerUrl || (ExplorerUrl = {}));
649
+
650
+ // src/types/chains.ts
651
+ var Chain;
652
+ (function(Chain2) {
653
+ Chain2["Arbitrum"] = "ARB";
654
+ Chain2["Avalanche"] = "AVAX";
655
+ Chain2["Binance"] = "BNB";
656
+ Chain2["BinanceSmartChain"] = "BSC";
657
+ Chain2["Bitcoin"] = "BTC";
658
+ Chain2["BitcoinCash"] = "BCH";
659
+ Chain2["Cosmos"] = "GAIA";
660
+ Chain2["Dash"] = "DASH";
661
+ Chain2["Dogecoin"] = "DOGE";
662
+ Chain2["Ethereum"] = "ETH";
663
+ Chain2["Kujira"] = "KUJI";
664
+ Chain2["Litecoin"] = "LTC";
665
+ Chain2["Maya"] = "MAYA";
666
+ Chain2["Optimism"] = "OP";
667
+ Chain2["Polkadot"] = "DOT";
668
+ Chain2["Chainflip"] = "FLIP";
669
+ Chain2["Polygon"] = "MATIC";
670
+ Chain2["THORChain"] = "THOR";
671
+ })(Chain || (Chain = {}));
672
+ var ChainId;
673
+ (function(ChainId2) {
674
+ ChainId2["Arbitrum"] = "42161";
675
+ ChainId2["ArbitrumHex"] = "0xa4b1";
676
+ ChainId2["Avalanche"] = "43114";
677
+ ChainId2["AvalancheHex"] = "0xa86a";
678
+ ChainId2["Binance"] = "Binance-Chain-Tigris";
679
+ ChainId2["BinanceSmartChain"] = "56";
680
+ ChainId2["BinanceSmartChainHex"] = "0x38";
681
+ ChainId2["Bitcoin"] = "bitcoin";
682
+ ChainId2["BitcoinCash"] = "bitcoincash";
683
+ ChainId2["Chainflip"] = "chainflip";
684
+ ChainId2["Cosmos"] = "cosmoshub-4";
685
+ ChainId2["Dash"] = "dash";
686
+ ChainId2["Dogecoin"] = "dogecoin";
687
+ ChainId2["Kujira"] = "kaiyo-1";
688
+ ChainId2["Ethereum"] = "1";
689
+ ChainId2["EthereumHex"] = "0x1";
690
+ ChainId2["Litecoin"] = "litecoin";
691
+ ChainId2["Maya"] = "mayachain-mainnet-v1";
692
+ ChainId2["MayaStagenet"] = "mayachain-stagenet-v1";
693
+ ChainId2["Optimism"] = "10";
694
+ ChainId2["OptimismHex"] = "0xa";
695
+ ChainId2["Polkadot"] = "polkadot";
696
+ ChainId2["Polygon"] = "137";
697
+ ChainId2["PolygonHex"] = "0x89";
698
+ ChainId2["THORChain"] = "thorchain-mainnet-v1";
699
+ ChainId2["THORChainStagenet"] = "thorchain-stagenet-v2";
700
+ })(ChainId || (ChainId = {}));
701
+ var ChainIdToChain = {
702
+ [ChainId.ArbitrumHex]: Chain.Arbitrum,
703
+ [ChainId.Arbitrum]: Chain.Arbitrum,
704
+ [ChainId.AvalancheHex]: Chain.Avalanche,
705
+ [ChainId.Avalanche]: Chain.Avalanche,
706
+ [ChainId.BinanceSmartChainHex]: Chain.BinanceSmartChain,
707
+ [ChainId.BinanceSmartChain]: Chain.BinanceSmartChain,
708
+ [ChainId.Binance]: Chain.Binance,
709
+ [ChainId.BitcoinCash]: Chain.BitcoinCash,
710
+ [ChainId.Bitcoin]: Chain.Bitcoin,
711
+ [ChainId.Chainflip]: Chain.Chainflip,
712
+ [ChainId.Cosmos]: Chain.Cosmos,
713
+ [ChainId.Dash]: Chain.Dash,
714
+ [ChainId.Dogecoin]: Chain.Dogecoin,
715
+ [ChainId.EthereumHex]: Chain.Ethereum,
716
+ [ChainId.Kujira]: Chain.Kujira,
717
+ [ChainId.Ethereum]: Chain.Ethereum,
718
+ [ChainId.Litecoin]: Chain.Litecoin,
719
+ [ChainId.MayaStagenet]: Chain.Maya,
720
+ [ChainId.Maya]: Chain.Maya,
721
+ [ChainId.OptimismHex]: Chain.Optimism,
722
+ [ChainId.Optimism]: Chain.Optimism,
723
+ [ChainId.Polkadot]: Chain.Polkadot,
724
+ [ChainId.PolygonHex]: Chain.Polygon,
725
+ [ChainId.Polygon]: Chain.Polygon,
726
+ [ChainId.THORChainStagenet]: Chain.THORChain,
727
+ [ChainId.THORChain]: Chain.THORChain
728
+ };
729
+ var chainNames = Object.keys(Chain);
730
+ var chains = Object.values(Chain);
731
+ var BaseDecimal;
732
+ (function(BaseDecimal2) {
733
+ BaseDecimal2[BaseDecimal2["ARB"] = 18] = "ARB";
734
+ BaseDecimal2[BaseDecimal2["AVAX"] = 18] = "AVAX";
735
+ BaseDecimal2[BaseDecimal2["BCH"] = 8] = "BCH";
736
+ BaseDecimal2[BaseDecimal2["BNB"] = 8] = "BNB";
737
+ BaseDecimal2[BaseDecimal2["BSC"] = 18] = "BSC";
738
+ BaseDecimal2[BaseDecimal2["BTC"] = 8] = "BTC";
739
+ BaseDecimal2[BaseDecimal2["DASH"] = 8] = "DASH";
740
+ BaseDecimal2[BaseDecimal2["DOGE"] = 8] = "DOGE";
741
+ BaseDecimal2[BaseDecimal2["DOT"] = 10] = "DOT";
742
+ BaseDecimal2[BaseDecimal2["ETH"] = 18] = "ETH";
743
+ BaseDecimal2[BaseDecimal2["FLIP"] = 18] = "FLIP";
744
+ BaseDecimal2[BaseDecimal2["GAIA"] = 6] = "GAIA";
745
+ BaseDecimal2[BaseDecimal2["KUJI"] = 6] = "KUJI";
746
+ BaseDecimal2[BaseDecimal2["LTC"] = 8] = "LTC";
747
+ BaseDecimal2[BaseDecimal2["MATIC"] = 18] = "MATIC";
748
+ BaseDecimal2[BaseDecimal2["MAYA"] = 10] = "MAYA";
749
+ BaseDecimal2[BaseDecimal2["OP"] = 18] = "OP";
750
+ BaseDecimal2[BaseDecimal2["THOR"] = 8] = "THOR";
751
+ BaseDecimal2[BaseDecimal2["ZEC"] = 8] = "ZEC";
752
+ })(BaseDecimal || (BaseDecimal = {}));
753
+ var SubstrateChains = [Chain.Polkadot, Chain.Chainflip];
754
+ var EVMChains = [
755
+ Chain.Ethereum,
756
+ Chain.Avalanche,
757
+ Chain.BinanceSmartChain,
758
+ Chain.Arbitrum,
759
+ Chain.Optimism,
760
+ Chain.Polygon
761
+ ];
762
+ var UTXOChains = [
763
+ Chain.Bitcoin,
764
+ Chain.BitcoinCash,
765
+ Chain.Dash,
766
+ Chain.Dogecoin,
767
+ Chain.Litecoin
768
+ ];
769
+ var CosmosChains = [
770
+ Chain.Cosmos,
771
+ Chain.THORChain,
772
+ Chain.Binance,
773
+ Chain.Maya,
774
+ Chain.Kujira
775
+ ];
776
+ var TCSupportedChains = [
777
+ Chain.Avalanche,
778
+ Chain.Binance,
779
+ Chain.BinanceSmartChain,
780
+ Chain.Bitcoin,
781
+ Chain.BitcoinCash,
782
+ Chain.Cosmos,
783
+ Chain.Dogecoin,
784
+ Chain.Ethereum,
785
+ Chain.Litecoin,
786
+ Chain.THORChain
787
+ ];
788
+ var MAYASupportedChains = [
789
+ Chain.Dash,
790
+ Chain.Ethereum,
791
+ Chain.Kujira,
792
+ Chain.Maya,
793
+ Chain.THORChain
794
+ ];
795
+ var ChainToChainName = chains.reduce((acc, chain) => {
796
+ const chainName = chainNames.find((key) => Chain[key] === chain);
797
+ if (chainName)
798
+ acc[chain] = chainName;
799
+ return acc;
800
+ }, {});
801
+ var ChainToChainId = chains.reduce((acc, chain) => {
802
+ acc[chain] = ChainId[ChainToChainName[chain]];
803
+ return acc;
804
+ }, {});
805
+ var ChainToRPC = chains.reduce((acc, chain) => {
806
+ acc[chain] = RPCUrl[ChainToChainName[chain]];
807
+ return acc;
808
+ }, {});
809
+ var ChainToHexChainId = chains.reduce((acc, chain) => {
810
+ const chainString = `${ChainToChainName[chain]}Hex`;
811
+ acc[chain] = ChainId[chainString];
812
+ return acc;
813
+ }, {});
814
+ var ChainToExplorerUrl = chains.reduce((acc, chain) => {
815
+ acc[chain] = ExplorerUrl[ChainToChainName[chain]];
816
+ return acc;
817
+ }, {});
818
+ // src/types/commonTypes.ts
819
+ var QuoteMode;
820
+ (function(QuoteMode2) {
821
+ QuoteMode2["TC_SUPPORTED_TO_TC_SUPPORTED"] = "TC-TC";
822
+ QuoteMode2["TC_SUPPORTED_TO_ETH"] = "TC-ERC20";
823
+ QuoteMode2["TC_SUPPORTED_TO_AVAX"] = "TC-ARC20";
824
+ QuoteMode2["TC_SUPPORTED_TO_BSC"] = "TC-BEP20";
825
+ QuoteMode2["ETH_TO_TC_SUPPORTED"] = "ERC20-TC";
826
+ QuoteMode2["ETH_TO_ETH"] = "ERC20-ERC20";
827
+ QuoteMode2["ETH_TO_AVAX"] = "ERC20-ARC20";
828
+ QuoteMode2["ETH_TO_BSC"] = "ERC20-BEP20";
829
+ QuoteMode2["AVAX_TO_TC_SUPPORTED"] = "ARC20-TC";
830
+ QuoteMode2["AVAX_TO_ETH"] = "ARC20-ERC20";
831
+ QuoteMode2["AVAX_TO_AVAX"] = "ARC20-ARC20";
832
+ QuoteMode2["AVAX_TO_BSC"] = "ARC20-BEP20";
833
+ QuoteMode2["BSC_TO_TC_SUPPORTED"] = "BEP20-TC";
834
+ QuoteMode2["BSC_TO_ETH"] = "BEP20-ERC20";
835
+ QuoteMode2["BSC_TO_AVAX"] = "BEP20-ARC20";
836
+ QuoteMode2["BSC_TO_BSC"] = "BEP20-BEP20";
837
+ })(QuoteMode || (QuoteMode = {}));
838
+ var AGG_SWAP = [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC];
839
+ var SWAP_IN = [
840
+ QuoteMode.ETH_TO_TC_SUPPORTED,
841
+ QuoteMode.ETH_TO_AVAX,
842
+ QuoteMode.ETH_TO_BSC,
843
+ QuoteMode.AVAX_TO_TC_SUPPORTED,
844
+ QuoteMode.AVAX_TO_ETH,
845
+ QuoteMode.AVAX_TO_BSC,
846
+ QuoteMode.BSC_TO_TC_SUPPORTED,
847
+ QuoteMode.BSC_TO_ETH,
848
+ QuoteMode.BSC_TO_AVAX
849
+ ];
850
+ var SWAP_OUT = [
851
+ QuoteMode.TC_SUPPORTED_TO_TC_SUPPORTED,
852
+ QuoteMode.TC_SUPPORTED_TO_ETH,
853
+ QuoteMode.TC_SUPPORTED_TO_AVAX,
854
+ QuoteMode.TC_SUPPORTED_TO_BSC
855
+ ];
856
+ // src/types/derivationPath.ts
857
+ var ContractAddress;
858
+ (function(ContractAddress2) {
859
+ ContractAddress2["ARB"] = "0x0000000000000000000000000000000000000000";
860
+ ContractAddress2["AVAX"] = "0x0000000000000000000000000000000000000000";
861
+ ContractAddress2["ETH"] = "0x0000000000000000000000000000000000000000";
862
+ ContractAddress2["BSC"] = "0x0000000000000000000000000000000000000000";
863
+ ContractAddress2["MATIC"] = "0x0000000000000000000000000000000000001010";
864
+ ContractAddress2["OP"] = "0x4200000000000000000000000000000000000042";
865
+ })(ContractAddress || (ContractAddress = {}));
866
+ var DerivationPath;
867
+ (function(DerivationPath2) {
868
+ DerivationPath2["ARB"] = "m/44'/60'/0'/0";
869
+ DerivationPath2["AVAX"] = "m/44'/60'/0'/0";
870
+ DerivationPath2["BCH"] = "m/44'/145'/0'/0";
871
+ DerivationPath2["BNB"] = "m/44'/714'/0'/0";
872
+ DerivationPath2["BSC"] = "m/44'/60'/0'/0";
873
+ DerivationPath2["BTC"] = "m/84'/0'/0'/0";
874
+ DerivationPath2["DASH"] = "m/44'/5'/0'/0";
875
+ DerivationPath2["DOGE"] = "m/44'/3'/0'/0";
876
+ DerivationPath2["DOT"] = "////";
877
+ DerivationPath2["ETH"] = "m/44'/60'/0'/0";
878
+ DerivationPath2["FLIP"] = "////";
879
+ DerivationPath2["GAIA"] = "m/44'/118'/0'/0";
880
+ DerivationPath2["KUJI"] = "m/44'/118'/0'/0";
881
+ DerivationPath2["LTC"] = "m/84'/2'/0'/0";
882
+ DerivationPath2["MATIC"] = "m/44'/60'/0'/0";
883
+ DerivationPath2["MAYA"] = "m/44'/931'/0'/0";
884
+ DerivationPath2["OP"] = "m/44'/60'/0'/0";
885
+ DerivationPath2["THOR"] = "m/44'/931'/0'/0";
886
+ })(DerivationPath || (DerivationPath = {}));
887
+ var NetworkDerivationPath = {
888
+ ARB: [44, 60, 0, 0, 0],
889
+ AVAX: [44, 60, 0, 0, 0],
890
+ BCH: [44, 145, 0, 0, 0],
891
+ BNB: [44, 714, 0, 0, 0],
892
+ BSC: [44, 60, 0, 0, 0],
893
+ BTC: [84, 0, 0, 0, 0],
894
+ DASH: [44, 5, 0, 0, 0],
895
+ DOGE: [44, 3, 0, 0, 0],
896
+ ETH: [44, 60, 0, 0, 0],
897
+ GAIA: [44, 118, 0, 0, 0],
898
+ KUJI: [44, 118, 0, 0, 0],
899
+ LTC: [84, 2, 0, 0, 0],
900
+ MATIC: [44, 60, 0, 0, 0],
901
+ MAYA: [44, 931, 0, 0, 0],
902
+ OP: [44, 60, 0, 0, 0],
903
+ THOR: [44, 931, 0, 0, 0],
904
+ DOT: [0, 0, 0, 0, 0],
905
+ FLIP: [0, 0, 0, 0, 0]
906
+ };
907
+ // src/types/transactions.ts
908
+ var FeeOption;
909
+ (function(FeeOption2) {
910
+ FeeOption2["Average"] = "average";
911
+ FeeOption2["Fast"] = "fast";
912
+ FeeOption2["Fastest"] = "fastest";
913
+ })(FeeOption || (FeeOption = {}));
914
+ var ApproveMode;
915
+ (function(ApproveMode2) {
916
+ ApproveMode2["Approve"] = "approve";
917
+ ApproveMode2["CheckOnly"] = "checkOnly";
918
+ })(ApproveMode || (ApproveMode = {}));
919
+ var MemoType;
920
+ (function(MemoType2) {
921
+ MemoType2["BOND"] = "BOND";
922
+ MemoType2["DEPOSIT"] = "+";
923
+ MemoType2["LEAVE"] = "LEAVE";
924
+ MemoType2["THORNAME_REGISTER"] = "~";
925
+ MemoType2["UNBOND"] = "UNBOND";
926
+ MemoType2["WITHDRAW"] = "-";
927
+ MemoType2["OPEN_LOAN"] = "$+";
928
+ MemoType2["CLOSE_LOAN"] = "$-";
929
+ })(MemoType || (MemoType = {}));
930
+ // src/types/wallet.ts
931
+ var WalletOption;
932
+ (function(WalletOption2) {
933
+ WalletOption2["KEYSTORE"] = "KEYSTORE";
934
+ WalletOption2["KEEPKEY"] = "KEEPKEY";
935
+ WalletOption2["XDEFI"] = "XDEFI";
936
+ WalletOption2["METAMASK"] = "METAMASK";
937
+ WalletOption2["COINBASE_WEB"] = "COINBASE_WEB";
938
+ WalletOption2["TREZOR"] = "TREZOR";
939
+ WalletOption2["TRUSTWALLET_WEB"] = "TRUSTWALLET_WEB";
940
+ WalletOption2["LEDGER"] = "LEDGER";
941
+ WalletOption2["KEPLR"] = "KEPLR";
942
+ WalletOption2["OKX"] = "OKX";
943
+ WalletOption2["OKX_MOBILE"] = "OKX_MOBILE";
944
+ WalletOption2["BRAVE"] = "BRAVE";
945
+ WalletOption2["WALLETCONNECT"] = "WALLETCONNECT";
946
+ })(WalletOption || (WalletOption = {}));
947
+ var LedgerErrorCode;
948
+ (function(LedgerErrorCode2) {
949
+ LedgerErrorCode2[LedgerErrorCode2["NoError"] = 36864] = "NoError";
950
+ LedgerErrorCode2[LedgerErrorCode2["LockedDevice"] = 21781] = "LockedDevice";
951
+ LedgerErrorCode2[LedgerErrorCode2["TC_NotFound"] = 65535] = "TC_NotFound";
952
+ })(LedgerErrorCode || (LedgerErrorCode = {}));
953
+ // src/modules/requestClient.ts
954
+ import ky from "ky";
955
+ function setRequestClientConfig({ apiKey, ...config }) {
956
+ kyClient = ky.create({
957
+ ...config,
958
+ headers: { ...defaultRequestHeaders, ...config.headers, "x-api-key": apiKey }
959
+ });
960
+ }
961
+ var getKyClient = function() {
962
+ if (kyClient)
963
+ return kyClient;
964
+ kyClient = ky.create({ headers: defaultRequestHeaders });
965
+ return kyClient;
966
+ };
967
+ var kyClient;
968
+ var defaultRequestHeaders = typeof window !== "undefined" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" };
969
+ var RequestClient = {
970
+ get: (url, options) => getKyClient().get(url, options).json(),
971
+ post: (url, options) => getKyClient().post(url, options).json()
972
+ };
11
973
 
12
974
  // src/helpers/asset.ts
13
- import {RequestClient} from "@swapkit/api";
14
- import {BaseDecimal, Chain, ChainToRPC, EVMChains, FeeOption} from "@swapkit/types";
15
975
  async function findAssetBy(params) {
16
976
  const tokenPackages = await import("@swapkit/tokens");
17
977
  for (const tokenList of Object.values(tokenPackages)) {
@@ -163,12 +1123,11 @@ var evmAssetHasAddress = (assetString) => {
163
1123
  const [, address] = symbol.split("-");
164
1124
  return isGasAsset({ chain, symbol }) || !!address;
165
1125
  };
166
- var filterAssets = (tokens) => tokens.filter(({ chain, value, symbol }) => {
1126
+ var filterAssets = (tokens2) => tokens2.filter(({ chain, value, symbol }) => {
167
1127
  const assetString = `${chain}.${symbol}`;
168
1128
  return !potentialScamRegex.test(assetString) && evmAssetHasAddress(assetString) && value !== "0";
169
1129
  });
170
1130
  // src/helpers/liquidity.ts
171
- import {BaseDecimal as BaseDecimal2} from "@swapkit/types";
172
1131
  function getAsymmetricRuneShare({
173
1132
  liquidityUnits,
174
1133
  poolUnits,
@@ -218,7 +1177,7 @@ function getAsymmetricAssetWithdrawAmount({
218
1177
  return getAsymmetricAssetShare({ assetDepth, liquidityUnits, poolUnits }).mul(percent);
219
1178
  }
220
1179
  var toTCSwapKitNumber = function(value) {
221
- return SwapKitNumber.fromBigInt(BigInt(value), BaseDecimal2.THOR);
1180
+ return SwapKitNumber.fromBigInt(BigInt(value), BaseDecimal.THOR);
222
1181
  };
223
1182
  function getSymmetricPoolShare({
224
1183
  liquidityUnits,
@@ -284,7 +1243,6 @@ function getLiquiditySlippage({
284
1243
  return Math.abs(numerator.div(denominator).getBaseValue("number"));
285
1244
  }
286
1245
  // src/helpers/memo.ts
287
- import {Chain as Chain2, MemoType} from "@swapkit/types";
288
1246
  var getMemoFor = (memoType, options) => {
289
1247
  switch (memoType) {
290
1248
  case MemoType.LEAVE:
@@ -304,11 +1262,11 @@ var getMemoFor = (memoType, options) => {
304
1262
  const { chain, symbol, address, singleSide } = options;
305
1263
  const getPoolIdentifier = (chain2, symbol2) => {
306
1264
  switch (chain2) {
307
- case Chain2.Litecoin:
1265
+ case Chain.Litecoin:
308
1266
  return "l";
309
- case Chain2.Dogecoin:
1267
+ case Chain.Dogecoin:
310
1268
  return "d";
311
- case Chain2.BitcoinCash:
1269
+ case Chain.BitcoinCash:
312
1270
  return "c";
313
1271
  default:
314
1272
  return `${chain2}.${symbol2}`;
@@ -409,9 +1367,9 @@ function getMAYANameCost(year) {
409
1367
  throw new Error("Invalid number of year");
410
1368
  return Math.round((10 + year * 1.0512) * 10000000000) / 10000000000;
411
1369
  }
412
- function derivationPathToString([network, chainId, account, change, index]) {
1370
+ function derivationPathToString([network3, chainId, account, change, index]) {
413
1371
  const shortPath = typeof index !== "number";
414
- return `m/${network}'/${chainId}'/${account}'/${change}${shortPath ? "" : `/${index}`}`;
1372
+ return `m/${network3}'/${chainId}'/${account}'/${change}${shortPath ? "" : `/${index}`}`;
415
1373
  }
416
1374
  function wrapWithThrow(fn, errorKey) {
417
1375
  try {
@@ -423,11 +1381,7 @@ function wrapWithThrow(fn, errorKey) {
423
1381
  return console.error(error);
424
1382
  }
425
1383
  }
426
- // src/modules/assetValue.ts
427
- import {BaseDecimal as BaseDecimal4, Chain as Chain4, ChainToChainId} from "@swapkit/types";
428
-
429
1384
  // src/helpers/validators.ts
430
- import {Chain as Chain3} from "@swapkit/types";
431
1385
  function validateIdentifier(identifier = "") {
432
1386
  const uppercasedIdentifier = identifier.toUpperCase();
433
1387
  const [chain] = uppercasedIdentifier.split(".");
@@ -438,10 +1392,9 @@ function validateIdentifier(identifier = "") {
438
1392
  return true;
439
1393
  throw new Error(`Invalid identifier: ${identifier}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`);
440
1394
  }
441
- var supportedChains = [...Object.values(Chain3), "TERRA"];
1395
+ var supportedChains = [...Object.values(Chain), "TERRA"];
442
1396
 
443
1397
  // src/modules/bigIntArithmetics.ts
444
- import {BaseDecimal as BaseDecimal3} from "@swapkit/types";
445
1398
  function formatBigIntToSafeValue({
446
1399
  value,
447
1400
  bigIntDecimal = DEFAULT_DECIMAL,
@@ -546,7 +1499,7 @@ class BigIntArithmetics {
546
1499
  }
547
1500
  }
548
1501
  getBaseValue(type) {
549
- const divisor = this.decimalMultiplier / toMultiplier(this.decimal || BaseDecimal3.THOR);
1502
+ const divisor = this.decimalMultiplier / toMultiplier(this.decimal || BaseDecimal.THOR);
550
1503
  const baseValue = this.bigIntValue / divisor;
551
1504
  switch (type) {
552
1505
  case "number":
@@ -729,19 +1682,19 @@ class SwapKitNumber extends BigIntArithmetics {
729
1682
  function getMinAmountByChain(chain) {
730
1683
  const asset2 = AssetValue.fromChainOrSignature(chain);
731
1684
  switch (chain) {
732
- case Chain4.Bitcoin:
733
- case Chain4.Litecoin:
734
- case Chain4.BitcoinCash:
1685
+ case Chain.Bitcoin:
1686
+ case Chain.Litecoin:
1687
+ case Chain.BitcoinCash:
735
1688
  return asset2.set(0.00010001);
736
- case Chain4.Dogecoin:
1689
+ case Chain.Dogecoin:
737
1690
  return asset2.set(1.00000001);
738
- case Chain4.Avalanche:
739
- case Chain4.Ethereum:
1691
+ case Chain.Avalanche:
1692
+ case Chain.Ethereum:
740
1693
  return asset2.set(0.00000001);
741
- case Chain4.THORChain:
742
- case Chain4.Maya:
1694
+ case Chain.THORChain:
1695
+ case Chain.Maya:
743
1696
  return asset2.set(0);
744
- case Chain4.Cosmos:
1697
+ case Chain.Cosmos:
745
1698
  return asset2.set(0.000001);
746
1699
  default:
747
1700
  return asset2.set(0.00000001);
@@ -757,13 +1710,13 @@ async function createAssetValue(identifier, value = 0) {
757
1710
  return new AssetValue({ decimal, value: safeValue(value, decimal), identifier });
758
1711
  }
759
1712
  var createSyntheticAssetValue = function(identifier, value = 0) {
760
- const [synthChain, symbol] = identifier.split(".")?.[0]?.toUpperCase() === Chain4.THORChain ? identifier.split(".").slice(1).join().split("/") : identifier.split("/");
1713
+ const [synthChain, symbol] = identifier.split(".")?.[0]?.toUpperCase() === Chain.THORChain ? identifier.split(".").slice(1).join().split("/") : identifier.split("/");
761
1714
  if (!(synthChain && symbol))
762
1715
  throw new Error("Invalid asset identifier");
763
1716
  return new AssetValue({
764
1717
  decimal: 8,
765
1718
  value: safeValue(value, 8),
766
- identifier: `${Chain4.THORChain}.${synthChain}/${symbol}`
1719
+ identifier: `${Chain.THORChain}.${synthChain}/${symbol}`
767
1720
  });
768
1721
  };
769
1722
  var safeValue = function(value, decimal) {
@@ -771,10 +1724,10 @@ var safeValue = function(value, decimal) {
771
1724
  };
772
1725
  var getAssetInfo = function(identifier) {
773
1726
  const isSynthetic = identifier.slice(0, 14).includes("/");
774
- const [synthChain, synthSymbol = ""] = identifier.split(".")?.[0]?.toUpperCase() === Chain4.THORChain ? identifier.split(".").slice(1).join().split("/") : identifier.split("/");
1727
+ const [synthChain, synthSymbol = ""] = identifier.split(".")?.[0]?.toUpperCase() === Chain.THORChain ? identifier.split(".").slice(1).join().split("/") : identifier.split("/");
775
1728
  if (isSynthetic && !(synthChain && synthSymbol))
776
1729
  throw new Error("Invalid asset identifier");
777
- const adjustedIdentifier = identifier.includes(".") && !isSynthetic ? identifier : `${Chain4.THORChain}.${synthSymbol}`;
1730
+ const adjustedIdentifier = identifier.includes(".") && !isSynthetic ? identifier : `${Chain.THORChain}.${synthSymbol}`;
778
1731
  const [chain, ...rest] = adjustedIdentifier.split(".");
779
1732
  const [ticker, address] = (isSynthetic ? synthSymbol : rest.join(".")).split("-");
780
1733
  const symbol = isSynthetic ? synthSymbol : rest.join(".");
@@ -798,6 +1751,7 @@ class AssetValue extends BigIntArithmetics {
798
1751
  tax;
799
1752
  ticker;
800
1753
  type;
1754
+ chainId;
801
1755
  constructor({
802
1756
  value,
803
1757
  decimal,
@@ -816,6 +1770,7 @@ class AssetValue extends BigIntArithmetics {
816
1770
  this.address = assetInfo.address;
817
1771
  this.isSynthetic = assetInfo.isSynthetic;
818
1772
  this.isGasAsset = assetInfo.isGasAsset;
1773
+ this.chainId = ChainToChainId[assetInfo.chain];
819
1774
  }
820
1775
  toString() {
821
1776
  return this.isSynthetic ? this.symbol : `${this.chain}.${this.symbol}`;
@@ -826,14 +1781,11 @@ class AssetValue extends BigIntArithmetics {
826
1781
  eq({ chain, symbol }) {
827
1782
  return this.chain === chain && this.symbol === symbol;
828
1783
  }
829
- chainId() {
830
- return ChainToChainId[this.chain];
831
- }
832
1784
  static fromUrl(urlAsset, value = 0) {
833
1785
  const [chain, ticker, symbol] = urlAsset.split(".");
834
1786
  if (!(chain && ticker))
835
1787
  throw new Error("Invalid asset url");
836
- const assetString = chain === Chain4.THORChain && symbol ? `${chain}.${ticker}/${symbol}` : urlAsset;
1788
+ const assetString = chain === Chain.THORChain && symbol ? `${chain}.${ticker}/${symbol}` : urlAsset;
837
1789
  return createAssetValue(assetString, value);
838
1790
  }
839
1791
  static fromString(assetString, value = 0) {
@@ -848,7 +1800,7 @@ class AssetValue extends BigIntArithmetics {
848
1800
  if (isSynthetic)
849
1801
  return createSyntheticAssetValue(assetString, value);
850
1802
  const { tax, decimal, identifier } = tokenInfo || {
851
- decimal: BaseDecimal4[chain],
1803
+ decimal: BaseDecimal[chain],
852
1804
  identifier: assetString
853
1805
  };
854
1806
  return new AssetValue({
@@ -858,7 +1810,7 @@ class AssetValue extends BigIntArithmetics {
858
1810
  decimal: isSynthetic ? 8 : decimal
859
1811
  });
860
1812
  }
861
- static async fromStringWithBase(assetString, value = 0, baseDecimal = BaseDecimal4.THOR) {
1813
+ static async fromStringWithBase(assetString, value = 0, baseDecimal = BaseDecimal.THOR) {
862
1814
  const shiftedAmount = BigIntArithmetics.shiftDecimals({
863
1815
  value: SwapKitNumber.fromBigInt(BigInt(value)),
864
1816
  from: 0,
@@ -867,13 +1819,13 @@ class AssetValue extends BigIntArithmetics {
867
1819
  const assetValue = await AssetValue.fromString(assetString, value);
868
1820
  return assetValue.set(shiftedAmount);
869
1821
  }
870
- static fromStringWithBaseSync(assetString, value = 0, baseDecimal = BaseDecimal4.THOR) {
1822
+ static fromStringWithBaseSync(assetString, value = 0, baseDecimal = BaseDecimal.THOR) {
871
1823
  const { chain, isSynthetic } = getAssetInfo(assetString);
872
1824
  const tokenInfo = staticTokensMap.get(assetString.toUpperCase());
873
1825
  if (isSynthetic)
874
1826
  return createSyntheticAssetValue(assetString, value);
875
1827
  const { tax, decimal, identifier } = tokenInfo || {
876
- decimal: BaseDecimal4[chain],
1828
+ decimal: BaseDecimal[chain],
877
1829
  identifier: assetString
878
1830
  };
879
1831
  return new AssetValue({
@@ -889,7 +1841,7 @@ class AssetValue extends BigIntArithmetics {
889
1841
  if (isSynthetic)
890
1842
  return createSyntheticAssetValue(assetString, value);
891
1843
  const { tax, decimal, identifier } = tokenInfo || {
892
- decimal: BaseDecimal4[chain],
1844
+ decimal: BaseDecimal[chain],
893
1845
  identifier: assetString
894
1846
  };
895
1847
  return new AssetValue({ tax, decimal, identifier, value: safeValue(value, decimal) });
@@ -906,7 +1858,7 @@ class AssetValue extends BigIntArithmetics {
906
1858
  for (const { identifier, chain, ...rest } of tokenList.tokens) {
907
1859
  staticTokensMap.set(identifier.toUpperCase(), {
908
1860
  identifier,
909
- decimal: "decimals" in rest ? rest.decimals : BaseDecimal4[chain]
1861
+ decimal: "decimals" in rest ? rest.decimals : BaseDecimal[chain]
910
1862
  });
911
1863
  }
912
1864
  }
@@ -925,6 +1877,7 @@ class AssetValue extends BigIntArithmetics {
925
1877
  }
926
1878
  export {
927
1879
  wrapWithThrow,
1880
+ setRequestClientConfig,
928
1881
  isGasAsset,
929
1882
  getTHORNameCost,
930
1883
  getSymmetricWithdraw,
@@ -945,12 +1898,46 @@ export {
945
1898
  formatBigIntToSafeValue,
946
1899
  findAssetBy,
947
1900
  filterAssets,
1901
+ erc20ABI,
948
1902
  derivationPathToString,
1903
+ defaultRequestHeaders,
949
1904
  assetFromString,
1905
+ WalletOption,
1906
+ UTXOChains,
1907
+ TCSupportedChains,
1908
+ TCEthereumVaultAbi,
1909
+ TCBscDepositABI,
1910
+ TCAvalancheDepositABI,
950
1911
  SwapKitNumber,
951
1912
  SwapKitError,
1913
+ SubstrateChains,
1914
+ SWAP_OUT,
1915
+ SWAP_IN,
1916
+ RequestClient,
1917
+ RPCUrl,
1918
+ QuoteMode,
1919
+ NetworkDerivationPath,
1920
+ MemoType,
1921
+ MAYASupportedChains,
1922
+ LedgerErrorCode,
1923
+ FeeOption,
1924
+ ExplorerUrl,
1925
+ EVMChains,
1926
+ DerivationPath,
1927
+ CosmosChains,
1928
+ ContractAddress,
1929
+ ChainToRPC,
1930
+ ChainToHexChainId,
1931
+ ChainToExplorerUrl,
1932
+ ChainToChainId,
1933
+ ChainIdToChain,
1934
+ ChainId,
1935
+ Chain,
952
1936
  BigIntArithmetics,
953
- AssetValue
1937
+ BaseDecimal,
1938
+ AssetValue,
1939
+ ApproveMode,
1940
+ AGG_SWAP
954
1941
  };
955
1942
 
956
- //# debugId=73252CC82EFDBB7564756e2164756e21
1943
+ //# debugId=1DDD0D0CC7BC556064756e2164756e21