@swapkit/core 1.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +201 -0
  2. package/dist/index-9e36735e.cjs +1 -0
  3. package/dist/index-cf1865cd.js +649 -0
  4. package/dist/index.cjs +2 -0
  5. package/dist/index.d.ts +214 -0
  6. package/dist/index.es-320ea117.js +13836 -0
  7. package/dist/index.es-66e7d15a.js +11436 -0
  8. package/dist/index.es-8503fb04-8503fb04.js +34669 -0
  9. package/dist/index.es-8503fb04-903b9173.cjs +1 -0
  10. package/dist/index.es-c82b553a.cjs +14 -0
  11. package/dist/index.es-e22f22e9.cjs +1 -0
  12. package/dist/index.es.js +3743 -0
  13. package/package.json +57 -0
  14. package/src/aggregator/contracts/avaxGeneric.ts +92 -0
  15. package/src/aggregator/contracts/avaxWoofi.ts +145 -0
  16. package/src/aggregator/contracts/bscGeneric.ts +106 -0
  17. package/src/aggregator/contracts/ethGeneric.ts +92 -0
  18. package/src/aggregator/contracts/index.ts +74 -0
  19. package/src/aggregator/contracts/pancakeV2.ts +145 -0
  20. package/src/aggregator/contracts/pangolin.ts +120 -0
  21. package/src/aggregator/contracts/sushiswap.ts +120 -0
  22. package/src/aggregator/contracts/traderJoe.ts +120 -0
  23. package/src/aggregator/contracts/uniswapV2.ts +120 -0
  24. package/src/aggregator/contracts/uniswapV2Leg.ts +128 -0
  25. package/src/aggregator/contracts/uniswapV3_100.ts +128 -0
  26. package/src/aggregator/contracts/uniswapV3_10000.ts +128 -0
  27. package/src/aggregator/contracts/uniswapV3_3000.ts +128 -0
  28. package/src/aggregator/contracts/uniswapV3_500.ts +128 -0
  29. package/src/aggregator/getSwapParams.ts +70 -0
  30. package/src/client/__tests__/helpers.test.ts +69 -0
  31. package/src/client/explorerUrls.ts +60 -0
  32. package/src/client/index.ts +690 -0
  33. package/src/client/thornode.ts +31 -0
  34. package/src/client/types.ts +101 -0
  35. package/src/index.ts +4 -0
