@proton/wrap-constants 0.2.10 → 0.2.14
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/coins.d.ts +5 -0
- package/dist/parsers/dex.d.ts +23 -0
- package/dist/wrap-constants.cjs.development.js +67 -8
- package/dist/wrap-constants.cjs.development.js.map +1 -1
- package/dist/wrap-constants.cjs.production.min.js +1 -1
- package/dist/wrap-constants.cjs.production.min.js.map +1 -1
- package/dist/wrap-constants.esm.js +68 -9
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/coins.ts +50 -0
- package/src/math.ts +8 -8
- package/src/parsers/dex.ts +10 -0
|
@@ -50,6 +50,13 @@ var Networks;
|
|
|
50
50
|
})(Networks || (Networks = {}));
|
|
51
51
|
|
|
52
52
|
var similarChains = (_similarChains = {}, _similarChains[Chains.EthereumMainnet] = [Chains.BinanceBEP20], _similarChains[Chains.BinanceBEP20] = [Chains.EthereumMainnet], _similarChains);
|
|
53
|
+
var Providers;
|
|
54
|
+
|
|
55
|
+
(function (Providers) {
|
|
56
|
+
Providers["FIREBLOCKS"] = "fireblocks";
|
|
57
|
+
Providers["METAL"] = "metal";
|
|
58
|
+
})(Providers || (Providers = {}));
|
|
59
|
+
|
|
53
60
|
var explorerLinkByChain = (_explorerLinkByChain = {}, _explorerLinkByChain[Chains.BitcoinMainnet] = function (txid) {
|
|
54
61
|
return "https://blockchain.com/btc/tx/" + txid;
|
|
55
62
|
}, _explorerLinkByChain[Chains.BitcoinTestnet] = function (txid) {
|
|
@@ -129,6 +136,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
129
136
|
network: Networks.ERC20,
|
|
130
137
|
precision: 4,
|
|
131
138
|
contract: '0xD7EFB00D12C2C13131FD319336FDF952525DA2AF',
|
|
139
|
+
provider: Providers.FIREBLOCKS,
|
|
132
140
|
hasWithdrawMemo: false
|
|
133
141
|
}, {
|
|
134
142
|
wallet: 'XPR-BEP20',
|
|
@@ -137,6 +145,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
137
145
|
network: Networks.BEP20,
|
|
138
146
|
precision: 4,
|
|
139
147
|
contract: '0x5DE3939B2F811A61D830E6F52D13B066881412AB',
|
|
148
|
+
provider: Providers.FIREBLOCKS,
|
|
140
149
|
hasWithdrawMemo: false
|
|
141
150
|
}] : []),
|
|
142
151
|
image: 'https://www.proton.org/images/tokens/eosio-tokenXPR.png',
|
|
@@ -158,6 +167,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
158
167
|
network: Networks.ERC20,
|
|
159
168
|
precision: 6,
|
|
160
169
|
contract: '0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48',
|
|
170
|
+
provider: Providers.FIREBLOCKS,
|
|
161
171
|
hasWithdrawMemo: false
|
|
162
172
|
}, {
|
|
163
173
|
wallet: 'USDC-BEP20',
|
|
@@ -166,6 +176,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
166
176
|
network: Networks.BEP20,
|
|
167
177
|
precision: 18,
|
|
168
178
|
contract: '0x8AC76A51CC950D9822D68B83FE1AD97B32CD580D',
|
|
179
|
+
provider: Providers.FIREBLOCKS,
|
|
169
180
|
hasWithdrawMemo: false
|
|
170
181
|
}, {
|
|
171
182
|
wallet: 'USDC-XLM',
|
|
@@ -174,6 +185,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
174
185
|
network: Networks.XLM,
|
|
175
186
|
precision: 7,
|
|
176
187
|
contract: undefined,
|
|
188
|
+
provider: Providers.FIREBLOCKS,
|
|
177
189
|
hasWithdrawMemo: true
|
|
178
190
|
}] : [], IS_TESTNET ? [{
|
|
179
191
|
wallet: 'USDC',
|
|
@@ -182,6 +194,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
182
194
|
network: Networks.Ropsten,
|
|
183
195
|
precision: 6,
|
|
184
196
|
contract: '0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48',
|
|
197
|
+
provider: Providers.FIREBLOCKS,
|
|
185
198
|
hasWithdrawMemo: false
|
|
186
199
|
}, {
|
|
187
200
|
wallet: 'USDC-XLM',
|
|
@@ -190,6 +203,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
190
203
|
network: Networks.XLM,
|
|
191
204
|
precision: 7,
|
|
192
205
|
contract: undefined,
|
|
206
|
+
provider: Providers.FIREBLOCKS,
|
|
193
207
|
hasWithdrawMemo: true
|
|
194
208
|
}] : []),
|
|
195
209
|
image: 'https://www.proton.org/images/tokens/xtokensXUSDC.png',
|
|
@@ -211,6 +225,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
211
225
|
network: Networks.ERC20,
|
|
212
226
|
precision: 8,
|
|
213
227
|
contract: '0xF433089366899D83A9F26A773D59EC7ECF30355E',
|
|
228
|
+
provider: Providers.FIREBLOCKS,
|
|
214
229
|
hasWithdrawMemo: false
|
|
215
230
|
}] : []),
|
|
216
231
|
image: 'https://www.proton.org/images/tokens/xtokensXMT.png',
|
|
@@ -232,6 +247,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
232
247
|
network: Networks.AVM,
|
|
233
248
|
precision: 9,
|
|
234
249
|
contract: '',
|
|
250
|
+
provider: Providers.METAL,
|
|
235
251
|
hasWithdrawMemo: true
|
|
236
252
|
}] : []),
|
|
237
253
|
image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/metal-chain.png',
|
|
@@ -253,6 +269,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
253
269
|
network: Networks.Mainnet,
|
|
254
270
|
precision: 8,
|
|
255
271
|
contract: undefined,
|
|
272
|
+
provider: Providers.FIREBLOCKS,
|
|
256
273
|
hasWithdrawMemo: false
|
|
257
274
|
}] : [], IS_TESTNET ? [{
|
|
258
275
|
wallet: 'BTC',
|
|
@@ -261,6 +278,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
261
278
|
network: Networks.Testnet,
|
|
262
279
|
precision: 8,
|
|
263
280
|
contract: undefined,
|
|
281
|
+
provider: Providers.FIREBLOCKS,
|
|
264
282
|
hasWithdrawMemo: false
|
|
265
283
|
}] : []),
|
|
266
284
|
image: 'https://www.proton.org/images/tokens/xtokensXBTC.png',
|
|
@@ -282,6 +300,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
282
300
|
network: Networks.Mainnet,
|
|
283
301
|
precision: 18,
|
|
284
302
|
contract: '0x0000000000000000000000000000000000000000',
|
|
303
|
+
provider: Providers.FIREBLOCKS,
|
|
285
304
|
hasWithdrawMemo: false
|
|
286
305
|
}] : [], IS_TESTNET ? [{
|
|
287
306
|
wallet: 'ETH',
|
|
@@ -290,6 +309,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
290
309
|
network: Networks.Ropsten,
|
|
291
310
|
precision: 18,
|
|
292
311
|
contract: '0x0000000000000000000000000000000000000000',
|
|
312
|
+
provider: Providers.FIREBLOCKS,
|
|
293
313
|
hasWithdrawMemo: false
|
|
294
314
|
}] : []),
|
|
295
315
|
image: 'https://www.proton.org/images/tokens/xtokensXETH.png',
|
|
@@ -324,6 +344,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
324
344
|
network: Networks.ERC20,
|
|
325
345
|
precision: 6,
|
|
326
346
|
contract: '0xDAC17F958D2EE523A2206206994597C13D831EC7',
|
|
347
|
+
provider: Providers.FIREBLOCKS,
|
|
327
348
|
hasWithdrawMemo: false
|
|
328
349
|
}] : [], IS_MAINNET ? [{
|
|
329
350
|
wallet: 'USDT-BEP20',
|
|
@@ -332,6 +353,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
332
353
|
network: Networks.BEP20,
|
|
333
354
|
precision: 18,
|
|
334
355
|
contract: '0x55d398326f99059fF775485246999027B3197955',
|
|
356
|
+
provider: Providers.FIREBLOCKS,
|
|
335
357
|
hasWithdrawMemo: false
|
|
336
358
|
}] : [], IS_TESTNET ? [{
|
|
337
359
|
wallet: 'USDT',
|
|
@@ -340,6 +362,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
340
362
|
network: Networks.Ropsten,
|
|
341
363
|
precision: 6,
|
|
342
364
|
contract: '0xDAC17F958D2EE523A2206206994597C13D831EC7',
|
|
365
|
+
provider: Providers.FIREBLOCKS,
|
|
343
366
|
hasWithdrawMemo: false
|
|
344
367
|
}] : []),
|
|
345
368
|
image: 'https://www.proton.org/images/tokens/xtokensXUSDT.png',
|
|
@@ -361,6 +384,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
361
384
|
network: Networks.ERC20,
|
|
362
385
|
precision: 18,
|
|
363
386
|
contract: '0x0000000000085D4780B73119B644AE5ECD22B376',
|
|
387
|
+
provider: Providers.FIREBLOCKS,
|
|
364
388
|
hasWithdrawMemo: false
|
|
365
389
|
}] : []),
|
|
366
390
|
image: 'https://www.proton.org/images/tokens/xtokensXTUSD.png',
|
|
@@ -382,6 +406,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
382
406
|
network: Networks.ERC20,
|
|
383
407
|
precision: 18,
|
|
384
408
|
contract: '0x8E870D67F660D95D5BE530380D0EC0BD388289E1',
|
|
409
|
+
provider: Providers.FIREBLOCKS,
|
|
385
410
|
hasWithdrawMemo: false
|
|
386
411
|
}] : []),
|
|
387
412
|
image: 'https://www.proton.org/images/tokens/xtokensXPAX.png',
|
|
@@ -403,6 +428,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
403
428
|
network: Networks.ERC20,
|
|
404
429
|
precision: 18,
|
|
405
430
|
contract: '0x45804880DE22913DAFE09F4980848ECE6ECBAF78',
|
|
431
|
+
provider: Providers.FIREBLOCKS,
|
|
406
432
|
hasWithdrawMemo: false
|
|
407
433
|
}] : [], IS_TESTNET ? [{
|
|
408
434
|
wallet: 'PAXG',
|
|
@@ -411,6 +437,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
411
437
|
network: Networks.Ropsten,
|
|
412
438
|
precision: 18,
|
|
413
439
|
contract: '0x45804880DE22913DAFE09F4980848ECE6ECBAF78',
|
|
440
|
+
provider: Providers.FIREBLOCKS,
|
|
414
441
|
hasWithdrawMemo: false
|
|
415
442
|
}] : []),
|
|
416
443
|
image: 'https://www.proton.org/images/tokens/xtokensXPAXG.png',
|
|
@@ -471,6 +498,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
471
498
|
network: Networks.ERC20,
|
|
472
499
|
precision: 18,
|
|
473
500
|
contract: '0x1F9840A85D5AF5BF1D1762F925BDADDC4201F984',
|
|
501
|
+
provider: Providers.FIREBLOCKS,
|
|
474
502
|
hasWithdrawMemo: false
|
|
475
503
|
}] : [], IS_TESTNET ? [{
|
|
476
504
|
wallet: 'UNI',
|
|
@@ -479,6 +507,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
479
507
|
network: Networks.Ropsten,
|
|
480
508
|
precision: 18,
|
|
481
509
|
contract: '0x1F9840A85D5AF5BF1D1762F925BDADDC4201F984',
|
|
510
|
+
provider: Providers.FIREBLOCKS,
|
|
482
511
|
hasWithdrawMemo: false
|
|
483
512
|
}] : []),
|
|
484
513
|
image: 'https://www.proton.org/images/tokens/xtokensXUNI.png',
|
|
@@ -500,6 +529,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
500
529
|
network: Networks.ERC20,
|
|
501
530
|
precision: 18,
|
|
502
531
|
contract: '0x111111111117DC0AA78B770FA6A738034120C302',
|
|
532
|
+
provider: Providers.FIREBLOCKS,
|
|
503
533
|
hasWithdrawMemo: false
|
|
504
534
|
}] : []),
|
|
505
535
|
image: 'https://www.proton.org/images/tokens/xtokensXINCH.png',
|
|
@@ -521,6 +551,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
521
551
|
network: Networks.ERC20,
|
|
522
552
|
precision: 18,
|
|
523
553
|
contract: '0x514910771AF9CA656AF840DFF83E8264ECF986CA',
|
|
554
|
+
provider: Providers.FIREBLOCKS,
|
|
524
555
|
hasWithdrawMemo: false
|
|
525
556
|
}] : []),
|
|
526
557
|
image: 'https://www.proton.org/images/tokens/xtokensXLINK.png',
|
|
@@ -542,6 +573,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
542
573
|
network: Networks.Mainnet,
|
|
543
574
|
precision: 8,
|
|
544
575
|
contract: undefined,
|
|
576
|
+
provider: Providers.FIREBLOCKS,
|
|
545
577
|
hasWithdrawMemo: false
|
|
546
578
|
}] : [], IS_TESTNET ? [{
|
|
547
579
|
wallet: 'LTC',
|
|
@@ -550,6 +582,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
550
582
|
network: Networks.Testnet,
|
|
551
583
|
precision: 8,
|
|
552
584
|
contract: undefined,
|
|
585
|
+
provider: Providers.FIREBLOCKS,
|
|
553
586
|
hasWithdrawMemo: false
|
|
554
587
|
}] : []),
|
|
555
588
|
image: 'https://www.proton.org/images/tokens/xtokensXLTC.png',
|
|
@@ -571,6 +604,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
571
604
|
network: Networks.Mainnet,
|
|
572
605
|
precision: 8,
|
|
573
606
|
contract: undefined,
|
|
607
|
+
provider: Providers.FIREBLOCKS,
|
|
574
608
|
hasWithdrawMemo: false
|
|
575
609
|
}] : [], IS_TESTNET ? [{
|
|
576
610
|
wallet: 'BCH',
|
|
@@ -579,6 +613,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
579
613
|
network: Networks.Testnet,
|
|
580
614
|
precision: 8,
|
|
581
615
|
contract: undefined,
|
|
616
|
+
provider: Providers.FIREBLOCKS,
|
|
582
617
|
hasWithdrawMemo: false
|
|
583
618
|
}] : []),
|
|
584
619
|
image: 'https://www.proton.org/images/tokens/xtokensXBCH.png',
|
|
@@ -600,6 +635,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
600
635
|
network: Networks.Mainnet,
|
|
601
636
|
precision: 7,
|
|
602
637
|
contract: undefined,
|
|
638
|
+
provider: Providers.FIREBLOCKS,
|
|
603
639
|
hasWithdrawMemo: true
|
|
604
640
|
}] : [], IS_TESTNET ? [{
|
|
605
641
|
wallet: 'XLM',
|
|
@@ -608,6 +644,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
608
644
|
network: Networks.Testnet,
|
|
609
645
|
precision: 7,
|
|
610
646
|
contract: undefined,
|
|
647
|
+
provider: Providers.FIREBLOCKS,
|
|
611
648
|
hasWithdrawMemo: true
|
|
612
649
|
}] : []),
|
|
613
650
|
image: 'https://www.proton.org/images/tokens/xtokensXXLM.png',
|
|
@@ -642,6 +679,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
642
679
|
network: Networks.Mainnet,
|
|
643
680
|
precision: 10,
|
|
644
681
|
contract: undefined,
|
|
682
|
+
provider: Providers.FIREBLOCKS,
|
|
645
683
|
hasWithdrawMemo: false
|
|
646
684
|
}] : []),
|
|
647
685
|
image: 'https://www.proton.org/images/tokens/xtokensXDOT.png',
|
|
@@ -663,6 +701,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
663
701
|
network: Networks.BEP20,
|
|
664
702
|
precision: 18,
|
|
665
703
|
contract: undefined,
|
|
704
|
+
provider: Providers.FIREBLOCKS,
|
|
666
705
|
hasWithdrawMemo: false
|
|
667
706
|
}] : []),
|
|
668
707
|
image: 'https://www.proton.org/images/tokens/xtokensXBNB.png',
|
|
@@ -684,6 +723,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
684
723
|
network: Networks.BEP20,
|
|
685
724
|
precision: 18,
|
|
686
725
|
contract: '0xe9e7cea3dedca5984780bafc599bd69add087d56',
|
|
726
|
+
provider: Providers.FIREBLOCKS,
|
|
687
727
|
hasWithdrawMemo: false
|
|
688
728
|
}] : []),
|
|
689
729
|
image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/xbusd.png',
|
|
@@ -705,6 +745,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
705
745
|
network: Networks.Mainnet,
|
|
706
746
|
precision: 4,
|
|
707
747
|
contract: undefined,
|
|
748
|
+
provider: Providers.FIREBLOCKS,
|
|
708
749
|
hasWithdrawMemo: true
|
|
709
750
|
}] : [], IS_TESTNET ? [{
|
|
710
751
|
wallet: 'EOS',
|
|
@@ -713,6 +754,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
713
754
|
network: Networks.Testnet,
|
|
714
755
|
precision: 4,
|
|
715
756
|
contract: undefined,
|
|
757
|
+
provider: Providers.FIREBLOCKS,
|
|
716
758
|
hasWithdrawMemo: true
|
|
717
759
|
}] : []),
|
|
718
760
|
image: 'https://www.proton.org/images/tokens/xtokensXEOS.png',
|
|
@@ -734,6 +776,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
734
776
|
network: Networks.Mainnet,
|
|
735
777
|
precision: 8,
|
|
736
778
|
contract: undefined,
|
|
779
|
+
provider: Providers.FIREBLOCKS,
|
|
737
780
|
hasWithdrawMemo: false
|
|
738
781
|
}] : []),
|
|
739
782
|
image: 'https://www.proton.org/images/tokens/xtokensXDOGE.png',
|
|
@@ -755,6 +798,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
755
798
|
network: Networks.Mainnet,
|
|
756
799
|
precision: 6,
|
|
757
800
|
contract: undefined,
|
|
801
|
+
provider: Providers.FIREBLOCKS,
|
|
758
802
|
hasWithdrawMemo: false
|
|
759
803
|
}] : []),
|
|
760
804
|
image: 'https://www.proton.org/images/tokens/xtokensXADA.png',
|
|
@@ -777,6 +821,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
777
821
|
network: Networks.Mainnet,
|
|
778
822
|
precision: 6,
|
|
779
823
|
contract: undefined,
|
|
824
|
+
provider: Providers.FIREBLOCKS,
|
|
780
825
|
hasWithdrawMemo: true
|
|
781
826
|
}] : []),
|
|
782
827
|
image: 'https://www.proton.org/images/tokens/xtokensXLUNA.png',
|
|
@@ -798,6 +843,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
798
843
|
network: Networks.Mainnet,
|
|
799
844
|
precision: 6,
|
|
800
845
|
contract: undefined,
|
|
846
|
+
provider: Providers.FIREBLOCKS,
|
|
801
847
|
hasWithdrawMemo: true
|
|
802
848
|
}] : []),
|
|
803
849
|
image: 'https://www.proton.org/images/tokens/xtokensXUST.png',
|
|
@@ -819,6 +865,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
819
865
|
network: Networks.Mainnet,
|
|
820
866
|
precision: 9,
|
|
821
867
|
contract: undefined,
|
|
868
|
+
provider: Providers.FIREBLOCKS,
|
|
822
869
|
hasWithdrawMemo: false
|
|
823
870
|
}] : []),
|
|
824
871
|
image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/xsol.png',
|
|
@@ -840,6 +887,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
840
887
|
network: Networks.Mainnet,
|
|
841
888
|
precision: 6,
|
|
842
889
|
contract: undefined,
|
|
890
|
+
provider: Providers.FIREBLOCKS,
|
|
843
891
|
hasWithdrawMemo: true
|
|
844
892
|
}] : []),
|
|
845
893
|
image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/xxrp.png',
|
|
@@ -862,6 +910,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
862
910
|
network: Networks.Mainnet,
|
|
863
911
|
precision: 9,
|
|
864
912
|
contract: undefined,
|
|
913
|
+
provider: Providers.FIREBLOCKS,
|
|
865
914
|
hasWithdrawMemo: false
|
|
866
915
|
}] : []),
|
|
867
916
|
image: 'https://www.proton.org/images/tokens/xtokensXAVAX.png',
|
|
@@ -883,6 +932,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
883
932
|
network: Networks.Mainnet,
|
|
884
933
|
precision: 18,
|
|
885
934
|
contract: '0x0000000000000000000000000000000000000000',
|
|
935
|
+
provider: Providers.FIREBLOCKS,
|
|
886
936
|
hasWithdrawMemo: false
|
|
887
937
|
}] : []),
|
|
888
938
|
image: 'https://www.proton.org/images/tokens/xtokensXMATIC.png',
|
|
@@ -904,6 +954,7 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
904
954
|
network: Networks.Testnet,
|
|
905
955
|
precision: 8,
|
|
906
956
|
contract: undefined,
|
|
957
|
+
provider: Providers.FIREBLOCKS,
|
|
907
958
|
hasWithdrawMemo: true
|
|
908
959
|
}] : []),
|
|
909
960
|
image: 'https://www.proton.org/images/tokens/xtokensXHBAR.png',
|
|
@@ -1404,6 +1455,7 @@ var orderHistoryParser = /*#__PURE__*/z.object({
|
|
|
1404
1455
|
});
|
|
1405
1456
|
var getOrderHistoryParser = /*#__PURE__*/z.object({
|
|
1406
1457
|
account: /*#__PURE__*/z.string(),
|
|
1458
|
+
marketId: /*#__PURE__*/z.number().or(numTransform).optional(),
|
|
1407
1459
|
offset: /*#__PURE__*/z.number().or(numTransform)["default"](0),
|
|
1408
1460
|
limit: /*#__PURE__*/z.number().or(numTransform)["default"](100).refine(function (n) {
|
|
1409
1461
|
return n <= 250;
|
|
@@ -1422,6 +1474,13 @@ var getDepthParser = /*#__PURE__*/z.object({
|
|
|
1422
1474
|
return n <= 250;
|
|
1423
1475
|
}, 'Max limit is 250')
|
|
1424
1476
|
});
|
|
1477
|
+
var dailyParser = /*#__PURE__*/z.object({
|
|
1478
|
+
market_id: /*#__PURE__*/z.number(),
|
|
1479
|
+
first: /*#__PURE__*/z.number(),
|
|
1480
|
+
last: /*#__PURE__*/z.number(),
|
|
1481
|
+
bid: /*#__PURE__*/z.number(),
|
|
1482
|
+
ask: /*#__PURE__*/z.number()
|
|
1483
|
+
});
|
|
1425
1484
|
var tradeParser = /*#__PURE__*/z.object({
|
|
1426
1485
|
block_num: /*#__PURE__*/z.number(),
|
|
1427
1486
|
block_time: /*#__PURE__*/z.string(),
|
|
@@ -1710,12 +1769,12 @@ var Graph = /*#__PURE__*/function () {
|
|
|
1710
1769
|
|
|
1711
1770
|
var compute_transfer = function compute_transfer(pool1, pool2, swap, exchange_fee, precision) {
|
|
1712
1771
|
var term1 = pool2;
|
|
1713
|
-
var term2over = pool1.
|
|
1772
|
+
var term2over = pool1.times(pool2);
|
|
1714
1773
|
var term2under = pool1.plus(swap);
|
|
1715
|
-
var term2 = term2over.
|
|
1774
|
+
var term2 = term2over.div(term2under).integerValue(BigNumber.ROUND_DOWN);
|
|
1716
1775
|
var term = term1.minus(term2);
|
|
1717
|
-
var fee = new BigNumber(exchange_fee).
|
|
1718
|
-
var result = term.minus(term.
|
|
1776
|
+
var fee = new BigNumber(exchange_fee).div(FEE_FACTOR);
|
|
1777
|
+
var result = term.minus(term.times(fee));
|
|
1719
1778
|
return result.integerValue(BigNumber.ROUND_DOWN).shiftedBy(-precision);
|
|
1720
1779
|
};
|
|
1721
1780
|
var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve_out, amount_in, exchange_fee, precision, amplifier) {
|
|
@@ -1748,7 +1807,7 @@ var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve
|
|
|
1748
1807
|
|
|
1749
1808
|
while (x != x_prev && i--) {
|
|
1750
1809
|
x_prev = F(x);
|
|
1751
|
-
x = +new BigNumber(x * x + c).
|
|
1810
|
+
x = +new BigNumber(x * x + c).div(2 * x + b).toFixed(0, BigNumber.ROUND_DOWN);
|
|
1752
1811
|
}
|
|
1753
1812
|
|
|
1754
1813
|
if (reserve_out <= x) {
|
|
@@ -1759,15 +1818,15 @@ var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve
|
|
|
1759
1818
|
var amount_out_with_fee = new BigNumber(reserve_out - x); // Fee + 1
|
|
1760
1819
|
// +1 covers small precision issues
|
|
1761
1820
|
|
|
1762
|
-
var fee = amount_out_with_fee.
|
|
1821
|
+
var fee = amount_out_with_fee.times(exchange_fee).div(FEE_FACTOR).plus(1).toFixed(0, BigNumber.ROUND_DOWN); // Amount out
|
|
1763
1822
|
|
|
1764
1823
|
var amount_out = amount_out_with_fee.minus(fee);
|
|
1765
1824
|
return amount_out.integerValue(BigNumber.ROUND_DOWN).shiftedBy(-precision);
|
|
1766
1825
|
};
|
|
1767
1826
|
var compute_liquidity = function compute_liquidity(amount_lt, pool, lt_supply, precision) {
|
|
1768
|
-
var over = amount_lt.
|
|
1827
|
+
var over = amount_lt.times(pool);
|
|
1769
1828
|
var under = lt_supply;
|
|
1770
|
-
var result = over.
|
|
1829
|
+
var result = over.div(under).integerValue(BigNumber.ROUND_DOWN);
|
|
1771
1830
|
return +result.shiftedBy(-precision).toFixed(precision, BigNumber.ROUND_DOWN);
|
|
1772
1831
|
};
|
|
1773
1832
|
var isInputInvalid = function isInputInvalid(data, value, pool) {
|
|
@@ -1791,5 +1850,5 @@ var applyDiscountToFee = function applyDiscountToFee(fee, staked) {
|
|
|
1791
1850
|
}
|
|
1792
1851
|
};
|
|
1793
1852
|
|
|
1794
|
-
export { Chains, ExtendedAssetParser, FEE_FACTOR, Graph, ILink, INode, ITopics, Networks, Status, TOPICS, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDepthParser, getOhlcvParser, getOrderHistoryParser, getTradesParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, logStatus, median, ohlcvParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, similarChains, singleActionTransactionParser, syncParser, tradeParser, transactionParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
|
|
1853
|
+
export { Chains, ExtendedAssetParser, FEE_FACTOR, Graph, ILink, INode, ITopics, Networks, Providers, Status, TOPICS, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, dailyParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDepthParser, getOhlcvParser, getOrderHistoryParser, getTradesParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, logStatus, median, ohlcvParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, similarChains, singleActionTransactionParser, syncParser, tradeParser, transactionParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
|
|
1795
1854
|
//# sourceMappingURL=wrap-constants.esm.js.map
|