@coinmasters/types 1.0.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.
- package/LICENSE +201 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +767 -0
- package/dist/index.es.js +861 -0
- package/package.json +43 -0
- package/src/abis/erc20.ts +99 -0
- package/src/abis/tcEthVault.ts +496 -0
- package/src/commonTypes.ts +132 -0
- package/src/errors/apiError.ts +75 -0
- package/src/errors/displayMessages.ts +68 -0
- package/src/errors/index.ts +2 -0
- package/src/errors/types.ts +144 -0
- package/src/index.ts +8 -0
- package/src/network.ts +253 -0
- package/src/thorchain.ts +30 -0
- package/src/transactions.ts +22 -0
- package/src/wallet.ts +20 -0
package/dist/index.es.js
ADDED
@@ -0,0 +1,861 @@
|
|
1
|
+
var h = Object.defineProperty;
|
2
|
+
var C = (e, n, a) => n in e ? h(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a;
|
3
|
+
var s = (e, n, a) => (C(e, typeof n != "symbol" ? n + "" : n, a), a);
|
4
|
+
const U = [
|
5
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
6
|
+
{
|
7
|
+
anonymous: !1,
|
8
|
+
inputs: [
|
9
|
+
{ indexed: !0, internalType: "address", name: "owner", type: "address" },
|
10
|
+
{ indexed: !0, internalType: "address", name: "spender", type: "address" },
|
11
|
+
{ indexed: !1, internalType: "uint256", name: "value", type: "uint256" }
|
12
|
+
],
|
13
|
+
name: "Approval",
|
14
|
+
type: "event"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
anonymous: !1,
|
18
|
+
inputs: [
|
19
|
+
{ indexed: !0, internalType: "address", name: "from", type: "address" },
|
20
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
21
|
+
{ indexed: !1, internalType: "uint256", name: "value", type: "uint256" }
|
22
|
+
],
|
23
|
+
name: "Transfer",
|
24
|
+
type: "event"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
inputs: [
|
28
|
+
{ internalType: "address", name: "", type: "address" },
|
29
|
+
{ internalType: "address", name: "", type: "address" }
|
30
|
+
],
|
31
|
+
name: "allowance",
|
32
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
33
|
+
stateMutability: "view",
|
34
|
+
type: "function"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
inputs: [
|
38
|
+
{ internalType: "address", name: "spender", type: "address" },
|
39
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
40
|
+
],
|
41
|
+
name: "approve",
|
42
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
43
|
+
stateMutability: "nonpayable",
|
44
|
+
type: "function"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
48
|
+
name: "balanceOf",
|
49
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
50
|
+
stateMutability: "view",
|
51
|
+
type: "function"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
inputs: [],
|
55
|
+
name: "decimals",
|
56
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
57
|
+
stateMutability: "view",
|
58
|
+
type: "function"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
inputs: [],
|
62
|
+
name: "name",
|
63
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
64
|
+
stateMutability: "view",
|
65
|
+
type: "function"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
inputs: [],
|
69
|
+
name: "symbol",
|
70
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
71
|
+
stateMutability: "view",
|
72
|
+
type: "function"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
inputs: [],
|
76
|
+
name: "totalSupply",
|
77
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
78
|
+
stateMutability: "view",
|
79
|
+
type: "function"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
inputs: [
|
83
|
+
{ internalType: "address", name: "to", type: "address" },
|
84
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
85
|
+
],
|
86
|
+
name: "transfer",
|
87
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
88
|
+
stateMutability: "nonpayable",
|
89
|
+
type: "function"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
inputs: [
|
93
|
+
{ internalType: "address", name: "from", type: "address" },
|
94
|
+
{ internalType: "address", name: "to", type: "address" },
|
95
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
96
|
+
],
|
97
|
+
name: "transferFrom",
|
98
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
99
|
+
stateMutability: "nonpayable",
|
100
|
+
type: "function"
|
101
|
+
}
|
102
|
+
], w = [
|
103
|
+
{
|
104
|
+
inputs: [{ internalType: "address", name: "rune", type: "address" }],
|
105
|
+
stateMutability: "nonpayable",
|
106
|
+
type: "constructor"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
anonymous: !1,
|
110
|
+
inputs: [
|
111
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
112
|
+
{ indexed: !0, internalType: "address", name: "asset", type: "address" },
|
113
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
114
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
115
|
+
],
|
116
|
+
name: "Deposit",
|
117
|
+
type: "event"
|
118
|
+
},
|
119
|
+
{
|
120
|
+
anonymous: !1,
|
121
|
+
inputs: [
|
122
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
123
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
124
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
125
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
126
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
127
|
+
],
|
128
|
+
name: "TransferAllowance",
|
129
|
+
type: "event"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
anonymous: !1,
|
133
|
+
inputs: [
|
134
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
135
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
136
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
137
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
138
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
139
|
+
],
|
140
|
+
name: "TransferOut",
|
141
|
+
type: "event"
|
142
|
+
},
|
143
|
+
{
|
144
|
+
anonymous: !1,
|
145
|
+
inputs: [
|
146
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
147
|
+
{ indexed: !1, internalType: "address", name: "target", type: "address" },
|
148
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
149
|
+
{ indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
|
150
|
+
{ indexed: !1, internalType: "address", name: "to", type: "address" },
|
151
|
+
{ indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
152
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
153
|
+
],
|
154
|
+
name: "TransferOutAndCall",
|
155
|
+
type: "event"
|
156
|
+
},
|
157
|
+
{
|
158
|
+
anonymous: !1,
|
159
|
+
inputs: [
|
160
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
161
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
162
|
+
{
|
163
|
+
components: [
|
164
|
+
{ internalType: "address", name: "asset", type: "address" },
|
165
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
166
|
+
],
|
167
|
+
indexed: !1,
|
168
|
+
internalType: "struct THORChain_Router.Coin[]",
|
169
|
+
name: "coins",
|
170
|
+
type: "tuple[]"
|
171
|
+
},
|
172
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
173
|
+
],
|
174
|
+
name: "VaultTransfer",
|
175
|
+
type: "event"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
inputs: [],
|
179
|
+
name: "RUNE",
|
180
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
181
|
+
stateMutability: "view",
|
182
|
+
type: "function"
|
183
|
+
},
|
184
|
+
{
|
185
|
+
inputs: [
|
186
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
187
|
+
{ internalType: "address", name: "asset", type: "address" },
|
188
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
189
|
+
{ internalType: "string", name: "memo", type: "string" }
|
190
|
+
],
|
191
|
+
name: "deposit",
|
192
|
+
outputs: [],
|
193
|
+
stateMutability: "payable",
|
194
|
+
type: "function"
|
195
|
+
},
|
196
|
+
{
|
197
|
+
inputs: [
|
198
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
199
|
+
{ internalType: "address", name: "asset", type: "address" },
|
200
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
201
|
+
{ internalType: "string", name: "memo", type: "string" },
|
202
|
+
{ internalType: "uint256", name: "expiration", type: "uint256" }
|
203
|
+
],
|
204
|
+
name: "depositWithExpiry",
|
205
|
+
outputs: [],
|
206
|
+
stateMutability: "payable",
|
207
|
+
type: "function"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
inputs: [
|
211
|
+
{ internalType: "address", name: "router", type: "address" },
|
212
|
+
{ internalType: "address payable", name: "asgard", type: "address" },
|
213
|
+
{
|
214
|
+
components: [
|
215
|
+
{ internalType: "address", name: "asset", type: "address" },
|
216
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
217
|
+
],
|
218
|
+
internalType: "struct THORChain_Router.Coin[]",
|
219
|
+
name: "coins",
|
220
|
+
type: "tuple[]"
|
221
|
+
},
|
222
|
+
{ internalType: "string", name: "memo", type: "string" }
|
223
|
+
],
|
224
|
+
name: "returnVaultAssets",
|
225
|
+
outputs: [],
|
226
|
+
stateMutability: "payable",
|
227
|
+
type: "function"
|
228
|
+
},
|
229
|
+
{
|
230
|
+
inputs: [
|
231
|
+
{ internalType: "address", name: "router", type: "address" },
|
232
|
+
{ internalType: "address", name: "newVault", type: "address" },
|
233
|
+
{ internalType: "address", name: "asset", type: "address" },
|
234
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
235
|
+
{ internalType: "string", name: "memo", type: "string" }
|
236
|
+
],
|
237
|
+
name: "transferAllowance",
|
238
|
+
outputs: [],
|
239
|
+
stateMutability: "nonpayable",
|
240
|
+
type: "function"
|
241
|
+
},
|
242
|
+
{
|
243
|
+
inputs: [
|
244
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
245
|
+
{ internalType: "address", name: "asset", type: "address" },
|
246
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
247
|
+
{ internalType: "string", name: "memo", type: "string" }
|
248
|
+
],
|
249
|
+
name: "transferOut",
|
250
|
+
outputs: [],
|
251
|
+
stateMutability: "payable",
|
252
|
+
type: "function"
|
253
|
+
},
|
254
|
+
{
|
255
|
+
inputs: [
|
256
|
+
{ internalType: "address payable", name: "aggregator", type: "address" },
|
257
|
+
{ internalType: "address", name: "finalToken", type: "address" },
|
258
|
+
{ internalType: "address", name: "to", type: "address" },
|
259
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
260
|
+
{ internalType: "string", name: "memo", type: "string" }
|
261
|
+
],
|
262
|
+
name: "transferOutAndCall",
|
263
|
+
outputs: [],
|
264
|
+
stateMutability: "payable",
|
265
|
+
type: "function"
|
266
|
+
},
|
267
|
+
{
|
268
|
+
inputs: [
|
269
|
+
{ internalType: "address", name: "vault", type: "address" },
|
270
|
+
{ internalType: "address", name: "token", type: "address" }
|
271
|
+
],
|
272
|
+
name: "vaultAllowance",
|
273
|
+
outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
274
|
+
stateMutability: "view",
|
275
|
+
type: "function"
|
276
|
+
}
|
277
|
+
], F = [
|
278
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
279
|
+
{
|
280
|
+
anonymous: !1,
|
281
|
+
inputs: [
|
282
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
283
|
+
{ indexed: !0, internalType: "address", name: "asset", type: "address" },
|
284
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
285
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
286
|
+
],
|
287
|
+
name: "Deposit",
|
288
|
+
type: "event"
|
289
|
+
},
|
290
|
+
{
|
291
|
+
anonymous: !1,
|
292
|
+
inputs: [
|
293
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
294
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
295
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
296
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
297
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
298
|
+
],
|
299
|
+
name: "TransferAllowance",
|
300
|
+
type: "event"
|
301
|
+
},
|
302
|
+
{
|
303
|
+
anonymous: !1,
|
304
|
+
inputs: [
|
305
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
306
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
307
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
308
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
309
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
310
|
+
],
|
311
|
+
name: "TransferOut",
|
312
|
+
type: "event"
|
313
|
+
},
|
314
|
+
{
|
315
|
+
anonymous: !1,
|
316
|
+
inputs: [
|
317
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
318
|
+
{ indexed: !1, internalType: "address", name: "target", type: "address" },
|
319
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
320
|
+
{ indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
|
321
|
+
{ indexed: !1, internalType: "address", name: "to", type: "address" },
|
322
|
+
{ indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
323
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
324
|
+
],
|
325
|
+
name: "TransferOutAndCall",
|
326
|
+
type: "event"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
anonymous: !1,
|
330
|
+
inputs: [
|
331
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
332
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
333
|
+
{
|
334
|
+
components: [
|
335
|
+
{ internalType: "address", name: "asset", type: "address" },
|
336
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
337
|
+
],
|
338
|
+
indexed: !1,
|
339
|
+
internalType: "struct AvaxRouter.Coin[]",
|
340
|
+
name: "coins",
|
341
|
+
type: "tuple[]"
|
342
|
+
},
|
343
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
344
|
+
],
|
345
|
+
name: "VaultTransfer",
|
346
|
+
type: "event"
|
347
|
+
},
|
348
|
+
{
|
349
|
+
inputs: [
|
350
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
351
|
+
{ internalType: "address", name: "asset", type: "address" },
|
352
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
353
|
+
{ internalType: "string", name: "memo", type: "string" }
|
354
|
+
],
|
355
|
+
name: "deposit",
|
356
|
+
outputs: [],
|
357
|
+
stateMutability: "payable",
|
358
|
+
type: "function"
|
359
|
+
},
|
360
|
+
{
|
361
|
+
inputs: [
|
362
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
363
|
+
{ internalType: "address", name: "asset", type: "address" },
|
364
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
365
|
+
{ internalType: "string", name: "memo", type: "string" },
|
366
|
+
{ internalType: "uint256", name: "expiration", type: "uint256" }
|
367
|
+
],
|
368
|
+
name: "depositWithExpiry",
|
369
|
+
outputs: [],
|
370
|
+
stateMutability: "payable",
|
371
|
+
type: "function"
|
372
|
+
},
|
373
|
+
{
|
374
|
+
inputs: [
|
375
|
+
{ internalType: "address", name: "router", type: "address" },
|
376
|
+
{ internalType: "address payable", name: "asgard", type: "address" },
|
377
|
+
{
|
378
|
+
components: [
|
379
|
+
{ internalType: "address", name: "asset", type: "address" },
|
380
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
381
|
+
],
|
382
|
+
internalType: "struct AvaxRouter.Coin[]",
|
383
|
+
name: "coins",
|
384
|
+
type: "tuple[]"
|
385
|
+
},
|
386
|
+
{ internalType: "string", name: "memo", type: "string" }
|
387
|
+
],
|
388
|
+
name: "returnVaultAssets",
|
389
|
+
outputs: [],
|
390
|
+
stateMutability: "payable",
|
391
|
+
type: "function"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
inputs: [
|
395
|
+
{ internalType: "address", name: "router", type: "address" },
|
396
|
+
{ internalType: "address", name: "newVault", type: "address" },
|
397
|
+
{ internalType: "address", name: "asset", type: "address" },
|
398
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
399
|
+
{ internalType: "string", name: "memo", type: "string" }
|
400
|
+
],
|
401
|
+
name: "transferAllowance",
|
402
|
+
outputs: [],
|
403
|
+
stateMutability: "nonpayable",
|
404
|
+
type: "function"
|
405
|
+
},
|
406
|
+
{
|
407
|
+
inputs: [
|
408
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
409
|
+
{ internalType: "address", name: "asset", type: "address" },
|
410
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
411
|
+
{ internalType: "string", name: "memo", type: "string" }
|
412
|
+
],
|
413
|
+
name: "transferOut",
|
414
|
+
outputs: [],
|
415
|
+
stateMutability: "payable",
|
416
|
+
type: "function"
|
417
|
+
},
|
418
|
+
{
|
419
|
+
inputs: [
|
420
|
+
{ internalType: "address payable", name: "target", type: "address" },
|
421
|
+
{ internalType: "address", name: "finalToken", type: "address" },
|
422
|
+
{ internalType: "address", name: "to", type: "address" },
|
423
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
424
|
+
{ internalType: "string", name: "memo", type: "string" }
|
425
|
+
],
|
426
|
+
name: "transferOutAndCall",
|
427
|
+
outputs: [],
|
428
|
+
stateMutability: "payable",
|
429
|
+
type: "function"
|
430
|
+
},
|
431
|
+
{
|
432
|
+
inputs: [
|
433
|
+
{ internalType: "address", name: "vault", type: "address" },
|
434
|
+
{ internalType: "address", name: "token", type: "address" }
|
435
|
+
],
|
436
|
+
name: "vaultAllowance",
|
437
|
+
outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
438
|
+
stateMutability: "view",
|
439
|
+
type: "function"
|
440
|
+
}
|
441
|
+
], X = [
|
442
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
443
|
+
{
|
444
|
+
anonymous: !1,
|
445
|
+
inputs: [
|
446
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
447
|
+
{ indexed: !0, internalType: "address", name: "asset", type: "address" },
|
448
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
449
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
450
|
+
],
|
451
|
+
name: "Deposit",
|
452
|
+
type: "event"
|
453
|
+
},
|
454
|
+
{
|
455
|
+
anonymous: !1,
|
456
|
+
inputs: [
|
457
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
458
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
459
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
460
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
461
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
462
|
+
],
|
463
|
+
name: "TransferAllowance",
|
464
|
+
type: "event"
|
465
|
+
},
|
466
|
+
{
|
467
|
+
anonymous: !1,
|
468
|
+
inputs: [
|
469
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
470
|
+
{ indexed: !0, internalType: "address", name: "to", type: "address" },
|
471
|
+
{ indexed: !1, internalType: "address", name: "asset", type: "address" },
|
472
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
473
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
474
|
+
],
|
475
|
+
name: "TransferOut",
|
476
|
+
type: "event"
|
477
|
+
},
|
478
|
+
{
|
479
|
+
anonymous: !1,
|
480
|
+
inputs: [
|
481
|
+
{ indexed: !0, internalType: "address", name: "vault", type: "address" },
|
482
|
+
{ indexed: !1, internalType: "address", name: "target", type: "address" },
|
483
|
+
{ indexed: !1, internalType: "uint256", name: "amount", type: "uint256" },
|
484
|
+
{ indexed: !1, internalType: "address", name: "finalAsset", type: "address" },
|
485
|
+
{ indexed: !1, internalType: "address", name: "to", type: "address" },
|
486
|
+
{ indexed: !1, internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
487
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
488
|
+
],
|
489
|
+
name: "TransferOutAndCall",
|
490
|
+
type: "event"
|
491
|
+
},
|
492
|
+
{
|
493
|
+
anonymous: !1,
|
494
|
+
inputs: [
|
495
|
+
{ indexed: !0, internalType: "address", name: "oldVault", type: "address" },
|
496
|
+
{ indexed: !0, internalType: "address", name: "newVault", type: "address" },
|
497
|
+
{
|
498
|
+
components: [
|
499
|
+
{ internalType: "address", name: "asset", type: "address" },
|
500
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
501
|
+
],
|
502
|
+
indexed: !1,
|
503
|
+
internalType: "struct THORChain_Router.Coin[]",
|
504
|
+
name: "coins",
|
505
|
+
type: "tuple[]"
|
506
|
+
},
|
507
|
+
{ indexed: !1, internalType: "string", name: "memo", type: "string" }
|
508
|
+
],
|
509
|
+
name: "VaultTransfer",
|
510
|
+
type: "event"
|
511
|
+
},
|
512
|
+
{
|
513
|
+
inputs: [
|
514
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
515
|
+
{ internalType: "address", name: "asset", type: "address" },
|
516
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
517
|
+
{ internalType: "string", name: "memo", type: "string" },
|
518
|
+
{ internalType: "uint256", name: "expiration", type: "uint256" }
|
519
|
+
],
|
520
|
+
name: "depositWithExpiry",
|
521
|
+
outputs: [],
|
522
|
+
stateMutability: "payable",
|
523
|
+
type: "function"
|
524
|
+
},
|
525
|
+
{
|
526
|
+
inputs: [
|
527
|
+
{ internalType: "address", name: "router", type: "address" },
|
528
|
+
{ internalType: "address payable", name: "asgard", type: "address" },
|
529
|
+
{
|
530
|
+
components: [
|
531
|
+
{ internalType: "address", name: "asset", type: "address" },
|
532
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
533
|
+
],
|
534
|
+
internalType: "struct THORChain_Router.Coin[]",
|
535
|
+
name: "coins",
|
536
|
+
type: "tuple[]"
|
537
|
+
},
|
538
|
+
{ internalType: "string", name: "memo", type: "string" }
|
539
|
+
],
|
540
|
+
name: "returnVaultAssets",
|
541
|
+
outputs: [],
|
542
|
+
stateMutability: "payable",
|
543
|
+
type: "function"
|
544
|
+
},
|
545
|
+
{
|
546
|
+
inputs: [
|
547
|
+
{ internalType: "address", name: "router", type: "address" },
|
548
|
+
{ internalType: "address", name: "newVault", type: "address" },
|
549
|
+
{ internalType: "address", name: "asset", type: "address" },
|
550
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
551
|
+
{ internalType: "string", name: "memo", type: "string" }
|
552
|
+
],
|
553
|
+
name: "transferAllowance",
|
554
|
+
outputs: [],
|
555
|
+
stateMutability: "nonpayable",
|
556
|
+
type: "function"
|
557
|
+
},
|
558
|
+
{
|
559
|
+
inputs: [
|
560
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
561
|
+
{ internalType: "address", name: "asset", type: "address" },
|
562
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
563
|
+
{ internalType: "string", name: "memo", type: "string" }
|
564
|
+
],
|
565
|
+
name: "transferOut",
|
566
|
+
outputs: [],
|
567
|
+
stateMutability: "payable",
|
568
|
+
type: "function"
|
569
|
+
},
|
570
|
+
{
|
571
|
+
inputs: [
|
572
|
+
{ internalType: "address payable", name: "target", type: "address" },
|
573
|
+
{ internalType: "address", name: "finalToken", type: "address" },
|
574
|
+
{ internalType: "address", name: "to", type: "address" },
|
575
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
576
|
+
{ internalType: "string", name: "memo", type: "string" }
|
577
|
+
],
|
578
|
+
name: "transferOutAndCall",
|
579
|
+
outputs: [],
|
580
|
+
stateMutability: "payable",
|
581
|
+
type: "function"
|
582
|
+
},
|
583
|
+
{
|
584
|
+
inputs: [
|
585
|
+
{ internalType: "address", name: "vault", type: "address" },
|
586
|
+
{ internalType: "address", name: "token", type: "address" }
|
587
|
+
],
|
588
|
+
name: "vaultAllowance",
|
589
|
+
outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
590
|
+
stateMutability: "view",
|
591
|
+
type: "function"
|
592
|
+
}
|
593
|
+
];
|
594
|
+
var g = /* @__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))(g || {});
|
595
|
+
const K = [
|
596
|
+
"ERC20-ERC20",
|
597
|
+
"ARC20-ARC20",
|
598
|
+
"BEP20-BEP20"
|
599
|
+
/* BSC_TO_BSC */
|
600
|
+
], Y = [
|
601
|
+
"ERC20-TC",
|
602
|
+
"ERC20-ARC20",
|
603
|
+
"ERC20-BEP20",
|
604
|
+
"ARC20-TC",
|
605
|
+
"ARC20-ERC20",
|
606
|
+
"ARC20-BEP20",
|
607
|
+
"BEP20-TC",
|
608
|
+
"BEP20-ERC20",
|
609
|
+
"BEP20-ARC20"
|
610
|
+
/* BSC_TO_AVAX */
|
611
|
+
], W = [
|
612
|
+
"TC-TC",
|
613
|
+
"TC-ERC20",
|
614
|
+
"TC-ARC20",
|
615
|
+
"TC-BEP20"
|
616
|
+
/* TC_SUPPORTED_TO_BSC */
|
617
|
+
];
|
618
|
+
var m = /* @__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))(m || {}), O = /* @__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))(O || {}), t = /* @__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))(t || {});
|
619
|
+
const P = {
|
620
|
+
[t.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
|
621
|
+
[t.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
|
622
|
+
[t.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
|
623
|
+
[t.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
|
624
|
+
[t.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
|
625
|
+
[t.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
|
626
|
+
[t.INVALID_TYPE_GENERIC]: "Invalid type",
|
627
|
+
[t.INVALID_NUMBER_STRING]: "Invalid number string.",
|
628
|
+
[t.INVALID_NUMBER]: "Invalid number.",
|
629
|
+
[t.INVALID_BOOLEAN]: "Invalid boolean.",
|
630
|
+
[t.INVALID_OBJECT]: "Invalid object.",
|
631
|
+
[t.INVALID_ARRAY]: "Invalid array.",
|
632
|
+
[t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
|
633
|
+
[t.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
|
634
|
+
[t.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
|
635
|
+
[t.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
|
636
|
+
[t.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
|
637
|
+
[t.AFF_BPS_INTEGER_0_100]: "affiliateBasisPoints must be an integer between 0 and 100.",
|
638
|
+
[t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
|
639
|
+
[t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
|
640
|
+
[t.PREFERRED_PROFVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
|
641
|
+
[t.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
|
642
|
+
[t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
|
643
|
+
[t.INVALID_PROVIDER]: "Invalid provider {0}.",
|
644
|
+
[t.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
|
645
|
+
[t.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
|
646
|
+
[t.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
|
647
|
+
[t.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
|
648
|
+
[t.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
|
649
|
+
[t.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
|
650
|
+
[t.INVALID_CHAIN]: "Invalid chain {0}.",
|
651
|
+
[t.INVALID_ASSET]: "Invalid asset {0}.",
|
652
|
+
[t.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
|
653
|
+
[t.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
|
654
|
+
[t.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
|
655
|
+
[t.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
|
656
|
+
[t.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
|
657
|
+
[t.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
|
658
|
+
[t.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
|
659
|
+
[t.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
|
660
|
+
[t.INVALID_QUOTE_MODE]: "Invalid quote mode.",
|
661
|
+
[t.NO_QUOTES]: "No quotes to service this request.",
|
662
|
+
[t.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
|
663
|
+
[t.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
|
664
|
+
[t.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
|
665
|
+
[t.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
|
666
|
+
[t.NO_PRICE]: "No price for asset {0}.",
|
667
|
+
[t.PRICE_IS_STALE]: "Price is stale for asset {0}.",
|
668
|
+
[t.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
|
669
|
+
[t.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
|
670
|
+
}, u = (e, n) => {
|
671
|
+
let a = P[e];
|
672
|
+
for (let r = 0; r < n.length; r++)
|
673
|
+
a = a.replace(`{${r}}`, n[r]);
|
674
|
+
return n.length === 0 ? a.replace("{0}", "") : a;
|
675
|
+
};
|
676
|
+
class A extends Error {
|
677
|
+
constructor({
|
678
|
+
status: a,
|
679
|
+
revision: r,
|
680
|
+
module: S,
|
681
|
+
code: d,
|
682
|
+
message: _,
|
683
|
+
type: N,
|
684
|
+
options: { shouldLog: E, shouldThrow: c, shouldTrace: f } = {
|
685
|
+
shouldLog: !0,
|
686
|
+
shouldThrow: !0,
|
687
|
+
shouldTrace: !0
|
688
|
+
},
|
689
|
+
displayMessageParams: y
|
690
|
+
}) {
|
691
|
+
const l = _ || u(d, y || []) || "";
|
692
|
+
super(l);
|
693
|
+
s(this, "status");
|
694
|
+
s(this, "revision");
|
695
|
+
s(this, "type");
|
696
|
+
s(this, "module");
|
697
|
+
s(this, "code");
|
698
|
+
s(this, "message");
|
699
|
+
s(this, "display");
|
700
|
+
s(this, "stack");
|
701
|
+
s(this, "options");
|
702
|
+
s(this, "displayMessageParams");
|
703
|
+
this.status = a, this.revision = r || "NO_REVISION", this.module = S, this.message = l, this.display = u(d, y || []), this.code = d, this.type = N || m.UNHANDLED_ERROR, this.options = {
|
704
|
+
shouldLog: E || !0,
|
705
|
+
shouldTrace: f || !0,
|
706
|
+
shouldThrow: c || !1
|
707
|
+
}, this.displayMessageParams = y || [], this.options.shouldTrace && Error.captureStackTrace(this);
|
708
|
+
}
|
709
|
+
static fromErrorInfo(a) {
|
710
|
+
return new A(a);
|
711
|
+
}
|
712
|
+
toErrorInfo() {
|
713
|
+
return { ...this, identifier: this.identifier };
|
714
|
+
}
|
715
|
+
get identifier() {
|
716
|
+
return `${this.revision}-${this.type || "NO_TYPE"}-${this.module}-${this.code}`;
|
717
|
+
}
|
718
|
+
get displayMessage() {
|
719
|
+
return u(this.code, this.displayMessageParams || []);
|
720
|
+
}
|
721
|
+
handle() {
|
722
|
+
const a = `[${this.identifier}]: ${this.message}`;
|
723
|
+
if (this.options.shouldLog && console.error(a, `
|
724
|
+
`, this.stack || ""), this.options.shouldThrow)
|
725
|
+
throw Error(a, { cause: this.stack });
|
726
|
+
return this.toErrorInfo();
|
727
|
+
}
|
728
|
+
}
|
729
|
+
var i = /* @__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))(i || {}), V = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(V || {}), B = /* @__PURE__ */ ((e) => (e[e.Ethereum = 60] = "Ethereum", e[e.Binance = 714] = "Binance", e[e.THORChain = 931] = "THORChain", e))(B || {}), b = /* @__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))(b || {});
|
730
|
+
const k = {
|
731
|
+
ARB: [44, 60, 0, 0, 0],
|
732
|
+
AVAX: [44, 60, 0, 0, 0],
|
733
|
+
BCH: [44, 145, 0, 0, 0],
|
734
|
+
BNB: [44, 714, 0, 0, 0],
|
735
|
+
BSC: [44, 60, 0, 0, 0],
|
736
|
+
BTC: [84, 0, 0, 0, 0],
|
737
|
+
DOGE: [44, 3, 0, 0, 0],
|
738
|
+
ETH: [44, 60, 0, 0, 0],
|
739
|
+
GAIA: [44, 118, 0, 0, 0],
|
740
|
+
LTC: [84, 2, 0, 0, 0],
|
741
|
+
MATIC: [44, 60, 0, 0, 0],
|
742
|
+
MAYA: [44, 931, 0, 0, 0],
|
743
|
+
OP: [44, 60, 0, 0, 0],
|
744
|
+
THOR: [44, 931, 0, 0, 0]
|
745
|
+
};
|
746
|
+
var x = /* @__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))(x || {});
|
747
|
+
const $ = [
|
748
|
+
"ETH",
|
749
|
+
"AVAX",
|
750
|
+
"BSC",
|
751
|
+
"ARB",
|
752
|
+
"OP",
|
753
|
+
"MATIC"
|
754
|
+
/* Polygon */
|
755
|
+
], q = [
|
756
|
+
"BTC",
|
757
|
+
"BCH",
|
758
|
+
"DOGE",
|
759
|
+
"LTC"
|
760
|
+
/* Litecoin */
|
761
|
+
], J = [
|
762
|
+
"GAIA",
|
763
|
+
"THOR",
|
764
|
+
"BNB"
|
765
|
+
/* Binance */
|
766
|
+
];
|
767
|
+
var T = /* @__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))(T || {}), I = /* @__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))(I || {}), H = /* @__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))(H || {});
|
768
|
+
const p = Object.values(i), v = Object.keys(i), o = p.reduce(
|
769
|
+
(e, n) => {
|
770
|
+
const a = v.find((r) => i[r] === n);
|
771
|
+
return a && (e[n] = a), e;
|
772
|
+
},
|
773
|
+
{}
|
774
|
+
), j = p.reduce(
|
775
|
+
(e, n) => (e[n] = T[o[n]], e),
|
776
|
+
{}
|
777
|
+
), Z = p.reduce(
|
778
|
+
(e, n) => (e[n] = I[o[n]], e),
|
779
|
+
{}
|
780
|
+
), z = p.reduce(
|
781
|
+
(e, n) => {
|
782
|
+
const a = `${o[n]}Hex`;
|
783
|
+
return e[n] = T[a], e;
|
784
|
+
},
|
785
|
+
{}
|
786
|
+
), Q = {
|
787
|
+
"0xa4b1": "ARB",
|
788
|
+
42161: "ARB",
|
789
|
+
"0xa86a": "AVAX",
|
790
|
+
43114: "AVAX",
|
791
|
+
"0x38": "BSC",
|
792
|
+
56: "BSC",
|
793
|
+
"Binance-Chain-Tigris": "BNB",
|
794
|
+
bitcoincash: "BCH",
|
795
|
+
bitcoin: "BTC",
|
796
|
+
"cosmoshub-4": "GAIA",
|
797
|
+
dogecoin: "DOGE",
|
798
|
+
"0x1": "ETH",
|
799
|
+
1: "ETH",
|
800
|
+
litecoin: "LTC",
|
801
|
+
"mayachain-stagenet-v1": "MAYA",
|
802
|
+
"mayachain-mainnet-v1": "MAYA",
|
803
|
+
"0xa": "OP",
|
804
|
+
10: "OP",
|
805
|
+
"0x89": "MATIC",
|
806
|
+
137: "MATIC",
|
807
|
+
"thorchain-stagenet-v2": "THOR",
|
808
|
+
"thorchain-mainnet-v1": "THOR"
|
809
|
+
/* THORChain */
|
810
|
+
}, ee = {
|
811
|
+
ARB: "https://arbiscan.io",
|
812
|
+
AVAX: "https://snowtrace.io",
|
813
|
+
BSC: "https://bscscan.com",
|
814
|
+
BNB: "https://explorer.binance.org",
|
815
|
+
BCH: "https://www.blockchain.com/bch",
|
816
|
+
BTC: "https://blockstream.info",
|
817
|
+
GAIA: "https://cosmos.bigdipper.live",
|
818
|
+
DOGE: "https://blockchair.com/dogecoin",
|
819
|
+
ETH: "https://etherscan.io",
|
820
|
+
LTC: "https://ltc.bitaps.com",
|
821
|
+
MAYA: "https://www.mayascan.org",
|
822
|
+
OP: "https://optimistic.etherscan.io",
|
823
|
+
MATIC: "https://polygonscan.com",
|
824
|
+
THOR: "https://viewblock.io/thorchain"
|
825
|
+
};
|
826
|
+
var L = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(L || {}), D = /* @__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))(D || {}), R = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(R || {}), M = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.KEEPKEY = "KEEPKEY", 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))(M || {});
|
827
|
+
export {
|
828
|
+
K as AGG_SWAP,
|
829
|
+
A as ApiError,
|
830
|
+
H as ApiUrl,
|
831
|
+
x as BaseDecimal,
|
832
|
+
i as Chain,
|
833
|
+
T as ChainId,
|
834
|
+
Q as ChainIdToChain,
|
835
|
+
j as ChainToChainId,
|
836
|
+
ee as ChainToExplorerUrl,
|
837
|
+
z as ChainToHexChainId,
|
838
|
+
Z as ChainToRPC,
|
839
|
+
V as ContractAddress,
|
840
|
+
J as CosmosChainList,
|
841
|
+
b as DerivationPath,
|
842
|
+
t as ERROR_CODE,
|
843
|
+
O as ERROR_MODULE,
|
844
|
+
m as ERROR_TYPE,
|
845
|
+
$ as EVMChainList,
|
846
|
+
L as ErrorCode,
|
847
|
+
R as FeeOption,
|
848
|
+
D as MemoType,
|
849
|
+
k as NetworkDerivationPath,
|
850
|
+
B as NetworkId,
|
851
|
+
g as QuoteMode,
|
852
|
+
I as RPCUrl,
|
853
|
+
Y as SWAP_IN,
|
854
|
+
W as SWAP_OUT,
|
855
|
+
F as TCAvalancheDepositABI,
|
856
|
+
X as TCBscDepositABI,
|
857
|
+
w as TCEthereumVaultAbi,
|
858
|
+
q as UTXOChainList,
|
859
|
+
M as WalletOption,
|
860
|
+
U as erc20ABI
|
861
|
+
};
|