@@ -0,0 +1,3743 @@
1
+ var Ce = Object.defineProperty;
2
+ var Ne = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var T = (e, t, n) => (Ne(e, typeof t != "symbol" ? t + "" : t, n), n), xe = (e, t, n) => {
4
+ if (!t.has(e))
5
+ throw TypeError("Cannot " + n);
6
+ };
7
+ var A = (e, t, n) => (xe(e, t, "read from private field"), n ? n.call(e) : t.get(e)), P = (e, t, n) => {
8
+ if (t.has(e))
9
+ throw TypeError("Cannot add the same private member more than once");
10
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
11
+ };
12
+ var De = Object.defineProperty, Pe = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (Pe(e, typeof t != "symbol" ? t + "" : t, n), n);
13
+ const Lt = [
14
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
15
+ {
16
+ anonymous: !1,
17
+ inputs: [
18
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
19
+ { indexed: !0, internalType: "address", name: "spender", type: "address" },
20
+ { indexed: !1, internalType: "uint256", name: "value", type: "uint256" }
21
+ ],
22
+ name: "Approval",
23
+ type: "event"
24
+ },
25
+ {
26
+ anonymous: !1,
27
+ inputs: [
28
+ { indexed: !0, internalType: "address", name: "from", type: "address" },
29
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
30
+ { indexed: !1, internalType: "uint256", name: "value", type: "uint256" }
31
+ ],
32
+ name: "Transfer",
33
+ type: "event"
34
+ },
35
+ {
36
+ inputs: [
37
+ { internalType: "address", name: "", type: "address" },
38
+ { internalType: "address", name: "", type: "address" }
39
+ ],
40
+ name: "allowance",
41
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
42
+ stateMutability: "view",
43
+ type: "function"
44
+ },
45
+ {
46
+ inputs: [
47
+ { internalType: "address", name: "spender", type: "address" },
48
+ { internalType: "uint256", name: "value", type: "uint256" }
49
+ ],
50
+ name: "approve",
51
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
52
+ stateMutability: "nonpayable",
53
+ type: "function"
54
+ },
55
+ {
56
+ inputs: [{ internalType: "address", name: "", type: "address" }],
57
+ name: "balanceOf",
58
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
59
+ stateMutability: "view",
60
+ type: "function"
61
+ },
62
+ {
63
+ inputs: [],
64
+ name: "decimals",
65
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
66
+ stateMutability: "view",
67
+ type: "function"
68
+ },
69
+ {
70
+ inputs: [],
71
+ name: "name",
72
+ outputs: [{ internalType: "string", name: "", type: "string" }],
73
+ stateMutability: "view",
74
+ type: "function"
75
+ },
76
+ {
77
+ inputs: [],
78
+ name: "symbol",
79
+ outputs: [{ internalType: "string", name: "", type: "string" }],
80
+ stateMutability: "view",
81
+ type: "function"
82
+ },
83
+ {
84
+ inputs: [],
85
+ name: "totalSupply",
86
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
87
+ stateMutability: "view",
88
+ type: "function"
89
+ },
90
+ {
91
+ inputs: [
92
+ { internalType: "address", name: "to", type: "address" },
93
+ { internalType: "uint256", name: "value", type: "uint256" }
94
+ ],
95
+ name: "transfer",
96
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
97
+ stateMutability: "nonpayable",
98
+ type: "function"
99
+ },
100
+ {
101
+ inputs: [
102
+ { internalType: "address", name: "from", type: "address" },
103
+ { internalType: "address", name: "to", type: "address" },
104
+ { internalType: "uint256", name: "value", type: "uint256" }
105
+ ],
106
+ name: "transferFrom",
107
+ outputs: [{ internalType: "bool", name: "success", type: "bool" }],
108
+ stateMutability: "nonpayable",
109
+ type: "function"
110
+ }
111
+ ], Be = [
112
+ {
113
+ inputs: [{ internalType: "address", name: "rune", type: "address" }],
114
+ stateMutability: "nonpayable",
115
+ type: "constructor"
116
+ },
117
+ {
118
+ anonymous: !1,
119
+ inputs: [
120
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
121
+ { indexed: !0, internalType: "address", name: "asset", type: "address" },
122
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
123
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
124
+ ],
125
+ name: "Deposit",
126
+ type: "event"
127
+ },
128
+ {
129
+ anonymous: !1,
130
+ inputs: [
131
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
132
+ { indexed: !0, internalType: "address", name: "newVault", type: "address" },
133
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
134
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
135
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
136
+ ],
137
+ name: "TransferAllowance",
138
+ type: "event"
139
+ },
140
+ {
141
+ anonymous: !1,
142
+ inputs: [
143
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
144
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
145
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
146
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
147
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
148
+ ],
149
+ name: "TransferOut",
150
+ type: "event"
151
+ },
152
+ {
153
+ anonymous: !1,
154
+ inputs: [
155
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
156
+ { indexed: !1, internalType: "address", name: "target", type: "address" },
157
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
158
+ { indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
159
+ { indexed: !1, internalType: "address", name: "to", type: "address" },
160
+ { indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
161
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
162
+ ],
163
+ name: "TransferOutAndCall",
164
+ type: "event"
165
+ },
166
+ {
167
+ anonymous: !1,
168
+ inputs: [
169
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
170
+ { indexed: !0, internalType: "address", name: "newVault", type: "address" },
171
+ {
172
+ components: [
173
+ { internalType: "address", name: "asset", type: "address" },
174
+ { internalType: "uint256", name: "amount", type: "uint256" }
175
+ ],
176
+ indexed: !1,
177
+ internalType: "struct THORChain_Router.Coin[]",
178
+ name: "coins",
179
+ type: "tuple[]"
180
+ },
181
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
182
+ ],
183
+ name: "VaultTransfer",
184
+ type: "event"
185
+ },
186
+ {
187
+ inputs: [],
188
+ name: "RUNE",
189
+ outputs: [{ internalType: "address", name: "", type: "address" }],
190
+ stateMutability: "view",
191
+ type: "function"
192
+ },
193
+ {
194
+ inputs: [
195
+ { internalType: "address payable", name: "vault", type: "address" },
196
+ { internalType: "address", name: "asset", type: "address" },
197
+ { internalType: "uint256", name: "amount", type: "uint256" },
198
+ { internalType: "string", name: "memo", type: "string" }
199
+ ],
200
+ name: "deposit",
201
+ outputs: [],
202
+ stateMutability: "payable",
203
+ type: "function"
204
+ },
205
+ {
206
+ inputs: [
207
+ { internalType: "address payable", name: "vault", type: "address" },
208
+ { internalType: "address", name: "asset", type: "address" },
209
+ { internalType: "uint256", name: "amount", type: "uint256" },
210
+ { internalType: "string", name: "memo", type: "string" },
211
+ { internalType: "uint256", name: "expiration", type: "uint256" }
212
+ ],
213
+ name: "depositWithExpiry",
214
+ outputs: [],
215
+ stateMutability: "payable",
216
+ type: "function"
217
+ },
218
+ {
219
+ inputs: [
220
+ { internalType: "address", name: "router", type: "address" },
221
+ { internalType: "address payable", name: "asgard", type: "address" },
222
+ {
223
+ components: [
224
+ { internalType: "address", name: "asset", type: "address" },
225
+ { internalType: "uint256", name: "amount", type: "uint256" }
226
+ ],
227
+ internalType: "struct THORChain_Router.Coin[]",
228
+ name: "coins",
229
+ type: "tuple[]"
230
+ },
231
+ { internalType: "string", name: "memo", type: "string" }
232
+ ],
233
+ name: "returnVaultAssets",
234
+ outputs: [],
235
+ stateMutability: "payable",
236
+ type: "function"
237
+ },
238
+ {
239
+ inputs: [
240
+ { internalType: "address", name: "router", type: "address" },
241
+ { internalType: "address", name: "newVault", type: "address" },
242
+ { internalType: "address", name: "asset", type: "address" },
243
+ { internalType: "uint256", name: "amount", type: "uint256" },
244
+ { internalType: "string", name: "memo", type: "string" }
245
+ ],
246
+ name: "transferAllowance",
247
+ outputs: [],
248
+ stateMutability: "nonpayable",
249
+ type: "function"
250
+ },
251
+ {
252
+ inputs: [
253
+ { internalType: "address payable", name: "to", type: "address" },
254
+ { internalType: "address", name: "asset", type: "address" },
255
+ { internalType: "uint256", name: "amount", type: "uint256" },
256
+ { internalType: "string", name: "memo", type: "string" }
257
+ ],
258
+ name: "transferOut",
259
+ outputs: [],
260
+ stateMutability: "payable",
261
+ type: "function"
262
+ },
263
+ {
264
+ inputs: [
265
+ { internalType: "address payable", name: "aggregator", type: "address" },
266
+ { internalType: "address", name: "finalToken", type: "address" },
267
+ { internalType: "address", name: "to", type: "address" },
268
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
269
+ { internalType: "string", name: "memo", type: "string" }
270
+ ],
271
+ name: "transferOutAndCall",
272
+ outputs: [],
273
+ stateMutability: "payable",
274
+ type: "function"
275
+ },
276
+ {
277
+ inputs: [
278
+ { internalType: "address", name: "vault", type: "address" },
279
+ { internalType: "address", name: "token", type: "address" }
280
+ ],
281
+ name: "vaultAllowance",
282
+ outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
283
+ stateMutability: "view",
284
+ type: "function"
285
+ }
286
+ ], Ve = [
287
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
288
+ {
289
+ anonymous: !1,
290
+ inputs: [
291
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
292
+ { indexed: !0, internalType: "address", name: "asset", type: "address" },
293
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
294
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
295
+ ],
296
+ name: "Deposit",
297
+ type: "event"
298
+ },
299
+ {
300
+ anonymous: !1,
301
+ inputs: [
302
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
303
+ { indexed: !0, internalType: "address", name: "newVault", type: "address" },
304
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
305
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
306
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
307
+ ],
308
+ name: "TransferAllowance",
309
+ type: "event"
310
+ },
311
+ {
312
+ anonymous: !1,
313
+ inputs: [
314
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
315
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
316
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
317
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
318
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
319
+ ],
320
+ name: "TransferOut",
321
+ type: "event"
322
+ },
323
+ {
324
+ anonymous: !1,
325
+ inputs: [
326
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
327
+ { indexed: !1, internalType: "address", name: "target", type: "address" },
328
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
329
+ { indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
330
+ { indexed: !1, internalType: "address", name: "to", type: "address" },
331
+ { indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
332
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
333
+ ],
334
+ name: "TransferOutAndCall",
335
+ type: "event"
336
+ },
337
+ {
338
+ anonymous: !1,
339
+ inputs: [
340
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
341
+ { indexed: !0, 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: !1,
348
+ internalType: "struct AvaxRouter.Coin[]",
349
+ name: "coins",
350
+ type: "tuple[]"
351
+ },
352
+ { indexed: !1, 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
+ ], Le = [
451
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
452
+ {
453
+ anonymous: !1,
454
+ inputs: [
455
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
456
+ { indexed: !0, internalType: "address", name: "asset", type: "address" },
457
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
458
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
459
+ ],
460
+ name: "Deposit",
461
+ type: "event"
462
+ },
463
+ {
464
+ anonymous: !1,
465
+ inputs: [
466
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
467
+ { indexed: !0, internalType: "address", name: "newVault", type: "address" },
468
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
469
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
470
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
471
+ ],
472
+ name: "TransferAllowance",
473
+ type: "event"
474
+ },
475
+ {
476
+ anonymous: !1,
477
+ inputs: [
478
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
479
+ { indexed: !0, internalType: "address", name: "to", type: "address" },
480
+ { indexed: !1, internalType: "address", name: "asset", type: "address" },
481
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
482
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
483
+ ],
484
+ name: "TransferOut",
485
+ type: "event"
486
+ },
487
+ {
488
+ anonymous: !1,
489
+ inputs: [
490
+ { indexed: !0, internalType: "address", name: "vault", type: "address" },
491
+ { indexed: !1, internalType: "address", name: "target", type: "address" },
492
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
493
+ { indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
494
+ { indexed: !1, internalType: "address", name: "to", type: "address" },
495
+ { indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
496
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
497
+ ],
498
+ name: "TransferOutAndCall",
499
+ type: "event"
500
+ },
501
+ {
502
+ anonymous: !1,
503
+ inputs: [
504
+ { indexed: !0, internalType: "address", name: "oldVault", type: "address" },
505
+ { indexed: !0, internalType: "address", name: "newVault", type: "address" },
506
+ {
507
+ components: [
508
+ { internalType: "address", name: "asset", type: "address" },
509
+ { internalType: "uint256", name: "amount", type: "uint256" }
510
+ ],
511
+ indexed: !1,
512
+ internalType: "struct THORChain_Router.Coin[]",
513
+ name: "coins",
514
+ type: "tuple[]"
515
+ },
516
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
517
+ ],
518
+ name: "VaultTransfer",
519
+ type: "event"
520
+ },
521
+ {
522
+ inputs: [
523
+ { internalType: "address payable", name: "vault", type: "address" },
524
+ { internalType: "address", name: "asset", type: "address" },
525
+ { internalType: "uint256", name: "amount", type: "uint256" },
526
+ { internalType: "string", name: "memo", type: "string" },
527
+ { internalType: "uint256", name: "expiration", type: "uint256" }
528
+ ],
529
+ name: "depositWithExpiry",
530
+ outputs: [],
531
+ stateMutability: "payable",
532
+ type: "function"
533
+ },
534
+ {
535
+ inputs: [
536
+ { internalType: "address", name: "router", type: "address" },
537
+ { internalType: "address payable", name: "asgard", type: "address" },
538
+ {
539
+ components: [
540
+ { internalType: "address", name: "asset", type: "address" },
541
+ { internalType: "uint256", name: "amount", type: "uint256" }
542
+ ],
543
+ internalType: "struct THORChain_Router.Coin[]",
544
+ name: "coins",
545
+ type: "tuple[]"
546
+ },
547
+ { internalType: "string", name: "memo", type: "string" }
548
+ ],
549
+ name: "returnVaultAssets",
550
+ outputs: [],
551
+ stateMutability: "payable",
552
+ type: "function"
553
+ },
554
+ {
555
+ inputs: [
556
+ { internalType: "address", name: "router", type: "address" },
557
+ { internalType: "address", name: "newVault", type: "address" },
558
+ { internalType: "address", name: "asset", type: "address" },
559
+ { internalType: "uint256", name: "amount", type: "uint256" },
560
+ { internalType: "string", name: "memo", type: "string" }
561
+ ],
562
+ name: "transferAllowance",
563
+ outputs: [],
564
+ stateMutability: "nonpayable",
565
+ type: "function"
566
+ },
567
+ {
568
+ inputs: [
569
+ { internalType: "address payable", name: "to", type: "address" },
570
+ { internalType: "address", name: "asset", type: "address" },
571
+ { internalType: "uint256", name: "amount", type: "uint256" },
572
+ { internalType: "string", name: "memo", type: "string" }
573
+ ],
574
+ name: "transferOut",
575
+ outputs: [],
576
+ stateMutability: "payable",
577
+ type: "function"
578
+ },
579
+ {
580
+ inputs: [
581
+ { internalType: "address payable", name: "target", type: "address" },
582
+ { internalType: "address", name: "finalToken", type: "address" },
583
+ { internalType: "address", name: "to", type: "address" },
584
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
585
+ { internalType: "string", name: "memo", type: "string" }
586
+ ],
587
+ name: "transferOutAndCall",
588
+ outputs: [],
589
+ stateMutability: "payable",
590
+ type: "function"
591
+ },
592
+ {
593
+ inputs: [
594
+ { internalType: "address", name: "vault", type: "address" },
595
+ { internalType: "address", name: "token", type: "address" }
596
+ ],
597
+ name: "vaultAllowance",
598
+ outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
599
+ stateMutability: "view",
600
+ type: "function"
601
+ }
602
+ ];
603
+ var Ue = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e))(Ue || {});
604
+ const He = [
605
+ "ERC20-ERC20",
606
+ "ARC20-ARC20",
607
+ "BEP20-BEP20"
608
+ /* BSC_TO_BSC */
609
+ ], $e = [
610
+ "ERC20-TC",
611
+ "ERC20-ARC20",
612
+ "ERC20-BEP20",
613
+ "ARC20-TC",
614
+ "ARC20-ERC20",
615
+ "ARC20-BEP20",
616
+ "BEP20-TC",
617
+ "BEP20-ERC20",
618
+ "BEP20-ARC20"
619
+ /* BSC_TO_AVAX */
620
+ ], ke = [
621
+ "TC-TC",
622
+ "TC-ERC20",
623
+ "TC-ARC20",
624
+ "TC-BEP20"
625
+ /* TC_SUPPORTED_TO_BSC */
626
+ ];
627
+ var Ae = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(Ae || {}), Fe = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(Fe || {}), o = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(o || {});
628
+ const Ge = {
629
+ [o.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
630
+ [o.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
631
+ [o.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
632
+ [o.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
633
+ [o.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
634
+ [o.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
635
+ [o.INVALID_TYPE_GENERIC]: "Invalid type",
636
+ [o.INVALID_NUMBER_STRING]: "Invalid number string.",
637
+ [o.INVALID_NUMBER]: "Invalid number.",
638
+ [o.INVALID_BOOLEAN]: "Invalid boolean.",
639
+ [o.INVALID_OBJECT]: "Invalid object.",
640
+ [o.INVALID_ARRAY]: "Invalid array.",
641
+ [o.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
642
+ [o.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
643
+ [o.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
644
+ [o.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
645
+ [o.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
646
+ [o.AFF_BPS_INTEGER_0_100]: "affiliateBasisPoints must be an integer between 0 and 100.",
647
+ [o.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
648
+ [o.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
649
+ [o.PREFERRED_PROFVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
650
+ [o.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
651
+ [o.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
652
+ [o.INVALID_PROVIDER]: "Invalid provider {0}.",
653
+ [o.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
654
+ [o.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
655
+ [o.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
656
+ [o.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
657
+ [o.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
658
+ [o.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
659
+ [o.INVALID_CHAIN]: "Invalid chain {0}.",
660
+ [o.INVALID_ASSET]: "Invalid asset {0}.",
661
+ [o.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
662
+ [o.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
663
+ [o.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
664
+ [o.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
665
+ [o.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
666
+ [o.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
667
+ [o.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
668
+ [o.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
669
+ [o.INVALID_QUOTE_MODE]: "Invalid quote mode.",
670
+ [o.NO_QUOTES]: "No quotes to service this request.",
671
+ [o.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
672
+ [o.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
673
+ [o.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
674
+ [o.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
675
+ [o.NO_PRICE]: "No price for asset {0}.",
676
+ [o.PRICE_IS_STALE]: "Price is stale for asset {0}.",
677
+ [o.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
678
+ [o.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
679
+ }, ae = (e, t) => {
680
+ let n = Ge[e];
681
+ for (let a = 0; a < t.length; a++)
682
+ n = n.replace(`{${a}}`, t[a]);
683
+ return t.length === 0 ? n.replace("{0}", "") : n;
684
+ };
685
+ let Ut = class we extends Error {
686
+ constructor({
687
+ status: t,
688
+ revision: n,
689
+ module: a,
690
+ code: i,
691
+ message: r,
692
+ type: p,
693
+ options: { shouldLog: d, shouldThrow: l, shouldTrace: m } = {
694
+ shouldLog: !0,
695
+ shouldThrow: !0,
696
+ shouldTrace: !0
697
+ },
698
+ displayMessageParams: y
699
+ }) {
700
+ const u = r || ae(i, y || []) || "";
701
+ super(u), C(this, "status"), C(this, "revision"), C(this, "type"), C(this, "module"), C(this, "code"), C(this, "message"), C(this, "display"), C(this, "stack"), C(this, "options"), C(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = u, this.display = ae(i, y || []), this.code = i, this.type = p || Ae.UNHANDLED_ERROR, this.options = {
702
+ shouldLog: d || !0,
703
+ shouldTrace: m || !0,
704
+ shouldThrow: l || !1
705
+ }, this.displayMessageParams = y || [], this.options.shouldTrace && Error.captureStackTrace(this);
706
+ }
707
+ static fromErrorInfo(t) {
708
+ return new we(t);
709
+ }
710
+ toErrorInfo() {
711
+ return { ...this, identifier: this.identifier };
712
+ }
713
+ get identifier() {
714
+ return `${this.revision}-${this.type || "NO_TYPE"}-${this.module}-${this.code}`;
715
+ }
716
+ get displayMessage() {
717
+ return ae(this.code, this.displayMessageParams || []);
718
+ }
719
+ handle() {
720
+ const t = `[${this.identifier}]: ${this.message}`;
721
+ if (this.options.shouldLog && console.error(t, `
722
+ `, this.stack || ""), this.options.shouldThrow)
723
+ throw Error(t, { cause: this.stack });
724
+ return this.toErrorInfo();
725
+ }
726
+ };
727
+ var s = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(s || {}), We = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(We || {}), qe = /* @__PURE__ */ ((e) => (e[e.Ethereum = 60] = "Ethereum", e[e.Binance = 714] = "Binance", e[e.THORChain = 931] = "THORChain", e))(qe || {}), Ye = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0", e.AVAX = "m/44'/60'/0'/0", e.BCH = "m/44'/145'/0'/0", e.BNB = "m/44'/714'/0'/0", e.BSC = "m/44'/60'/0'/0", e.BTC = "m/84'/0'/0'/0", e.DOGE = "m/44'/3'/0'/0", e.ETH = "m/44'/60'/0'/0", e.GAIA = "m/44'/118'/0'/0", e.LTC = "m/84'/2'/0'/0", e.MATIC = "m/44'/60'/0'/0", e.MAYA = "m/44'/931'/0'/0", e.OP = "m/44'/60'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(Ye || {});
728
+ const Ht = {
729
+ ARB: [44, 60, 0, 0, 0],
730
+ AVAX: [44, 60, 0, 0, 0],
731
+ BCH: [44, 145, 0, 0, 0],
732
+ BNB: [44, 714, 0, 0, 0],
733
+ BSC: [44, 60, 0, 0, 0],
734
+ BTC: [84, 0, 0, 0, 0],
735
+ DOGE: [44, 3, 0, 0, 0],
736
+ ETH: [44, 60, 0, 0, 0],
737
+ GAIA: [44, 118, 0, 0, 0],
738
+ LTC: [84, 2, 0, 0, 0],
739
+ MATIC: [44, 60, 0, 0, 0],
740
+ MAYA: [44, 931, 0, 0, 0],
741
+ OP: [44, 60, 0, 0, 0],
742
+ THOR: [44, 931, 0, 0, 0]
743
+ };
744
+ var E = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.THOR = 8] = "THOR", e))(E || {});
745
+ const $t = [
746
+ "ETH",
747
+ "AVAX",
748
+ "BSC",
749
+ "ARB",
750
+ "OP",
751
+ "MATIC"
752
+ /* Polygon */
753
+ ], kt = [
754
+ "BTC",
755
+ "BCH",
756
+ "DOGE",
757
+ "LTC"
758
+ /* Litecoin */
759
+ ], Ft = [
760
+ "GAIA",
761
+ "THOR",
762
+ "BNB"
763
+ /* Binance */
764
+ ];
765
+ var me = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(me || {}), Ee = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(Ee || {}), q = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(q || {});
766
+ const te = Object.values(s), Xe = Object.keys(s), ce = te.reduce(
767
+ (e, t) => {
768
+ const n = Xe.find((a) => s[a] === t);
769
+ return n && (e[t] = n), e;
770
+ },
771
+ {}
772
+ ), Ke = te.reduce(
773
+ (e, t) => (e[t] = me[ce[t]], e),
774
+ {}
775
+ ), je = te.reduce(
776
+ (e, t) => (e[t] = Ee[ce[t]], e),
777
+ {}
778
+ ), Gt = te.reduce(
779
+ (e, t) => {
780
+ const n = `${ce[t]}Hex`;
781
+ return e[t] = me[n], e;
782
+ },
783
+ {}
784
+ ), Wt = {
785
+ "0xa4b1": "ARB",
786
+ 42161: "ARB",
787
+ "0xa86a": "AVAX",
788
+ 43114: "AVAX",
789
+ "0x38": "BSC",
790
+ 56: "BSC",
791
+ "Binance-Chain-Tigris": "BNB",
792
+ bitcoincash: "BCH",
793
+ bitcoin: "BTC",
794
+ "cosmoshub-4": "GAIA",
795
+ dogecoin: "DOGE",
796
+ "0x1": "ETH",
797
+ 1: "ETH",
798
+ litecoin: "LTC",
799
+ "mayachain-stagenet-v1": "MAYA",
800
+ "mayachain-mainnet-v1": "MAYA",
801
+ "0xa": "OP",
802
+ 10: "OP",
803
+ "0x89": "MATIC",
804
+ 137: "MATIC",
805
+ "thorchain-stagenet-v2": "THOR",
806
+ "thorchain-mainnet-v1": "THOR"
807
+ /* THORChain */
808
+ }, Re = {
809
+ ARB: "https://arbiscan.io",
810
+ AVAX: "https://snowtrace.io",
811
+ BSC: "https://bscscan.com",
812
+ BNB: "https://explorer.binance.org",
813
+ BCH: "https://www.blockchain.com/bch",
814
+ BTC: "https://blockstream.info",
815
+ GAIA: "https://cosmos.bigdipper.live",
816
+ DOGE: "https://blockchair.com/dogecoin",
817
+ ETH: "https://etherscan.io",
818
+ LTC: "https://ltc.bitaps.com",
819
+ MAYA: "https://explorer.mayachain.info",
820
+ OP: "https://optimistic.etherscan.io",
821
+ MATIC: "https://polygonscan.com",
822
+ THOR: "https://viewblock.io/thorchain"
823
+ };
824
+ var Qe = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(Qe || {}), f = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(f || {}), F = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(F || {}), ze = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(ze || {}), Je = Object.defineProperty, Ze = (e, t, n) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, N = (e, t, n) => (Ze(e, typeof t != "symbol" ? t + "" : t, n), n), et = (e, t, n) => {
825
+ if (!t.has(e))
826
+ throw TypeError("Cannot " + n);
827
+ }, B = (e, t, n) => {
828
+ if (t.has(e))
829
+ throw TypeError("Cannot add the same private member more than once");
830
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
831
+ }, R = (e, t, n) => (et(e, t, "access private method"), n);
832
+ const qt = (e) => {
833
+ if (e < 0)
834
+ throw new Error("Invalid number of year");
835
+ return 10 + e;
836
+ }, Yt = (e) => {
837
+ if (e.length > 30)
838
+ return !1;
839
+ const t = /^[a-zA-Z0-9+_-]+$/g;
840
+ return !!e.match(t);
841
+ }, Xt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Oe = async (e, t) => {
842
+ const n = Object.entries(t || {}).reduce(
843
+ (a, [i, r]) => (r && (a[i] = r), a),
844
+ {}
845
+ );
846
+ return (await fetch(
847
+ `${e}${t ? `?${new URLSearchParams(n).toString()}` : ""}`,
848
+ { method: "GET", mode: "cors", credentials: "omit", referrer: "https://sk.thorswap.net" }
849
+ )).json();
850
+ }, tt = async (e, t, n, a = !1) => {
851
+ const i = await fetch(`${e}`, {
852
+ body: t,
853
+ headers: n,
854
+ method: "POST",
855
+ referrer: "https://sk.thorswap.net"
856
+ });
857
+ return a ? i.text() : i.json();
858
+ }, nt = "0x313ce567", Ie = async ({ chain: e, to: t }) => {
859
+ try {
860
+ const n = await tt(
861
+ je[e],
862
+ JSON.stringify({
863
+ method: "eth_call",
864
+ params: [{ to: t.toLowerCase(), data: nt }, "latest"],
865
+ id: 44,
866
+ jsonrpc: "2.0"
867
+ }),
868
+ { accept: "*/*", "cache-control": "no-cache", "content-type": "application/json" },
869
+ !0
870
+ ), { result: a } = JSON.parse(n);
871
+ return parseInt(BigInt(a).toString());
872
+ } catch (n) {
873
+ return console.error(n), E[e];
874
+ }
875
+ }, at = async (e) => {
876
+ if (e === s.Ethereum)
877
+ return E.ETH;
878
+ const [, t] = e.split("-");
879
+ return t != null && t.startsWith("0x") ? Ie({ chain: s.Ethereum, to: t }) : E.ETH;
880
+ }, st = async (e) => {
881
+ const [, t] = e.split("-");
882
+ return t != null && t.startsWith("0x") ? Ie({ chain: s.Avalanche, to: t.toLowerCase() }) : E.AVAX;
883
+ }, it = async (e) => (e === s.BinanceSmartChain, E.BSC), Se = async ({ chain: e, symbol: t }) => {
884
+ switch (e) {
885
+ case s.Ethereum:
886
+ return at(t);
887
+ case s.Avalanche:
888
+ return st(t);
889
+ case s.BinanceSmartChain:
890
+ return it(t);
891
+ default:
892
+ return E[e];
893
+ }
894
+ }, rt = {
895
+ [F.Average]: 1.2,
896
+ [F.Fast]: 1.5,
897
+ [F.Fastest]: 2
898
+ }, pt = ({ chain: e, symbol: t }) => {
899
+ switch (e) {
900
+ case s.Bitcoin:
901
+ case s.BitcoinCash:
902
+ case s.Litecoin:
903
+ case s.Dogecoin:
904
+ case s.Binance:
905
+ case s.Ethereum:
906
+ case s.Avalanche:
907
+ return t === e;
908
+ case s.Arbitrum:
909
+ case s.Optimism:
910
+ return t === "ETH";
911
+ case s.Maya:
912
+ return t === "CACAO";
913
+ case s.Cosmos:
914
+ return t === "ATOM";
915
+ case s.Polygon:
916
+ return t === "MATIC";
917
+ case s.BinanceSmartChain:
918
+ return t === "BNB";
919
+ case s.THORChain:
920
+ return t === "RUNE";
921
+ }
922
+ }, ot = (e) => {
923
+ switch (e) {
924
+ case "ETH.THOR":
925
+ return { identifier: "ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044", decimal: 18 };
926
+ case "ETH.vTHOR":
927
+ return { identifier: "ETH.vTHOR-0x815c23eca83261b6ec689b60cc4a58b54bc24d8d", decimal: 18 };
928
+ case s.Cosmos:
929
+ return { identifier: "GAIA.ATOM", decimal: E[e] };
930
+ case s.THORChain:
931
+ return { identifier: "THOR.RUNE", decimal: E[e] };
932
+ case s.BinanceSmartChain:
933
+ return { identifier: "BSC.BNB", decimal: E[e] };
934
+ case s.Maya:
935
+ return { identifier: "MAYA.CACAO", decimal: E.MAYA };
936
+ case "MAYA.MAYA":
937
+ return { identifier: "MAYA.MAYA", decimal: 4 };
938
+ case s.Arbitrum:
939
+ case s.Optimism:
940
+ case s.BitcoinCash:
941
+ case s.Litecoin:
942
+ case s.Dogecoin:
943
+ case s.Binance:
944
+ case s.Avalanche:
945
+ case s.Polygon:
946
+ case s.Bitcoin:
947
+ case s.Ethereum:
948
+ return { identifier: `${e}.${e}`, decimal: E[e] };
949
+ }
950
+ }, dt = ({ chain: e, symbol: t }) => {
951
+ if (t.includes("/"))
952
+ return "Synth";
953
+ switch (e) {
954
+ case s.Bitcoin:
955
+ case s.BitcoinCash:
956
+ case s.Dogecoin:
957
+ case s.Litecoin:
958
+ case s.Maya:
959
+ case s.THORChain:
960
+ return "Native";
961
+ case s.Cosmos:
962
+ return t === "ATOM" ? "Native" : "GAIA";
963
+ case s.Binance:
964
+ return t === s.Binance ? "Native" : "BEP2";
965
+ case s.BinanceSmartChain:
966
+ return t === s.Binance ? "Native" : "BEP20";
967
+ case s.Ethereum:
968
+ return t === s.Ethereum ? "Native" : "ERC20";
969
+ case s.Avalanche:
970
+ return t === s.Avalanche ? "Native" : "AVAX";
971
+ case s.Polygon:
972
+ return t === s.Polygon ? "Native" : "POLYGON";
973
+ case s.Arbitrum:
974
+ return [s.Ethereum, s.Arbitrum].includes(t) ? "Native" : "ARBITRUM";
975
+ case s.Optimism:
976
+ return [s.Ethereum, s.Optimism].includes(t) ? "Native" : "OPTIMISM";
977
+ }
978
+ }, Kt = (e) => {
979
+ var t;
980
+ const [n, ...a] = e.split("."), i = e.includes("/"), r = a.join("."), p = (t = r == null ? void 0 : r.split("-")) == null ? void 0 : t[0];
981
+ return { chain: n, symbol: r, ticker: p, synth: i };
982
+ }, ut = ({
983
+ liquidityUnits: e,
984
+ poolUnits: t,
985
+ runeDepth: n
986
+ }) => {
987
+ const a = w(e), i = w(t), r = w(n), p = a.mul(r), d = i.mul(i).mul(2), l = i.mul(a).mul(2), m = a.mul(a), y = i.mul(i).mul(i);
988
+ return p.mul(d.sub(l).add(m)).div(y);
989
+ }, yt = ({
990
+ liquidityUnits: e,
991
+ poolUnits: t,
992
+ assetDepth: n
993
+ }) => {
994
+ const a = w(e), i = w(t), r = w(n), p = a.mul(r), d = i.mul(i).mul(2), l = i.mul(a).mul(2), m = a.mul(a), y = p.mul(d.sub(l).add(m)), u = i.mul(i).mul(i);
995
+ return y.div(u);
996
+ }, jt = ({
997
+ percent: e,
998
+ runeDepth: t,
999
+ liquidityUnits: n,
1000
+ poolUnits: a
1001
+ }) => ut({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), Qt = ({
1002
+ percent: e,
1003
+ assetDepth: t,
1004
+ liquidityUnits: n,
1005
+ poolUnits: a
1006
+ }) => yt({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), w = (e) => new le({ value: e, decimal: E.THOR }), zt = ({
1007
+ liquidityUnits: e,
1008
+ poolUnits: t,
1009
+ runeDepth: n,
1010
+ assetDepth: a,
1011
+ percent: i
1012
+ }) => ({
1013
+ assetAmount: w(a).mul(e).div(t).mul(i),
1014
+ runeAmount: w(n).mul(e).div(t).mul(i)
1015
+ }), Jt = ({
1016
+ runeDepth: e,
1017
+ poolUnits: t,
1018
+ assetDepth: n,
1019
+ liquidityUnits: a,
1020
+ runeAmount: i,
1021
+ assetAmount: r
1022
+ }) => {
1023
+ const p = w(e), d = w(n), l = w(t), m = w(i), y = w(r), u = m.mul(d), h = y.mul(p), _ = m.mul(y), O = p.mul(d), I = l.mul(u.add(h.add(_.mul(2)))), g = u.add(h.add(O.mul(2))), S = I.div(g), b = w(a).add(S);
1024
+ if (S.baseValueNumber === 0)
1025
+ return b.div(l).baseValueNumber;
1026
+ const M = l.add(b);
1027
+ return b.div(M).baseValueNumber;
1028
+ }, Zt = ({
1029
+ runeAmount: e,
1030
+ assetAmount: t,
1031
+ runeDepth: n,
1032
+ assetDepth: a
1033
+ }) => {
1034
+ const i = w(n), r = w(a), p = w(t), d = w(e), l = p.mul(i).sub(r.mul(d)), m = r.mul(d).add(i.mul(r));
1035
+ return Math.abs(l.div(m).baseValueNumber);
1036
+ }, lt = ({
1037
+ symbol: e,
1038
+ ticker: t,
1039
+ chain: n
1040
+ }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, D = (e, t) => {
1041
+ switch (e) {
1042
+ case f.LEAVE:
1043
+ case f.BOND: {
1044
+ const { address: n } = t;
1045
+ return `${e}:${n}`;
1046
+ }
1047
+ case f.UNBOND: {
1048
+ const { address: n, unbondAmount: a } = t;
1049
+ return `${e}:${n}:${a * 10 ** 8}`;
1050
+ }
1051
+ case f.THORNAME_REGISTER: {
1052
+ const { name: n, chain: a, address: i, owner: r } = t;
1053
+ return `${e}:${n}:${a}:${i}${r ? `:${r}` : ""}`;
1054
+ }
1055
+ case f.DEPOSIT: {
1056
+ const { chain: n, symbol: a, address: i, singleSide: r } = t;
1057
+ return r ? `${e}:${n}/${a}::t:0` : `${e}:${n}.${a}:${i || ""}:t:0`;
1058
+ }
1059
+ case f.WITHDRAW: {
1060
+ const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: d } = t, l = !d && p ? `:${p}` : "", m = lt({ chain: n, symbol: i, ticker: a });
1061
+ return `${e}:${n}${d ? "/" : "."}${m}:${r}${l}`;
1062
+ }
1063
+ case f.OPEN_LOAN:
1064
+ case f.CLOSE_LOAN: {
1065
+ const { asset: n, address: a } = t;
1066
+ return `${e}:${n}:${a}`;
1067
+ }
1068
+ default:
1069
+ return "";
1070
+ }
1071
+ }, Y = 8, ge = ({
1072
+ value: e,
1073
+ bigIntDecimal: t = Y,
1074
+ decimal: n = Y
1075
+ }) => {
1076
+ const a = e < 0n;
1077
+ let i = e.toString().substring(a ? 1 : 0);
1078
+ const r = n - (i.length - 1);
1079
+ r > 0 && (i = "0".repeat(r) + i);
1080
+ const p = i.length - n;
1081
+ let d = i.slice(-n);
1082
+ return parseInt(d[t]) >= 5 ? d = `${d.substring(0, t - 1)}${(parseInt(d[t - 1]) + 1).toString()}` : d = d.substring(0, t), `${a ? "-" : ""}${i.slice(0, p)}.${d}`.replace(
1083
+ /\.?0*$/,
1084
+ ""
1085
+ );
1086
+ }, Te = Object.values(s), mt = (e = "") => {
1087
+ const t = e.toUpperCase(), [n] = t.split(".");
1088
+ if (Te.includes(n))
1089
+ return !0;
1090
+ const [a] = t.split("/");
1091
+ if (Te.includes(a))
1092
+ return !0;
1093
+ throw new Error(
1094
+ `Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
1095
+ );
1096
+ }, U = (e) => 10n ** BigInt(e), G = (e) => Math.log10(parseFloat(e.toString()));
1097
+ var L, $, ie, ve, re, _e, J, pe, H, W, Z, oe, k, Q;
1098
+ const ct = class z {
1099
+ constructor(t) {
1100
+ B(this, L), B(this, ie), B(this, re), B(this, J), B(this, H), B(this, Z), B(this, k), N(this, "decimalMultiplier", 10n ** 8n), N(this, "bigIntValue", 0n), N(this, "decimal");
1101
+ const n = typeof t == "object", a = n ? t.value : t;
1102
+ this.decimal = n ? t.decimal : void 0, this.decimalMultiplier = U(
1103
+ Math.max(R(this, Z, oe).call(this, R(this, H, W).call(this, a)), this.decimal || 0)
1104
+ ), R(this, ie, ve).call(this, a);
1105
+ }
1106
+ static fromBigInt(t, n) {
1107
+ return new z({
1108
+ decimal: n,
1109
+ value: ge({ value: t, bigIntDecimal: n, decimal: n })
1110
+ });
1111
+ }
1112
+ static shiftDecimals({
1113
+ value: t,
1114
+ from: n,
1115
+ to: a
1116
+ }) {
1117
+ return z.fromBigInt(
1118
+ new z(t).bigIntValue * U(a) / U(n),
1119
+ a
1120
+ );
1121
+ }
1122
+ get unsafeNumber() {
1123
+ return parseFloat((this.bigIntValue / this.decimalMultiplier).toString());
1124
+ }
1125
+ get baseValue() {
1126
+ return R(this, k, Q).call(this, "string");
1127
+ }
1128
+ get baseValueNumber() {
1129
+ return R(this, k, Q).call(this, "number");
1130
+ }
1131
+ get baseValueBigInt() {
1132
+ return R(this, k, Q).call(this, "number");
1133
+ }
1134
+ get value() {
1135
+ return this.formatBigIntToSafeValue(
1136
+ this.bigIntValue,
1137
+ this.decimal || G(this.decimalMultiplier)
1138
+ );
1139
+ }
1140
+ add(...t) {
1141
+ return R(this, L, $).call(this, "add", ...t);
1142
+ }
1143
+ sub(...t) {
1144
+ return R(this, L, $).call(this, "sub", ...t);
1145
+ }
1146
+ mul(...t) {
1147
+ return R(this, L, $).call(this, "mul", ...t);
1148
+ }
1149
+ div(...t) {
1150
+ return R(this, L, $).call(this, "div", ...t);
1151
+ }
1152
+ gt(t) {
1153
+ return this.bigIntValue > this.getBigIntValue(t);
1154
+ }
1155
+ gte(t) {
1156
+ return this.bigIntValue >= this.getBigIntValue(t);
1157
+ }
1158
+ lt(t) {
1159
+ return this.bigIntValue < this.getBigIntValue(t);
1160
+ }
1161
+ lte(t) {
1162
+ return this.bigIntValue <= this.getBigIntValue(t);
1163
+ }
1164
+ eqValue(t) {
1165
+ return this.bigIntValue === this.getBigIntValue(t);
1166
+ }
1167
+ getBigIntValue(t, n) {
1168
+ return !n && typeof t == "object" ? t.bigIntValue : (t = typeof t == "object" ? t.value : t, R(this, J, pe).call(this, R(this, H, W).call(this, t), n));
1169
+ }
1170
+ formatBigIntToSafeValue(t, n) {
1171
+ const a = n || this.decimal || Y, i = Math.max(
1172
+ a,
1173
+ G(this.decimalMultiplier)
1174
+ ), r = t < 0n;
1175
+ let p = t.toString().substring(r ? 1 : 0);
1176
+ const d = i - (p.length - 1);
1177
+ d > 0 && (p = "0".repeat(d) + p);
1178
+ const l = p.length - i;
1179
+ let m = p.slice(-i);
1180
+ return parseInt(m[a]) >= 5 ? m = `${m.substring(0, a - 1)}${(parseInt(m[a - 1]) + 1).toString()}` : m = m.substring(0, a), `${r ? "-" : ""}${p.slice(0, l)}.${m}`.replace(
1181
+ /\.?0*$/,
1182
+ ""
1183
+ );
1184
+ }
1185
+ toSignificant(t) {
1186
+ const n = this.value.split("."), a = n[0], i = n[1];
1187
+ return i ? `${a}.${i.slice(0, t || this.decimal)}`.replace(
1188
+ /\.?0*$/,
1189
+ ""
1190
+ ) : a;
1191
+ }
1192
+ };
1193
+ L = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1194
+ const n = R(this, re, _e).call(this, this, ...t), a = U(n), i = t.reduce(
1195
+ (p, d) => {
1196
+ const l = this.getBigIntValue(d, n);
1197
+ if (e === "div" && l === 0n)
1198
+ throw new RangeError("Division by zero");
1199
+ return e === "add" ? p + l : e === "sub" ? p - l : e === "mul" ? p * l / a : p * a / l;
1200
+ },
1201
+ //normalize is to precision multiplier base
1202
+ this.bigIntValue * a / this.decimalMultiplier
1203
+ ), r = ge({
1204
+ bigIntDecimal: n,
1205
+ decimal: Math.max(n, G(this.decimalMultiplier)),
1206
+ value: i
1207
+ });
1208
+ return new this.constructor({ decimal: this.decimal, value: r, identifier: this.toString() });
1209
+ }, ie = /* @__PURE__ */ new WeakSet(), ve = function(e, t) {
1210
+ const n = R(this, H, W).call(this, e) || "0";
1211
+ this.bigIntValue = t || R(this, J, pe).call(this, n);
1212
+ }, re = /* @__PURE__ */ new WeakSet(), _e = function(...e) {
1213
+ const t = e.map(
1214
+ (n) => typeof n == "object" ? n.decimal || G(n.decimalMultiplier) : R(this, Z, oe).call(this, R(this, H, W).call(this, n))
1215
+ ).filter(Boolean);
1216
+ return Math.max(...t, Y);
1217
+ }, J = /* @__PURE__ */ new WeakSet(), pe = function(e, t) {
1218
+ const n = t ? U(t) : this.decimalMultiplier, a = G(n), [i, r = ""] = e.split(".");
1219
+ return BigInt(`${i}${r.padEnd(a, "0")}`);
1220
+ }, H = /* @__PURE__ */ new WeakSet(), W = function(e) {
1221
+ const t = `${typeof e == "number" ? Number(e).toLocaleString("fullwide", {
1222
+ useGrouping: !1,
1223
+ maximumFractionDigits: 20
1224
+ }) : e}`.replaceAll(",", ".").split(".");
1225
+ return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
1226
+ }, Z = /* @__PURE__ */ new WeakSet(), oe = function(e) {
1227
+ var t;
1228
+ const n = ((t = e.split(".")[1]) == null ? void 0 : t.length) || 0;
1229
+ return Math.max(n, Y);
1230
+ }, k = /* @__PURE__ */ new WeakSet(), Q = function(e) {
1231
+ const t = this.decimalMultiplier / U(this.decimal || 0), n = this.bigIntValue / t;
1232
+ switch (e) {
1233
+ case "number":
1234
+ return Number(n);
1235
+ case "string":
1236
+ return n.toString();
1237
+ default:
1238
+ return n;
1239
+ }
1240
+ };
1241
+ let de = ct, ue;
1242
+ const se = (e) => {
1243
+ if (!ue)
1244
+ throw new Error("Static assets not loaded, call await AssetValue.loadStaticAssets() first");
1245
+ return ue.get(e.toUpperCase()) || { decimal: E.THOR, identifier: "" };
1246
+ }, he = async (e, t = 0) => {
1247
+ mt(e);
1248
+ const n = await Se(ye(e));
1249
+ return new v({ decimal: n, value: t, identifier: e });
1250
+ };
1251
+ class v extends de {
1252
+ constructor(t) {
1253
+ super(
1254
+ t.value instanceof de ? t.value : { decimal: t.decimal, value: t.value }
1255
+ ), N(this, "address"), N(this, "chain"), N(this, "isSynthetic", !1), N(this, "isGasAsset", !1), N(this, "symbol"), N(this, "ticker"), N(this, "type");
1256
+ const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`, a = ye(n);
1257
+ this.type = dt(a), this.chain = a.chain, this.ticker = a.ticker, this.symbol = a.symbol, this.address = a.address, this.isSynthetic = a.isSynthetic, this.isGasAsset = a.isGasAsset;
1258
+ }
1259
+ static async fromString(t, n = 0) {
1260
+ return he(t, n);
1261
+ }
1262
+ static fromStringSync(t, n = 0) {
1263
+ const { decimal: a, identifier: i } = se(
1264
+ t
1265
+ );
1266
+ return i ? new v({ decimal: a, identifier: i, value: n }) : void 0;
1267
+ }
1268
+ static async fromIdentifier(t, n = 0) {
1269
+ return he(t, n);
1270
+ }
1271
+ static fromIdentifierSync(t, n = 0) {
1272
+ const { decimal: a, identifier: i } = se(t);
1273
+ return new v({ decimal: a, identifier: i, value: n });
1274
+ }
1275
+ static fromChainOrSignature(t, n = 0) {
1276
+ const { decimal: a, identifier: i } = ot(t);
1277
+ return new v({ value: n, decimal: a, identifier: i });
1278
+ }
1279
+ static async fromTCQuote(t, n = 0) {
1280
+ const a = await Se(ye(t)), i = this.shiftDecimals({ value: n, from: E.THOR, to: a });
1281
+ return new v({ value: i, identifier: t, decimal: a });
1282
+ }
1283
+ static fromTCQuoteStatic(t, n = 0) {
1284
+ const a = se(t), i = this.shiftDecimals({
1285
+ value: n,
1286
+ from: E.THOR,
1287
+ to: a.decimal
1288
+ });
1289
+ return new v({ ...a, value: i });
1290
+ }
1291
+ static async loadStaticAssets() {
1292
+ return new Promise(
1293
+ async (t, n) => {
1294
+ try {
1295
+ const {
1296
+ // Omit ThorchainList from import to avoid decimals conflict (TC uses 8 for all)
1297
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1298
+ ThorchainList: a,
1299
+ NativeList: i,
1300
+ ...r
1301
+ } = await import("./index.es-8503fb04-8503fb04.js");
1302
+ ue = [i, ...Object.values(r)].reduce(
1303
+ (p, { tokens: d }) => (d.forEach(({ identifier: l, chain: m, ...y }) => {
1304
+ const u = "decimals" in y ? y.decimals : E[m];
1305
+ p.set(l, { identifier: l, decimal: u });
1306
+ }), p),
1307
+ /* @__PURE__ */ new Map()
1308
+ ), t({ ok: !0 });
1309
+ } catch (a) {
1310
+ console.error(a), n({
1311
+ ok: !1,
1312
+ error: a,
1313
+ message: "Couldn't load static assets. Ensure you have installed @swapkit/tokens package"
1314
+ });
1315
+ }
1316
+ }
1317
+ );
1318
+ }
1319
+ get assetValue() {
1320
+ return `${this.value} ${this.ticker}`;
1321
+ }
1322
+ toString() {
1323
+ return `${this.chain}.${this.symbol}`;
1324
+ }
1325
+ eq({ chain: t, symbol: n }) {
1326
+ return this.chain === t && this.symbol === n;
1327
+ }
1328
+ }
1329
+ const fe = (e) => {
1330
+ const t = v.fromChainOrSignature(e);
1331
+ switch (e) {
1332
+ case s.Bitcoin:
1333
+ case s.Litecoin:
1334
+ case s.BitcoinCash:
1335
+ return t.add(10001);
1336
+ case s.Dogecoin:
1337
+ return t.add(100000001);
1338
+ case s.Avalanche:
1339
+ case s.Ethereum:
1340
+ return t.add(10 * 10 ** 9);
1341
+ case s.THORChain:
1342
+ case s.Maya:
1343
+ return t.add(0);
1344
+ default:
1345
+ return t.add(1);
1346
+ }
1347
+ }, ye = (e) => {
1348
+ const t = e.slice(0, 14).includes("/"), n = e.includes(".") ? e : `${s.THORChain}.${e}`, [a, i] = n.split("."), [r, p] = i.split("-");
1349
+ return {
1350
+ address: p == null ? void 0 : p.toLowerCase(),
1351
+ chain: a,
1352
+ isGasAsset: pt({ chain: a, symbol: i }),
1353
+ isSynthetic: t,
1354
+ symbol: p ? `${r}-${(p == null ? void 0 : p.toLowerCase()) ?? ""}` : i,
1355
+ ticker: t ? i : r
1356
+ };
1357
+ }, Tt = {
1358
+ /**
1359
+ * Core
1360
+ */
1361
+ core_wallet_connection_not_found: 10001,
1362
+ core_estimated_max_spendable_chain_not_supported: 10002,
1363
+ core_extend_error: 10003,
1364
+ core_inbound_data_not_found: 10004,
1365
+ core_approve_asset_address_or_from_not_found: 10005,
1366
+ core_chain_halted: 10099,
1367
+ /**
1368
+ * Core - Wallet Connection
1369
+ */
1370
+ core_wallet_xdefi_not_installed: 10101,
1371
+ core_wallet_evmwallet_not_installed: 10102,
1372
+ core_wallet_walletconnect_not_installed: 10103,
1373
+ core_wallet_keystore_not_installed: 10104,
1374
+ core_wallet_ledger_not_installed: 10105,
1375
+ core_wallet_trezor_not_installed: 10106,
1376
+ core_wallet_keplr_not_installed: 10107,
1377
+ core_wallet_okx_not_installed: 10108,
1378
+ /**
1379
+ * Core - Swap
1380
+ */
1381
+ core_swap_invalid_params: 10200,
1382
+ core_swap_route_not_complete: 10201,
1383
+ core_swap_asset_not_recognized: 10202,
1384
+ core_swap_contract_not_found: 10203,
1385
+ core_swap_route_transaction_not_found: 10204,
1386
+ core_swap_contract_not_supported: 10205,
1387
+ core_swap_transaction_error: 10206,
1388
+ core_swap_quote_mode_not_supported: 10207,
1389
+ /**
1390
+ * Core - Transaction
1391
+ */
1392
+ core_transaction_deposit_error: 10301,
1393
+ core_transaction_create_liquidity_rune_error: 10302,
1394
+ core_transaction_create_liquidity_asset_error: 10303,
1395
+ core_transaction_create_liquidity_invalid_params: 10304,
1396
+ core_transaction_add_liquidity_invalid_params: 10305,
1397
+ core_transaction_add_liquidity_no_rune_address: 10306,
1398
+ core_transaction_add_liquidity_rune_error: 10307,
1399
+ core_transaction_add_liquidity_asset_error: 10308,
1400
+ core_transaction_withdraw_error: 10309,
1401
+ core_transaction_deposit_to_pool_error: 10310,
1402
+ core_transaction_deposit_insufficient_funds_error: 10311,
1403
+ core_transaction_deposit_gas_error: 10312,
1404
+ core_transaction_deposit_server_error: 10313,
1405
+ /**
1406
+ * Wallets
1407
+ */
1408
+ wallet_ledger_connection_error: 20001,
1409
+ /**
1410
+ * Helpers
1411
+ */
1412
+ helpers_number_different_decimals: 99101
1413
+ };
1414
+ class c extends Error {
1415
+ constructor(t, n) {
1416
+ console.error(n), super(t, { cause: { code: Tt[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
1417
+ }
1418
+ }
1419
+ class le extends de {
1420
+ eq(t) {
1421
+ return this.eqValue(t);
1422
+ }
1423
+ toString() {
1424
+ return this.value;
1425
+ }
1426
+ }
1427
+ const _t = [
1428
+ {
1429
+ inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1430
+ stateMutability: "nonpayable",
1431
+ type: "constructor"
1432
+ },
1433
+ {
1434
+ anonymous: !1,
1435
+ inputs: [
1436
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1437
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
1438
+ ],
1439
+ name: "FeeSet",
1440
+ type: "event"
1441
+ },
1442
+ {
1443
+ anonymous: !1,
1444
+ inputs: [
1445
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
1446
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
1447
+ ],
1448
+ name: "OwnerSet",
1449
+ type: "event"
1450
+ },
1451
+ {
1452
+ inputs: [],
1453
+ name: "fee",
1454
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1455
+ stateMutability: "view",
1456
+ type: "function"
1457
+ },
1458
+ {
1459
+ inputs: [],
1460
+ name: "feeRecipient",
1461
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1462
+ stateMutability: "view",
1463
+ type: "function"
1464
+ },
1465
+ {
1466
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1467
+ name: "owners",
1468
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1469
+ stateMutability: "view",
1470
+ type: "function"
1471
+ },
1472
+ {
1473
+ inputs: [
1474
+ { internalType: "uint256", name: "_fee", type: "uint256" },
1475
+ { internalType: "address", name: "_feeRecipient", type: "address" }
1476
+ ],
1477
+ name: "setFee",
1478
+ outputs: [],
1479
+ stateMutability: "nonpayable",
1480
+ type: "function"
1481
+ },
1482
+ {
1483
+ inputs: [
1484
+ { internalType: "address", name: "owner", type: "address" },
1485
+ { internalType: "bool", name: "active", type: "bool" }
1486
+ ],
1487
+ name: "setOwner",
1488
+ outputs: [],
1489
+ stateMutability: "nonpayable",
1490
+ type: "function"
1491
+ },
1492
+ {
1493
+ inputs: [
1494
+ { internalType: "address", name: "tcRouter", type: "address" },
1495
+ { internalType: "address", name: "tcVault", type: "address" },
1496
+ { internalType: "string", name: "tcMemo", type: "string" },
1497
+ { internalType: "address", name: "token", type: "address" },
1498
+ { internalType: "uint256", name: "amount", type: "uint256" },
1499
+ { internalType: "address", name: "router", type: "address" },
1500
+ { internalType: "bytes", name: "data", type: "bytes" },
1501
+ { internalType: "uint256", name: "deadline", type: "uint256" }
1502
+ ],
1503
+ name: "swapIn",
1504
+ outputs: [],
1505
+ stateMutability: "nonpayable",
1506
+ type: "function"
1507
+ },
1508
+ {
1509
+ inputs: [],
1510
+ name: "tokenTransferProxy",
1511
+ outputs: [
1512
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
1513
+ ],
1514
+ stateMutability: "view",
1515
+ type: "function"
1516
+ },
1517
+ { stateMutability: "payable", type: "receive" }
1518
+ ], ht = [
1519
+ {
1520
+ inputs: [
1521
+ { internalType: "address", name: "_ttp", type: "address" },
1522
+ { internalType: "address", name: "_weth", type: "address" },
1523
+ { internalType: "address", name: "_swapRouter", type: "address" }
1524
+ ],
1525
+ stateMutability: "nonpayable",
1526
+ type: "constructor"
1527
+ },
1528
+ {
1529
+ anonymous: !1,
1530
+ inputs: [
1531
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1532
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
1533
+ ],
1534
+ name: "FeeSet",
1535
+ type: "event"
1536
+ },
1537
+ {
1538
+ anonymous: !1,
1539
+ inputs: [
1540
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
1541
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
1542
+ ],
1543
+ name: "OwnerSet",
1544
+ type: "event"
1545
+ },
1546
+ {
1547
+ anonymous: !1,
1548
+ inputs: [
1549
+ { indexed: !1, internalType: "address", name: "from", type: "address" },
1550
+ { indexed: !1, internalType: "address", name: "token", type: "address" },
1551
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
1552
+ { indexed: !1, internalType: "uint256", name: "out", type: "uint256" },
1553
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1554
+ { indexed: !1, internalType: "address", name: "vault", type: "address" },
1555
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
1556
+ ],
1557
+ name: "SwapIn",
1558
+ type: "event"
1559
+ },
1560
+ {
1561
+ anonymous: !1,
1562
+ inputs: [
1563
+ { indexed: !1, internalType: "address", name: "to", type: "address" },
1564
+ { indexed: !1, internalType: "address", name: "token", type: "address" },
1565
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
1566
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" }
1567
+ ],
1568
+ name: "SwapOut",
1569
+ type: "event"
1570
+ },
1571
+ {
1572
+ inputs: [],
1573
+ name: "fee",
1574
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1575
+ stateMutability: "view",
1576
+ type: "function"
1577
+ },
1578
+ {
1579
+ inputs: [],
1580
+ name: "feeRecipient",
1581
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1582
+ stateMutability: "view",
1583
+ type: "function"
1584
+ },
1585
+ {
1586
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1587
+ name: "owners",
1588
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1589
+ stateMutability: "view",
1590
+ type: "function"
1591
+ },
1592
+ {
1593
+ inputs: [
1594
+ { internalType: "uint256", name: "_fee", type: "uint256" },
1595
+ { internalType: "address", name: "_feeRecipient", type: "address" }
1596
+ ],
1597
+ name: "setFee",
1598
+ outputs: [],
1599
+ stateMutability: "nonpayable",
1600
+ type: "function"
1601
+ },
1602
+ {
1603
+ inputs: [
1604
+ { internalType: "address", name: "owner", type: "address" },
1605
+ { internalType: "bool", name: "active", type: "bool" }
1606
+ ],
1607
+ name: "setOwner",
1608
+ outputs: [],
1609
+ stateMutability: "nonpayable",
1610
+ type: "function"
1611
+ },
1612
+ {
1613
+ inputs: [
1614
+ { internalType: "address", name: "router", type: "address" },
1615
+ { internalType: "address", name: "vault", type: "address" },
1616
+ { internalType: "string", name: "memo", type: "string" },
1617
+ { internalType: "address", name: "token", type: "address" },
1618
+ { internalType: "uint256", name: "amount", type: "uint256" },
1619
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
1620
+ { internalType: "uint256", name: "deadline", type: "uint256" }
1621
+ ],
1622
+ name: "swapIn",
1623
+ outputs: [],
1624
+ stateMutability: "nonpayable",
1625
+ type: "function"
1626
+ },
1627
+ {
1628
+ inputs: [
1629
+ { internalType: "address", name: "token", type: "address" },
1630
+ { internalType: "address", name: "to", type: "address" },
1631
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
1632
+ ],
1633
+ name: "swapOut",
1634
+ outputs: [],
1635
+ stateMutability: "payable",
1636
+ type: "function"
1637
+ },
1638
+ {
1639
+ inputs: [],
1640
+ name: "swapRouter",
1641
+ outputs: [{ internalType: "contract IWoofi", name: "", type: "address" }],
1642
+ stateMutability: "view",
1643
+ type: "function"
1644
+ },
1645
+ {
1646
+ inputs: [],
1647
+ name: "tokenTransferProxy",
1648
+ outputs: [
1649
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
1650
+ ],
1651
+ stateMutability: "view",
1652
+ type: "function"
1653
+ },
1654
+ {
1655
+ inputs: [],
1656
+ name: "weth",
1657
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1658
+ stateMutability: "view",
1659
+ type: "function"
1660
+ },
1661
+ { stateMutability: "payable", type: "receive" }
1662
+ ], ft = [
1663
+ {
1664
+ inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1665
+ stateMutability: "nonpayable",
1666
+ type: "constructor"
1667
+ },
1668
+ {
1669
+ anonymous: !1,
1670
+ inputs: [
1671
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1672
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
1673
+ ],
1674
+ name: "FeeSet",
1675
+ type: "event"
1676
+ },
1677
+ {
1678
+ anonymous: !1,
1679
+ inputs: [
1680
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
1681
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
1682
+ ],
1683
+ name: "OwnerSet",
1684
+ type: "event"
1685
+ },
1686
+ {
1687
+ anonymous: !1,
1688
+ inputs: [
1689
+ { indexed: !1, internalType: "address", name: "from", type: "address" },
1690
+ { indexed: !1, internalType: "address", name: "token", type: "address" },
1691
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
1692
+ { indexed: !1, internalType: "uint256", name: "out", type: "uint256" },
1693
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1694
+ { indexed: !1, internalType: "address", name: "vault", type: "address" },
1695
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
1696
+ ],
1697
+ name: "SwapIn",
1698
+ type: "event"
1699
+ },
1700
+ {
1701
+ inputs: [],
1702
+ name: "fee",
1703
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1704
+ stateMutability: "view",
1705
+ type: "function"
1706
+ },
1707
+ {
1708
+ inputs: [],
1709
+ name: "feeRecipient",
1710
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1711
+ stateMutability: "view",
1712
+ type: "function"
1713
+ },
1714
+ {
1715
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1716
+ name: "owners",
1717
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1718
+ stateMutability: "view",
1719
+ type: "function"
1720
+ },
1721
+ {
1722
+ inputs: [
1723
+ { internalType: "uint256", name: "_fee", type: "uint256" },
1724
+ { internalType: "address", name: "_feeRecipient", type: "address" }
1725
+ ],
1726
+ name: "setFee",
1727
+ outputs: [],
1728
+ stateMutability: "nonpayable",
1729
+ type: "function"
1730
+ },
1731
+ {
1732
+ inputs: [
1733
+ { internalType: "address", name: "owner", type: "address" },
1734
+ { internalType: "bool", name: "active", type: "bool" }
1735
+ ],
1736
+ name: "setOwner",
1737
+ outputs: [],
1738
+ stateMutability: "nonpayable",
1739
+ type: "function"
1740
+ },
1741
+ {
1742
+ inputs: [
1743
+ { internalType: "address", name: "router", type: "address" },
1744
+ { internalType: "address", name: "vault", type: "address" },
1745
+ { internalType: "string", name: "memo", type: "string" },
1746
+ { internalType: "address", name: "token", type: "address" },
1747
+ { internalType: "uint256", name: "amount", type: "uint256" },
1748
+ { internalType: "address", name: "swapRouter", type: "address" },
1749
+ { internalType: "bytes", name: "data", type: "bytes" },
1750
+ { internalType: "uint256", name: "deadline", type: "uint256" }
1751
+ ],
1752
+ name: "swapIn",
1753
+ outputs: [],
1754
+ stateMutability: "nonpayable",
1755
+ type: "function"
1756
+ },
1757
+ {
1758
+ inputs: [],
1759
+ name: "tokenTransferProxy",
1760
+ outputs: [
1761
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
1762
+ ],
1763
+ stateMutability: "view",
1764
+ type: "function"
1765
+ },
1766
+ { stateMutability: "payable", type: "receive" }
1767
+ ], bt = [
1768
+ {
1769
+ inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1770
+ stateMutability: "nonpayable",
1771
+ type: "constructor"
1772
+ },
1773
+ {
1774
+ anonymous: !1,
1775
+ inputs: [
1776
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1777
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
1778
+ ],
1779
+ name: "FeeSet",
1780
+ type: "event"
1781
+ },
1782
+ {
1783
+ anonymous: !1,
1784
+ inputs: [
1785
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
1786
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
1787
+ ],
1788
+ name: "OwnerSet",
1789
+ type: "event"
1790
+ },
1791
+ {
1792
+ inputs: [],
1793
+ name: "fee",
1794
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1795
+ stateMutability: "view",
1796
+ type: "function"
1797
+ },
1798
+ {
1799
+ inputs: [],
1800
+ name: "feeRecipient",
1801
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1802
+ stateMutability: "view",
1803
+ type: "function"
1804
+ },
1805
+ {
1806
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1807
+ name: "owners",
1808
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1809
+ stateMutability: "view",
1810
+ type: "function"
1811
+ },
1812
+ {
1813
+ inputs: [
1814
+ { internalType: "uint256", name: "_fee", type: "uint256" },
1815
+ { internalType: "address", name: "_feeRecipient", type: "address" }
1816
+ ],
1817
+ name: "setFee",
1818
+ outputs: [],
1819
+ stateMutability: "nonpayable",
1820
+ type: "function"
1821
+ },
1822
+ {
1823
+ inputs: [
1824
+ { internalType: "address", name: "owner", type: "address" },
1825
+ { internalType: "bool", name: "active", type: "bool" }
1826
+ ],
1827
+ name: "setOwner",
1828
+ outputs: [],
1829
+ stateMutability: "nonpayable",
1830
+ type: "function"
1831
+ },
1832
+ {
1833
+ inputs: [
1834
+ { internalType: "address", name: "tcRouter", type: "address" },
1835
+ { internalType: "address", name: "tcVault", type: "address" },
1836
+ { internalType: "string", name: "tcMemo", type: "string" },
1837
+ { internalType: "address", name: "token", type: "address" },
1838
+ { internalType: "uint256", name: "amount", type: "uint256" },
1839
+ { internalType: "address", name: "router", type: "address" },
1840
+ { internalType: "bytes", name: "data", type: "bytes" },
1841
+ { internalType: "uint256", name: "deadline", type: "uint256" }
1842
+ ],
1843
+ name: "swapIn",
1844
+ outputs: [],
1845
+ stateMutability: "nonpayable",
1846
+ type: "function"
1847
+ },
1848
+ {
1849
+ inputs: [],
1850
+ name: "tokenTransferProxy",
1851
+ outputs: [
1852
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
1853
+ ],
1854
+ stateMutability: "view",
1855
+ type: "function"
1856
+ },
1857
+ { stateMutability: "payable", type: "receive" }
1858
+ ], At = [
1859
+ {
1860
+ inputs: [
1861
+ { internalType: "address", name: "_ttp", type: "address" },
1862
+ { internalType: "address", name: "_wbnb", type: "address" },
1863
+ { internalType: "address", name: "_swapRouter", type: "address" }
1864
+ ],
1865
+ stateMutability: "nonpayable",
1866
+ type: "constructor"
1867
+ },
1868
+ {
1869
+ anonymous: !1,
1870
+ inputs: [
1871
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1872
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
1873
+ ],
1874
+ name: "FeeSet",
1875
+ type: "event"
1876
+ },
1877
+ {
1878
+ anonymous: !1,
1879
+ inputs: [
1880
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
1881
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
1882
+ ],
1883
+ name: "OwnerSet",
1884
+ type: "event"
1885
+ },
1886
+ {
1887
+ anonymous: !1,
1888
+ inputs: [
1889
+ { indexed: !1, internalType: "address", name: "from", type: "address" },
1890
+ { indexed: !1, internalType: "address", name: "token", type: "address" },
1891
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
1892
+ { indexed: !1, internalType: "uint256", name: "out", type: "uint256" },
1893
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
1894
+ { indexed: !1, internalType: "address", name: "vault", type: "address" },
1895
+ { indexed: !1, internalType: "string", name: "memo", type: "string" }
1896
+ ],
1897
+ name: "SwapIn",
1898
+ type: "event"
1899
+ },
1900
+ {
1901
+ anonymous: !1,
1902
+ inputs: [
1903
+ { indexed: !1, internalType: "address", name: "to", type: "address" },
1904
+ { indexed: !1, internalType: "address", name: "token", type: "address" },
1905
+ { indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
1906
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" }
1907
+ ],
1908
+ name: "SwapOut",
1909
+ type: "event"
1910
+ },
1911
+ {
1912
+ inputs: [],
1913
+ name: "fee",
1914
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1915
+ stateMutability: "view",
1916
+ type: "function"
1917
+ },
1918
+ {
1919
+ inputs: [],
1920
+ name: "feeRecipient",
1921
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1922
+ stateMutability: "view",
1923
+ type: "function"
1924
+ },
1925
+ {
1926
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1927
+ name: "owners",
1928
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1929
+ stateMutability: "view",
1930
+ type: "function"
1931
+ },
1932
+ {
1933
+ inputs: [
1934
+ { internalType: "uint256", name: "_fee", type: "uint256" },
1935
+ { internalType: "address", name: "_feeRecipient", type: "address" }
1936
+ ],
1937
+ name: "setFee",
1938
+ outputs: [],
1939
+ stateMutability: "nonpayable",
1940
+ type: "function"
1941
+ },
1942
+ {
1943
+ inputs: [
1944
+ { internalType: "address", name: "owner", type: "address" },
1945
+ { internalType: "bool", name: "active", type: "bool" }
1946
+ ],
1947
+ name: "setOwner",
1948
+ outputs: [],
1949
+ stateMutability: "nonpayable",
1950
+ type: "function"
1951
+ },
1952
+ {
1953
+ inputs: [
1954
+ { internalType: "address", name: "router", type: "address" },
1955
+ { internalType: "address", name: "vault", type: "address" },
1956
+ { internalType: "string", name: "memo", type: "string" },
1957
+ { internalType: "address", name: "token", type: "address" },
1958
+ { internalType: "uint256", name: "amount", type: "uint256" },
1959
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
1960
+ { internalType: "uint256", name: "deadline", type: "uint256" }
1961
+ ],
1962
+ name: "swapIn",
1963
+ outputs: [],
1964
+ stateMutability: "nonpayable",
1965
+ type: "function"
1966
+ },
1967
+ {
1968
+ inputs: [
1969
+ { internalType: "address", name: "token", type: "address" },
1970
+ { internalType: "address", name: "to", type: "address" },
1971
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
1972
+ ],
1973
+ name: "swapOut",
1974
+ outputs: [],
1975
+ stateMutability: "payable",
1976
+ type: "function"
1977
+ },
1978
+ {
1979
+ inputs: [],
1980
+ name: "swapRouter",
1981
+ outputs: [{ internalType: "contract IPancakeRouterV2", name: "", type: "address" }],
1982
+ stateMutability: "view",
1983
+ type: "function"
1984
+ },
1985
+ {
1986
+ inputs: [],
1987
+ name: "tokenTransferProxy",
1988
+ outputs: [
1989
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
1990
+ ],
1991
+ stateMutability: "view",
1992
+ type: "function"
1993
+ },
1994
+ {
1995
+ inputs: [],
1996
+ name: "wbnb",
1997
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1998
+ stateMutability: "view",
1999
+ type: "function"
2000
+ },
2001
+ { stateMutability: "payable", type: "receive" }
2002
+ ], wt = [
2003
+ {
2004
+ inputs: [
2005
+ { internalType: "address", name: "_ttp", type: "address" },
2006
+ { internalType: "address", name: "_weth", type: "address" },
2007
+ { internalType: "address", name: "_swapRouter", type: "address" }
2008
+ ],
2009
+ stateMutability: "nonpayable",
2010
+ type: "constructor"
2011
+ },
2012
+ {
2013
+ anonymous: !1,
2014
+ inputs: [
2015
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2016
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2017
+ ],
2018
+ name: "FeeSet",
2019
+ type: "event"
2020
+ },
2021
+ {
2022
+ anonymous: !1,
2023
+ inputs: [
2024
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2025
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2026
+ ],
2027
+ name: "OwnerSet",
2028
+ type: "event"
2029
+ },
2030
+ {
2031
+ inputs: [],
2032
+ name: "fee",
2033
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2034
+ stateMutability: "view",
2035
+ type: "function"
2036
+ },
2037
+ {
2038
+ inputs: [],
2039
+ name: "feeRecipient",
2040
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2041
+ stateMutability: "view",
2042
+ type: "function"
2043
+ },
2044
+ {
2045
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2046
+ name: "owners",
2047
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2048
+ stateMutability: "view",
2049
+ type: "function"
2050
+ },
2051
+ {
2052
+ inputs: [
2053
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2054
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2055
+ ],
2056
+ name: "setFee",
2057
+ outputs: [],
2058
+ stateMutability: "nonpayable",
2059
+ type: "function"
2060
+ },
2061
+ {
2062
+ inputs: [
2063
+ { internalType: "address", name: "owner", type: "address" },
2064
+ { internalType: "bool", name: "active", type: "bool" }
2065
+ ],
2066
+ name: "setOwner",
2067
+ outputs: [],
2068
+ stateMutability: "nonpayable",
2069
+ type: "function"
2070
+ },
2071
+ {
2072
+ inputs: [
2073
+ { internalType: "address", name: "tcRouter", type: "address" },
2074
+ { internalType: "address", name: "tcVault", type: "address" },
2075
+ { internalType: "string", name: "tcMemo", type: "string" },
2076
+ { internalType: "address", name: "token", type: "address" },
2077
+ { internalType: "uint256", name: "amount", type: "uint256" },
2078
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2079
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2080
+ ],
2081
+ name: "swapIn",
2082
+ outputs: [],
2083
+ stateMutability: "nonpayable",
2084
+ type: "function"
2085
+ },
2086
+ {
2087
+ inputs: [
2088
+ { internalType: "address", name: "token", type: "address" },
2089
+ { internalType: "address", name: "to", type: "address" },
2090
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2091
+ ],
2092
+ name: "swapOut",
2093
+ outputs: [],
2094
+ stateMutability: "payable",
2095
+ type: "function"
2096
+ },
2097
+ {
2098
+ inputs: [],
2099
+ name: "swapRouter",
2100
+ outputs: [{ internalType: "contract IUniswapRouterV2AVAX", name: "", type: "address" }],
2101
+ stateMutability: "view",
2102
+ type: "function"
2103
+ },
2104
+ {
2105
+ inputs: [],
2106
+ name: "tokenTransferProxy",
2107
+ outputs: [
2108
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2109
+ ],
2110
+ stateMutability: "view",
2111
+ type: "function"
2112
+ },
2113
+ {
2114
+ inputs: [],
2115
+ name: "weth",
2116
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2117
+ stateMutability: "view",
2118
+ type: "function"
2119
+ },
2120
+ { stateMutability: "payable", type: "receive" }
2121
+ ], Et = [
2122
+ {
2123
+ inputs: [
2124
+ { internalType: "address", name: "_ttp", type: "address" },
2125
+ { internalType: "address", name: "_weth", type: "address" },
2126
+ { internalType: "address", name: "_swapRouter", type: "address" }
2127
+ ],
2128
+ stateMutability: "nonpayable",
2129
+ type: "constructor"
2130
+ },
2131
+ {
2132
+ anonymous: !1,
2133
+ inputs: [
2134
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2135
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2136
+ ],
2137
+ name: "FeeSet",
2138
+ type: "event"
2139
+ },
2140
+ {
2141
+ anonymous: !1,
2142
+ inputs: [
2143
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2144
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2145
+ ],
2146
+ name: "OwnerSet",
2147
+ type: "event"
2148
+ },
2149
+ {
2150
+ inputs: [],
2151
+ name: "fee",
2152
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2153
+ stateMutability: "view",
2154
+ type: "function"
2155
+ },
2156
+ {
2157
+ inputs: [],
2158
+ name: "feeRecipient",
2159
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2160
+ stateMutability: "view",
2161
+ type: "function"
2162
+ },
2163
+ {
2164
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2165
+ name: "owners",
2166
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2167
+ stateMutability: "view",
2168
+ type: "function"
2169
+ },
2170
+ {
2171
+ inputs: [
2172
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2173
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2174
+ ],
2175
+ name: "setFee",
2176
+ outputs: [],
2177
+ stateMutability: "nonpayable",
2178
+ type: "function"
2179
+ },
2180
+ {
2181
+ inputs: [
2182
+ { internalType: "address", name: "owner", type: "address" },
2183
+ { internalType: "bool", name: "active", type: "bool" }
2184
+ ],
2185
+ name: "setOwner",
2186
+ outputs: [],
2187
+ stateMutability: "nonpayable",
2188
+ type: "function"
2189
+ },
2190
+ {
2191
+ inputs: [
2192
+ { internalType: "address", name: "tcRouter", type: "address" },
2193
+ { internalType: "address", name: "tcVault", type: "address" },
2194
+ { internalType: "string", name: "tcMemo", type: "string" },
2195
+ { internalType: "address", name: "token", type: "address" },
2196
+ { internalType: "uint256", name: "amount", type: "uint256" },
2197
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2198
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2199
+ ],
2200
+ name: "swapIn",
2201
+ outputs: [],
2202
+ stateMutability: "nonpayable",
2203
+ type: "function"
2204
+ },
2205
+ {
2206
+ inputs: [
2207
+ { internalType: "address", name: "token", type: "address" },
2208
+ { internalType: "address", name: "to", type: "address" },
2209
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2210
+ ],
2211
+ name: "swapOut",
2212
+ outputs: [],
2213
+ stateMutability: "payable",
2214
+ type: "function"
2215
+ },
2216
+ {
2217
+ inputs: [],
2218
+ name: "swapRouter",
2219
+ outputs: [{ internalType: "contract IUniswapRouterV2", name: "", type: "address" }],
2220
+ stateMutability: "view",
2221
+ type: "function"
2222
+ },
2223
+ {
2224
+ inputs: [],
2225
+ name: "tokenTransferProxy",
2226
+ outputs: [
2227
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2228
+ ],
2229
+ stateMutability: "view",
2230
+ type: "function"
2231
+ },
2232
+ {
2233
+ inputs: [],
2234
+ name: "weth",
2235
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2236
+ stateMutability: "view",
2237
+ type: "function"
2238
+ },
2239
+ { stateMutability: "payable", type: "receive" }
2240
+ ], Rt = [
2241
+ {
2242
+ inputs: [
2243
+ { internalType: "address", name: "_ttp", type: "address" },
2244
+ { internalType: "address", name: "_weth", type: "address" },
2245
+ { internalType: "address", name: "_swapRouter", type: "address" }
2246
+ ],
2247
+ stateMutability: "nonpayable",
2248
+ type: "constructor"
2249
+ },
2250
+ {
2251
+ anonymous: !1,
2252
+ inputs: [
2253
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2254
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2255
+ ],
2256
+ name: "FeeSet",
2257
+ type: "event"
2258
+ },
2259
+ {
2260
+ anonymous: !1,
2261
+ inputs: [
2262
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2263
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2264
+ ],
2265
+ name: "OwnerSet",
2266
+ type: "event"
2267
+ },
2268
+ {
2269
+ inputs: [],
2270
+ name: "fee",
2271
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2272
+ stateMutability: "view",
2273
+ type: "function"
2274
+ },
2275
+ {
2276
+ inputs: [],
2277
+ name: "feeRecipient",
2278
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2279
+ stateMutability: "view",
2280
+ type: "function"
2281
+ },
2282
+ {
2283
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2284
+ name: "owners",
2285
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2286
+ stateMutability: "view",
2287
+ type: "function"
2288
+ },
2289
+ {
2290
+ inputs: [
2291
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2292
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2293
+ ],
2294
+ name: "setFee",
2295
+ outputs: [],
2296
+ stateMutability: "nonpayable",
2297
+ type: "function"
2298
+ },
2299
+ {
2300
+ inputs: [
2301
+ { internalType: "address", name: "owner", type: "address" },
2302
+ { internalType: "bool", name: "active", type: "bool" }
2303
+ ],
2304
+ name: "setOwner",
2305
+ outputs: [],
2306
+ stateMutability: "nonpayable",
2307
+ type: "function"
2308
+ },
2309
+ {
2310
+ inputs: [
2311
+ { internalType: "address", name: "tcRouter", type: "address" },
2312
+ { internalType: "address", name: "tcVault", type: "address" },
2313
+ { internalType: "string", name: "tcMemo", type: "string" },
2314
+ { internalType: "address", name: "token", type: "address" },
2315
+ { internalType: "uint256", name: "amount", type: "uint256" },
2316
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2317
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2318
+ ],
2319
+ name: "swapIn",
2320
+ outputs: [],
2321
+ stateMutability: "nonpayable",
2322
+ type: "function"
2323
+ },
2324
+ {
2325
+ inputs: [
2326
+ { internalType: "address", name: "token", type: "address" },
2327
+ { internalType: "address", name: "to", type: "address" },
2328
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2329
+ ],
2330
+ name: "swapOut",
2331
+ outputs: [],
2332
+ stateMutability: "payable",
2333
+ type: "function"
2334
+ },
2335
+ {
2336
+ inputs: [],
2337
+ name: "swapRouter",
2338
+ outputs: [{ internalType: "contract IUniswapRouterV2AVAX", name: "", type: "address" }],
2339
+ stateMutability: "view",
2340
+ type: "function"
2341
+ },
2342
+ {
2343
+ inputs: [],
2344
+ name: "tokenTransferProxy",
2345
+ outputs: [
2346
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2347
+ ],
2348
+ stateMutability: "view",
2349
+ type: "function"
2350
+ },
2351
+ {
2352
+ inputs: [],
2353
+ name: "weth",
2354
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2355
+ stateMutability: "view",
2356
+ type: "function"
2357
+ },
2358
+ { stateMutability: "payable", type: "receive" }
2359
+ ], Ot = [
2360
+ {
2361
+ inputs: [
2362
+ { internalType: "address", name: "_ttp", type: "address" },
2363
+ { internalType: "address", name: "_weth", type: "address" },
2364
+ { internalType: "address", name: "_swapRouter", type: "address" }
2365
+ ],
2366
+ stateMutability: "nonpayable",
2367
+ type: "constructor"
2368
+ },
2369
+ {
2370
+ anonymous: !1,
2371
+ inputs: [
2372
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2373
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2374
+ ],
2375
+ name: "FeeSet",
2376
+ type: "event"
2377
+ },
2378
+ {
2379
+ anonymous: !1,
2380
+ inputs: [
2381
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2382
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2383
+ ],
2384
+ name: "OwnerSet",
2385
+ type: "event"
2386
+ },
2387
+ {
2388
+ inputs: [],
2389
+ name: "fee",
2390
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2391
+ stateMutability: "view",
2392
+ type: "function"
2393
+ },
2394
+ {
2395
+ inputs: [],
2396
+ name: "feeRecipient",
2397
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2398
+ stateMutability: "view",
2399
+ type: "function"
2400
+ },
2401
+ {
2402
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2403
+ name: "owners",
2404
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2405
+ stateMutability: "view",
2406
+ type: "function"
2407
+ },
2408
+ {
2409
+ inputs: [
2410
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2411
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2412
+ ],
2413
+ name: "setFee",
2414
+ outputs: [],
2415
+ stateMutability: "nonpayable",
2416
+ type: "function"
2417
+ },
2418
+ {
2419
+ inputs: [
2420
+ { internalType: "address", name: "owner", type: "address" },
2421
+ { internalType: "bool", name: "active", type: "bool" }
2422
+ ],
2423
+ name: "setOwner",
2424
+ outputs: [],
2425
+ stateMutability: "nonpayable",
2426
+ type: "function"
2427
+ },
2428
+ {
2429
+ inputs: [
2430
+ { internalType: "address", name: "tcRouter", type: "address" },
2431
+ { internalType: "address", name: "tcVault", type: "address" },
2432
+ { internalType: "string", name: "tcMemo", type: "string" },
2433
+ { internalType: "address", name: "token", type: "address" },
2434
+ { internalType: "uint256", name: "amount", type: "uint256" },
2435
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2436
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2437
+ ],
2438
+ name: "swapIn",
2439
+ outputs: [],
2440
+ stateMutability: "nonpayable",
2441
+ type: "function"
2442
+ },
2443
+ {
2444
+ inputs: [
2445
+ { internalType: "address", name: "token", type: "address" },
2446
+ { internalType: "address", name: "to", type: "address" },
2447
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2448
+ ],
2449
+ name: "swapOut",
2450
+ outputs: [],
2451
+ stateMutability: "payable",
2452
+ type: "function"
2453
+ },
2454
+ {
2455
+ inputs: [],
2456
+ name: "swapRouter",
2457
+ outputs: [{ internalType: "contract IUniswapRouterV2", name: "", type: "address" }],
2458
+ stateMutability: "view",
2459
+ type: "function"
2460
+ },
2461
+ {
2462
+ inputs: [],
2463
+ name: "tokenTransferProxy",
2464
+ outputs: [
2465
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2466
+ ],
2467
+ stateMutability: "view",
2468
+ type: "function"
2469
+ },
2470
+ {
2471
+ inputs: [],
2472
+ name: "weth",
2473
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2474
+ stateMutability: "view",
2475
+ type: "function"
2476
+ },
2477
+ { stateMutability: "payable", type: "receive" }
2478
+ ], It = [
2479
+ {
2480
+ inputs: [
2481
+ { internalType: "address", name: "_ttp", type: "address" },
2482
+ { internalType: "address", name: "_weth", type: "address" },
2483
+ { internalType: "address", name: "_swapRouter", type: "address" },
2484
+ { internalType: "address", name: "_legToken", type: "address" }
2485
+ ],
2486
+ stateMutability: "nonpayable",
2487
+ type: "constructor"
2488
+ },
2489
+ {
2490
+ anonymous: !1,
2491
+ inputs: [
2492
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2493
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2494
+ ],
2495
+ name: "FeeSet",
2496
+ type: "event"
2497
+ },
2498
+ {
2499
+ anonymous: !1,
2500
+ inputs: [
2501
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2502
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2503
+ ],
2504
+ name: "OwnerSet",
2505
+ type: "event"
2506
+ },
2507
+ {
2508
+ inputs: [],
2509
+ name: "fee",
2510
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2511
+ stateMutability: "view",
2512
+ type: "function"
2513
+ },
2514
+ {
2515
+ inputs: [],
2516
+ name: "feeRecipient",
2517
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2518
+ stateMutability: "view",
2519
+ type: "function"
2520
+ },
2521
+ {
2522
+ inputs: [],
2523
+ name: "legToken",
2524
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2525
+ stateMutability: "view",
2526
+ type: "function"
2527
+ },
2528
+ {
2529
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2530
+ name: "owners",
2531
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2532
+ stateMutability: "view",
2533
+ type: "function"
2534
+ },
2535
+ {
2536
+ inputs: [
2537
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2538
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2539
+ ],
2540
+ name: "setFee",
2541
+ outputs: [],
2542
+ stateMutability: "nonpayable",
2543
+ type: "function"
2544
+ },
2545
+ {
2546
+ inputs: [
2547
+ { internalType: "address", name: "owner", type: "address" },
2548
+ { internalType: "bool", name: "active", type: "bool" }
2549
+ ],
2550
+ name: "setOwner",
2551
+ outputs: [],
2552
+ stateMutability: "nonpayable",
2553
+ type: "function"
2554
+ },
2555
+ {
2556
+ inputs: [
2557
+ { internalType: "address", name: "tcRouter", type: "address" },
2558
+ { internalType: "address", name: "tcVault", type: "address" },
2559
+ { internalType: "string", name: "tcMemo", type: "string" },
2560
+ { internalType: "address", name: "token", type: "address" },
2561
+ { internalType: "uint256", name: "amount", type: "uint256" },
2562
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2563
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2564
+ ],
2565
+ name: "swapIn",
2566
+ outputs: [],
2567
+ stateMutability: "nonpayable",
2568
+ type: "function"
2569
+ },
2570
+ {
2571
+ inputs: [
2572
+ { internalType: "address", name: "token", type: "address" },
2573
+ { internalType: "address", name: "to", type: "address" },
2574
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2575
+ ],
2576
+ name: "swapOut",
2577
+ outputs: [],
2578
+ stateMutability: "payable",
2579
+ type: "function"
2580
+ },
2581
+ {
2582
+ inputs: [],
2583
+ name: "swapRouter",
2584
+ outputs: [{ internalType: "contract IUniswapRouterV2", name: "", type: "address" }],
2585
+ stateMutability: "view",
2586
+ type: "function"
2587
+ },
2588
+ {
2589
+ inputs: [],
2590
+ name: "tokenTransferProxy",
2591
+ outputs: [
2592
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2593
+ ],
2594
+ stateMutability: "view",
2595
+ type: "function"
2596
+ },
2597
+ {
2598
+ inputs: [],
2599
+ name: "weth",
2600
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2601
+ stateMutability: "view",
2602
+ type: "function"
2603
+ },
2604
+ { stateMutability: "payable", type: "receive" }
2605
+ ], St = [
2606
+ {
2607
+ inputs: [
2608
+ { internalType: "address", name: "_ttp", type: "address" },
2609
+ { internalType: "address", name: "_weth", type: "address" },
2610
+ { internalType: "address", name: "_swapRouter", type: "address" },
2611
+ { internalType: "uint24", name: "_poolFee", type: "uint24" }
2612
+ ],
2613
+ stateMutability: "nonpayable",
2614
+ type: "constructor"
2615
+ },
2616
+ {
2617
+ anonymous: !1,
2618
+ inputs: [
2619
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2620
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2621
+ ],
2622
+ name: "FeeSet",
2623
+ type: "event"
2624
+ },
2625
+ {
2626
+ anonymous: !1,
2627
+ inputs: [
2628
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2629
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2630
+ ],
2631
+ name: "OwnerSet",
2632
+ type: "event"
2633
+ },
2634
+ {
2635
+ inputs: [],
2636
+ name: "fee",
2637
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2638
+ stateMutability: "view",
2639
+ type: "function"
2640
+ },
2641
+ {
2642
+ inputs: [],
2643
+ name: "feeRecipient",
2644
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2645
+ stateMutability: "view",
2646
+ type: "function"
2647
+ },
2648
+ {
2649
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2650
+ name: "owners",
2651
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2652
+ stateMutability: "view",
2653
+ type: "function"
2654
+ },
2655
+ {
2656
+ inputs: [],
2657
+ name: "poolFee",
2658
+ outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
2659
+ stateMutability: "view",
2660
+ type: "function"
2661
+ },
2662
+ {
2663
+ inputs: [
2664
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2665
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2666
+ ],
2667
+ name: "setFee",
2668
+ outputs: [],
2669
+ stateMutability: "nonpayable",
2670
+ type: "function"
2671
+ },
2672
+ {
2673
+ inputs: [
2674
+ { internalType: "address", name: "owner", type: "address" },
2675
+ { internalType: "bool", name: "active", type: "bool" }
2676
+ ],
2677
+ name: "setOwner",
2678
+ outputs: [],
2679
+ stateMutability: "nonpayable",
2680
+ type: "function"
2681
+ },
2682
+ {
2683
+ inputs: [
2684
+ { internalType: "address", name: "tcRouter", type: "address" },
2685
+ { internalType: "address", name: "tcVault", type: "address" },
2686
+ { internalType: "string", name: "tcMemo", type: "string" },
2687
+ { internalType: "address", name: "token", type: "address" },
2688
+ { internalType: "uint256", name: "amount", type: "uint256" },
2689
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2690
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2691
+ ],
2692
+ name: "swapIn",
2693
+ outputs: [],
2694
+ stateMutability: "nonpayable",
2695
+ type: "function"
2696
+ },
2697
+ {
2698
+ inputs: [
2699
+ { internalType: "address", name: "token", type: "address" },
2700
+ { internalType: "address", name: "to", type: "address" },
2701
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2702
+ ],
2703
+ name: "swapOut",
2704
+ outputs: [],
2705
+ stateMutability: "payable",
2706
+ type: "function"
2707
+ },
2708
+ {
2709
+ inputs: [],
2710
+ name: "swapRouter",
2711
+ outputs: [{ internalType: "contract IUniswapRouterV3", name: "", type: "address" }],
2712
+ stateMutability: "view",
2713
+ type: "function"
2714
+ },
2715
+ {
2716
+ inputs: [],
2717
+ name: "tokenTransferProxy",
2718
+ outputs: [
2719
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2720
+ ],
2721
+ stateMutability: "view",
2722
+ type: "function"
2723
+ },
2724
+ {
2725
+ inputs: [],
2726
+ name: "weth",
2727
+ outputs: [{ internalType: "contract IWETH9", name: "", type: "address" }],
2728
+ stateMutability: "view",
2729
+ type: "function"
2730
+ },
2731
+ { stateMutability: "payable", type: "receive" }
2732
+ ], gt = [
2733
+ {
2734
+ inputs: [
2735
+ { internalType: "address", name: "_ttp", type: "address" },
2736
+ { internalType: "address", name: "_weth", type: "address" },
2737
+ { internalType: "address", name: "_swapRouter", type: "address" },
2738
+ { internalType: "uint24", name: "_poolFee", type: "uint24" }
2739
+ ],
2740
+ stateMutability: "nonpayable",
2741
+ type: "constructor"
2742
+ },
2743
+ {
2744
+ anonymous: !1,
2745
+ inputs: [
2746
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2747
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2748
+ ],
2749
+ name: "FeeSet",
2750
+ type: "event"
2751
+ },
2752
+ {
2753
+ anonymous: !1,
2754
+ inputs: [
2755
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2756
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2757
+ ],
2758
+ name: "OwnerSet",
2759
+ type: "event"
2760
+ },
2761
+ {
2762
+ inputs: [],
2763
+ name: "fee",
2764
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2765
+ stateMutability: "view",
2766
+ type: "function"
2767
+ },
2768
+ {
2769
+ inputs: [],
2770
+ name: "feeRecipient",
2771
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2772
+ stateMutability: "view",
2773
+ type: "function"
2774
+ },
2775
+ {
2776
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2777
+ name: "owners",
2778
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2779
+ stateMutability: "view",
2780
+ type: "function"
2781
+ },
2782
+ {
2783
+ inputs: [],
2784
+ name: "poolFee",
2785
+ outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
2786
+ stateMutability: "view",
2787
+ type: "function"
2788
+ },
2789
+ {
2790
+ inputs: [
2791
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2792
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2793
+ ],
2794
+ name: "setFee",
2795
+ outputs: [],
2796
+ stateMutability: "nonpayable",
2797
+ type: "function"
2798
+ },
2799
+ {
2800
+ inputs: [
2801
+ { internalType: "address", name: "owner", type: "address" },
2802
+ { internalType: "bool", name: "active", type: "bool" }
2803
+ ],
2804
+ name: "setOwner",
2805
+ outputs: [],
2806
+ stateMutability: "nonpayable",
2807
+ type: "function"
2808
+ },
2809
+ {
2810
+ inputs: [
2811
+ { internalType: "address", name: "tcRouter", type: "address" },
2812
+ { internalType: "address", name: "tcVault", type: "address" },
2813
+ { internalType: "string", name: "tcMemo", type: "string" },
2814
+ { internalType: "address", name: "token", type: "address" },
2815
+ { internalType: "uint256", name: "amount", type: "uint256" },
2816
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2817
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2818
+ ],
2819
+ name: "swapIn",
2820
+ outputs: [],
2821
+ stateMutability: "nonpayable",
2822
+ type: "function"
2823
+ },
2824
+ {
2825
+ inputs: [
2826
+ { internalType: "address", name: "token", type: "address" },
2827
+ { internalType: "address", name: "to", type: "address" },
2828
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2829
+ ],
2830
+ name: "swapOut",
2831
+ outputs: [],
2832
+ stateMutability: "payable",
2833
+ type: "function"
2834
+ },
2835
+ {
2836
+ inputs: [],
2837
+ name: "swapRouter",
2838
+ outputs: [{ internalType: "contract IUniswapRouterV3", name: "", type: "address" }],
2839
+ stateMutability: "view",
2840
+ type: "function"
2841
+ },
2842
+ {
2843
+ inputs: [],
2844
+ name: "tokenTransferProxy",
2845
+ outputs: [
2846
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2847
+ ],
2848
+ stateMutability: "view",
2849
+ type: "function"
2850
+ },
2851
+ {
2852
+ inputs: [],
2853
+ name: "weth",
2854
+ outputs: [{ internalType: "contract IWETH9", name: "", type: "address" }],
2855
+ stateMutability: "view",
2856
+ type: "function"
2857
+ },
2858
+ { stateMutability: "payable", type: "receive" }
2859
+ ], vt = [
2860
+ {
2861
+ inputs: [
2862
+ { internalType: "address", name: "_ttp", type: "address" },
2863
+ { internalType: "address", name: "_weth", type: "address" },
2864
+ { internalType: "address", name: "_swapRouter", type: "address" },
2865
+ { internalType: "uint24", name: "_poolFee", type: "uint24" }
2866
+ ],
2867
+ stateMutability: "nonpayable",
2868
+ type: "constructor"
2869
+ },
2870
+ {
2871
+ anonymous: !1,
2872
+ inputs: [
2873
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
2874
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
2875
+ ],
2876
+ name: "FeeSet",
2877
+ type: "event"
2878
+ },
2879
+ {
2880
+ anonymous: !1,
2881
+ inputs: [
2882
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
2883
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
2884
+ ],
2885
+ name: "OwnerSet",
2886
+ type: "event"
2887
+ },
2888
+ {
2889
+ inputs: [],
2890
+ name: "fee",
2891
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2892
+ stateMutability: "view",
2893
+ type: "function"
2894
+ },
2895
+ {
2896
+ inputs: [],
2897
+ name: "feeRecipient",
2898
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2899
+ stateMutability: "view",
2900
+ type: "function"
2901
+ },
2902
+ {
2903
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2904
+ name: "owners",
2905
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2906
+ stateMutability: "view",
2907
+ type: "function"
2908
+ },
2909
+ {
2910
+ inputs: [],
2911
+ name: "poolFee",
2912
+ outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
2913
+ stateMutability: "view",
2914
+ type: "function"
2915
+ },
2916
+ {
2917
+ inputs: [
2918
+ { internalType: "uint256", name: "_fee", type: "uint256" },
2919
+ { internalType: "address", name: "_feeRecipient", type: "address" }
2920
+ ],
2921
+ name: "setFee",
2922
+ outputs: [],
2923
+ stateMutability: "nonpayable",
2924
+ type: "function"
2925
+ },
2926
+ {
2927
+ inputs: [
2928
+ { internalType: "address", name: "owner", type: "address" },
2929
+ { internalType: "bool", name: "active", type: "bool" }
2930
+ ],
2931
+ name: "setOwner",
2932
+ outputs: [],
2933
+ stateMutability: "nonpayable",
2934
+ type: "function"
2935
+ },
2936
+ {
2937
+ inputs: [
2938
+ { internalType: "address", name: "tcRouter", type: "address" },
2939
+ { internalType: "address", name: "tcVault", type: "address" },
2940
+ { internalType: "string", name: "tcMemo", type: "string" },
2941
+ { internalType: "address", name: "token", type: "address" },
2942
+ { internalType: "uint256", name: "amount", type: "uint256" },
2943
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
2944
+ { internalType: "uint256", name: "deadline", type: "uint256" }
2945
+ ],
2946
+ name: "swapIn",
2947
+ outputs: [],
2948
+ stateMutability: "nonpayable",
2949
+ type: "function"
2950
+ },
2951
+ {
2952
+ inputs: [
2953
+ { internalType: "address", name: "token", type: "address" },
2954
+ { internalType: "address", name: "to", type: "address" },
2955
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
2956
+ ],
2957
+ name: "swapOut",
2958
+ outputs: [],
2959
+ stateMutability: "payable",
2960
+ type: "function"
2961
+ },
2962
+ {
2963
+ inputs: [],
2964
+ name: "swapRouter",
2965
+ outputs: [{ internalType: "contract IUniswapRouterV3", name: "", type: "address" }],
2966
+ stateMutability: "view",
2967
+ type: "function"
2968
+ },
2969
+ {
2970
+ inputs: [],
2971
+ name: "tokenTransferProxy",
2972
+ outputs: [
2973
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
2974
+ ],
2975
+ stateMutability: "view",
2976
+ type: "function"
2977
+ },
2978
+ {
2979
+ inputs: [],
2980
+ name: "weth",
2981
+ outputs: [{ internalType: "contract IWETH9", name: "", type: "address" }],
2982
+ stateMutability: "view",
2983
+ type: "function"
2984
+ },
2985
+ { stateMutability: "payable", type: "receive" }
2986
+ ], Mt = [
2987
+ {
2988
+ inputs: [
2989
+ { internalType: "address", name: "_ttp", type: "address" },
2990
+ { internalType: "address", name: "_weth", type: "address" },
2991
+ { internalType: "address", name: "_swapRouter", type: "address" },
2992
+ { internalType: "uint24", name: "_poolFee", type: "uint24" }
2993
+ ],
2994
+ stateMutability: "nonpayable",
2995
+ type: "constructor"
2996
+ },
2997
+ {
2998
+ anonymous: !1,
2999
+ inputs: [
3000
+ { indexed: !1, internalType: "uint256", name: "fee", type: "uint256" },
3001
+ { indexed: !1, internalType: "address", name: "feeRecipient", type: "address" }
3002
+ ],
3003
+ name: "FeeSet",
3004
+ type: "event"
3005
+ },
3006
+ {
3007
+ anonymous: !1,
3008
+ inputs: [
3009
+ { indexed: !0, internalType: "address", name: "owner", type: "address" },
3010
+ { indexed: !1, internalType: "bool", name: "active", type: "bool" }
3011
+ ],
3012
+ name: "OwnerSet",
3013
+ type: "event"
3014
+ },
3015
+ {
3016
+ inputs: [],
3017
+ name: "fee",
3018
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
3019
+ stateMutability: "view",
3020
+ type: "function"
3021
+ },
3022
+ {
3023
+ inputs: [],
3024
+ name: "feeRecipient",
3025
+ outputs: [{ internalType: "address", name: "", type: "address" }],
3026
+ stateMutability: "view",
3027
+ type: "function"
3028
+ },
3029
+ {
3030
+ inputs: [{ internalType: "address", name: "", type: "address" }],
3031
+ name: "owners",
3032
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3033
+ stateMutability: "view",
3034
+ type: "function"
3035
+ },
3036
+ {
3037
+ inputs: [],
3038
+ name: "poolFee",
3039
+ outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
3040
+ stateMutability: "view",
3041
+ type: "function"
3042
+ },
3043
+ {
3044
+ inputs: [
3045
+ { internalType: "uint256", name: "_fee", type: "uint256" },
3046
+ { internalType: "address", name: "_feeRecipient", type: "address" }
3047
+ ],
3048
+ name: "setFee",
3049
+ outputs: [],
3050
+ stateMutability: "nonpayable",
3051
+ type: "function"
3052
+ },
3053
+ {
3054
+ inputs: [
3055
+ { internalType: "address", name: "owner", type: "address" },
3056
+ { internalType: "bool", name: "active", type: "bool" }
3057
+ ],
3058
+ name: "setOwner",
3059
+ outputs: [],
3060
+ stateMutability: "nonpayable",
3061
+ type: "function"
3062
+ },
3063
+ {
3064
+ inputs: [
3065
+ { internalType: "address", name: "tcRouter", type: "address" },
3066
+ { internalType: "address", name: "tcVault", type: "address" },
3067
+ { internalType: "string", name: "tcMemo", type: "string" },
3068
+ { internalType: "address", name: "token", type: "address" },
3069
+ { internalType: "uint256", name: "amount", type: "uint256" },
3070
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
3071
+ { internalType: "uint256", name: "deadline", type: "uint256" }
3072
+ ],
3073
+ name: "swapIn",
3074
+ outputs: [],
3075
+ stateMutability: "nonpayable",
3076
+ type: "function"
3077
+ },
3078
+ {
3079
+ inputs: [
3080
+ { internalType: "address", name: "token", type: "address" },
3081
+ { internalType: "address", name: "to", type: "address" },
3082
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" }
3083
+ ],
3084
+ name: "swapOut",
3085
+ outputs: [],
3086
+ stateMutability: "payable",
3087
+ type: "function"
3088
+ },
3089
+ {
3090
+ inputs: [],
3091
+ name: "swapRouter",
3092
+ outputs: [{ internalType: "contract IUniswapRouterV3", name: "", type: "address" }],
3093
+ stateMutability: "view",
3094
+ type: "function"
3095
+ },
3096
+ {
3097
+ inputs: [],
3098
+ name: "tokenTransferProxy",
3099
+ outputs: [
3100
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" }
3101
+ ],
3102
+ stateMutability: "view",
3103
+ type: "function"
3104
+ },
3105
+ {
3106
+ inputs: [],
3107
+ name: "weth",
3108
+ outputs: [{ internalType: "contract IWETH9", name: "", type: "address" }],
3109
+ stateMutability: "view",
3110
+ type: "function"
3111
+ },
3112
+ { stateMutability: "payable", type: "receive" }
3113
+ ], Me = {
3114
+ ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: _t,
3115
+ ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: ft,
3116
+ ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: bt
3117
+ }, Ct = {
3118
+ ...Me,
3119
+ // AVAX
3120
+ ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: wt,
3121
+ ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: ht,
3122
+ ["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: Rt,
3123
+ // BSC
3124
+ ["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: At,
3125
+ // ETH
3126
+ ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: Et,
3127
+ ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Ot,
3128
+ ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: It,
3129
+ ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: St,
3130
+ ["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: gt,
3131
+ ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: vt,
3132
+ ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: Mt
3133
+ }, Nt = ({
3134
+ streamSwap: e,
3135
+ contractAddress: t,
3136
+ recipient: n,
3137
+ toChecksumAddress: a,
3138
+ calldata: {
3139
+ amount: i,
3140
+ amountOutMin: r = "",
3141
+ data: p = "",
3142
+ deadline: d,
3143
+ memo: l,
3144
+ router: m,
3145
+ memoStreamingSwap: y,
3146
+ tcMemo: u,
3147
+ tcRouter: h,
3148
+ tcVault: _,
3149
+ vault: O,
3150
+ token: I
3151
+ }
3152
+ }) => {
3153
+ const g = !!Me[t.toLowerCase()];
3154
+ if (g && !m)
3155
+ throw new Error("Router is required on calldata for swapIn with GenericContract");
3156
+ const S = u || l, b = e && y || S;
3157
+ if (!_ && !O)
3158
+ throw new Error("TC Vault is required on calldata");
3159
+ if (!h && !m)
3160
+ throw new Error("TC Router is required on calldata");
3161
+ if (!b)
3162
+ throw new Error("TC Memo is required on calldata");
3163
+ if (!I)
3164
+ throw new Error("Token is required on calldata");
3165
+ const M = [
3166
+ // v2 contracts don't have tcVault, tcRouter, tcMemo but vault, router, memo
3167
+ a(h || m),
3168
+ a(_ || O),
3169
+ b.replace("{recipientAddress}", n),
3170
+ a(I),
3171
+ i
3172
+ ], ne = g ? [a(m), p, d] : [r, d];
3173
+ return [...M, ...ne];
3174
+ }, xt = ({ chain: e, txHash: t }) => {
3175
+ const n = Re[e];
3176
+ switch (e) {
3177
+ case s.Binance:
3178
+ case s.Bitcoin:
3179
+ case s.BitcoinCash:
3180
+ case s.Maya:
3181
+ case s.THORChain:
3182
+ return `${n}/tx/${t}`;
3183
+ case s.Arbitrum:
3184
+ case s.Avalanche:
3185
+ case s.BinanceSmartChain:
3186
+ case s.Ethereum:
3187
+ case s.Optimism:
3188
+ case s.Polygon:
3189
+ return `${n}/tx/${t.startsWith("0x") ? t : `0x${t}`}`;
3190
+ case s.Cosmos:
3191
+ return `${n}/transactions/${t}`;
3192
+ case s.Dogecoin:
3193
+ return `${n}/transaction/${t.toLowerCase()}`;
3194
+ case s.Litecoin:
3195
+ return `${n}/${t}`;
3196
+ default:
3197
+ throw new Error(`Unsupported chain: ${e}`);
3198
+ }
3199
+ }, Dt = ({ chain: e, address: t }) => {
3200
+ const n = Re[e];
3201
+ switch (e) {
3202
+ case s.Arbitrum:
3203
+ case s.Avalanche:
3204
+ case s.Binance:
3205
+ case s.BinanceSmartChain:
3206
+ case s.Bitcoin:
3207
+ case s.BitcoinCash:
3208
+ case s.Dogecoin:
3209
+ case s.Ethereum:
3210
+ case s.Maya:
3211
+ case s.Optimism:
3212
+ case s.Polygon:
3213
+ case s.THORChain:
3214
+ return `${n}/address/${t}`;
3215
+ case s.Cosmos:
3216
+ return `${n}/account/${t}`;
3217
+ case s.Litecoin:
3218
+ return `${n}/${t}`;
3219
+ default:
3220
+ throw new Error(`Unsupported chain: ${e}`);
3221
+ }
3222
+ }, Pt = (e) => {
3223
+ const t = e ? q.ThornodeStagenet : q.ThornodeMainnet;
3224
+ return Oe(`${t}/thorchain/inbound_addresses`);
3225
+ }, Bt = (e) => {
3226
+ const t = e ? q.ThornodeStagenet : q.ThornodeMainnet;
3227
+ return Oe(`${t}/thorchain/mimir`);
3228
+ }, be = () => Object.values(s).reduce(
3229
+ (e, t) => (e[t] = null, e),
3230
+ {}
3231
+ );
3232
+ var V, ee, X, x, K, j;
3233
+ class en {
3234
+ constructor({ stagenet: t } = {}) {
3235
+ T(this, "connectedChains", be());
3236
+ T(this, "connectedWallets", be());
3237
+ T(this, "stagenet", !1);
3238
+ T(this, "getAddress", (t) => {
3239
+ var n;
3240
+ return ((n = this.connectedChains[t]) == null ? void 0 : n.address) || "";
3241
+ });
3242
+ T(this, "getExplorerTxUrl", (t, n) => xt({ chain: t, txHash: n }));
3243
+ T(this, "getWallet", (t) => this.connectedWallets[t]);
3244
+ T(this, "getExplorerAddressUrl", (t, n) => Dt({ chain: t, address: n }));
3245
+ T(this, "getBalance", async (t, n) => {
3246
+ var i;
3247
+ if (!n)
3248
+ return ((i = this.connectedChains[t]) == null ? void 0 : i.balance) || [];
3249
+ const a = await this.getWalletByChain(t);
3250
+ return (a == null ? void 0 : a.balance) || [];
3251
+ });
3252
+ T(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3253
+ var d, l, m, y;
3254
+ const { quoteMode: r } = a.meta, p = r.startsWith("ERC20-") ? s.Ethereum : r.startsWith("ARC20-") ? s.Avalanche : s.BinanceSmartChain;
3255
+ if (!a.complete)
3256
+ throw new c("core_swap_route_not_complete");
3257
+ try {
3258
+ if (He.includes(r)) {
3259
+ const u = this.connectedWallets[p];
3260
+ if (!(u != null && u.sendTransaction))
3261
+ throw new c("core_wallet_connection_not_found");
3262
+ if (!(t ? (d = a == null ? void 0 : a.streamingSwap) == null ? void 0 : d.transaction : a == null ? void 0 : a.transaction))
3263
+ throw new c("core_swap_route_transaction_not_found");
3264
+ const { isHexString: _, parseUnits: O } = await import("./index-cf1865cd.js"), { data: I, from: g, to: S, value: b } = a.transaction, M = {
3265
+ data: I,
3266
+ from: g,
3267
+ to: S.toLowerCase(),
3268
+ chainId: BigInt(Ke[p]),
3269
+ value: b ? new le({
3270
+ value: _(b) ? b : O(b, "wei").toString(16)
3271
+ }).baseValueBigInt : 0n
3272
+ };
3273
+ return u.sendTransaction(M, i);
3274
+ }
3275
+ if (ke.includes(r)) {
3276
+ if (!a.calldata.fromAsset)
3277
+ throw new c("core_swap_asset_not_recognized");
3278
+ const u = await v.fromString(a.calldata.fromAsset);
3279
+ if (!u)
3280
+ throw new c("core_swap_asset_not_recognized");
3281
+ const { address: h } = await A(this, V).call(this, u.chain), {
3282
+ contract: _,
3283
+ calldata: { amountIn: O, memo: I, memoStreamingSwap: g }
3284
+ } = a, S = u.add(le.fromBigInt(BigInt(O), u.decimal)), b = t && g || I;
3285
+ return this.deposit({ assetValue: S, memo: b, feeOptionKey: i, router: _, recipient: h });
3286
+ }
3287
+ if ($e.includes(r)) {
3288
+ const { calldata: u, contract: h } = a;
3289
+ if (!h)
3290
+ throw new c("core_swap_contract_not_found");
3291
+ const _ = this.connectedWallets[p], O = this.getAddress(p);
3292
+ if (!(_ != null && _.sendTransaction) || !O)
3293
+ throw new c("core_wallet_connection_not_found");
3294
+ const { getProvider: I, toChecksumAddress: g } = await import("./index.es-66e7d15a.js"), S = I(p), b = Ct[h.toLowerCase()];
3295
+ if (!b)
3296
+ throw new c("core_swap_contract_not_supported", { contractAddress: h });
3297
+ const ne = await ((y = (m = (await ((l = _.createContract) == null ? void 0 : l.call(_, h, b, S))).populateTransaction).swapIn) == null ? void 0 : y.call(
3298
+ m,
3299
+ ...Nt({
3300
+ streamSwap: t,
3301
+ toChecksumAddress: g,
3302
+ contractAddress: h,
3303
+ recipient: n,
3304
+ calldata: u
3305
+ }),
3306
+ { from: O }
3307
+ ));
3308
+ return _.sendTransaction(ne, i);
3309
+ }
3310
+ throw new c("core_swap_quote_mode_not_supported", { quoteMode: r });
3311
+ } catch (u) {
3312
+ throw new c("core_swap_transaction_error", u);
3313
+ }
3314
+ });
3315
+ T(this, "getWalletByChain", async (t) => {
3316
+ var i, r;
3317
+ const n = this.getAddress(t);
3318
+ if (!n)
3319
+ return null;
3320
+ const a = await ((i = this.getWallet(t)) == null ? void 0 : i.getBalance(n)) ?? [
3321
+ v.fromChainOrSignature(t)
3322
+ ];
3323
+ return this.connectedChains[t] = {
3324
+ address: n,
3325
+ balance: a,
3326
+ walletType: (r = this.connectedChains[t]) == null ? void 0 : r.walletType
3327
+ }, { ...this.connectedChains[t] };
3328
+ });
3329
+ T(this, "approveAssetValue", (t, n) => A(this, X).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3330
+ T(this, "isAssetValueApproved", (t, n) => A(this, X).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3331
+ T(this, "validateAddress", ({ address: t, chain: n }) => {
3332
+ var a, i;
3333
+ return (i = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : i.call(a, t);
3334
+ });
3335
+ T(this, "transfer", async (t) => {
3336
+ const n = this.connectedWallets[t.assetValue.chain];
3337
+ if (!n)
3338
+ throw new c("core_wallet_connection_not_found");
3339
+ try {
3340
+ return await n.transfer(A(this, j).call(this, t));
3341
+ } catch (a) {
3342
+ throw new c("core_swap_transaction_error", a);
3343
+ }
3344
+ });
3345
+ T(this, "deposit", async ({
3346
+ assetValue: t,
3347
+ recipient: n,
3348
+ router: a,
3349
+ ...i
3350
+ }) => {
3351
+ const { chain: r, symbol: p, ticker: d } = t, l = this.connectedWallets[r];
3352
+ if (!l)
3353
+ throw new c("core_wallet_connection_not_found");
3354
+ const m = A(this, j).call(this, { assetValue: t, recipient: n, router: a, ...i });
3355
+ try {
3356
+ switch (r) {
3357
+ case s.THORChain: {
3358
+ const y = l;
3359
+ return await (n === "" ? y.deposit(m) : y.transfer(m));
3360
+ }
3361
+ case s.Ethereum:
3362
+ case s.BinanceSmartChain:
3363
+ case s.Avalanche: {
3364
+ const { getChecksumAddressFromAsset: y } = await import("./index.es-66e7d15a.js"), u = r === s.Avalanche ? Ve : r === s.BinanceSmartChain ? Le : Be;
3365
+ return await l.call({
3366
+ abi: u,
3367
+ contractAddress: a || (await A(this, V).call(this, r)).router,
3368
+ funcName: "depositWithExpiry",
3369
+ funcParams: [
3370
+ n,
3371
+ y({ chain: r, symbol: p, ticker: d }, r),
3372
+ // TODO: (@Towan) Re-Check on that conversion 🙏
3373
+ t.baseValueBigInt.toString(),
3374
+ m.memo,
3375
+ i.expiration
3376
+ ],
3377
+ txOverrides: { from: m.from, value: t.baseValueBigInt }
3378
+ });
3379
+ }
3380
+ default:
3381
+ return await l.transfer(m);
3382
+ }
3383
+ } catch (y) {
3384
+ const u = ((y == null ? void 0 : y.message) || (y == null ? void 0 : y.toString())).toLowerCase(), h = u == null ? void 0 : u.includes("insufficient funds"), _ = u == null ? void 0 : u.includes("gas"), O = u == null ? void 0 : u.includes("server"), I = h ? "core_transaction_deposit_insufficient_funds_error" : _ ? "core_transaction_deposit_gas_error" : O ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
3385
+ throw new c(I, y);
3386
+ }
3387
+ });
3388
+ /**
3389
+ * TC related Methods
3390
+ */
3391
+ T(this, "createLiquidity", async ({
3392
+ runeAssetValue: t,
3393
+ assetValue: n
3394
+ }) => {
3395
+ if (t.lte(0) || n.lte(0))
3396
+ throw new c("core_transaction_create_liquidity_invalid_params");
3397
+ let a = "", i = "";
3398
+ try {
3399
+ a = await A(this, x).call(this, {
3400
+ assetValue: t,
3401
+ memo: D(f.DEPOSIT, {
3402
+ ...n,
3403
+ address: this.getAddress(n.chain)
3404
+ })
3405
+ });
3406
+ } catch (r) {
3407
+ throw new c("core_transaction_create_liquidity_rune_error", r);
3408
+ }
3409
+ try {
3410
+ i = await A(this, x).call(this, {
3411
+ assetValue: n,
3412
+ memo: D(f.DEPOSIT, {
3413
+ ...n,
3414
+ address: this.getAddress(s.THORChain)
3415
+ })
3416
+ });
3417
+ } catch (r) {
3418
+ throw new c("core_transaction_create_liquidity_asset_error", r);
3419
+ }
3420
+ return { runeTx: a, assetTx: i };
3421
+ });
3422
+ T(this, "addLiquidity", async ({
3423
+ poolIdentifier: t,
3424
+ runeAssetValue: n,
3425
+ assetValue: a,
3426
+ runeAddr: i,
3427
+ assetAddr: r,
3428
+ isPendingSymmAsset: p,
3429
+ mode: d = "sym"
3430
+ }) => {
3431
+ const [l, ...m] = t.split("."), y = d === "sym", u = (n == null ? void 0 : n.gt(0)) && (y || d === "rune"), h = (a == null ? void 0 : a.gt(0)) && (y || d === "asset"), _ = p || u, O = _ ? i || this.getAddress(s.THORChain) : "", I = y || d === "asset" ? r || this.getAddress(l) : "";
3432
+ if (!u && !h)
3433
+ throw new c("core_transaction_add_liquidity_invalid_params");
3434
+ if (_ && !O)
3435
+ throw new c("core_transaction_add_liquidity_no_rune_address");
3436
+ let g, S;
3437
+ const b = { chain: l, symbol: m.join(".") };
3438
+ if (u && n)
3439
+ try {
3440
+ g = await A(this, x).call(this, {
3441
+ assetValue: n,
3442
+ memo: D(f.DEPOSIT, { ...b, address: I })
3443
+ });
3444
+ } catch (M) {
3445
+ throw new c("core_transaction_add_liquidity_rune_error", M);
3446
+ }
3447
+ if (h && a)
3448
+ try {
3449
+ S = await A(this, x).call(this, {
3450
+ assetValue: a,
3451
+ memo: D(f.DEPOSIT, { ...b, address: O })
3452
+ });
3453
+ } catch (M) {
3454
+ throw new c("core_transaction_add_liquidity_asset_error", M);
3455
+ }
3456
+ return { runeTx: g, assetTx: S };
3457
+ });
3458
+ T(this, "withdraw", async ({
3459
+ memo: t,
3460
+ assetValue: n,
3461
+ percent: a,
3462
+ from: i,
3463
+ to: r
3464
+ }) => {
3465
+ const p = r === "rune" ? v.fromChainOrSignature(s.THORChain) : i === "sym" && r === "sym" || i === "rune" || i === "asset" ? void 0 : n;
3466
+ try {
3467
+ return await A(this, x).call(this, {
3468
+ assetValue: fe(i === "asset" ? n.chain : s.THORChain),
3469
+ memo: t || D(f.WITHDRAW, {
3470
+ symbol: n.symbol,
3471
+ chain: n.chain,
3472
+ ticker: n.ticker,
3473
+ basisPoints: Math.max(1e4, Math.round(a * 100)),
3474
+ targetAssetString: p == null ? void 0 : p.toString(),
3475
+ singleSide: !1
3476
+ })
3477
+ });
3478
+ } catch (d) {
3479
+ throw new c("core_transaction_withdraw_error", d);
3480
+ }
3481
+ });
3482
+ T(this, "savings", async ({
3483
+ assetValue: t,
3484
+ memo: n,
3485
+ percent: a,
3486
+ type: i
3487
+ }) => {
3488
+ const r = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || D(r, {
3489
+ ticker: t.ticker,
3490
+ symbol: t.symbol,
3491
+ chain: t.chain,
3492
+ singleSide: !0,
3493
+ basisPoints: a ? Math.max(1e4, Math.round(a * 100)) : void 0
3494
+ });
3495
+ return A(this, x).call(this, { assetValue: t, memo: p });
3496
+ });
3497
+ T(this, "loan", ({
3498
+ assetValue: t,
3499
+ memo: n,
3500
+ minAmount: a,
3501
+ type: i
3502
+ }) => A(this, x).call(this, {
3503
+ assetValue: t,
3504
+ memo: n || D(i === "open" ? f.OPEN_LOAN : f.CLOSE_LOAN, {
3505
+ asset: t.toString(),
3506
+ minAmount: a.toString(),
3507
+ address: this.getAddress(t.chain)
3508
+ })
3509
+ }));
3510
+ T(this, "nodeAction", ({
3511
+ type: t,
3512
+ assetValue: n,
3513
+ address: a
3514
+ }) => {
3515
+ const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, r = D(i, {
3516
+ address: a,
3517
+ unbondAmount: t === "unbond" ? n.baseValueNumber : void 0
3518
+ });
3519
+ return A(this, K).call(this, {
3520
+ memo: r,
3521
+ assetValue: t === "bond" ? n : fe(s.THORChain)
3522
+ });
3523
+ });
3524
+ T(this, "registerThorname", ({
3525
+ assetValue: t,
3526
+ ...n
3527
+ }) => A(this, K).call(this, { assetValue: t, memo: D(f.THORNAME_REGISTER, n) }));
3528
+ T(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
3529
+ try {
3530
+ t.forEach((r) => {
3531
+ this[r.connectMethodName] = r.connect({
3532
+ addChain: A(this, ee),
3533
+ config: n || {},
3534
+ apis: a,
3535
+ rpcUrls: i
3536
+ });
3537
+ });
3538
+ } catch (r) {
3539
+ throw new c("core_extend_error", r);
3540
+ }
3541
+ });
3542
+ T(this, "estimateMaxSendableAmount", async ({
3543
+ chain: t,
3544
+ params: n
3545
+ }) => {
3546
+ const a = this.getWallet(t);
3547
+ switch (t) {
3548
+ case s.Arbitrum:
3549
+ case s.Avalanche:
3550
+ case s.BinanceSmartChain:
3551
+ case s.Ethereum:
3552
+ case s.Optimism:
3553
+ case s.Polygon: {
3554
+ const { estimateMaxSendableAmount: i } = await import("./index.es-66e7d15a.js");
3555
+ return i({
3556
+ ...n,
3557
+ toolbox: a
3558
+ });
3559
+ }
3560
+ case s.Bitcoin:
3561
+ case s.BitcoinCash:
3562
+ case s.Dogecoin:
3563
+ case s.Litecoin:
3564
+ return a.estimateMaxSendableAmount(n);
3565
+ case s.Binance:
3566
+ case s.THORChain:
3567
+ case s.Cosmos: {
3568
+ const { estimateMaxSendableAmount: i } = await import("./index.es-320ea117.js");
3569
+ return i({
3570
+ ...n,
3571
+ toolbox: a
3572
+ });
3573
+ }
3574
+ default:
3575
+ throw new c("core_estimated_max_spendable_chain_not_supported");
3576
+ }
3577
+ });
3578
+ /**
3579
+ * Wallet connection methods
3580
+ */
3581
+ T(this, "connectXDEFI", async (t) => {
3582
+ throw new c("core_wallet_xdefi_not_installed");
3583
+ });
3584
+ T(this, "connectEVMWallet", async (t, n) => {
3585
+ throw new c("core_wallet_evmwallet_not_installed");
3586
+ });
3587
+ T(this, "connectWalletconnect", async (t, n) => {
3588
+ throw new c("core_wallet_walletconnect_not_installed");
3589
+ });
3590
+ T(this, "connectKeystore", async (t, n) => {
3591
+ throw new c("core_wallet_keystore_not_installed");
3592
+ });
3593
+ T(this, "connectLedger", async (t, n) => {
3594
+ throw new c("core_wallet_ledger_not_installed");
3595
+ });
3596
+ T(this, "connectTrezor", async (t, n) => {
3597
+ throw new c("core_wallet_trezor_not_installed");
3598
+ });
3599
+ T(this, "connectKeplr", async () => {
3600
+ throw new c("core_wallet_keplr_not_installed");
3601
+ });
3602
+ T(this, "connectOkx", async (t) => {
3603
+ throw new c("core_wallet_okx_not_installed");
3604
+ });
3605
+ T(this, "disconnectChain", (t) => {
3606
+ this.connectedChains[t] = null, this.connectedWallets[t] = null;
3607
+ });
3608
+ P(this, V, async (t) => {
3609
+ if (t === s.THORChain)
3610
+ return {
3611
+ gas_rate: "0",
3612
+ router: "0",
3613
+ address: "",
3614
+ halted: !1,
3615
+ chain: s.THORChain
3616
+ };
3617
+ const a = (await Pt(this.stagenet)).find((i) => i.chain === t);
3618
+ if (!a)
3619
+ throw new c("core_inbound_data_not_found");
3620
+ if (a != null && a.halted)
3621
+ throw new c("core_chain_halted");
3622
+ return a;
3623
+ });
3624
+ P(this, ee, ({ chain: t, wallet: n, walletMethods: a }) => {
3625
+ this.connectedChains[t] = n, this.connectedWallets[t] = a;
3626
+ });
3627
+ P(this, X, async ({
3628
+ assetValue: { baseValueBigInt: t, address: n, chain: a, isGasAsset: i, isSynthetic: r },
3629
+ type: p = "checkOnly",
3630
+ contractAddress: d
3631
+ }) => {
3632
+ const l = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(a);
3633
+ if (l && i || !l || r)
3634
+ return !0;
3635
+ const y = this.connectedWallets[a], u = p === "checkOnly" ? y == null ? void 0 : y.isApproved : y == null ? void 0 : y.approve;
3636
+ if (!u)
3637
+ throw new c("core_wallet_connection_not_found");
3638
+ const h = this.getAddress(a);
3639
+ if (!n || !h)
3640
+ throw new c("core_approve_asset_address_or_from_not_found");
3641
+ const _ = d || (await A(this, V).call(this, a)).router;
3642
+ return u({
3643
+ amount: t,
3644
+ assetAddress: n,
3645
+ from: h,
3646
+ spenderAddress: _
3647
+ });
3648
+ });
3649
+ P(this, x, async ({
3650
+ assetValue: t,
3651
+ memo: n,
3652
+ feeOptionKey: a = F.Fast
3653
+ }) => {
3654
+ const {
3655
+ gas_rate: i,
3656
+ router: r,
3657
+ address: p
3658
+ } = await A(this, V).call(this, t.chain), d = (parseInt(i) || 0) * rt[a];
3659
+ return this.deposit({
3660
+ assetValue: t,
3661
+ recipient: p,
3662
+ memo: n,
3663
+ router: r,
3664
+ feeRate: d
3665
+ });
3666
+ });
3667
+ P(this, K, async ({ memo: t, assetValue: n }) => {
3668
+ const a = await Bt(this.stagenet);
3669
+ if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
3670
+ throw new c("core_chain_halted");
3671
+ return this.deposit({ assetValue: n, recipient: "", memo: t });
3672
+ });
3673
+ P(this, j, ({ assetValue: t, ...n }) => ({
3674
+ ...n,
3675
+ memo: n.memo || "",
3676
+ from: this.getAddress(t.chain),
3677
+ assetValue: t
3678
+ }));
3679
+ this.stagenet = !!t;
3680
+ }
3681
+ }
3682
+ V = new WeakMap(), ee = new WeakMap(), X = new WeakMap(), x = new WeakMap(), K = new WeakMap(), j = new WeakMap();
3683
+ export {
3684
+ He as AGG_SWAP,
3685
+ Ut as ApiError,
3686
+ q as ApiUrl,
3687
+ v as AssetValue,
3688
+ E as BaseDecimal,
3689
+ s as Chain,
3690
+ me as ChainId,
3691
+ Wt as ChainIdToChain,
3692
+ Ke as ChainToChainId,
3693
+ Re as ChainToExplorerUrl,
3694
+ Gt as ChainToHexChainId,
3695
+ je as ChainToRPC,
3696
+ We as ContractAddress,
3697
+ Ft as CosmosChainList,
3698
+ Y as DEFAULT_DECIMAL,
3699
+ Ye as DerivationPath,
3700
+ o as ERROR_CODE,
3701
+ Fe as ERROR_MODULE,
3702
+ Ae as ERROR_TYPE,
3703
+ $t as EVMChainList,
3704
+ Qe as ErrorCode,
3705
+ F as FeeOption,
3706
+ f as MemoType,
3707
+ Ht as NetworkDerivationPath,
3708
+ qe as NetworkId,
3709
+ Ue as QuoteMode,
3710
+ Ee as RPCUrl,
3711
+ $e as SWAP_IN,
3712
+ ke as SWAP_OUT,
3713
+ en as SwapKitCore,
3714
+ c as SwapKitError,
3715
+ le as SwapKitNumber,
3716
+ Ve as TCAvalancheDepositABI,
3717
+ Le as TCBscDepositABI,
3718
+ Be as TCEthereumVaultAbi,
3719
+ kt as UTXOChainList,
3720
+ ze as WalletOption,
3721
+ Kt as assetFromString,
3722
+ Xt as derivationPathToString,
3723
+ Lt as erc20ABI,
3724
+ ge as formatBigIntToSafeValue,
3725
+ rt as gasFeeMultiplier,
3726
+ dt as getAssetType,
3727
+ yt as getAsymmetricAssetShare,
3728
+ Qt as getAsymmetricAssetWithdrawAmount,
3729
+ ut as getAsymmetricRuneShare,
3730
+ jt as getAsymmetricRuneWithdrawAmount,
3731
+ ot as getCommonAssetInfo,
3732
+ Se as getDecimal,
3733
+ Jt as getEstimatedPoolShare,
3734
+ Zt as getLiquiditySlippage,
3735
+ D as getMemoFor,
3736
+ fe as getMinAmountByChain,
3737
+ Oe as getRequest,
3738
+ zt as getSymmetricWithdraw,
3739
+ qt as getTHORNameCost,
3740
+ pt as isGasAsset,
3741
+ tt as postRequest,
3742
+ Yt as validateTHORName
3743
+ };