@proton/wrap-constants 0.2.193 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2718 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ // \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ let zod = require("zod");
24
+ zod = __toESM(zod, 1);
25
+ let lodash_clonedeep = require("lodash.clonedeep");
26
+ lodash_clonedeep = __toESM(lodash_clonedeep, 1);
27
+ let bignumber_js = require("bignumber.js");
28
+ bignumber_js = __toESM(bignumber_js, 1);
29
+ let _scure_base = require("@scure/base");
30
+ let _noble_hashes_sha2 = require("@noble/hashes/sha2");
31
+ let _noble_hashes_sha3 = require("@noble/hashes/sha3");
32
+ // src/coins.ts
33
+ let Chains = /* @__PURE__ */ function(Chains) {
34
+ Chains["BitcoinMainnet"] = "Bitcoin";
35
+ Chains["BitcoinTestnet"] = "Bitcoin (Testnet)";
36
+ Chains["EthereumMainnet"] = "Ethereum";
37
+ Chains["EthereumSepolia"] = "Ethereum (Sepolia)";
38
+ Chains["LitecoinMainnet"] = "Litecoin";
39
+ Chains["LitecoinTestnet"] = "Litecoin (Testnet)";
40
+ Chains["BitcoinCashMainnet"] = "Bitcoin Cash";
41
+ Chains["BitcoinCashTestnet"] = "Bitcoin Cash (Testnet)";
42
+ Chains["StellarMainnet"] = "Stellar";
43
+ Chains["StellarTestnet"] = "Stellar (Testnet)";
44
+ Chains["ProtonMainnet"] = "Proton";
45
+ Chains["ProtonTestnet"] = "Proton (Testnet)";
46
+ Chains["PolkadotMainnet"] = "Polkadot";
47
+ Chains["BinanceBEP2"] = "Binance (BEP2)";
48
+ Chains["BinanceBEP20"] = "Binance (BEP20)";
49
+ Chains["EosMainnet"] = "EOS";
50
+ Chains["EosTestnet"] = "EOS (Jungle Testnet)";
51
+ Chains["HederaMainnet"] = "Hedera (Mainnet)";
52
+ Chains["HederaTestnet"] = "Hedera (Testnet)";
53
+ Chains["DogeMainnet"] = "Dogecoin";
54
+ Chains["CardanoMainnet"] = "Cardano";
55
+ Chains["AvalancheXChain"] = "Avalanche X-Chain";
56
+ Chains["AvalancheCChain"] = "Avalanche C-Chain";
57
+ Chains["PolygonMainnet"] = "Polygon";
58
+ Chains["TerraMainnet"] = "Terra";
59
+ Chains["RippleMainnet"] = "Ripple";
60
+ Chains["SolanaMainnet"] = "Solana";
61
+ Chains["XDCMainnet"] = "XDC Network";
62
+ Chains["MetalXTestnet"] = "Metal X-Chain (Testnet)";
63
+ Chains["MetalCTestnet"] = "Metal C-Chain (Testnet)";
64
+ Chains["MetalCMainnet"] = "Metal C-Chain";
65
+ Chains["MetalL2Mainnet"] = "Metal L2";
66
+ Chains["MetalL2Testnet"] = "Metal L2 (Testnet)";
67
+ return Chains;
68
+ }({});
69
+ let Networks = /* @__PURE__ */ function(Networks) {
70
+ Networks["Mainnet"] = "mainnet";
71
+ Networks["Testnet"] = "testnet";
72
+ Networks["ERC20"] = "erc20";
73
+ Networks["BEP20"] = "bep20";
74
+ Networks["XLM"] = "xlm";
75
+ Networks["AVM"] = "avm";
76
+ Networks["EVM"] = "evm";
77
+ Networks["METALL2"] = "metall2";
78
+ Networks["Sepolia"] = "sepolia";
79
+ return Networks;
80
+ }({});
81
+ const similarChains = {
82
+ ["Ethereum"]: ["Binance (BEP20)"],
83
+ ["Binance (BEP20)"]: ["Ethereum"]
84
+ };
85
+ let Providers = /* @__PURE__ */ function(Providers) {
86
+ Providers["FIREBLOCKS"] = "fireblocks";
87
+ Providers["METAL"] = "metal";
88
+ Providers["METALL2"] = "metall2";
89
+ return Providers;
90
+ }({});
91
+ const explorerLinkByChain = {
92
+ ["Bitcoin"]: (txid) => `https://blockchain.com/btc/tx/${txid}`,
93
+ ["Bitcoin (Testnet)"]: (txid) => `https://blockstream.info/testnet/tx/${txid}`,
94
+ ["Ethereum"]: (txid) => `https://etherscan.io/tx/${txid}`,
95
+ ["Ethereum (Sepolia)"]: (txid) => `https://sepolia.etherscan.io/tx/${txid}`,
96
+ ["Litecoin"]: (txid) => `https://blockchair.com/litecoin/transaction/${txid}`,
97
+ ["Litecoin (Testnet)"]: (txid) => `https://blockexplorer.one/litecoin/testnet/blockHash/${txid}`,
98
+ ["Bitcoin Cash"]: (txid) => `https://blockchair.com/bitcoin-cash/transaction/${txid}`,
99
+ ["Bitcoin Cash (Testnet)"]: (txid) => `https://blockexplorer.one/bitcoin-cash/testnet/blockHash/${txid}`,
100
+ ["Stellar"]: (txid) => `https://blockchair.com/stellar/transaction/${txid}`,
101
+ ["Stellar (Testnet)"]: (txid) => `https://testnet.steexp.com/tx/${txid}`,
102
+ ["Proton"]: (txid, traces) => `https://explorer.xprnetwork.org/transaction/${txid}${traces ? "?tab=traces" : ""}`,
103
+ ["Proton (Testnet)"]: (txid, traces) => `https://testnet.explorer.xprnetwork.org/transaction/${txid}${traces ? "?tab=traces" : ""}`,
104
+ ["Polkadot"]: (txid) => `https://polkadot.subscan.io/extrinsic/${txid}`,
105
+ ["Binance (BEP2)"]: (txid) => `https://binance.mintscan.io/txs/${txid}`,
106
+ ["Binance (BEP20)"]: (txid) => `https://bscscan.com/tx/${txid}`,
107
+ ["EOS"]: (txid) => `https://bloks.io/transaction/${txid}`,
108
+ ["EOS (Jungle Testnet)"]: (txid) => `https://jungle.bloks.io/transaction/${txid}`,
109
+ ["Hedera (Mainnet)"]: (txid) => `https://app.dragonglass.me/transactions/${txid}`,
110
+ ["Hedera (Testnet)"]: (txid) => `https://testnet.dragonglass.me/transactions/${txid}`,
111
+ ["Dogecoin"]: (txid) => `https://blockchair.com/dogecoin/transaction/${txid}`,
112
+ ["Cardano"]: (txid) => `https://explorer.cardano.org/en/transaction?id=${txid}`,
113
+ ["Avalanche X-Chain"]: (txid) => `https://avascan.info/blockchain/x/tx/${txid}`,
114
+ ["Avalanche C-Chain"]: (txid) => `https://snowtrace.io/tx/${txid}`,
115
+ ["Polygon"]: (txid) => `https://polygonscan.com/tx/${txid}`,
116
+ ["Terra"]: (txid) => `https://terra.stake.id/?#/tx/${txid}`,
117
+ ["Ripple"]: (txid) => `https://xrpscan.com/tx/${txid}`,
118
+ ["Solana"]: (txid) => `https://explorer.solana.com/tx/${txid}`,
119
+ ["Metal X-Chain (Testnet)"]: (txid) => `https://metalscan.io/tx/${txid}`,
120
+ ["Metal C-Chain (Testnet)"]: (txid) => `https://tahoe.metaltrace.io/tx/${txid}`,
121
+ ["Metal C-Chain"]: (txid) => `https://metalscan.io/tx/${txid}`,
122
+ ["XDC Network"]: (txid) => `https://xdc.blocksscan.io/txs/${txid}`,
123
+ ["Metal L2 (Testnet)"]: (txid) => `https://testnet.explorer.metall2.com/tx/${txid}`,
124
+ ["Metal L2"]: (txid) => `https://explorer.metall2.com/tx/${txid}`
125
+ };
126
+ const protonExplorerTxUrl = (chain, txId, traces) => chain === "proton" ? explorerLinkByChain["Proton"](txId, traces) : explorerLinkByChain["Proton (Testnet)"](txId, traces);
127
+ const initializeCoins = (protonChain) => {
128
+ const IS_MAINNET = protonChain === "proton";
129
+ const IS_TESTNET = protonChain === "proton-test";
130
+ const coins = [
131
+ {
132
+ allowSwap: true,
133
+ allowBridge: IS_MAINNET,
134
+ allowLend: true,
135
+ allowBorrow: true,
136
+ name: "XPR Network",
137
+ coin: "XPR",
138
+ xtokenSymbol: "XPR",
139
+ xtokenPrecision: 4,
140
+ xtokenContract: "eosio.token",
141
+ wallets: [...IS_MAINNET ? [{
142
+ wallet: "XPR-ERC20",
143
+ symbol: "XPR",
144
+ chain: "Ethereum",
145
+ network: "erc20",
146
+ precision: 4,
147
+ contract: "0xD7EFB00D12C2C13131FD319336FDF952525DA2AF",
148
+ provider: "fireblocks",
149
+ hasWithdrawMemo: false
150
+ }, {
151
+ wallet: "XPR-BEP20",
152
+ symbol: "XPR",
153
+ chain: "Binance (BEP20)",
154
+ network: "bep20",
155
+ precision: 4,
156
+ contract: "0x5DE3939B2F811A61D830E6F52D13B066881412AB",
157
+ provider: "fireblocks",
158
+ hasWithdrawMemo: false
159
+ }] : []],
160
+ image: "https://app.metalx.com/img/tokens/XPR.png",
161
+ coingeckoId: "proton",
162
+ unifiedCryptoassetId: "5350"
163
+ },
164
+ {
165
+ allowSwap: true,
166
+ allowBridge: true,
167
+ allowLend: true,
168
+ allowBorrow: true,
169
+ name: "USD Coin",
170
+ coin: "USDC",
171
+ xtokenSymbol: "XUSDC",
172
+ xtokenPrecision: 6,
173
+ xtokenContract: "xtokens",
174
+ wallets: [...IS_MAINNET ? [{
175
+ wallet: "USDC",
176
+ symbol: "USDC",
177
+ chain: "Ethereum",
178
+ network: "erc20",
179
+ precision: 6,
180
+ contract: "0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48",
181
+ provider: "fireblocks",
182
+ hasWithdrawMemo: false
183
+ }, {
184
+ wallet: "USDC-XLM",
185
+ symbol: "USDC",
186
+ chain: "Stellar",
187
+ network: "xlm",
188
+ precision: 7,
189
+ contract: void 0,
190
+ provider: "fireblocks",
191
+ hasWithdrawMemo: true
192
+ }] : [], ...IS_TESTNET ? [{
193
+ wallet: "USDC",
194
+ symbol: "USDC",
195
+ chain: "Ethereum (Sepolia)",
196
+ network: "sepolia",
197
+ precision: 6,
198
+ contract: "0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48",
199
+ provider: "fireblocks",
200
+ hasWithdrawMemo: false
201
+ }, {
202
+ wallet: "USDC-XLM",
203
+ symbol: "USDC",
204
+ chain: "Stellar (Testnet)",
205
+ network: "xlm",
206
+ precision: 7,
207
+ contract: void 0,
208
+ provider: "fireblocks",
209
+ hasWithdrawMemo: true
210
+ }] : []],
211
+ image: "https://app.metalx.com/img/tokens/usdc.png",
212
+ coingeckoId: "usd-coin",
213
+ unifiedCryptoassetId: "3408"
214
+ },
215
+ {
216
+ allowSwap: true,
217
+ allowBridge: true,
218
+ allowLend: true,
219
+ allowBorrow: true,
220
+ name: "Metal DAO",
221
+ coin: "MTL",
222
+ xtokenSymbol: "XMT",
223
+ xtokenPrecision: 8,
224
+ xtokenContract: "xtokens",
225
+ wallets: [...IS_MAINNET ? [{
226
+ wallet: "MTL-METALL2",
227
+ symbol: "MTL",
228
+ chain: "Metal L2",
229
+ network: "metall2",
230
+ precision: 8,
231
+ contract: "0xBCFc435d8F276585f6431Fc1b9EE9A850B5C00A9",
232
+ provider: "metall2",
233
+ hasWithdrawMemo: false
234
+ }] : []],
235
+ image: "https://app.metalx.com/img/tokens/mtl.png",
236
+ coingeckoId: "metal",
237
+ unifiedCryptoassetId: "1788"
238
+ },
239
+ {
240
+ allowSwap: true,
241
+ allowBridge: true,
242
+ allowLend: false,
243
+ allowBorrow: false,
244
+ name: "Metal Blockchain",
245
+ coin: "METAL",
246
+ xtokenSymbol: "METAL",
247
+ xtokenPrecision: 8,
248
+ xtokenContract: "xtokens",
249
+ wallets: [...IS_TESTNET ? [{
250
+ wallet: "METAL",
251
+ symbol: "METAL",
252
+ chain: "Metal C-Chain (Testnet)",
253
+ network: "evm",
254
+ precision: 18,
255
+ contract: "",
256
+ provider: "metal",
257
+ hasWithdrawMemo: false
258
+ }] : [], ...IS_MAINNET ? [{
259
+ wallet: "METAL",
260
+ symbol: "METAL",
261
+ chain: "Metal C-Chain",
262
+ network: "evm",
263
+ precision: 18,
264
+ contract: "",
265
+ provider: "metal",
266
+ hasWithdrawMemo: false
267
+ }, {
268
+ wallet: "METAL-ERC20",
269
+ symbol: "METAL",
270
+ chain: "Ethereum",
271
+ network: "erc20",
272
+ precision: 18,
273
+ contract: "",
274
+ provider: "fireblocks",
275
+ hasWithdrawMemo: false
276
+ }] : []],
277
+ image: "https://app.metalx.com/img/tokens/metal.png",
278
+ coingeckoId: "metal-blockchain",
279
+ unifiedCryptoassetId: "21769"
280
+ },
281
+ {
282
+ allowSwap: true,
283
+ allowBridge: true,
284
+ allowLend: true,
285
+ allowBorrow: true,
286
+ name: "Bitcoin",
287
+ coin: "BTC",
288
+ xtokenSymbol: "XBTC",
289
+ xtokenPrecision: 8,
290
+ xtokenContract: "xtokens",
291
+ wallets: [...IS_MAINNET ? [{
292
+ wallet: "BTC",
293
+ symbol: "BTC",
294
+ chain: "Bitcoin",
295
+ network: "mainnet",
296
+ precision: 8,
297
+ contract: void 0,
298
+ provider: "fireblocks",
299
+ hasWithdrawMemo: false
300
+ }] : [], ...IS_TESTNET ? [{
301
+ wallet: "BTC",
302
+ symbol: "BTC",
303
+ chain: "Bitcoin (Testnet)",
304
+ network: "testnet",
305
+ precision: 8,
306
+ contract: void 0,
307
+ provider: "fireblocks",
308
+ hasWithdrawMemo: false
309
+ }] : []],
310
+ image: "https://app.metalx.com/img/tokens/btc.png",
311
+ coingeckoId: "bitcoin",
312
+ unifiedCryptoassetId: "1"
313
+ },
314
+ {
315
+ allowSwap: true,
316
+ allowBridge: true,
317
+ allowLend: true,
318
+ allowBorrow: true,
319
+ name: "Ethereum",
320
+ coin: "ETH",
321
+ xtokenSymbol: "XETH",
322
+ xtokenPrecision: 8,
323
+ xtokenContract: "xtokens",
324
+ wallets: [...IS_MAINNET ? [{
325
+ wallet: "ETH",
326
+ symbol: "ETH",
327
+ chain: "Ethereum",
328
+ network: "mainnet",
329
+ precision: 18,
330
+ contract: "0x0000000000000000000000000000000000000000",
331
+ provider: "fireblocks",
332
+ hasWithdrawMemo: false
333
+ }] : [], ...IS_TESTNET ? [{
334
+ wallet: "ETH",
335
+ symbol: "ETH",
336
+ chain: "Ethereum (Sepolia)",
337
+ network: "sepolia",
338
+ precision: 18,
339
+ contract: "0x0000000000000000000000000000000000000000",
340
+ provider: "fireblocks",
341
+ hasWithdrawMemo: false
342
+ }] : []],
343
+ image: "https://app.metalx.com/img/tokens/eth.png",
344
+ coingeckoId: "ethereum",
345
+ unifiedCryptoassetId: "1027"
346
+ },
347
+ {
348
+ allowSwap: true,
349
+ allowBridge: false,
350
+ allowLend: false,
351
+ allowBorrow: false,
352
+ name: "LOAN Protocol",
353
+ coin: "LOAN",
354
+ xtokenSymbol: "LOAN",
355
+ xtokenPrecision: 4,
356
+ xtokenContract: "loan.token",
357
+ wallets: [],
358
+ image: "https://app.metalx.com/img/tokens/loan.png",
359
+ coingeckoId: "proton-loan",
360
+ unifiedCryptoassetId: "22071"
361
+ },
362
+ {
363
+ allowSwap: true,
364
+ allowBridge: true,
365
+ allowLend: false,
366
+ allowBorrow: false,
367
+ name: "Tether",
368
+ coin: "USDT",
369
+ xtokenSymbol: "XUSDT",
370
+ xtokenPrecision: 6,
371
+ xtokenContract: "xtokens",
372
+ wallets: [...IS_MAINNET ? [{
373
+ wallet: "USDT",
374
+ symbol: "USDT",
375
+ chain: "Ethereum",
376
+ network: "erc20",
377
+ precision: 6,
378
+ contract: "0xDAC17F958D2EE523A2206206994597C13D831EC7",
379
+ provider: "fireblocks",
380
+ hasWithdrawMemo: false
381
+ }] : [{
382
+ wallet: "USDT",
383
+ symbol: "USDT",
384
+ chain: "Ethereum (Sepolia)",
385
+ network: "sepolia",
386
+ precision: 6,
387
+ contract: "0xDAC17F958D2EE523A2206206994597C13D831EC7",
388
+ provider: "fireblocks",
389
+ hasWithdrawMemo: false
390
+ }]],
391
+ image: "https://app.metalx.com/img/tokens/usdt.png",
392
+ coingeckoId: "tether",
393
+ unifiedCryptoassetId: "825"
394
+ },
395
+ {
396
+ allowSwap: false,
397
+ allowBridge: false,
398
+ allowLend: false,
399
+ allowBorrow: false,
400
+ name: "TrueUSD",
401
+ coin: "TUSD",
402
+ xtokenSymbol: "XTUSD",
403
+ xtokenPrecision: 6,
404
+ xtokenContract: "xtokens",
405
+ wallets: [...IS_MAINNET ? [] : []],
406
+ image: "https://app.metalx.com/img/tokens/tusd.png",
407
+ coingeckoId: "true-usd",
408
+ unifiedCryptoassetId: "2563"
409
+ },
410
+ {
411
+ allowSwap: false,
412
+ allowBridge: IS_MAINNET,
413
+ allowLend: false,
414
+ allowBorrow: false,
415
+ name: "Euro Coin",
416
+ coin: "EUROC",
417
+ xtokenSymbol: "XEUROC",
418
+ xtokenPrecision: 6,
419
+ xtokenContract: "xtokens",
420
+ wallets: [...IS_MAINNET ? [{
421
+ wallet: "EUROC-ERC20",
422
+ symbol: "EUROC",
423
+ chain: "Ethereum",
424
+ network: "erc20",
425
+ precision: 6,
426
+ contract: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
427
+ provider: "fireblocks",
428
+ hasWithdrawMemo: false
429
+ }] : []],
430
+ image: "https://assets.coingecko.com/coins/images/26045/small/euro-coin.png?1655394420",
431
+ coingeckoId: "euro-coin",
432
+ unifiedCryptoassetId: "20641"
433
+ },
434
+ {
435
+ allowSwap: false,
436
+ allowBridge: IS_MAINNET,
437
+ allowLend: false,
438
+ allowBorrow: false,
439
+ name: "XDC Network",
440
+ coin: "XDC",
441
+ xtokenSymbol: "XDC",
442
+ xtokenPrecision: 4,
443
+ xtokenContract: "xtokens",
444
+ wallets: [...IS_MAINNET ? [{
445
+ wallet: "XDC",
446
+ symbol: "XDC",
447
+ chain: "XDC Network",
448
+ network: "mainnet",
449
+ precision: 18,
450
+ contract: "",
451
+ provider: "fireblocks",
452
+ hasWithdrawMemo: false
453
+ }] : []],
454
+ image: "https://app.metalx.com/img/tokens/xdc.png",
455
+ coingeckoId: "xdce-crowd-sale",
456
+ unifiedCryptoassetId: "2634"
457
+ },
458
+ {
459
+ allowSwap: false,
460
+ allowBridge: IS_MAINNET,
461
+ allowLend: false,
462
+ allowBorrow: false,
463
+ name: "Paxos Dollar",
464
+ coin: "PAX",
465
+ xtokenSymbol: "XPAX",
466
+ xtokenPrecision: 6,
467
+ xtokenContract: "xtokens",
468
+ wallets: [...IS_MAINNET ? [{
469
+ wallet: "PAX",
470
+ symbol: "PAX",
471
+ chain: "Ethereum",
472
+ network: "erc20",
473
+ precision: 18,
474
+ contract: "0x8E870D67F660D95D5BE530380D0EC0BD388289E1",
475
+ provider: "fireblocks",
476
+ hasWithdrawMemo: false
477
+ }] : []],
478
+ image: "https://app.metalx.com/img/tokens/pax.png",
479
+ coingeckoId: "paxos-standard",
480
+ unifiedCryptoassetId: "3330"
481
+ },
482
+ {
483
+ allowSwap: false,
484
+ allowBridge: true,
485
+ allowLend: false,
486
+ allowBorrow: false,
487
+ name: "Paxos Gold",
488
+ coin: "PAXG",
489
+ xtokenSymbol: "XPAXG",
490
+ xtokenPrecision: 8,
491
+ xtokenContract: "xtokens",
492
+ wallets: [...IS_MAINNET ? [{
493
+ wallet: "PAXG",
494
+ symbol: "PAXG",
495
+ chain: "Ethereum",
496
+ network: "erc20",
497
+ precision: 18,
498
+ contract: "0x45804880DE22913DAFE09F4980848ECE6ECBAF78",
499
+ provider: "fireblocks",
500
+ hasWithdrawMemo: false
501
+ }] : [], ...IS_TESTNET ? [{
502
+ wallet: "PAXG",
503
+ symbol: "PAXG",
504
+ chain: "Ethereum (Sepolia)",
505
+ network: "sepolia",
506
+ precision: 18,
507
+ contract: "0x45804880DE22913DAFE09F4980848ECE6ECBAF78",
508
+ provider: "fireblocks",
509
+ hasWithdrawMemo: false
510
+ }] : []],
511
+ image: "https://app.metalx.com/img/tokens/paxg.png",
512
+ coingeckoId: "pax-gold",
513
+ unifiedCryptoassetId: "4705"
514
+ },
515
+ {
516
+ allowSwap: false,
517
+ allowBridge: false,
518
+ allowLend: false,
519
+ allowBorrow: false,
520
+ name: "Storex",
521
+ coin: "STRX",
522
+ xtokenSymbol: "STRX",
523
+ xtokenPrecision: 4,
524
+ xtokenContract: "storex",
525
+ wallets: [],
526
+ image: "https://app.metalx.com/img/tokens/strx.png",
527
+ coingeckoId: "storex",
528
+ unifiedCryptoassetId: ""
529
+ },
530
+ {
531
+ allowSwap: false,
532
+ allowBridge: false,
533
+ allowLend: false,
534
+ allowBorrow: false,
535
+ name: "Mint",
536
+ coin: "MINT",
537
+ xtokenSymbol: "MINT",
538
+ xtokenPrecision: 4,
539
+ xtokenContract: "protonmint",
540
+ wallets: [],
541
+ image: "https://app.metalx.com/img/tokens/mint.png",
542
+ coingeckoId: "",
543
+ unifiedCryptoassetId: ""
544
+ },
545
+ {
546
+ allowSwap: IS_MAINNET,
547
+ allowBridge: false,
548
+ allowLend: false,
549
+ allowBorrow: false,
550
+ name: "Snipcoins",
551
+ coin: "SNIPS",
552
+ xtokenSymbol: "SNIPS",
553
+ xtokenPrecision: 4,
554
+ xtokenContract: "snipcoins",
555
+ wallets: [],
556
+ image: "https://app.metalx.com/img/tokens/snips.png",
557
+ coingeckoId: "",
558
+ unifiedCryptoassetId: ""
559
+ },
560
+ {
561
+ allowSwap: false,
562
+ allowBridge: false,
563
+ allowLend: false,
564
+ allowBorrow: false,
565
+ name: "Uniswap",
566
+ coin: "UNI",
567
+ xtokenSymbol: "XUNI",
568
+ xtokenPrecision: 6,
569
+ xtokenContract: "xtokens",
570
+ wallets: [...IS_MAINNET ? [] : [], ...IS_TESTNET ? [] : []],
571
+ image: "https://app.metalx.com/img/tokens/uni.png",
572
+ coingeckoId: "uniswap",
573
+ unifiedCryptoassetId: "7083"
574
+ },
575
+ {
576
+ allowSwap: false,
577
+ allowBridge: false,
578
+ allowLend: false,
579
+ allowBorrow: false,
580
+ name: "1INCH",
581
+ coin: "1INCH",
582
+ xtokenSymbol: "XINCH",
583
+ xtokenPrecision: 6,
584
+ xtokenContract: "xtokens",
585
+ wallets: [...IS_MAINNET ? [{
586
+ wallet: "1INCH",
587
+ symbol: "1INCH",
588
+ chain: "Ethereum",
589
+ network: "erc20",
590
+ precision: 18,
591
+ contract: "0x111111111117DC0AA78B770FA6A738034120C302",
592
+ provider: "fireblocks",
593
+ hasWithdrawMemo: false
594
+ }] : []],
595
+ image: "https://www.proton.org/images/tokens/xtokensXINCH.png",
596
+ coingeckoId: "1inch",
597
+ unifiedCryptoassetId: "8104"
598
+ },
599
+ {
600
+ allowSwap: false,
601
+ allowBridge: false,
602
+ allowLend: false,
603
+ allowBorrow: false,
604
+ name: "Chainlink",
605
+ coin: "LINK",
606
+ xtokenSymbol: "XLINK",
607
+ xtokenPrecision: 6,
608
+ xtokenContract: "xtokens",
609
+ wallets: [...IS_MAINNET ? [{
610
+ wallet: "LINK",
611
+ symbol: "LINK",
612
+ chain: "Ethereum",
613
+ network: "erc20",
614
+ precision: 18,
615
+ contract: "0x514910771AF9CA656AF840DFF83E8264ECF986CA",
616
+ provider: "fireblocks",
617
+ hasWithdrawMemo: false
618
+ }] : []],
619
+ image: "https://app.metalx.com/img/tokens/link.png",
620
+ coingeckoId: "chainlink",
621
+ unifiedCryptoassetId: "1975"
622
+ },
623
+ {
624
+ allowSwap: IS_MAINNET,
625
+ allowBridge: true,
626
+ allowLend: false,
627
+ allowBorrow: false,
628
+ name: "Litecoin",
629
+ coin: "LTC",
630
+ xtokenSymbol: "XLTC",
631
+ xtokenPrecision: 8,
632
+ xtokenContract: "xtokens",
633
+ wallets: [...IS_MAINNET ? [{
634
+ wallet: "LTC",
635
+ symbol: "LTC",
636
+ chain: "Litecoin",
637
+ network: "mainnet",
638
+ precision: 8,
639
+ contract: void 0,
640
+ provider: "fireblocks",
641
+ hasWithdrawMemo: false
642
+ }] : [], ...IS_TESTNET ? [{
643
+ wallet: "LTC",
644
+ symbol: "LTC",
645
+ chain: "Litecoin (Testnet)",
646
+ network: "testnet",
647
+ precision: 8,
648
+ contract: void 0,
649
+ provider: "fireblocks",
650
+ hasWithdrawMemo: false
651
+ }] : []],
652
+ image: "https://app.metalx.com/img/tokens/ltc.png",
653
+ coingeckoId: "litecoin",
654
+ unifiedCryptoassetId: "2"
655
+ },
656
+ {
657
+ allowSwap: false,
658
+ allowBridge: IS_MAINNET,
659
+ allowLend: false,
660
+ allowBorrow: false,
661
+ name: "PayPal USD",
662
+ coin: "PYUSD",
663
+ xtokenSymbol: "XPYUSD",
664
+ xtokenPrecision: 6,
665
+ xtokenContract: "xtokens",
666
+ wallets: [...IS_MAINNET ? [{
667
+ wallet: "PYUSD",
668
+ symbol: "PYUSD",
669
+ chain: "Ethereum",
670
+ network: "erc20",
671
+ precision: 6,
672
+ contract: void 0,
673
+ provider: "fireblocks",
674
+ hasWithdrawMemo: false
675
+ }] : []],
676
+ image: "https://app.metalx.com/img/tokens/pyusd.png",
677
+ coingeckoId: "paypal-usd",
678
+ unifiedCryptoassetId: "27772"
679
+ },
680
+ {
681
+ allowSwap: false,
682
+ allowBridge: false,
683
+ allowLend: false,
684
+ allowBorrow: false,
685
+ name: "Bitcoin Cash",
686
+ coin: "BCH",
687
+ xtokenSymbol: "XBCH",
688
+ xtokenPrecision: 8,
689
+ xtokenContract: "xtokens",
690
+ wallets: [...IS_MAINNET ? [] : [], ...IS_TESTNET ? [] : []],
691
+ image: "https://app.metalx.com/img/tokens/bch.png",
692
+ coingeckoId: "bitcoin-cash",
693
+ unifiedCryptoassetId: "1831"
694
+ },
695
+ {
696
+ allowSwap: true,
697
+ allowBridge: true,
698
+ allowLend: false,
699
+ allowBorrow: false,
700
+ name: "LunarCrush",
701
+ coin: "LUNR",
702
+ xtokenSymbol: "XLUNR",
703
+ xtokenPrecision: 4,
704
+ xtokenContract: "xtokens",
705
+ wallets: [...IS_MAINNET ? [{
706
+ wallet: "LUNR",
707
+ symbol: "LUNR",
708
+ chain: "Ethereum",
709
+ network: "erc20",
710
+ precision: 4,
711
+ contract: void 0,
712
+ provider: "fireblocks",
713
+ hasWithdrawMemo: false
714
+ }] : []],
715
+ image: "https://app.metalx.com/img/tokens/lunr.png",
716
+ coingeckoId: "lunr-token",
717
+ unifiedCryptoassetId: "12971"
718
+ },
719
+ {
720
+ allowSwap: false,
721
+ allowBridge: true,
722
+ allowLend: false,
723
+ allowBorrow: false,
724
+ name: "Stellar",
725
+ coin: "XLM",
726
+ xtokenSymbol: "XXLM",
727
+ xtokenPrecision: 6,
728
+ xtokenContract: "xtokens",
729
+ wallets: [...IS_MAINNET ? [{
730
+ wallet: "XLM",
731
+ symbol: "XLM",
732
+ chain: "Stellar",
733
+ network: "mainnet",
734
+ precision: 7,
735
+ contract: void 0,
736
+ provider: "fireblocks",
737
+ hasWithdrawMemo: true
738
+ }] : [], ...IS_TESTNET ? [{
739
+ wallet: "XLM",
740
+ symbol: "XLM",
741
+ chain: "Stellar (Testnet)",
742
+ network: "testnet",
743
+ precision: 7,
744
+ contract: void 0,
745
+ provider: "fireblocks",
746
+ hasWithdrawMemo: true
747
+ }] : []],
748
+ image: "https://app.metalx.com/img/tokens/xlm.png",
749
+ coingeckoId: "stellar",
750
+ unifiedCryptoassetId: "512"
751
+ },
752
+ {
753
+ allowSwap: false,
754
+ allowBridge: false,
755
+ allowLend: false,
756
+ allowBorrow: false,
757
+ name: "Sense",
758
+ coin: "SENSE",
759
+ xtokenSymbol: "XSENSE",
760
+ xtokenPrecision: 4,
761
+ xtokenContract: "sense",
762
+ wallets: [],
763
+ image: "https://app.metalx.com/img/tokens/sense.png",
764
+ coingeckoId: "sense",
765
+ unifiedCryptoassetId: ""
766
+ },
767
+ {
768
+ allowSwap: false,
769
+ allowBridge: false,
770
+ allowLend: false,
771
+ allowBorrow: false,
772
+ name: "Polkadot",
773
+ coin: "DOT",
774
+ xtokenSymbol: "XDOT",
775
+ xtokenPrecision: 8,
776
+ xtokenContract: "xtokens",
777
+ wallets: [...IS_MAINNET ? [{
778
+ wallet: "DOT",
779
+ symbol: "DOT",
780
+ chain: "Polkadot",
781
+ network: "mainnet",
782
+ precision: 10,
783
+ contract: void 0,
784
+ provider: "fireblocks",
785
+ hasWithdrawMemo: false
786
+ }] : []],
787
+ image: "https://app.metalx.com/img/tokens/dot.png",
788
+ coingeckoId: "polkadot",
789
+ unifiedCryptoassetId: "6636"
790
+ },
791
+ {
792
+ allowSwap: true,
793
+ allowBridge: false,
794
+ allowLend: false,
795
+ allowBorrow: false,
796
+ name: "Binance Coin",
797
+ coin: "BNB",
798
+ xtokenSymbol: "XBNB",
799
+ xtokenPrecision: 8,
800
+ xtokenContract: "xtokens",
801
+ wallets: [...IS_MAINNET ? [] : []],
802
+ image: "https://app.metalx.com/img/tokens/bnb.png",
803
+ coingeckoId: "binancecoin",
804
+ unifiedCryptoassetId: "1839"
805
+ },
806
+ {
807
+ allowSwap: false,
808
+ allowBridge: false,
809
+ allowLend: false,
810
+ allowBorrow: false,
811
+ name: "Binance USD",
812
+ coin: "BUSD",
813
+ xtokenSymbol: "XBUSD",
814
+ xtokenPrecision: 6,
815
+ xtokenContract: "xtokens",
816
+ wallets: [],
817
+ image: "https://app.metalx.com/img/tokens/busd.png",
818
+ coingeckoId: "binance-usd",
819
+ unifiedCryptoassetId: "4687"
820
+ },
821
+ {
822
+ allowSwap: true,
823
+ allowBridge: true,
824
+ allowLend: false,
825
+ allowBorrow: false,
826
+ name: "EOS",
827
+ coin: "EOS",
828
+ xtokenSymbol: "XEOS",
829
+ xtokenPrecision: 4,
830
+ xtokenContract: "xtokens",
831
+ wallets: [...IS_MAINNET ? [{
832
+ wallet: "EOS",
833
+ symbol: "EOS",
834
+ chain: "EOS",
835
+ network: "mainnet",
836
+ precision: 4,
837
+ contract: void 0,
838
+ provider: "fireblocks",
839
+ hasWithdrawMemo: true
840
+ }] : [], ...IS_TESTNET ? [{
841
+ wallet: "EOS",
842
+ symbol: "EOS",
843
+ chain: "EOS (Jungle Testnet)",
844
+ network: "testnet",
845
+ precision: 4,
846
+ contract: void 0,
847
+ provider: "fireblocks",
848
+ hasWithdrawMemo: true
849
+ }] : []],
850
+ image: "https://app.metalx.com/img/tokens/eos.png",
851
+ coingeckoId: "eos",
852
+ unifiedCryptoassetId: "1765"
853
+ },
854
+ {
855
+ allowSwap: IS_MAINNET,
856
+ allowBridge: IS_MAINNET,
857
+ allowLend: true,
858
+ allowBorrow: true,
859
+ name: "Dogecoin",
860
+ coin: "DOGE",
861
+ xtokenSymbol: "XDOGE",
862
+ xtokenPrecision: 6,
863
+ xtokenContract: "xtokens",
864
+ wallets: [...IS_MAINNET ? [{
865
+ wallet: "DOGE",
866
+ symbol: "DOGE",
867
+ chain: "Dogecoin",
868
+ network: "mainnet",
869
+ precision: 8,
870
+ contract: void 0,
871
+ provider: "fireblocks",
872
+ hasWithdrawMemo: false
873
+ }] : []],
874
+ image: "https://app.metalx.com/img/tokens/doge.png",
875
+ coingeckoId: "dogecoin",
876
+ unifiedCryptoassetId: "74"
877
+ },
878
+ {
879
+ allowSwap: IS_MAINNET,
880
+ allowBridge: IS_MAINNET,
881
+ allowLend: false,
882
+ allowBorrow: false,
883
+ name: "Cardano",
884
+ coin: "ADA",
885
+ xtokenSymbol: "XADA",
886
+ xtokenPrecision: 6,
887
+ xtokenContract: "xtokens",
888
+ wallets: [...IS_MAINNET ? [{
889
+ wallet: "ADA",
890
+ symbol: "ADA",
891
+ chain: "Cardano",
892
+ network: "mainnet",
893
+ precision: 6,
894
+ contract: void 0,
895
+ provider: "fireblocks",
896
+ hasWithdrawMemo: false
897
+ }] : []],
898
+ image: "https://app.metalx.com/img/tokens/ada.png",
899
+ coingeckoId: "cardano",
900
+ unifiedCryptoassetId: "2010"
901
+ },
902
+ {
903
+ allowSwap: false,
904
+ allowBridge: false,
905
+ allowLend: false,
906
+ allowBorrow: false,
907
+ name: "Terra",
908
+ coin: "LUNA",
909
+ xtokenSymbol: "XLUNA",
910
+ xtokenPrecision: 6,
911
+ xtokenContract: "xtokens",
912
+ wallets: [],
913
+ image: "https://app.metalx.com/img/tokens/luna.png",
914
+ coingeckoId: "terra-luna",
915
+ unifiedCryptoassetId: "4172"
916
+ },
917
+ {
918
+ allowSwap: false,
919
+ allowBridge: false,
920
+ allowLend: false,
921
+ allowBorrow: false,
922
+ name: "TerraUSD",
923
+ coin: "UST",
924
+ xtokenSymbol: "XUST",
925
+ xtokenPrecision: 6,
926
+ xtokenContract: "xtokens",
927
+ wallets: [...IS_MAINNET ? [{
928
+ wallet: "UST",
929
+ symbol: "UST",
930
+ chain: "Terra",
931
+ network: "mainnet",
932
+ precision: 6,
933
+ contract: void 0,
934
+ provider: "fireblocks",
935
+ hasWithdrawMemo: true
936
+ }] : []],
937
+ image: "https://app.metalx.com/img/tokens/ust.png",
938
+ coingeckoId: "terrausd",
939
+ unifiedCryptoassetId: "7129"
940
+ },
941
+ {
942
+ allowSwap: false,
943
+ allowBridge: IS_MAINNET,
944
+ allowLend: false,
945
+ allowBorrow: false,
946
+ name: "Solana",
947
+ coin: "SOL",
948
+ xtokenSymbol: "XSOL",
949
+ xtokenPrecision: 6,
950
+ xtokenContract: "xtokens",
951
+ wallets: [...IS_MAINNET ? [{
952
+ wallet: "SOL",
953
+ symbol: "SOL",
954
+ chain: "Solana",
955
+ network: "mainnet",
956
+ precision: 9,
957
+ contract: void 0,
958
+ provider: "fireblocks",
959
+ hasWithdrawMemo: false
960
+ }] : []],
961
+ image: "https://app.metalx.com/img/tokens/sol.png",
962
+ coingeckoId: "solana",
963
+ unifiedCryptoassetId: "5426"
964
+ },
965
+ {
966
+ allowSwap: false,
967
+ allowBridge: IS_MAINNET,
968
+ allowLend: false,
969
+ allowBorrow: false,
970
+ name: "Ripple",
971
+ coin: "XRP",
972
+ xtokenSymbol: "XXRP",
973
+ xtokenPrecision: 6,
974
+ xtokenContract: "xtokens",
975
+ wallets: [...IS_MAINNET ? [{
976
+ wallet: "XRP",
977
+ symbol: "XRP",
978
+ chain: "Ripple",
979
+ network: "mainnet",
980
+ precision: 6,
981
+ contract: void 0,
982
+ provider: "fireblocks",
983
+ hasWithdrawMemo: true
984
+ }] : []],
985
+ image: "https://app.metalx.com/img/tokens/xrp.png",
986
+ coingeckoId: "ripple",
987
+ unifiedCryptoassetId: "52"
988
+ },
989
+ {
990
+ allowSwap: false,
991
+ allowBridge: false,
992
+ allowLend: false,
993
+ allowBorrow: false,
994
+ name: "Avalanche",
995
+ coin: "AVAX",
996
+ xtokenSymbol: "XAVAX",
997
+ xtokenPrecision: 9,
998
+ xtokenContract: "xtokens",
999
+ wallets: [...IS_MAINNET ? [{
1000
+ wallet: "AVAX",
1001
+ symbol: "AVAX",
1002
+ chain: "Avalanche C-Chain",
1003
+ network: "mainnet",
1004
+ precision: 9,
1005
+ contract: void 0,
1006
+ provider: "fireblocks",
1007
+ hasWithdrawMemo: false
1008
+ }] : []],
1009
+ image: "https://app.metalx.com/img/tokens/avax.png",
1010
+ coingeckoId: "avalanche-2",
1011
+ unifiedCryptoassetId: "5805"
1012
+ },
1013
+ {
1014
+ allowSwap: false,
1015
+ allowBridge: false,
1016
+ allowLend: false,
1017
+ allowBorrow: false,
1018
+ name: "Polygon",
1019
+ coin: "MATIC",
1020
+ xtokenSymbol: "XMATIC",
1021
+ xtokenPrecision: 8,
1022
+ xtokenContract: "xtokens",
1023
+ wallets: [...IS_MAINNET ? [{
1024
+ wallet: "MATIC",
1025
+ symbol: "MATIC",
1026
+ chain: "Polygon",
1027
+ network: "mainnet",
1028
+ precision: 18,
1029
+ contract: "0x0000000000000000000000000000000000000000",
1030
+ provider: "fireblocks",
1031
+ hasWithdrawMemo: false
1032
+ }] : []],
1033
+ image: "https://app.metalx.com/img/tokens/matic.png",
1034
+ coingeckoId: "matic-network",
1035
+ unifiedCryptoassetId: "3890"
1036
+ },
1037
+ {
1038
+ allowSwap: true,
1039
+ allowBridge: false,
1040
+ allowLend: false,
1041
+ allowBorrow: false,
1042
+ name: "Metal Dollar",
1043
+ coin: "XMD",
1044
+ xtokenSymbol: "XMD",
1045
+ xtokenPrecision: 6,
1046
+ xtokenContract: "xmd.token",
1047
+ wallets: [],
1048
+ image: "https://app.metalx.com/img/tokens/xmd.png",
1049
+ coingeckoId: "",
1050
+ unifiedCryptoassetId: ""
1051
+ },
1052
+ {
1053
+ allowSwap: false,
1054
+ allowBridge: false,
1055
+ allowLend: false,
1056
+ allowBorrow: false,
1057
+ name: "Metal Dollar",
1058
+ coin: "MPD",
1059
+ xtokenSymbol: "MPD",
1060
+ xtokenPrecision: 6,
1061
+ xtokenContract: "mpd.token",
1062
+ wallets: [],
1063
+ image: "https://app.metalx.com/img/tokens/mpd.png",
1064
+ coingeckoId: "",
1065
+ unifiedCryptoassetId: ""
1066
+ },
1067
+ {
1068
+ allowSwap: false,
1069
+ allowBridge: true,
1070
+ allowLend: false,
1071
+ allowBorrow: false,
1072
+ name: "Hedera",
1073
+ coin: "HBAR",
1074
+ xtokenSymbol: "XHBAR",
1075
+ xtokenPrecision: 6,
1076
+ xtokenContract: "xtokens",
1077
+ wallets: [...IS_TESTNET ? [{
1078
+ wallet: "HBAR",
1079
+ symbol: "HBAR",
1080
+ chain: "Hedera (Testnet)",
1081
+ network: "testnet",
1082
+ precision: 8,
1083
+ contract: void 0,
1084
+ provider: "fireblocks",
1085
+ hasWithdrawMemo: true
1086
+ }] : [{
1087
+ wallet: "HBAR",
1088
+ symbol: "HBAR",
1089
+ chain: "Hedera (Mainnet)",
1090
+ network: "mainnet",
1091
+ precision: 8,
1092
+ contract: void 0,
1093
+ provider: "fireblocks",
1094
+ hasWithdrawMemo: true
1095
+ }]],
1096
+ image: "https://app.metalx.com/img/tokens/hbar.png",
1097
+ coingeckoId: "hedera-hashgraph",
1098
+ unifiedCryptoassetId: "4642"
1099
+ },
1100
+ {
1101
+ allowSwap: false,
1102
+ allowBridge: IS_TESTNET,
1103
+ allowLend: false,
1104
+ allowBorrow: false,
1105
+ name: "Ripple USD",
1106
+ coin: "RLUSD",
1107
+ xtokenSymbol: "XRLUSD",
1108
+ xtokenPrecision: 6,
1109
+ xtokenContract: "xtokens",
1110
+ wallets: [...IS_MAINNET ? [{
1111
+ wallet: "RLUSD",
1112
+ symbol: "RLUSD",
1113
+ chain: "Ethereum",
1114
+ network: "erc20",
1115
+ precision: 18,
1116
+ contract: "0x8292bb45bf1ee4d140127049757c2e0ff06317ed",
1117
+ provider: "fireblocks",
1118
+ hasWithdrawMemo: false
1119
+ }] : [{
1120
+ wallet: "RLUSD",
1121
+ symbol: "RLUSD",
1122
+ chain: "Ethereum (Sepolia)",
1123
+ network: "erc20",
1124
+ precision: 18,
1125
+ contract: "0xe101FB315a64cDa9944E570a7bFfaFE60b994b1D",
1126
+ provider: "fireblocks",
1127
+ hasWithdrawMemo: false
1128
+ }]],
1129
+ image: "https://app.metalx.com/img/tokens/rlusd.png",
1130
+ coingeckoId: "ripple-usd",
1131
+ unifiedCryptoassetId: "34387"
1132
+ },
1133
+ {
1134
+ allowSwap: false,
1135
+ allowBridge: false,
1136
+ allowLend: false,
1137
+ allowBorrow: false,
1138
+ name: "Fidelity Digital Dollar",
1139
+ coin: "FIDD",
1140
+ xtokenSymbol: "XFIDD",
1141
+ xtokenPrecision: 6,
1142
+ xtokenContract: "xtokens",
1143
+ wallets: [...IS_MAINNET ? [{
1144
+ wallet: "FIDD",
1145
+ symbol: "FIDD",
1146
+ chain: "Ethereum",
1147
+ network: "erc20",
1148
+ precision: 18,
1149
+ contract: "0x7C135549504245B5EAE64FC0E99FA5EBABB8E35D",
1150
+ provider: "fireblocks",
1151
+ hasWithdrawMemo: false
1152
+ }] : []],
1153
+ image: "https://app.metalx.com/img/tokens/fidd.png",
1154
+ coingeckoId: "fidelity-digital-dollar",
1155
+ unifiedCryptoassetId: "39549"
1156
+ },
1157
+ {
1158
+ allowSwap: false,
1159
+ allowBridge: false,
1160
+ allowLend: false,
1161
+ allowBorrow: false,
1162
+ name: "Pax Dollar",
1163
+ coin: "USDP",
1164
+ xtokenSymbol: "XUSDP",
1165
+ xtokenPrecision: 6,
1166
+ xtokenContract: "xtokens",
1167
+ wallets: [],
1168
+ image: "https://app.metalx.com/img/tokens/usdp.png",
1169
+ coingeckoId: "pax-dollar",
1170
+ unifiedCryptoassetId: "3330"
1171
+ }
1172
+ ];
1173
+ const walletWithDuplicateChains = coins.find((coin) => {
1174
+ const chains = coin.wallets.map((wallet) => wallet.chain);
1175
+ return new Set(chains).size !== chains.length;
1176
+ });
1177
+ if (walletWithDuplicateChains) throw new Error(`Coin ${walletWithDuplicateChains.coin} has duplicate chains in wallet`);
1178
+ return {
1179
+ allCoins: coins,
1180
+ swapCoins: coins.filter((coin) => coin.allowSwap),
1181
+ bridgeCoins: coins.filter((coin) => coin.allowBridge),
1182
+ lendCoins: coins.filter((coin) => coin.allowLend),
1183
+ borrowCoins: coins.filter((coin) => coin.allowBorrow),
1184
+ loanCoins: coins.filter((coin) => coin.allowLend || coin.allowBorrow),
1185
+ allEnabledCoins: coins.filter((coin) => coin.allowSwap || coin.allowBridge || coin.xtokenSymbol === "XMD")
1186
+ };
1187
+ };
1188
+ // src/parsers/base.ts
1189
+ const accountParser = zod.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
1190
+ const authorizationParser = zod.object({
1191
+ actor: accountParser,
1192
+ permission: zod.string()
1193
+ });
1194
+ const authorizationsParser = zod.array(authorizationParser).min(1);
1195
+ const ExtendedAssetParser = zod.object({
1196
+ quantity: zod.string(),
1197
+ contract: accountParser
1198
+ });
1199
+ const accountRamDeltaParser = zod.object({
1200
+ account: zod.string(),
1201
+ delta: zod.string()
1202
+ });
1203
+ // src/parsers/actions.ts
1204
+ const actionParser = zod.object({
1205
+ account: zod.string(),
1206
+ name: zod.string(),
1207
+ authorization: zod.array(zod.object({
1208
+ actor: zod.string(),
1209
+ permission: zod.string()
1210
+ })),
1211
+ data: zod.any(),
1212
+ hex_data: zod.string().optional()
1213
+ });
1214
+ const transactionExtensionsParser = zod.array(zod.number().or(zod.string())).optional();
1215
+ const rawTransactionParser = zod.object({
1216
+ expiration: zod.string(),
1217
+ ref_block_num: zod.number(),
1218
+ ref_block_prefix: zod.number(),
1219
+ max_net_usage_words: zod.number(),
1220
+ max_cpu_usage_ms: zod.number(),
1221
+ delay_sec: zod.number(),
1222
+ context_free_actions: zod.array(actionParser),
1223
+ transaction_extensions: zod.array(transactionExtensionsParser)
1224
+ });
1225
+ const baseActionParser = (contract, action, data) => zod.object({
1226
+ account: contract === "*" ? accountParser : zod.literal(contract),
1227
+ name: zod.literal(action),
1228
+ data: zod.object(data),
1229
+ authorization: authorizationsParser
1230
+ });
1231
+ const baseActionSerializedParser = (contract, action, data) => zod.object({
1232
+ account: contract === "*" ? accountParser : zod.literal(contract),
1233
+ name: zod.literal(action),
1234
+ data: zod.string().or(zod.object(data)),
1235
+ authorization: authorizationsParser
1236
+ });
1237
+ const webauthActionParser = (contract, action, data) => zod.object({
1238
+ account: zod.literal("webauthn"),
1239
+ name: zod.literal("exec"),
1240
+ data: zod.object({
1241
+ account: accountParser,
1242
+ key: zod.object({
1243
+ key: zod.array(zod.string().or(zod.object({
1244
+ modulus: zod.string(),
1245
+ exponent: zod.string()
1246
+ }))),
1247
+ user_presence: zod.number(),
1248
+ rpid: zod.string()
1249
+ }),
1250
+ nonce: zod.number(),
1251
+ permissions: authorizationsParser,
1252
+ signature: zod.object({
1253
+ auth_data: zod.string(),
1254
+ client_json: zod.string(),
1255
+ signature: zod.string()
1256
+ }),
1257
+ trx: rawTransactionParser.extend({ actions: zod.array(baseActionSerializedParser(contract, action, data)).length(1) })
1258
+ }),
1259
+ authorization: authorizationsParser
1260
+ });
1261
+ const singleActionTransactionParser = (contract, action, data) => {
1262
+ const baseAction = baseActionParser(contract, action, data);
1263
+ const webauthAction = webauthActionParser(contract, action, data);
1264
+ return rawTransactionParser.extend({ actions: zod.array(baseAction.or(webauthAction)).length(1) });
1265
+ };
1266
+ // src/constants.ts
1267
+ const WRAP_CONTRACT = "proton.wrap";
1268
+ const WRAP_AUTH_ACTION = "generateauth";
1269
+ const FEE_FACTOR = 1e4;
1270
+ const initializeConstants = (chain) => {
1271
+ const { swapCoins, bridgeCoins, allEnabledCoins, allCoins, lendCoins, borrowCoins, loanCoins } = initializeCoins(chain);
1272
+ const constants = {
1273
+ SWAP_CONTRACT: "proton.swaps",
1274
+ VEST_CONTRACT: "vest",
1275
+ DEX_CONTRACT: "dex",
1276
+ FEE_FACTOR,
1277
+ SWAP_URL: chain === "proton" ? "https://otc.protonswap.com" : "https://otc-test.protonswap.com",
1278
+ WRAP_SERVER_URL: chain === "proton" ? "https://www.api.bloks.io/proton-wrap-public2" : "https://www.api.bloks.io/proton-wrap-testnet-public2",
1279
+ WRAP_CONTRACT,
1280
+ WRAP_ACTIONS: {
1281
+ SAVE_ADDRESS: "saveaddress2",
1282
+ DELETE_ADDRESS: "deladdress2",
1283
+ WRAP_START: "wrapstart2",
1284
+ WRAP_FINISH: "wrapfinish2",
1285
+ WRAP_PROCESS: "wrapprocess2",
1286
+ WRAP_SET_CONF: "wrapsetconf2"
1287
+ },
1288
+ WRAP_TABLES: {
1289
+ ADDRESSES: "addresses2",
1290
+ WRAPS: "wraps2"
1291
+ },
1292
+ ADDRESSES_INDEXES: {
1293
+ BY_ACCOUNT: 2,
1294
+ BY_ADDR_HASH: 3
1295
+ },
1296
+ WRAPS_INDEXES: {
1297
+ BY_ACCOUNT: 2,
1298
+ BY_STATUS: 3,
1299
+ BY_WRAP_HASH: 4
1300
+ },
1301
+ WRAP_PROCESS_TIMER: 5e3,
1302
+ FARM_CONTRACT: "yield.farms",
1303
+ WEBHOOK_PERMISSION: "webhook",
1304
+ PUBLIC_PERMISSION: "public",
1305
+ LIGHT_PERMISSION: "light",
1306
+ WRAP_AUTH_ACTION,
1307
+ METAL_ENDPOINT: chain === "proton" ? "https://cirrus.metalpay.com" : "https://cirrus-dev.metalpay.com",
1308
+ METAL_PROTON_ENDPOINT: chain === "proton" ? "https://identity.api.prod.metalx.com" : "https://identity.api.dev.metalx.com",
1309
+ METAL_DEX_HTTP_ENDPOINT: chain === "proton" ? "https://dex.api.mainnet.metalx.com/dex" : "https://dex.api.testnet.metalx.com/dex",
1310
+ METAL_DEX_WS_ENDPOINT: chain === "proton" ? "wss://dex.api.mainnet.metalx.com/dexws" : "wss://dex.api.testnet.metalx.com/dexws",
1311
+ PROTON_ENDPOINTS: chain === "proton" ? [
1312
+ "https://rpc.api.mainnet.metalx.com",
1313
+ "https://proton.greymass.com",
1314
+ "https://proton.eoscafeblock.com",
1315
+ "https://proton.cryptolions.io",
1316
+ "https://proton.eosusa.news"
1317
+ ] : ["https://rpc.api.testnet.metalx.com", "https://testnet.protonchain.com"],
1318
+ CHAIN_ID: chain === "proton" ? "384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0" : "71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd",
1319
+ COINS_URL: chain === "proton" ? "https://app.metalx.com/mainnet-coins.json" : "https://app.metalx.com/testnet-coins.json",
1320
+ DEX_PROCESS_SIZE: 30,
1321
+ DEX_SLTPPROCESS_SIZE: 10,
1322
+ MAX_PRICE: "9223372036854775806",
1323
+ MAX_ITEMS_PER_PAGE_DESKTOP: 100,
1324
+ MIN_PRICE: 1,
1325
+ DEFAULT_DEX_SYMBOL: "XPR_XMD",
1326
+ CHAIN: chain,
1327
+ SWAP_COINS: swapCoins,
1328
+ BRIDGE_COINS: bridgeCoins,
1329
+ ALL_ENABLED_COINS: allEnabledCoins,
1330
+ LEND_COINS: lendCoins,
1331
+ BORROW_COINS: borrowCoins,
1332
+ LOAN_COINS: loanCoins,
1333
+ ALL_COINS: allCoins,
1334
+ XMD_CONTRACT: "xmd.treasury",
1335
+ XMD_TOKEN_CONTRACT: "xmd.token",
1336
+ XMD_SYMBOL_CODE: "XMD",
1337
+ XMD_DECIMALS: 6,
1338
+ findBridgeCoinWalletByXtokenAndChain(xtokenSymbol, chain) {
1339
+ const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin) => bridgeCoin.xtokenSymbol === xtokenSymbol);
1340
+ if (!bridgeCoin) return void 0;
1341
+ const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet) => bridgeWallet.chain === chain);
1342
+ if (!bridgeWallet) return void 0;
1343
+ return {
1344
+ ...bridgeCoin,
1345
+ ...bridgeWallet
1346
+ };
1347
+ },
1348
+ findBridgeCoinWallet(coin, wallet) {
1349
+ const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin) => bridgeCoin.coin === coin);
1350
+ if (!bridgeCoin) return void 0;
1351
+ const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet) => bridgeWallet.wallet === wallet);
1352
+ if (!bridgeWallet) return void 0;
1353
+ return {
1354
+ ...bridgeCoin,
1355
+ ...bridgeWallet
1356
+ };
1357
+ },
1358
+ findBridgeCoinWalletByWallet(wallet) {
1359
+ const matches = [];
1360
+ constants.BRIDGE_COINS.forEach((bridgeCoin) => {
1361
+ bridgeCoin.wallets.forEach((bridgeWallet) => {
1362
+ if (bridgeWallet.wallet === wallet) matches.push({
1363
+ ...bridgeCoin,
1364
+ ...bridgeWallet
1365
+ });
1366
+ });
1367
+ });
1368
+ return matches.length === 1 ? matches[0] : void 0;
1369
+ },
1370
+ findBridgeCoinNetwork(coin, network) {
1371
+ const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin) => bridgeCoin.coin === coin);
1372
+ if (!bridgeCoin) return void 0;
1373
+ const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet) => bridgeWallet.network === network);
1374
+ if (!bridgeWallet) return void 0;
1375
+ return {
1376
+ ...bridgeCoin,
1377
+ ...bridgeWallet
1378
+ };
1379
+ }
1380
+ };
1381
+ return constants;
1382
+ };
1383
+ // src/parsers/auth.ts
1384
+ const createAbstractAuthParser = (contract, action, data) => {
1385
+ return zod.object({
1386
+ signer: authorizationParser,
1387
+ signatures: zod.array(zod.string()).length(1),
1388
+ transaction: singleActionTransactionParser(contract, action, data)
1389
+ });
1390
+ };
1391
+ const generateAuthData = {
1392
+ time: zod.string(),
1393
+ protonAccount: zod.string()
1394
+ };
1395
+ const generateAuthActionsBaseParser = baseActionParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
1396
+ const generateAuthParser = createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
1397
+ // src/parsers/address.ts
1398
+ const addressParser = zod.object({
1399
+ index: zod.number(),
1400
+ account: accountParser,
1401
+ chain: zod.string(),
1402
+ address: zod.string(),
1403
+ address_hash: zod.string()
1404
+ });
1405
+ const generateAddressBodyParser = generateAuthParser.extend({
1406
+ coin: zod.string(),
1407
+ wallet: zod.string()
1408
+ });
1409
+ const generateAddressResponse = zod.object({
1410
+ id: zod.string(),
1411
+ address: zod.string(),
1412
+ coin: zod.string(),
1413
+ wallet: zod.string(),
1414
+ memo: zod.string().optional()
1415
+ });
1416
+ // src/parsers/currency.ts
1417
+ const rateParser = zod.object({
1418
+ counterCurrency: zod.string(),
1419
+ price: zod.number(),
1420
+ priceChangePercent: zod.number(),
1421
+ marketCap: zod.number(),
1422
+ volume: zod.number(),
1423
+ timestamp: zod.number()
1424
+ });
1425
+ const exchangeRateParser = zod.object({
1426
+ contract: zod.string(),
1427
+ symbol: zod.string(),
1428
+ rank: zod.number(),
1429
+ rates: zod.array(rateParser)
1430
+ });
1431
+ const exchangeRatesParser = zod.array(exchangeRateParser);
1432
+ const bloksRatesParser = zod.array(zod.object({
1433
+ contract: zod.string(),
1434
+ symbol: zod.string(),
1435
+ rank: zod.number(),
1436
+ rates: zod.array(rateParser)
1437
+ }));
1438
+ // src/parsers/deposit.ts
1439
+ let Type = /* @__PURE__ */ function(Type) {
1440
+ Type["RECEIVE"] = "receive";
1441
+ Type["SEND"] = "send";
1442
+ return Type;
1443
+ }({});
1444
+ const depositBodyParser = zod.object({
1445
+ id: zod.string(),
1446
+ type: zod.enum(Type),
1447
+ hash: zod.string(),
1448
+ coin: zod.string(),
1449
+ wallet: zod.string(),
1450
+ network: zod.string()
1451
+ });
1452
+ const metalTransactionParser = zod.object({
1453
+ id: zod.string(),
1454
+ wallet: zod.string(),
1455
+ value: zod.number(),
1456
+ valueString: zod.string(),
1457
+ address: zod.string(),
1458
+ type: zod.enum(Type),
1459
+ state: zod.string(),
1460
+ confirmations: zod.number(),
1461
+ hash: zod.string(),
1462
+ blockHash: zod.string().optional().nullable(),
1463
+ blockHeight: zod.number().optional().nullable()
1464
+ });
1465
+ // src/parsers/otc.ts
1466
+ const otcOrderResponseParser = zod.object({
1467
+ success: zod.boolean(),
1468
+ transaction_id: zod.string(),
1469
+ errormsg: zod.string().optional()
1470
+ });
1471
+ const otcQuoteBodyParser = zod.object({
1472
+ baseAmount: zod.number(),
1473
+ baseSymbol: zod.string(),
1474
+ quoteSymbol: zod.string()
1475
+ });
1476
+ const otcQuoteResponseParser = zod.object({
1477
+ success: zod.boolean(),
1478
+ token: zod.string(),
1479
+ qty: zod.number(),
1480
+ errormsg: zod.string().optional()
1481
+ });
1482
+ // src/parsers/withdraw.ts
1483
+ const withdrawData = {
1484
+ from: zod.string().refine((val) => val !== WRAP_CONTRACT, { error: `${WRAP_CONTRACT} must be receiver` }),
1485
+ to: zod.literal(WRAP_CONTRACT),
1486
+ quantity: zod.string(),
1487
+ memo: zod.string()
1488
+ };
1489
+ const withdrawBodyBaseAction = baseActionParser("*", "transfer", withdrawData);
1490
+ const withdrawBodyParser = zod.object({
1491
+ signer: authorizationParser,
1492
+ signatures: zod.array(zod.string()).length(1),
1493
+ transaction: singleActionTransactionParser("*", "transfer", withdrawData),
1494
+ quoteId: zod.string(),
1495
+ provider: zod.string().optional()
1496
+ });
1497
+ const withdrawMetalResponseParser = zod.object({
1498
+ success: zod.boolean(),
1499
+ id: zod.string()
1500
+ });
1501
+ const withdrawalFeeQuoteParser = zod.object({
1502
+ quoteId: zod.string(),
1503
+ estimatedFee: zod.string(),
1504
+ currency: zod.string(),
1505
+ network: zod.string()
1506
+ });
1507
+ // src/parsers/withdrawalHistory.ts
1508
+ const withdrawHistoryMetalSwapParser = zod.object({
1509
+ id: zod.string(),
1510
+ status: zod.string(),
1511
+ amount: zod.string(),
1512
+ currency: zod.string(),
1513
+ network: zod.string(),
1514
+ created: zod.string(),
1515
+ withdrawalAddress: zod.string(),
1516
+ withdrawalHash: zod.string().optional()
1517
+ });
1518
+ const withdrawHistoryMetalResponseParser = zod.object({
1519
+ swaps: zod.array(withdrawHistoryMetalSwapParser),
1520
+ page: zod.number(),
1521
+ pageSize: zod.number(),
1522
+ numberOfElements: zod.number(),
1523
+ totalPages: zod.number(),
1524
+ totalElements: zod.number()
1525
+ });
1526
+ // src/parsers/wrap.ts
1527
+ let Status = /* @__PURE__ */ function(Status) {
1528
+ Status["PENDING"] = "pending";
1529
+ Status["SUCCESS"] = "success";
1530
+ Status["FAIL"] = "fail";
1531
+ Status["PROCESSING"] = "processing";
1532
+ return Status;
1533
+ }({});
1534
+ const wrapStartParser = zod.object({
1535
+ balance: ExtendedAssetParser,
1536
+ id: zod.string(),
1537
+ txid: zod.string(),
1538
+ chain: zod.string(),
1539
+ deposit_address: zod.string(),
1540
+ confirmations: zod.number()
1541
+ });
1542
+ const wrapSetConfParser = zod.object({
1543
+ wrap_hash: zod.string(),
1544
+ confirmations: zod.number()
1545
+ });
1546
+ const wrapParser = zod.object({
1547
+ index: zod.number(),
1548
+ proton_account: zod.string(),
1549
+ balance: ExtendedAssetParser,
1550
+ id: zod.string(),
1551
+ txid: zod.string(),
1552
+ chain: zod.string(),
1553
+ deposit_address: zod.string(),
1554
+ status: zod.enum(Status),
1555
+ finish_txid: zod.string(),
1556
+ wrap_hash: zod.string(),
1557
+ confirmations: zod.number()
1558
+ });
1559
+ // src/parsers/dex.ts
1560
+ const booleanParamSchema = zod.boolean().or(zod.enum(["true", "false"]).transform((value) => value === "true"));
1561
+ const createLimit = (base, max) => zod.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, { error: `Limit must be between 0 and ${max}` });
1562
+ const createOffset = (base) => zod.coerce.number().default(base);
1563
+ const ordinalOrderIdsParser = zod.array(zod.string()).or(zod.string()).optional().transform((oids) => {
1564
+ if (!oids) return [];
1565
+ return Array.isArray(oids) ? oids : [oids];
1566
+ });
1567
+ const marketIdsParser = zod.array(zod.coerce.number()).or(zod.coerce.number()).transform((mids) => Array.isArray(mids) ? mids : [mids]).refine((mids) => mids.length > 0, { error: "Must provide atleast one market ID" });
1568
+ const contractFiltersParser = zod.array(zod.string()).or(zod.string()).optional().transform((oids) => {
1569
+ if (!oids) return [];
1570
+ return Array.isArray(oids) ? oids : [oids];
1571
+ });
1572
+ const sortDirectionEnum = zod.enum(["asc", "desc"]);
1573
+ /**
1574
+ * OHLCV
1575
+ */
1576
+ const ohlcvParser = zod.object({
1577
+ time: zod.number(),
1578
+ open: zod.number(),
1579
+ high: zod.number(),
1580
+ low: zod.number(),
1581
+ close: zod.number(),
1582
+ volume: zod.number(),
1583
+ volume_bid: zod.number(),
1584
+ count: zod.number()
1585
+ });
1586
+ const getOhlcvParser = zod.object({
1587
+ interval: zod.string(),
1588
+ from: zod.string(),
1589
+ to: zod.string(),
1590
+ symbol: zod.string(),
1591
+ limit: createLimit(500, 2e3)
1592
+ });
1593
+ const getOhlcvResponseParser = zod.object({
1594
+ sync: zod.number(),
1595
+ data: zod.array(ohlcvParser)
1596
+ });
1597
+ /**
1598
+ * Order History
1599
+ */
1600
+ const openOrderParser = zod.object({
1601
+ block_time: zod.string(),
1602
+ order_id: zod.string(),
1603
+ ordinal_order_id: zod.string(),
1604
+ market_id: zod.number(),
1605
+ quantity_init: zod.number().optional(),
1606
+ quantity_curr: zod.number(),
1607
+ price: zod.number(),
1608
+ account_name: zod.string(),
1609
+ order_side: zod.number(),
1610
+ order_type: zod.number(),
1611
+ trigger_price: zod.number(),
1612
+ fill_type: zod.number(),
1613
+ status: zod.string(),
1614
+ filled_total: zod.number().optional(),
1615
+ filled_amount: zod.number().optional(),
1616
+ filled_fee: zod.number().optional(),
1617
+ created_at: zod.string(),
1618
+ updated_at: zod.string()
1619
+ });
1620
+ const orderLogParser = zod.object({
1621
+ seq: zod.string(),
1622
+ block_num: zod.string(),
1623
+ block_time: zod.string(),
1624
+ order_id: zod.string(),
1625
+ market_id: zod.number(),
1626
+ quantity: zod.string(),
1627
+ price: zod.string(),
1628
+ account_name: zod.string(),
1629
+ order_side: zod.number(),
1630
+ order_type: zod.number(),
1631
+ trigger_price: zod.string(),
1632
+ fill_type: zod.number(),
1633
+ status: zod.string(),
1634
+ quantity_change: zod.string(),
1635
+ trx_id: zod.string()
1636
+ });
1637
+ const orderHistoryParser = zod.object({
1638
+ block_num: zod.string(),
1639
+ block_time: zod.string(),
1640
+ order_id: zod.string(),
1641
+ ordinal_order_id: zod.string(),
1642
+ market_id: zod.number(),
1643
+ quantity_init: zod.number().optional(),
1644
+ quantity_curr: zod.number(),
1645
+ price: zod.number(),
1646
+ account_name: zod.string(),
1647
+ order_side: zod.number(),
1648
+ order_type: zod.number(),
1649
+ trigger_price: zod.number(),
1650
+ fill_type: zod.number(),
1651
+ status: zod.string(),
1652
+ quantity_change: zod.number(),
1653
+ filled_total: zod.number().optional(),
1654
+ filled_amount: zod.number().optional(),
1655
+ filled_fee: zod.number().optional(),
1656
+ seq: zod.string(),
1657
+ trx_id: zod.string()
1658
+ });
1659
+ const getOpenOrdersParser = zod.object({
1660
+ account: zod.string(),
1661
+ symbol: zod.string().optional(),
1662
+ offset: createOffset(0),
1663
+ limit: createLimit(100, 250),
1664
+ ordinal_order_ids: ordinalOrderIdsParser
1665
+ });
1666
+ const getOpenOrdersResponseParser = zod.object({
1667
+ sync: zod.number(),
1668
+ count: zod.number(),
1669
+ data: zod.array(openOrderParser)
1670
+ });
1671
+ const getOrderHistoryParser = zod.object({
1672
+ account: zod.string(),
1673
+ symbol: zod.string().optional(),
1674
+ offset: createOffset(0),
1675
+ limit: createLimit(100, 250),
1676
+ ordinal_order_ids: ordinalOrderIdsParser,
1677
+ trx_id: zod.string().optional(),
1678
+ status: zod.string().optional()
1679
+ });
1680
+ const getOrderHistoryResponseParser = zod.object({
1681
+ sync: zod.number(),
1682
+ count: zod.number(),
1683
+ data: zod.array(orderHistoryParser)
1684
+ });
1685
+ const getOrderLifecycleParser = zod.object({
1686
+ order_id: zod.string().optional(),
1687
+ ordinal_order_id: zod.string().optional()
1688
+ });
1689
+ const getOrderLifecycleResponseParser = zod.object({
1690
+ sync: zod.number(),
1691
+ data: zod.array(orderHistoryParser)
1692
+ });
1693
+ /**
1694
+ * Submit Order
1695
+ */
1696
+ const postSubmitOrderParser = zod.object({
1697
+ serialized_tx_hex: zod.string(),
1698
+ signatures: zod.array(zod.string())
1699
+ });
1700
+ const postSubmitOrderResponseParser = zod.object({
1701
+ sync: zod.number(),
1702
+ data: zod.object({
1703
+ trx_id: zod.string(),
1704
+ block_time: zod.string(),
1705
+ orders: zod.array(zod.object({
1706
+ ordinal_order_id: zod.string(),
1707
+ order_id: zod.string(),
1708
+ status: zod.string()
1709
+ }))
1710
+ })
1711
+ });
1712
+ /**
1713
+ * Serialize Order
1714
+ */
1715
+ const postSerializeOrderParser = zod.object({ transaction: zod.object({ actions: zod.array(zod.object({
1716
+ account: zod.string(),
1717
+ name: zod.string(),
1718
+ authorization: zod.array(authorizationParser),
1719
+ data: zod.record(zod.string(), zod.any())
1720
+ })) }) });
1721
+ const postSerializeOrderResponseParser = zod.object({ data: zod.object({
1722
+ serialized_tx_hex: zod.string(),
1723
+ digest_hex: zod.string()
1724
+ }) });
1725
+ /**
1726
+ * Depth
1727
+ */
1728
+ const depthParser = zod.object({
1729
+ level: zod.number(),
1730
+ ask: zod.number(),
1731
+ bid: zod.number(),
1732
+ count: zod.number()
1733
+ });
1734
+ const getDepthParser = zod.object({
1735
+ symbol: zod.string(),
1736
+ step: zod.coerce.number(),
1737
+ limit: createLimit(100, 250)
1738
+ });
1739
+ const getDepthResponseParser = zod.object({
1740
+ sync: zod.number(),
1741
+ data: zod.object({
1742
+ bids: zod.array(depthParser),
1743
+ asks: zod.array(depthParser)
1744
+ })
1745
+ });
1746
+ /**
1747
+ * Daily
1748
+ */
1749
+ const dailyParser = zod.object({
1750
+ market_id: zod.number(),
1751
+ symbol: zod.string(),
1752
+ open: zod.number(),
1753
+ high: zod.number(),
1754
+ low: zod.number(),
1755
+ close: zod.number(),
1756
+ volume_bid: zod.number(),
1757
+ volume_ask: zod.number(),
1758
+ change_percentage: zod.number()
1759
+ });
1760
+ const getDailyResponseParser = zod.object({
1761
+ sync: zod.number(),
1762
+ data: zod.array(dailyParser)
1763
+ });
1764
+ /**
1765
+ * Markets
1766
+ */
1767
+ const marketParser = zod.object({
1768
+ market_id: zod.number(),
1769
+ symbol: zod.string(),
1770
+ status_code: zod.number(),
1771
+ type: zod.string(),
1772
+ maker_fee: zod.number(),
1773
+ taker_fee: zod.number(),
1774
+ order_min: zod.number(),
1775
+ bid_token: zod.object({
1776
+ code: zod.string(),
1777
+ precision: zod.number(),
1778
+ contract: zod.string(),
1779
+ multiplier: zod.number()
1780
+ }),
1781
+ ask_token: zod.object({
1782
+ code: zod.string(),
1783
+ precision: zod.number(),
1784
+ contract: zod.string(),
1785
+ multiplier: zod.number()
1786
+ })
1787
+ });
1788
+ const dbMarketParser = zod.object({
1789
+ market_id: zod.number(),
1790
+ order_min: zod.string(),
1791
+ status_code: zod.number(),
1792
+ ask_oracle_index: zod.string(),
1793
+ bid_token_c: zod.string(),
1794
+ bid_token_s: zod.string(),
1795
+ bid_token_m: zod.string(),
1796
+ ask_token_c: zod.string(),
1797
+ ask_token_s: zod.string(),
1798
+ ask_token_m: zod.string(),
1799
+ created_at: zod.date(),
1800
+ updated_at: zod.date()
1801
+ });
1802
+ const getMarketsResponseParser = zod.object({
1803
+ sync: zod.number(),
1804
+ data: zod.array(marketParser)
1805
+ });
1806
+ /**
1807
+ * Trades
1808
+ */
1809
+ const tradeLogParser = zod.object({
1810
+ block_num: zod.string(),
1811
+ block_time: zod.string(),
1812
+ trade_id: zod.string(),
1813
+ market_id: zod.number(),
1814
+ price: zod.string(),
1815
+ bid_user: zod.string(),
1816
+ bid_user_order_id: zod.string(),
1817
+ bid_total: zod.string(),
1818
+ bid_amount: zod.string(),
1819
+ bid_fee: zod.string(),
1820
+ bid_referrer: zod.string(),
1821
+ bid_referrer_fee: zod.string(),
1822
+ ask_user: zod.string(),
1823
+ ask_user_order_id: zod.string(),
1824
+ ask_total: zod.string(),
1825
+ ask_amount: zod.string(),
1826
+ ask_fee: zod.string(),
1827
+ ask_referrer: zod.string(),
1828
+ ask_referrer_fee: zod.string(),
1829
+ order_side: zod.number(),
1830
+ trx_id: zod.string()
1831
+ });
1832
+ const tradeParser = zod.object({
1833
+ block_num: zod.string(),
1834
+ block_time: zod.string(),
1835
+ trade_id: zod.string(),
1836
+ market_id: zod.number(),
1837
+ price: zod.number(),
1838
+ bid_user: zod.string(),
1839
+ bid_user_order_id: zod.string(),
1840
+ bid_user_ordinal_order_id: zod.string(),
1841
+ bid_total: zod.number(),
1842
+ bid_amount: zod.number(),
1843
+ bid_fee: zod.number(),
1844
+ bid_referrer: zod.string(),
1845
+ bid_referrer_fee: zod.number(),
1846
+ ask_user: zod.string(),
1847
+ ask_user_order_id: zod.string(),
1848
+ ask_user_ordinal_order_id: zod.string(),
1849
+ ask_total: zod.number(),
1850
+ ask_amount: zod.number(),
1851
+ ask_fee: zod.number(),
1852
+ ask_referrer: zod.string(),
1853
+ ask_referrer_fee: zod.number(),
1854
+ order_side: zod.number(),
1855
+ trx_id: zod.string()
1856
+ });
1857
+ const getTradesParser = zod.object({
1858
+ symbol: zod.string(),
1859
+ offset: createOffset(0),
1860
+ limit: createLimit(100, 250)
1861
+ });
1862
+ const getTradesResponseParser = zod.object({
1863
+ sync: zod.number(),
1864
+ data: zod.array(tradeParser)
1865
+ });
1866
+ const getTradeHistoryParser = zod.object({
1867
+ account: zod.string(),
1868
+ symbol: zod.string().optional(),
1869
+ offset: createOffset(0),
1870
+ ordinal_order_ids: ordinalOrderIdsParser,
1871
+ limit: createLimit(100, 250)
1872
+ });
1873
+ const getTradeHistoryResponseParser = zod.object({
1874
+ sync: zod.number(),
1875
+ count: zod.number(),
1876
+ data: zod.array(tradeParser)
1877
+ });
1878
+ /**
1879
+ * SYNC
1880
+ */
1881
+ const syncParser = zod.object({
1882
+ sourceid: zod.number(),
1883
+ block_num: zod.string(),
1884
+ block_time: zod.string(),
1885
+ irreversible: zod.string(),
1886
+ is_master: zod.number(),
1887
+ last_updated: zod.string()
1888
+ });
1889
+ const getSyncResponseParser = zod.object({
1890
+ dbSecondsBehind: zod.number(),
1891
+ chronicleSecondsBehind: zod.number(),
1892
+ maxSecondsBehind: zod.number()
1893
+ });
1894
+ /**
1895
+ * Referral Totals
1896
+ */
1897
+ const refferalTotalParser = zod.object({
1898
+ referrer: zod.string(),
1899
+ market_id: zod.number(),
1900
+ bid_fee: zod.number(),
1901
+ bid_total: zod.number(),
1902
+ ask_fee: zod.number(),
1903
+ ask_total: zod.number()
1904
+ });
1905
+ const getReferralTotalsParser = zod.object({ referrer: zod.string() });
1906
+ const getReferralTotalsResponseParser = zod.object({
1907
+ sync: zod.number(),
1908
+ data: zod.array(refferalTotalParser)
1909
+ });
1910
+ /**
1911
+ * Referrals
1912
+ */
1913
+ const refferalParser = zod.object({ referred_user: zod.string() });
1914
+ const getReferralsParser = zod.object({ referrer: zod.string() });
1915
+ const getReferralsResponseParser = zod.object({
1916
+ sync: zod.number(),
1917
+ data: zod.array(refferalParser)
1918
+ });
1919
+ /**
1920
+ * Leaderboard
1921
+ */
1922
+ const leaderboardParser = zod.object({
1923
+ user: zod.string(),
1924
+ total: zod.number()
1925
+ });
1926
+ const getLeaderboardParser = zod.object({
1927
+ market_ids: marketIdsParser,
1928
+ from: zod.string(),
1929
+ to: zod.string(),
1930
+ exclude_zero_fee: booleanParamSchema.prefault("true")
1931
+ });
1932
+ const getLeaderboardResponseParser = zod.object({
1933
+ sync: zod.number(),
1934
+ data: zod.array(leaderboardParser)
1935
+ });
1936
+ /**
1937
+ * History Transaction
1938
+ */
1939
+ const historyPartialParser = zod.object({
1940
+ expiration: zod.object({ utc_seconds: zod.string() }),
1941
+ ref_block_num: zod.string(),
1942
+ ref_block_prefix: zod.string(),
1943
+ max_net_usage_words: zod.string(),
1944
+ max_cpu_usage_ms: zod.string(),
1945
+ delay_sec: zod.string(),
1946
+ transaction_extensions: zod.array(zod.unknown()),
1947
+ signatures: zod.array(zod.string()),
1948
+ context_free_data: zod.array(zod.unknown())
1949
+ });
1950
+ const actParser = zod.object({
1951
+ account: zod.string(),
1952
+ name: zod.string(),
1953
+ authorization: zod.array(authorizationParser),
1954
+ data: zod.any()
1955
+ });
1956
+ const receiptParser = zod.object({
1957
+ receiver: zod.string(),
1958
+ act_digest: zod.string(),
1959
+ global_sequence: zod.string(),
1960
+ recv_sequence: zod.string(),
1961
+ auth_sequence: zod.array(zod.object({
1962
+ account: zod.string(),
1963
+ sequence: zod.string()
1964
+ })),
1965
+ code_sequence: zod.string(),
1966
+ abi_sequence: zod.string()
1967
+ });
1968
+ const actionTraceParser = zod.object({
1969
+ action_ordinal: zod.string(),
1970
+ creator_action_ordinal: zod.string(),
1971
+ receipt: receiptParser,
1972
+ receiver: zod.string(),
1973
+ act: actParser,
1974
+ context_free: zod.string(),
1975
+ elapsed: zod.string(),
1976
+ console: zod.string(),
1977
+ account_ram_deltas: zod.array(accountRamDeltaParser),
1978
+ except: zod.string(),
1979
+ error_code: zod.string().nullable(),
1980
+ return_value: zod.string()
1981
+ });
1982
+ const traceParser = zod.object({
1983
+ id: zod.string(),
1984
+ status: zod.string(),
1985
+ cpu_usage_us: zod.string(),
1986
+ net_usage_words: zod.string(),
1987
+ elapsed: zod.string(),
1988
+ net_usage: zod.string(),
1989
+ scheduled: zod.string(),
1990
+ action_traces: zod.array(actionTraceParser),
1991
+ account_ram_delta: zod.array(accountRamDeltaParser).nullable(),
1992
+ except: zod.string(),
1993
+ error_code: zod.string().nullable(),
1994
+ failed_dtrx_trace: zod.array(zod.unknown()),
1995
+ partial: historyPartialParser
1996
+ });
1997
+ const historyTransactionParser = zod.object({
1998
+ seq: zod.string(),
1999
+ block_num: zod.string(),
2000
+ block_time: zod.string(),
2001
+ trx_id: zod.string(),
2002
+ trace: zod.object({
2003
+ block_num: zod.string(),
2004
+ block_timestamp: zod.string(),
2005
+ trace: traceParser
2006
+ }),
2007
+ irreversible: zod.boolean()
2008
+ });
2009
+ const getHistoryTransactionResponseParser = zod.object({ data: historyTransactionParser.nullable() });
2010
+ const chronicleTransactionParser = zod.object({
2011
+ block_num: zod.string(),
2012
+ block_timestamp: zod.string(),
2013
+ trace: traceParser
2014
+ });
2015
+ const dbHistoryTransactionParser = zod.object({
2016
+ seq: zod.string(),
2017
+ block_num: zod.string(),
2018
+ block_time: zod.string(),
2019
+ trx_id: zod.string(),
2020
+ trace: zod.any()
2021
+ });
2022
+ /**
2023
+ * History Actions
2024
+ */
2025
+ const getHistoryActionsParser = zod.object({
2026
+ account: zod.string().min(1, { error: "account is required" }),
2027
+ contract_filters: contractFiltersParser,
2028
+ account_seq_from: zod.string().optional(),
2029
+ account_seq_to: zod.string().optional(),
2030
+ date_from: zod.string().optional(),
2031
+ date_to: zod.string().optional(),
2032
+ direction: sortDirectionEnum.optional(),
2033
+ limit: createLimit(100, 250)
2034
+ });
2035
+ const historyActionParser = zod.object({
2036
+ block_num: zod.number(),
2037
+ block_time: zod.string(),
2038
+ trx_id: zod.string(),
2039
+ account_action_seq: zod.number(),
2040
+ global_action_seq: zod.number(),
2041
+ action_trace: actionTraceParser,
2042
+ irreversible: zod.boolean()
2043
+ });
2044
+ const getHistoryActionsResponseParser = zod.object({
2045
+ sync: zod.number(),
2046
+ last_irreversible_block_num: zod.number(),
2047
+ data: zod.array(historyActionParser)
2048
+ });
2049
+ /**
2050
+ * History transfers
2051
+ */
2052
+ const getHistoryTransfersParser = zod.object({
2053
+ transfer_from: zod.string().optional(),
2054
+ transfer_to: zod.string().optional(),
2055
+ contract: zod.string().optional(),
2056
+ symbol: zod.string().optional(),
2057
+ amount_precision: zod.string().optional(),
2058
+ amount_min: zod.string().optional(),
2059
+ amount_max: zod.string().optional(),
2060
+ date_from: zod.string().optional(),
2061
+ date_to: zod.string().optional(),
2062
+ global_seq_from: zod.string().optional(),
2063
+ global_seq_to: zod.string().optional(),
2064
+ direction: sortDirectionEnum.optional(),
2065
+ limit: createLimit(100, 250)
2066
+ });
2067
+ const historyTransferParser = zod.object({
2068
+ block_num: zod.number(),
2069
+ block_time: zod.string(),
2070
+ trx_id: zod.string(),
2071
+ account_action_seq: zod.number(),
2072
+ global_action_seq: zod.number(),
2073
+ action_trace: actionTraceParser,
2074
+ irreversible: zod.boolean()
2075
+ });
2076
+ const getHistoryTransfersResponseParser = zod.object({
2077
+ sync: zod.number(),
2078
+ last_irreversible_block_num: zod.number(),
2079
+ data: zod.array(historyTransferParser)
2080
+ });
2081
+ /**
2082
+ * Open orders Balances
2083
+ */
2084
+ const marketOpenOrdersBalanceParser = zod.object({
2085
+ market_id: zod.number(),
2086
+ bid_token_quantity: zod.number(),
2087
+ bid_token: zod.string(),
2088
+ ask_token_quantity: zod.number(),
2089
+ ask_token: zod.string()
2090
+ });
2091
+ const getOpenOrdersBalancesResponseParser = zod.object({
2092
+ sync: zod.number(),
2093
+ data: zod.array(marketOpenOrdersBalanceParser)
2094
+ });
2095
+ /**
2096
+ * Basic Types
2097
+ */
2098
+ let orderType = /* @__PURE__ */ function(orderType) {
2099
+ orderType[orderType["ORDERBOOK"] = 0] = "ORDERBOOK";
2100
+ orderType[orderType["LIMIT"] = 1] = "LIMIT";
2101
+ orderType[orderType["STOPLOSS"] = 2] = "STOPLOSS";
2102
+ orderType[orderType["TAKEPROFIT"] = 3] = "TAKEPROFIT";
2103
+ return orderType;
2104
+ }({});
2105
+ let orderSide = /* @__PURE__ */ function(orderSide) {
2106
+ orderSide[orderSide["INVALID"] = 0] = "INVALID";
2107
+ orderSide[orderSide["BUY"] = 1] = "BUY";
2108
+ orderSide[orderSide["SELL"] = 2] = "SELL";
2109
+ return orderSide;
2110
+ }({});
2111
+ let fillType = /* @__PURE__ */ function(fillType) {
2112
+ fillType[fillType["GTC"] = 0] = "GTC";
2113
+ fillType[fillType["IOC"] = 1] = "IOC";
2114
+ fillType[fillType["POST_ONLY"] = 2] = "POST_ONLY";
2115
+ return fillType;
2116
+ }({});
2117
+ let logStatus = /* @__PURE__ */ function(logStatus) {
2118
+ logStatus["CREATE"] = "create";
2119
+ logStatus["UPDATE"] = "update";
2120
+ logStatus["TRANSFER"] = "transfer";
2121
+ logStatus["CANCEL"] = "cancel";
2122
+ logStatus["DELETE"] = "delete";
2123
+ return logStatus;
2124
+ }({});
2125
+ let ITopics = /* @__PURE__ */ function(ITopics) {
2126
+ ITopics["TRADES"] = "TRADES";
2127
+ ITopics["ORDERS"] = "ORDERS";
2128
+ return ITopics;
2129
+ }({});
2130
+ const TOPICS = {
2131
+ ["TRADES"]: { topic: "TRADES" },
2132
+ ["ORDERS"]: { topic: "ORDERS" }
2133
+ };
2134
+ // src/parsers/login.ts
2135
+ const loginAccountParamsV3Parser = generateAuthParser.extend({
2136
+ email: zod.string().optional(),
2137
+ verificationCode: zod.string().optional()
2138
+ });
2139
+ // src/utils.ts
2140
+ const isSameToken = (token1, token2) => {
2141
+ return token1.xtokenSymbol === token2.xtokenSymbol && token1.xtokenPrecision === token2.xtokenPrecision && token1.xtokenContract === token2.xtokenContract;
2142
+ };
2143
+ const median = (numbers) => {
2144
+ const sorted = numbers.slice().sort((a, b) => a - b);
2145
+ const middle = Math.floor(sorted.length / 2);
2146
+ if (sorted.length % 2 === 0) return (sorted[middle - 1] + sorted[middle]) / 2;
2147
+ return sorted[middle];
2148
+ };
2149
+ // src/graph.ts
2150
+ var INode = class {
2151
+ constructor(key, data) {
2152
+ this.key = key;
2153
+ this.data = {};
2154
+ if (data) this.data = data;
2155
+ }
2156
+ };
2157
+ var ILink = class {
2158
+ constructor(from, to, data) {
2159
+ this.from = from;
2160
+ this.to = to;
2161
+ this.data = {};
2162
+ if (data) this.data = data;
2163
+ }
2164
+ };
2165
+ var Graph = class {
2166
+ constructor() {
2167
+ this.nodes = [];
2168
+ this.links = [];
2169
+ this.lastPathFound = [];
2170
+ this.isEquals = (a, b) => a.key === b.key;
2171
+ }
2172
+ addNode(k, v) {
2173
+ if (!this.findNode(k)) this.nodes.push(new INode(k, v));
2174
+ }
2175
+ addNodes(...nodes) {
2176
+ nodes.forEach((node) => typeof node === "string" ? this.addNode(node) : this.addNode(node[0], node[1]));
2177
+ }
2178
+ findNode(k) {
2179
+ const inode = new INode(k);
2180
+ return this.nodes.find((node) => this.isEquals(node, inode));
2181
+ }
2182
+ findNodes(...keys) {
2183
+ return keys.map((k) => this.findNode(k));
2184
+ }
2185
+ requireFindNodes(...keys) {
2186
+ const nodes = this.findNodes(...keys);
2187
+ if (nodes.some((n) => n === void 0)) throw new Error("One of the nodes does not exist");
2188
+ return nodes;
2189
+ }
2190
+ addLink(nodeA, nodeB, data) {
2191
+ const [inodeA, inodeB] = this.requireFindNodes(nodeA, nodeB);
2192
+ this.links.push(new ILink(inodeA, inodeB, data));
2193
+ }
2194
+ addLinks(...links) {
2195
+ links.forEach((link) => this.addLink(...link));
2196
+ }
2197
+ /**
2198
+ * Get all nodes linked
2199
+ * to from `node`.
2200
+ */
2201
+ findLinkedNodes(node) {
2202
+ return this.links.reduce((acc, link) => {
2203
+ if (this.isEquals(link.from, node)) acc.push(link.to);
2204
+ return acc;
2205
+ }, []);
2206
+ }
2207
+ findAllPaths(from, to) {
2208
+ const allPaths = [];
2209
+ const [fromNode, toNode] = this.requireFindNodes(from, to);
2210
+ const path = [fromNode];
2211
+ let seen = /* @__PURE__ */ new Set();
2212
+ const stuck = (x) => {
2213
+ if (this.isEquals(x, toNode)) return false;
2214
+ for (const y of this.findLinkedNodes(x)) if (!seen.has(y.key)) {
2215
+ seen.add(y.key);
2216
+ if (!stuck(y)) return false;
2217
+ }
2218
+ return true;
2219
+ };
2220
+ const search = (x) => {
2221
+ if (this.isEquals(x, toNode)) {
2222
+ allPaths.push((0, lodash_clonedeep.default)(path));
2223
+ return;
2224
+ }
2225
+ seen = new Set(path.map((p) => p.key));
2226
+ if (stuck(x)) return;
2227
+ for (const y of this.findLinkedNodes(x)) if (!path.includes(y)) {
2228
+ path.push(y);
2229
+ search(y);
2230
+ path.pop();
2231
+ }
2232
+ };
2233
+ search(fromNode);
2234
+ return allPaths;
2235
+ }
2236
+ };
2237
+ // src/math.ts
2238
+ /**
2239
+ * XPR<>XUSDT (XPR -> XUSDT)
2240
+ *
2241
+ * pool1 * pool2
2242
+ * term = pool2 - --------------
2243
+ * pool1 + swap
2244
+ *
2245
+ * result = term - (term * fee)
2246
+ */
2247
+ const compute_transfer = (pool1, pool2, swap, exchange_fee, precision) => {
2248
+ const term1 = pool2;
2249
+ const term2over = pool1.times(pool2);
2250
+ const term2under = pool1.plus(swap);
2251
+ const term2 = term2over.div(term2under).integerValue(bignumber_js.default.ROUND_DOWN);
2252
+ const term = term1.minus(term2);
2253
+ const fee = new bignumber_js.default(exchange_fee).div(FEE_FACTOR);
2254
+ return term.minus(term.times(fee)).integerValue(bignumber_js.default.ROUND_DOWN).shiftedBy(-precision);
2255
+ };
2256
+ const compute_transfer_curve = (reserve_in, reserve_out, amount_in, exchange_fee, precision, amplifier) => {
2257
+ if (amplifier === 0) return compute_transfer(new bignumber_js.default(reserve_in), new bignumber_js.default(reserve_out), new bignumber_js.default(amount_in), exchange_fee, precision);
2258
+ const MAX_ITERATIONS = 10;
2259
+ const sum = reserve_in + reserve_out;
2260
+ let D = sum;
2261
+ let D_prev = 0;
2262
+ const F = (v) => {
2263
+ return (v >= 0 ? 1 : -1) * Math.floor(Math.abs(v));
2264
+ };
2265
+ let i = MAX_ITERATIONS;
2266
+ while (D != D_prev && i--) {
2267
+ const prod1 = F(F(D * D / (reserve_in * 2)) * D / (reserve_out * 2));
2268
+ D_prev = D;
2269
+ D = F(2 * D * (amplifier * sum + prod1) / ((2 * amplifier - 1) * D + 3 * prod1));
2270
+ }
2271
+ const b = reserve_in + amount_in + F(D / (amplifier * 2)) - D;
2272
+ const c = F(F(D * D / ((reserve_in + amount_in) * 2)) * D / (amplifier * 4));
2273
+ let x = D, x_prev = 0;
2274
+ i = MAX_ITERATIONS;
2275
+ while (x != x_prev && i--) {
2276
+ x_prev = F(x);
2277
+ x = +new bignumber_js.default(x * x + c).div(2 * x + b).toFixed(0, bignumber_js.default.ROUND_DOWN);
2278
+ }
2279
+ if (reserve_out <= x) throw new Error("curve: insufficient reserve out");
2280
+ const amount_out_with_fee = new bignumber_js.default(reserve_out - x);
2281
+ const fee = amount_out_with_fee.times(exchange_fee).div(FEE_FACTOR).plus(1).toFixed(0, bignumber_js.default.ROUND_DOWN);
2282
+ return amount_out_with_fee.minus(fee).integerValue(bignumber_js.default.ROUND_DOWN).shiftedBy(-precision);
2283
+ };
2284
+ const compute_liquidity = (amount_lt, pool, lt_supply, precision) => {
2285
+ const over = amount_lt.times(pool);
2286
+ const under = lt_supply;
2287
+ return +over.div(under).integerValue(bignumber_js.default.ROUND_DOWN).shiftedBy(-precision).toFixed(precision, bignumber_js.default.ROUND_DOWN);
2288
+ };
2289
+ const isInputInvalid = (data, value, pool) => {
2290
+ value = String(value);
2291
+ const isBackspace = data === null;
2292
+ const isNumber = !/[0-9]|\./.test(data);
2293
+ const isDoubleDot = data === "." && value.indexOf(".") !== value.length - 1;
2294
+ const isPrecisionTooHigh = value && value.indexOf(".") !== -1 && value.split(".")[1].length > pool.xtokenPrecision;
2295
+ return !isBackspace && Boolean(isNumber || isDoubleDot || isPrecisionTooHigh);
2296
+ };
2297
+ const applyDiscountToFee = (fee, staked) => {
2298
+ if (staked >= 1e7) return fee * 0;
2299
+ else if (staked >= 1e6) return fee * .33;
2300
+ else if (staked >= 1e5) return fee * .66;
2301
+ else return fee;
2302
+ };
2303
+ // src/validation/address.ts
2304
+ /**
2305
+ * Withdrawal destination validation for the bridge (MFE-855).
2306
+ *
2307
+ * The address and memo end up inside the XPR transfer memo as
2308
+ * `coin:network:address[?memo=...]:fee`, which the bridge server splits on ':'.
2309
+ * So beyond per-chain format checks, these validators also reject characters
2310
+ * that would corrupt that structure.
2311
+ *
2312
+ * Result levels:
2313
+ * - 'full' : the chain's address format was fully checked, including its
2314
+ * checksum where the format has one. Formats without a checksum
2315
+ * (Solana keys, EOS names, Hedera ids, single-case EVM) cannot
2316
+ * catch every typo even at this level.
2317
+ * - 'basic' : only the shared safety rules (and partial format checks) ran,
2318
+ * because no complete validator exists for this chain/format.
2319
+ */
2320
+ const MAX_ADDRESS_LENGTH = 128;
2321
+ const MAX_DEFAULT_MEMO_BYTES = 256;
2322
+ const FULL = {
2323
+ valid: true,
2324
+ level: "full"
2325
+ };
2326
+ const BASIC = {
2327
+ valid: true,
2328
+ level: "basic"
2329
+ };
2330
+ const fail = (reason) => ({
2331
+ valid: false,
2332
+ reason
2333
+ });
2334
+ const PRINTABLE_ASCII = /^[\x21-\x7e]+$/;
2335
+ const sharedAddressChecks = (address) => {
2336
+ if (typeof address !== "string" || address.length === 0) return fail("Address is required.");
2337
+ if (address.length > 128) return fail("Address is too long.");
2338
+ if (!PRINTABLE_ASCII.test(address)) return fail("Address contains spaces or unsupported characters.");
2339
+ if (address.includes(":")) return fail("Address must not contain \":\". If you pasted a payment link, paste only the address.");
2340
+ if (address.includes("?")) return fail("Address must not contain \"?\". Use the memo field for memos or tags.");
2341
+ return null;
2342
+ };
2343
+ const tryDecode = (fn) => {
2344
+ try {
2345
+ return fn();
2346
+ } catch {
2347
+ return;
2348
+ }
2349
+ };
2350
+ const bytesEqual = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
2351
+ const allZero = (a) => a.every((v) => v === 0);
2352
+ const UTXO_PARAMS = {
2353
+ ["Bitcoin"]: {
2354
+ name: "Bitcoin",
2355
+ segwitHrp: "bc",
2356
+ base58Versions: [0, 5]
2357
+ },
2358
+ ["Bitcoin (Testnet)"]: {
2359
+ name: "Bitcoin testnet",
2360
+ segwitHrp: "tb",
2361
+ base58Versions: [111, 196]
2362
+ },
2363
+ ["Litecoin"]: {
2364
+ name: "Litecoin",
2365
+ segwitHrp: "ltc",
2366
+ base58Versions: [
2367
+ 48,
2368
+ 50,
2369
+ 5
2370
+ ]
2371
+ },
2372
+ ["Litecoin (Testnet)"]: {
2373
+ name: "Litecoin testnet",
2374
+ segwitHrp: "tltc",
2375
+ base58Versions: [
2376
+ 111,
2377
+ 58,
2378
+ 196
2379
+ ]
2380
+ },
2381
+ ["Dogecoin"]: {
2382
+ name: "Dogecoin",
2383
+ base58Versions: [30, 22]
2384
+ }
2385
+ };
2386
+ const base58check = (0, _scure_base.createBase58check)(_noble_hashes_sha2.sha256);
2387
+ const BECH32_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
2388
+ const validateSegwit = (address, hrp, name) => {
2389
+ if (address.length > 90) return fail(`Not a valid ${name} address.`);
2390
+ const lower = address.toLowerCase();
2391
+ const version = BECH32_CHARSET.indexOf(lower.charAt(hrp.length + 1));
2392
+ if (version < 0) return fail(`Not a valid ${name} address.`);
2393
+ const decoded = tryDecode(() => (version === 0 ? _scure_base.bech32 : _scure_base.bech32m).decode(address, 90));
2394
+ if (!decoded || decoded.prefix !== hrp) return fail(`Not a valid ${name} address (checksum or network mismatch).`);
2395
+ const program = tryDecode(() => _scure_base.bech32.fromWords(decoded.words.slice(1)));
2396
+ if (!program) return fail(`Not a valid ${name} address.`);
2397
+ if (version === 0 && program.length !== 20 && program.length !== 32) return fail(`Not a valid ${name} address.`);
2398
+ if (version === 1 && program.length !== 32) return fail(`Not a valid ${name} address.`);
2399
+ if (version > 1) return fail(`Unsupported ${name} address version.`);
2400
+ return FULL;
2401
+ };
2402
+ const validateUtxo = (address, params) => {
2403
+ const { name, segwitHrp, base58Versions } = params;
2404
+ if (segwitHrp && address.toLowerCase().startsWith(`${segwitHrp}1`)) return validateSegwit(address, segwitHrp, name);
2405
+ const payload = tryDecode(() => base58check.decode(address));
2406
+ if (!payload || payload.length !== 21 || !base58Versions.includes(payload[0])) return fail(`Not a valid ${name} address (checksum or network mismatch).`);
2407
+ return FULL;
2408
+ };
2409
+ const EVM_CHAINS = /* @__PURE__ */ new Set([
2410
+ "Ethereum",
2411
+ "Ethereum (Sepolia)",
2412
+ "Binance (BEP20)",
2413
+ "Polygon",
2414
+ "Avalanche C-Chain",
2415
+ "Metal C-Chain",
2416
+ "Metal C-Chain (Testnet)",
2417
+ "Metal L2",
2418
+ "Metal L2 (Testnet)"
2419
+ ]);
2420
+ const toHex = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
2421
+ const validateHex40 = (hex) => {
2422
+ if (!/^[0-9a-fA-F]{40}$/.test(hex)) return fail("Address must be 0x followed by 40 hexadecimal characters.");
2423
+ if (/^0{40}$/.test(hex)) return fail("Withdrawing to the zero address would burn the funds.");
2424
+ const lower = hex.toLowerCase();
2425
+ if (hex === lower || hex === hex.toUpperCase()) return FULL;
2426
+ const hash = toHex((0, _noble_hashes_sha3.keccak_256)(new TextEncoder().encode(lower)));
2427
+ for (let i = 0; i < 40; i++) {
2428
+ const c = hex[i];
2429
+ if (c >= "0" && c <= "9") continue;
2430
+ const shouldBeUpper = parseInt(hash[i], 16) >= 8;
2431
+ if (c === c.toUpperCase() !== shouldBeUpper) return fail("Address checksum (EIP-55 capitalization) is invalid. Check for a typo.");
2432
+ }
2433
+ return FULL;
2434
+ };
2435
+ const validateEvm = (address) => address.startsWith("0x") ? validateHex40(address.slice(2)) : fail("Address must start with 0x.");
2436
+ const validateXdc = (address) => {
2437
+ if (address.startsWith("xdc") || address.startsWith("0x")) return validateHex40(address.slice(address.startsWith("xdc") ? 3 : 2));
2438
+ return fail("Address must start with xdc or 0x.");
2439
+ };
2440
+ const crc16xmodem = (data) => {
2441
+ let crc = 0;
2442
+ for (const byte of data) {
2443
+ crc ^= byte << 8;
2444
+ for (let i = 0; i < 8; i++) crc = crc & 32768 ? (crc << 1 ^ 4129) & 65535 : crc << 1 & 65535;
2445
+ }
2446
+ return crc;
2447
+ };
2448
+ const STELLAR_KINDS = {
2449
+ G: {
2450
+ length: 56,
2451
+ version: 48,
2452
+ bytes: 35
2453
+ },
2454
+ M: {
2455
+ length: 69,
2456
+ version: 96,
2457
+ bytes: 43
2458
+ }
2459
+ };
2460
+ const validateStellar = (address) => {
2461
+ const kind = STELLAR_KINDS[address[0]];
2462
+ if (!kind || address.length !== kind.length || !/^[A-Z2-7]+$/.test(address)) return fail("Not a valid Stellar address (should start with G and be 56 characters).");
2463
+ const data = tryDecode(() => _scure_base.base32nopad.decode(address));
2464
+ if (!data || data.length !== kind.bytes || data[0] !== kind.version) return fail("Not a valid Stellar address.");
2465
+ const body = data.slice(0, -2);
2466
+ const crc = crc16xmodem(body);
2467
+ if (data[data.length - 2] !== (crc & 255) || data[data.length - 1] !== crc >> 8) return fail("Stellar address checksum is invalid. Check for a typo.");
2468
+ return FULL;
2469
+ };
2470
+ const XRP_BLACKHOLES = [/* @__PURE__ */ new Uint8Array(20), Uint8Array.from([.../* @__PURE__ */ new Uint8Array(19), 1])];
2471
+ const validateXrp = (address) => {
2472
+ if (address.startsWith("X") || address.startsWith("T")) return fail("X-addresses are not supported. Use the classic r-address and put the destination tag in the memo field.");
2473
+ if (!address.startsWith("r") || address.length < 25 || address.length > 35) return fail("Not a valid XRP address.");
2474
+ const data = tryDecode(() => _scure_base.base58xrp.decode(address));
2475
+ if (!data || data.length !== 25 || data[0] !== 0) return fail("Not a valid XRP address.");
2476
+ const checksum = (0, _noble_hashes_sha2.sha256)((0, _noble_hashes_sha2.sha256)(data.slice(0, 21))).slice(0, 4);
2477
+ if (!bytesEqual(checksum, data.slice(21))) return fail("XRP address checksum is invalid. Check for a typo.");
2478
+ const accountId = data.slice(1, 21);
2479
+ if (XRP_BLACKHOLES.some((b) => bytesEqual(b, accountId))) return fail("This XRP address is unspendable (black hole).");
2480
+ return FULL;
2481
+ };
2482
+ const validateSolana = (address) => {
2483
+ if (address.length < 32 || address.length > 44) return fail("Not a valid Solana address.");
2484
+ const key = tryDecode(() => _scure_base.base58.decode(address));
2485
+ if (!key || key.length !== 32) return fail("Not a valid Solana address.");
2486
+ if (allZero(key)) return fail("This is the Solana system program, not a wallet address.");
2487
+ return FULL;
2488
+ };
2489
+ const validateCardano = (address) => {
2490
+ const lower = address.toLowerCase();
2491
+ if (lower.startsWith("addr_test1")) return fail("This is a Cardano testnet address.");
2492
+ if (lower.startsWith("stake")) return fail("This is a Cardano stake (reward) address, not a payment address.");
2493
+ if (lower.startsWith("addr1")) {
2494
+ const decoded = tryDecode(() => _scure_base.bech32.decode(address, 1023));
2495
+ const data = decoded && tryDecode(() => _scure_base.bech32.fromWords(decoded.words));
2496
+ if (!decoded || decoded.prefix !== "addr" || !data || data.length === 0) return fail("Not a valid Cardano address (checksum failed). Check for a typo.");
2497
+ const type = data[0] >> 4;
2498
+ if ((data[0] & 15) !== 1) return fail("This Cardano address is not for mainnet.");
2499
+ return (type <= 3 ? data.length === 57 : type <= 5 ? data.length > 29 : type <= 7 ? data.length === 29 : false) ? FULL : fail("Not a valid Cardano payment address.");
2500
+ }
2501
+ if ((address.startsWith("Ae2") || address.startsWith("DdzFF")) && tryDecode(() => _scure_base.base58.decode(address))) return BASIC;
2502
+ return fail("Not a valid Cardano address.");
2503
+ };
2504
+ const validateEos = (address) => /^[a-z1-5.]{1,12}$/.test(address) && !address.endsWith(".") ? FULL : fail("EOS account names are 1-12 characters: a-z, 1-5 and \".\" (not at the end).");
2505
+ const validateHedera = (address) => {
2506
+ const match = /^0\.0\.(\d{1,19})(-[a-z]{5})?$/.exec(address);
2507
+ if (!match) return fail("Hedera account ids look like 0.0.12345.");
2508
+ return match[2] ? BASIC : FULL;
2509
+ };
2510
+ const VALIDATORS = {
2511
+ ["XDC Network"]: validateXdc,
2512
+ ["Stellar"]: validateStellar,
2513
+ ["Stellar (Testnet)"]: validateStellar,
2514
+ ["Ripple"]: validateXrp,
2515
+ ["Solana"]: validateSolana,
2516
+ ["Cardano"]: validateCardano,
2517
+ ["EOS"]: validateEos,
2518
+ ["EOS (Jungle Testnet)"]: validateEos,
2519
+ ["Hedera (Mainnet)"]: validateHedera,
2520
+ ["Hedera (Testnet)"]: validateHedera
2521
+ };
2522
+ /**
2523
+ * Validate a withdrawal destination address for the given bridge chain
2524
+ * (a `Chains` enum value, i.e. `wallet.chain`). Expects already-trimmed input.
2525
+ * Pure and synchronous, so it is safe to call on every keystroke.
2526
+ */
2527
+ const validateWithdrawAddress = (chain, address) => {
2528
+ const sharedFailure = sharedAddressChecks(address);
2529
+ if (sharedFailure) return sharedFailure;
2530
+ const utxo = UTXO_PARAMS[chain];
2531
+ if (utxo) return validateUtxo(address, utxo);
2532
+ if (EVM_CHAINS.has(chain)) return validateEvm(address);
2533
+ const validator = VALIDATORS[chain];
2534
+ return validator ? validator(address) : BASIC;
2535
+ };
2536
+ const MEMO_BYTE_LIMITS = {
2537
+ ["Stellar"]: 28,
2538
+ ["Stellar (Testnet)"]: 28,
2539
+ ["Hedera (Mainnet)"]: 100,
2540
+ ["Hedera (Testnet)"]: 100
2541
+ };
2542
+ /**
2543
+ * Validate an optional withdrawal memo / destination tag. The memo is appended
2544
+ * to the address as `?memo=...` inside the ':'-delimited bridge memo, so
2545
+ * delimiter and URL-structure characters are rejected on every chain.
2546
+ */
2547
+ const validateWithdrawMemo = (chain, memo) => {
2548
+ if (memo === void 0 || memo === "") return { valid: true };
2549
+ if (typeof memo !== "string") return fail("Memo must be text.");
2550
+ if (/\p{Cc}/u.test(memo)) return fail("Memo contains unsupported characters.");
2551
+ if (/[:?&#=]/.test(memo)) return fail("Memo must not contain : ? & # or =.");
2552
+ if (chain === "Ripple") return /^\d{1,10}$/.test(memo) && Number(memo) <= 4294967295 ? { valid: true } : fail("XRP destination tags must be a whole number between 0 and 4294967295.");
2553
+ const limit = MEMO_BYTE_LIMITS[chain] ?? MAX_DEFAULT_MEMO_BYTES;
2554
+ if (new TextEncoder().encode(memo).length > limit) return fail(`Memo must be at most ${limit} bytes.`);
2555
+ return { valid: true };
2556
+ };
2557
+ // src/validation/withdrawError.ts
2558
+ /**
2559
+ * Turn a failed bridge withdrawal request into a message that is safe to show
2560
+ * to the user (MFE-855).
2561
+ *
2562
+ * Only 4xx responses are treated as user-facing: they describe a problem with
2563
+ * the request (for example an invalid address passed through from Proton Swap).
2564
+ * 5xx responses, network failures and anything unrecognised get a generic
2565
+ * message, so server internals such as stack traces are never displayed and
2566
+ * the raw "AxiosError: Request failed with status code 500" is never shown.
2567
+ *
2568
+ * Duck-typed so it has no axios dependency.
2569
+ */
2570
+ const GENERIC_WITHDRAW_ERROR = "Withdrawal failed. Please check the amount and address and try again.";
2571
+ const MAX_WITHDRAW_ERROR_LENGTH = 200;
2572
+ const sanitize = (raw) => {
2573
+ const cleaned = raw.replace(/[\p{Cc}\s]+/gu, " ").trim();
2574
+ return cleaned.length > 200 ? `${cleaned.slice(0, 199)}…` : cleaned;
2575
+ };
2576
+ const messageFromBody = (data) => {
2577
+ if (typeof data === "string") return data;
2578
+ if (data && typeof data === "object") {
2579
+ const { message, error } = data;
2580
+ if (typeof message === "string") return message;
2581
+ if (typeof error === "string") return error;
2582
+ }
2583
+ };
2584
+ const withdrawErrorMessage = (error) => {
2585
+ const response = error?.response;
2586
+ const status = response?.status;
2587
+ if (typeof status !== "number" || status < 400 || status >= 500) return GENERIC_WITHDRAW_ERROR;
2588
+ const raw = messageFromBody(response?.data);
2589
+ return (raw === void 0 ? "" : sanitize(raw)) || "Withdrawal failed. Please check the amount and address and try again.";
2590
+ };
2591
+ exports.Chains = Chains;
2592
+ exports.ExtendedAssetParser = ExtendedAssetParser;
2593
+ exports.FEE_FACTOR = FEE_FACTOR;
2594
+ exports.GENERIC_WITHDRAW_ERROR = GENERIC_WITHDRAW_ERROR;
2595
+ exports.Graph = Graph;
2596
+ exports.ILink = ILink;
2597
+ exports.INode = INode;
2598
+ exports.ITopics = ITopics;
2599
+ exports.MAX_ADDRESS_LENGTH = MAX_ADDRESS_LENGTH;
2600
+ exports.MAX_WITHDRAW_ERROR_LENGTH = MAX_WITHDRAW_ERROR_LENGTH;
2601
+ exports.Networks = Networks;
2602
+ exports.Providers = Providers;
2603
+ exports.Status = Status;
2604
+ exports.TOPICS = TOPICS;
2605
+ exports.Type = Type;
2606
+ exports.WRAP_AUTH_ACTION = WRAP_AUTH_ACTION;
2607
+ exports.WRAP_CONTRACT = WRAP_CONTRACT;
2608
+ exports.accountParser = accountParser;
2609
+ exports.accountRamDeltaParser = accountRamDeltaParser;
2610
+ exports.actParser = actParser;
2611
+ exports.actionTraceParser = actionTraceParser;
2612
+ exports.addressParser = addressParser;
2613
+ exports.applyDiscountToFee = applyDiscountToFee;
2614
+ exports.authorizationParser = authorizationParser;
2615
+ exports.authorizationsParser = authorizationsParser;
2616
+ exports.baseActionParser = baseActionParser;
2617
+ exports.baseActionSerializedParser = baseActionSerializedParser;
2618
+ exports.bloksRatesParser = bloksRatesParser;
2619
+ exports.chronicleTransactionParser = chronicleTransactionParser;
2620
+ exports.compute_liquidity = compute_liquidity;
2621
+ exports.compute_transfer = compute_transfer;
2622
+ exports.compute_transfer_curve = compute_transfer_curve;
2623
+ exports.createAbstractAuthParser = createAbstractAuthParser;
2624
+ exports.dailyParser = dailyParser;
2625
+ exports.dbHistoryTransactionParser = dbHistoryTransactionParser;
2626
+ exports.dbMarketParser = dbMarketParser;
2627
+ exports.depositBodyParser = depositBodyParser;
2628
+ exports.depthParser = depthParser;
2629
+ exports.exchangeRateParser = exchangeRateParser;
2630
+ exports.exchangeRatesParser = exchangeRatesParser;
2631
+ exports.explorerLinkByChain = explorerLinkByChain;
2632
+ exports.fillType = fillType;
2633
+ exports.generateAddressBodyParser = generateAddressBodyParser;
2634
+ exports.generateAddressResponse = generateAddressResponse;
2635
+ exports.generateAuthActionsBaseParser = generateAuthActionsBaseParser;
2636
+ exports.generateAuthParser = generateAuthParser;
2637
+ exports.getDailyResponseParser = getDailyResponseParser;
2638
+ exports.getDepthParser = getDepthParser;
2639
+ exports.getDepthResponseParser = getDepthResponseParser;
2640
+ exports.getHistoryActionsParser = getHistoryActionsParser;
2641
+ exports.getHistoryActionsResponseParser = getHistoryActionsResponseParser;
2642
+ exports.getHistoryTransactionResponseParser = getHistoryTransactionResponseParser;
2643
+ exports.getHistoryTransfersParser = getHistoryTransfersParser;
2644
+ exports.getHistoryTransfersResponseParser = getHistoryTransfersResponseParser;
2645
+ exports.getLeaderboardParser = getLeaderboardParser;
2646
+ exports.getLeaderboardResponseParser = getLeaderboardResponseParser;
2647
+ exports.getMarketsResponseParser = getMarketsResponseParser;
2648
+ exports.getOhlcvParser = getOhlcvParser;
2649
+ exports.getOhlcvResponseParser = getOhlcvResponseParser;
2650
+ exports.getOpenOrdersBalancesResponseParser = getOpenOrdersBalancesResponseParser;
2651
+ exports.getOpenOrdersParser = getOpenOrdersParser;
2652
+ exports.getOpenOrdersResponseParser = getOpenOrdersResponseParser;
2653
+ exports.getOrderHistoryParser = getOrderHistoryParser;
2654
+ exports.getOrderHistoryResponseParser = getOrderHistoryResponseParser;
2655
+ exports.getOrderLifecycleParser = getOrderLifecycleParser;
2656
+ exports.getOrderLifecycleResponseParser = getOrderLifecycleResponseParser;
2657
+ exports.getReferralTotalsParser = getReferralTotalsParser;
2658
+ exports.getReferralTotalsResponseParser = getReferralTotalsResponseParser;
2659
+ exports.getReferralsParser = getReferralsParser;
2660
+ exports.getReferralsResponseParser = getReferralsResponseParser;
2661
+ exports.getSyncResponseParser = getSyncResponseParser;
2662
+ exports.getTradeHistoryParser = getTradeHistoryParser;
2663
+ exports.getTradeHistoryResponseParser = getTradeHistoryResponseParser;
2664
+ exports.getTradesParser = getTradesParser;
2665
+ exports.getTradesResponseParser = getTradesResponseParser;
2666
+ exports.historyActionParser = historyActionParser;
2667
+ exports.historyPartialParser = historyPartialParser;
2668
+ exports.historyTransactionParser = historyTransactionParser;
2669
+ exports.historyTransferParser = historyTransferParser;
2670
+ exports.initializeCoins = initializeCoins;
2671
+ exports.initializeConstants = initializeConstants;
2672
+ exports.isInputInvalid = isInputInvalid;
2673
+ exports.isSameToken = isSameToken;
2674
+ exports.leaderboardParser = leaderboardParser;
2675
+ exports.logStatus = logStatus;
2676
+ exports.loginAccountParamsV3Parser = loginAccountParamsV3Parser;
2677
+ exports.marketOpenOrdersBalanceParser = marketOpenOrdersBalanceParser;
2678
+ exports.marketParser = marketParser;
2679
+ exports.median = median;
2680
+ exports.metalTransactionParser = metalTransactionParser;
2681
+ exports.ohlcvParser = ohlcvParser;
2682
+ exports.openOrderParser = openOrderParser;
2683
+ exports.orderHistoryParser = orderHistoryParser;
2684
+ exports.orderLogParser = orderLogParser;
2685
+ exports.orderSide = orderSide;
2686
+ exports.orderType = orderType;
2687
+ exports.otcOrderResponseParser = otcOrderResponseParser;
2688
+ exports.otcQuoteBodyParser = otcQuoteBodyParser;
2689
+ exports.otcQuoteResponseParser = otcQuoteResponseParser;
2690
+ exports.postSerializeOrderParser = postSerializeOrderParser;
2691
+ exports.postSerializeOrderResponseParser = postSerializeOrderResponseParser;
2692
+ exports.postSubmitOrderParser = postSubmitOrderParser;
2693
+ exports.postSubmitOrderResponseParser = postSubmitOrderResponseParser;
2694
+ exports.protonExplorerTxUrl = protonExplorerTxUrl;
2695
+ exports.rateParser = rateParser;
2696
+ exports.receiptParser = receiptParser;
2697
+ exports.refferalParser = refferalParser;
2698
+ exports.refferalTotalParser = refferalTotalParser;
2699
+ exports.similarChains = similarChains;
2700
+ exports.singleActionTransactionParser = singleActionTransactionParser;
2701
+ exports.sortDirectionEnum = sortDirectionEnum;
2702
+ exports.syncParser = syncParser;
2703
+ exports.traceParser = traceParser;
2704
+ exports.tradeLogParser = tradeLogParser;
2705
+ exports.tradeParser = tradeParser;
2706
+ exports.validateWithdrawAddress = validateWithdrawAddress;
2707
+ exports.validateWithdrawMemo = validateWithdrawMemo;
2708
+ exports.webauthActionParser = webauthActionParser;
2709
+ exports.withdrawBodyBaseAction = withdrawBodyBaseAction;
2710
+ exports.withdrawBodyParser = withdrawBodyParser;
2711
+ exports.withdrawErrorMessage = withdrawErrorMessage;
2712
+ exports.withdrawHistoryMetalResponseParser = withdrawHistoryMetalResponseParser;
2713
+ exports.withdrawHistoryMetalSwapParser = withdrawHistoryMetalSwapParser;
2714
+ exports.withdrawMetalResponseParser = withdrawMetalResponseParser;
2715
+ exports.withdrawalFeeQuoteParser = withdrawalFeeQuoteParser;
2716
+ exports.wrapParser = wrapParser;
2717
+ exports.wrapSetConfParser = wrapSetConfParser;
2718
+ exports.wrapStartParser = wrapStartParser;