@proton/wrap-constants 0.0.32 → 0.0.36
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 +1 -0
- package/dist/parsers/actions.d.ts +887 -0
- package/dist/parsers/address.d.ts +473 -0
- package/dist/parsers/auth.d.ts +904 -0
- package/dist/parsers/base.d.ts +32 -0
- package/dist/parsers/currency.d.ts +101 -0
- package/dist/parsers/deposit.d.ts +49 -0
- package/dist/parsers/index.d.ts +10 -0
- package/dist/parsers/otc.d.ts +39 -0
- package/dist/parsers/withdraw.d.ts +537 -0
- package/dist/parsers/withdrawalHistory.d.ts +70 -0
- package/dist/parsers/wrap.d.ts +85 -0
- package/dist/wrap-constants.cjs.development.js +224 -219
- 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 +224 -224
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/coins.ts +51 -25
- package/src/parsers/actions.ts +68 -0
- package/src/parsers/address.ts +27 -0
- package/src/parsers/auth.ts +23 -0
- package/src/parsers/base.ts +18 -0
- package/src/parsers/currency.ts +31 -0
- package/src/parsers/deposit.ts +30 -0
- package/src/parsers/index.ts +10 -0
- package/src/parsers/otc.ts +23 -0
- package/src/parsers/withdraw.ts +39 -0
- package/src/parsers/withdrawalHistory.ts +23 -0
- package/src/parsers/wrap.ts +41 -0
- package/dist/parsers.d.ts +0 -1881
- package/src/parsers.ts +0 -334
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { string, object, array, number, any, nativeEnum, boolean
|
|
1
|
+
import { string, object, array, literal, number, any, nativeEnum, boolean } from 'zod';
|
|
2
2
|
|
|
3
3
|
var _similarChains, _explorerLinkByChain;
|
|
4
4
|
|
|
@@ -113,7 +113,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
113
113
|
contract: '0x5DE3939B2F811A61D830E6F52D13B066881412AB',
|
|
114
114
|
hasWithdrawMemo: false
|
|
115
115
|
}] : []),
|
|
116
|
-
image: '/img/tokens/xpr.png'
|
|
116
|
+
image: '/img/tokens/xpr.png',
|
|
117
|
+
coingeckoId: 'proton'
|
|
117
118
|
}, {
|
|
118
119
|
allowSwap: true,
|
|
119
120
|
allowBridge: true,
|
|
@@ -157,7 +158,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
157
158
|
contract: '0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48',
|
|
158
159
|
hasWithdrawMemo: false
|
|
159
160
|
}] : []),
|
|
160
|
-
image: '/img/tokens/xusdc.png'
|
|
161
|
+
image: '/img/tokens/xusdc.png',
|
|
162
|
+
coingeckoId: 'usd-coin'
|
|
161
163
|
}, {
|
|
162
164
|
allowSwap: true,
|
|
163
165
|
allowBridge: IS_MAINNET,
|
|
@@ -177,7 +179,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
177
179
|
contract: '0xF433089366899D83A9F26A773D59EC7ECF30355E',
|
|
178
180
|
hasWithdrawMemo: false
|
|
179
181
|
}] : []),
|
|
180
|
-
image: '/img/tokens/xmt.png'
|
|
182
|
+
image: '/img/tokens/xmt.png',
|
|
183
|
+
coingeckoId: 'metal'
|
|
181
184
|
}, {
|
|
182
185
|
allowSwap: true,
|
|
183
186
|
allowBridge: true,
|
|
@@ -205,7 +208,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
205
208
|
contract: undefined,
|
|
206
209
|
hasWithdrawMemo: false
|
|
207
210
|
}] : []),
|
|
208
|
-
image: '/img/tokens/xbtc.png'
|
|
211
|
+
image: '/img/tokens/xbtc.png',
|
|
212
|
+
coingeckoId: 'bitcoin'
|
|
209
213
|
}, {
|
|
210
214
|
allowSwap: true,
|
|
211
215
|
allowBridge: true,
|
|
@@ -233,7 +237,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
233
237
|
contract: '0x0000000000000000000000000000000000000000',
|
|
234
238
|
hasWithdrawMemo: false
|
|
235
239
|
}] : []),
|
|
236
|
-
image: '/img/tokens/xeth.png'
|
|
240
|
+
image: '/img/tokens/xeth.png',
|
|
241
|
+
coingeckoId: 'ethereum'
|
|
237
242
|
}, {
|
|
238
243
|
allowSwap: IS_MAINNET,
|
|
239
244
|
allowBridge: true,
|
|
@@ -261,7 +266,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
261
266
|
contract: '0xDAC17F958D2EE523A2206206994597C13D831EC7',
|
|
262
267
|
hasWithdrawMemo: false
|
|
263
268
|
}] : []),
|
|
264
|
-
image: '/img/tokens/xusdt.png'
|
|
269
|
+
image: '/img/tokens/xusdt.png',
|
|
270
|
+
coingeckoId: 'tether'
|
|
265
271
|
}, {
|
|
266
272
|
allowSwap: false,
|
|
267
273
|
allowBridge: IS_MAINNET,
|
|
@@ -281,7 +287,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
281
287
|
contract: '0x0000000000085D4780B73119B644AE5ECD22B376',
|
|
282
288
|
hasWithdrawMemo: false
|
|
283
289
|
}] : []),
|
|
284
|
-
image: '/img/tokens/xtusd.png'
|
|
290
|
+
image: '/img/tokens/xtusd.png',
|
|
291
|
+
coingeckoId: 'true-usd'
|
|
285
292
|
}, {
|
|
286
293
|
allowSwap: false,
|
|
287
294
|
allowBridge: IS_MAINNET,
|
|
@@ -301,7 +308,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
301
308
|
contract: '0x8E870D67F660D95D5BE530380D0EC0BD388289E1',
|
|
302
309
|
hasWithdrawMemo: false
|
|
303
310
|
}] : []),
|
|
304
|
-
image: '/img/tokens/xpax.png'
|
|
311
|
+
image: '/img/tokens/xpax.png',
|
|
312
|
+
coingeckoId: 'usdp'
|
|
305
313
|
}, {
|
|
306
314
|
allowSwap: false,
|
|
307
315
|
allowBridge: true,
|
|
@@ -329,7 +337,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
329
337
|
contract: '0x45804880DE22913DAFE09F4980848ECE6ECBAF78',
|
|
330
338
|
hasWithdrawMemo: false
|
|
331
339
|
}] : []),
|
|
332
|
-
image: '/img/tokens/xpaxg.png'
|
|
340
|
+
image: '/img/tokens/xpaxg.png',
|
|
341
|
+
coingeckoId: 'pax-gold'
|
|
333
342
|
}, {
|
|
334
343
|
allowSwap: IS_MAINNET,
|
|
335
344
|
allowBridge: true,
|
|
@@ -357,7 +366,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
357
366
|
contract: '0x1F9840A85D5AF5BF1D1762F925BDADDC4201F984',
|
|
358
367
|
hasWithdrawMemo: false
|
|
359
368
|
}] : []),
|
|
360
|
-
image: '/img/tokens/xuni.png'
|
|
369
|
+
image: '/img/tokens/xuni.png',
|
|
370
|
+
coingeckoId: 'uniswap'
|
|
361
371
|
}, {
|
|
362
372
|
allowSwap: false,
|
|
363
373
|
allowBridge: false,
|
|
@@ -377,7 +387,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
377
387
|
contract: '0x111111111117DC0AA78B770FA6A738034120C302',
|
|
378
388
|
hasWithdrawMemo: false
|
|
379
389
|
}] : []),
|
|
380
|
-
image: '/img/tokens/xinch.png'
|
|
390
|
+
image: '/img/tokens/xinch.png',
|
|
391
|
+
coingeckoId: '1inch'
|
|
381
392
|
}, {
|
|
382
393
|
allowSwap: false,
|
|
383
394
|
allowBridge: false,
|
|
@@ -397,7 +408,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
397
408
|
contract: '0x514910771AF9CA656AF840DFF83E8264ECF986CA',
|
|
398
409
|
hasWithdrawMemo: false
|
|
399
410
|
}] : []),
|
|
400
|
-
image: '/img/tokens/xlink.png'
|
|
411
|
+
image: '/img/tokens/xlink.png',
|
|
412
|
+
coingeckoId: 'chainlink'
|
|
401
413
|
}, {
|
|
402
414
|
allowSwap: IS_MAINNET,
|
|
403
415
|
allowBridge: true,
|
|
@@ -425,7 +437,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
425
437
|
contract: undefined,
|
|
426
438
|
hasWithdrawMemo: false
|
|
427
439
|
}] : []),
|
|
428
|
-
image: '/img/tokens/xltc.png'
|
|
440
|
+
image: '/img/tokens/xltc.png',
|
|
441
|
+
coingeckoId: 'litecoin'
|
|
429
442
|
}, {
|
|
430
443
|
allowSwap: IS_MAINNET,
|
|
431
444
|
allowBridge: true,
|
|
@@ -453,7 +466,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
453
466
|
contract: undefined,
|
|
454
467
|
hasWithdrawMemo: false
|
|
455
468
|
}] : []),
|
|
456
|
-
image: '/img/tokens/xbch.png'
|
|
469
|
+
image: '/img/tokens/xbch.png',
|
|
470
|
+
coingeckoId: 'bitcoin-cash'
|
|
457
471
|
}, {
|
|
458
472
|
allowSwap: false,
|
|
459
473
|
allowBridge: false,
|
|
@@ -481,7 +495,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
481
495
|
contract: undefined,
|
|
482
496
|
hasWithdrawMemo: true
|
|
483
497
|
}] : []),
|
|
484
|
-
image: '/img/tokens/xxlm.png'
|
|
498
|
+
image: '/img/tokens/xxlm.png',
|
|
499
|
+
coingeckoId: 'stellar'
|
|
485
500
|
}, {
|
|
486
501
|
allowSwap: IS_MAINNET,
|
|
487
502
|
allowBridge: false,
|
|
@@ -493,7 +508,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
493
508
|
xtokenPrecision: 4,
|
|
494
509
|
xtokenContract: 'sense',
|
|
495
510
|
wallets: [],
|
|
496
|
-
image: '/img/tokens/xsense.png'
|
|
511
|
+
image: '/img/tokens/xsense.png',
|
|
512
|
+
coingeckoId: 'sense'
|
|
497
513
|
}, {
|
|
498
514
|
allowSwap: false,
|
|
499
515
|
allowBridge: false,
|
|
@@ -513,7 +529,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
513
529
|
contract: undefined,
|
|
514
530
|
hasWithdrawMemo: false
|
|
515
531
|
}] : []),
|
|
516
|
-
image: '/img/tokens/xdot.png'
|
|
532
|
+
image: '/img/tokens/xdot.png',
|
|
533
|
+
coingeckoId: 'polkadot'
|
|
517
534
|
}, {
|
|
518
535
|
allowSwap: true,
|
|
519
536
|
allowBridge: IS_MAINNET,
|
|
@@ -533,7 +550,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
533
550
|
contract: undefined,
|
|
534
551
|
hasWithdrawMemo: false
|
|
535
552
|
}] : []),
|
|
536
|
-
image: '/img/tokens/xbnb.png'
|
|
553
|
+
image: '/img/tokens/xbnb.png',
|
|
554
|
+
coingeckoId: 'binancecoin'
|
|
537
555
|
}, {
|
|
538
556
|
allowSwap: true,
|
|
539
557
|
allowBridge: true,
|
|
@@ -561,7 +579,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
561
579
|
contract: undefined,
|
|
562
580
|
hasWithdrawMemo: true
|
|
563
581
|
}] : []),
|
|
564
|
-
image: '/img/tokens/xeos.png'
|
|
582
|
+
image: '/img/tokens/xeos.png',
|
|
583
|
+
coingeckoId: 'eos'
|
|
565
584
|
}, {
|
|
566
585
|
allowSwap: false,
|
|
567
586
|
allowBridge: IS_TESTNET,
|
|
@@ -581,7 +600,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
581
600
|
contract: undefined,
|
|
582
601
|
hasWithdrawMemo: false
|
|
583
602
|
}] : []),
|
|
584
|
-
image: '/img/tokens/xhbar.png'
|
|
603
|
+
image: '/img/tokens/xhbar.png',
|
|
604
|
+
coingeckoId: 'hedera-hashgraph'
|
|
585
605
|
}, // Synthethic
|
|
586
606
|
{
|
|
587
607
|
allowSwap: IS_MAINNET,
|
|
@@ -602,7 +622,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
602
622
|
contract: undefined,
|
|
603
623
|
hasWithdrawMemo: false
|
|
604
624
|
}] : []),
|
|
605
|
-
image: '/img/tokens/xdoge.png'
|
|
625
|
+
image: '/img/tokens/xdoge.png',
|
|
626
|
+
coingeckoId: 'dogecoin'
|
|
606
627
|
}, {
|
|
607
628
|
allowSwap: IS_MAINNET,
|
|
608
629
|
allowBridge: IS_MAINNET,
|
|
@@ -622,7 +643,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
622
643
|
contract: undefined,
|
|
623
644
|
hasWithdrawMemo: false
|
|
624
645
|
}] : []),
|
|
625
|
-
image: '/img/tokens/xada.png'
|
|
646
|
+
image: '/img/tokens/xada.png',
|
|
647
|
+
coingeckoId: 'cardano'
|
|
626
648
|
}, {
|
|
627
649
|
allowSwap: false,
|
|
628
650
|
allowBridge: false,
|
|
@@ -634,7 +656,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
634
656
|
xtokenPrecision: 6,
|
|
635
657
|
xtokenContract: 'xtokens',
|
|
636
658
|
wallets: [],
|
|
637
|
-
image: '/img/tokens/xtheta.png'
|
|
659
|
+
image: '/img/tokens/xtheta.png',
|
|
660
|
+
coingeckoId: 'theta-token'
|
|
638
661
|
}, {
|
|
639
662
|
allowSwap: false,
|
|
640
663
|
allowBridge: false,
|
|
@@ -646,7 +669,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
646
669
|
xtokenPrecision: 6,
|
|
647
670
|
xtokenContract: 'xtokens',
|
|
648
671
|
wallets: [],
|
|
649
|
-
image: '/img/tokens/xfil.png'
|
|
672
|
+
image: '/img/tokens/xfil.png',
|
|
673
|
+
coingeckoId: 'filecoin'
|
|
650
674
|
}, {
|
|
651
675
|
allowSwap: false,
|
|
652
676
|
allowBridge: false,
|
|
@@ -658,7 +682,8 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
658
682
|
xtokenPrecision: 6,
|
|
659
683
|
xtokenContract: 'xtokens',
|
|
660
684
|
wallets: [],
|
|
661
|
-
image: '/img/tokens/xtrx.png'
|
|
685
|
+
image: '/img/tokens/xtrx.png',
|
|
686
|
+
coingeckoId: 'tron'
|
|
662
687
|
}]; // Validation
|
|
663
688
|
|
|
664
689
|
var walletWithDuplicateChains = coins.find(function (coin) {
|
|
@@ -695,6 +720,79 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
695
720
|
};
|
|
696
721
|
};
|
|
697
722
|
|
|
723
|
+
var accountParser = /*#__PURE__*/string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
|
|
724
|
+
var authorizationParser = /*#__PURE__*/object({
|
|
725
|
+
actor: accountParser,
|
|
726
|
+
permission: /*#__PURE__*/string()
|
|
727
|
+
});
|
|
728
|
+
var authorizationsParser = /*#__PURE__*/array(authorizationParser).min(1);
|
|
729
|
+
var ExtendedAssetParser = /*#__PURE__*/object({
|
|
730
|
+
quantity: /*#__PURE__*/string(),
|
|
731
|
+
contract: accountParser
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
var rawTransactionParser = /*#__PURE__*/object({
|
|
735
|
+
expiration: /*#__PURE__*/string(),
|
|
736
|
+
ref_block_num: /*#__PURE__*/number(),
|
|
737
|
+
ref_block_prefix: /*#__PURE__*/number(),
|
|
738
|
+
max_net_usage_words: /*#__PURE__*/number(),
|
|
739
|
+
max_cpu_usage_ms: /*#__PURE__*/number(),
|
|
740
|
+
delay_sec: /*#__PURE__*/number(),
|
|
741
|
+
context_free_actions: /*#__PURE__*/array( /*#__PURE__*/any()),
|
|
742
|
+
transaction_extensions: /*#__PURE__*/array( /*#__PURE__*/any())
|
|
743
|
+
});
|
|
744
|
+
var baseActionParser = function baseActionParser(contract, action, data) {
|
|
745
|
+
return object({
|
|
746
|
+
account: contract === '*' ? accountParser : literal(contract),
|
|
747
|
+
name: literal(action),
|
|
748
|
+
data: object(data),
|
|
749
|
+
authorization: authorizationsParser
|
|
750
|
+
});
|
|
751
|
+
};
|
|
752
|
+
var baseActionSerializedParser = function baseActionSerializedParser(contract, action, data) {
|
|
753
|
+
return object({
|
|
754
|
+
account: contract === '*' ? accountParser : literal(contract),
|
|
755
|
+
name: literal(action),
|
|
756
|
+
data: string().or(object(data)),
|
|
757
|
+
authorization: authorizationsParser
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
var webauthActionParser = function webauthActionParser(contract, action, data) {
|
|
761
|
+
return object({
|
|
762
|
+
account: literal('webauthn'),
|
|
763
|
+
name: literal('exec'),
|
|
764
|
+
data: object({
|
|
765
|
+
account: accountParser,
|
|
766
|
+
key: object({
|
|
767
|
+
key: array(string().or(object({
|
|
768
|
+
modulus: string(),
|
|
769
|
+
exponent: string()
|
|
770
|
+
}))),
|
|
771
|
+
user_presence: number(),
|
|
772
|
+
rpid: string()
|
|
773
|
+
}),
|
|
774
|
+
nonce: number(),
|
|
775
|
+
permissions: authorizationsParser,
|
|
776
|
+
signature: object({
|
|
777
|
+
auth_data: string(),
|
|
778
|
+
client_json: string(),
|
|
779
|
+
signature: string()
|
|
780
|
+
}),
|
|
781
|
+
trx: rawTransactionParser.merge(object({
|
|
782
|
+
actions: array(baseActionSerializedParser(contract, action, data)).length(1)
|
|
783
|
+
}))
|
|
784
|
+
}),
|
|
785
|
+
authorization: authorizationsParser
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
var singleActionTransactionParser = function singleActionTransactionParser(contract, action, data) {
|
|
789
|
+
var baseAction = baseActionParser(contract, action, data);
|
|
790
|
+
var webauthAction = webauthActionParser(contract, action, data);
|
|
791
|
+
return rawTransactionParser.merge(object({
|
|
792
|
+
actions: array(baseAction.or(webauthAction)).length(1)
|
|
793
|
+
}));
|
|
794
|
+
};
|
|
795
|
+
|
|
698
796
|
function _extends() {
|
|
699
797
|
_extends = Object.assign || function (target) {
|
|
700
798
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -808,87 +906,25 @@ var initializeConstants = function initializeConstants(chain) {
|
|
|
808
906
|
return constants;
|
|
809
907
|
};
|
|
810
908
|
|
|
811
|
-
var
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
(
|
|
823
|
-
Type["RECEIVE"] = "receive";
|
|
824
|
-
Type["SEND"] = "send";
|
|
825
|
-
})(Type || (Type = {}));
|
|
909
|
+
var createAbstractAuthParser = function createAbstractAuthParser(contract, action, data) {
|
|
910
|
+
return object({
|
|
911
|
+
signer: authorizationParser,
|
|
912
|
+
signatures: array(string()).length(1),
|
|
913
|
+
transaction: singleActionTransactionParser(contract, action, data)
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
var generateAuthData = {
|
|
917
|
+
time: /*#__PURE__*/string(),
|
|
918
|
+
protonAccount: /*#__PURE__*/string()
|
|
919
|
+
};
|
|
920
|
+
var generateAuthParser = /*#__PURE__*/createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
|
|
826
921
|
|
|
827
|
-
var
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
var rawTransactionParser = /*#__PURE__*/object({
|
|
834
|
-
expiration: /*#__PURE__*/string(),
|
|
835
|
-
ref_block_num: /*#__PURE__*/number(),
|
|
836
|
-
ref_block_prefix: /*#__PURE__*/number(),
|
|
837
|
-
max_net_usage_words: /*#__PURE__*/number(),
|
|
838
|
-
max_cpu_usage_ms: /*#__PURE__*/number(),
|
|
839
|
-
delay_sec: /*#__PURE__*/number(),
|
|
840
|
-
context_free_actions: /*#__PURE__*/array( /*#__PURE__*/any()),
|
|
841
|
-
transaction_extensions: /*#__PURE__*/array( /*#__PURE__*/any())
|
|
842
|
-
});
|
|
843
|
-
var generateAuthActionsBaseParser = /*#__PURE__*/object({
|
|
844
|
-
account: /*#__PURE__*/literal(WRAP_CONTRACT),
|
|
845
|
-
name: /*#__PURE__*/literal(WRAP_AUTH_ACTION),
|
|
846
|
-
data: /*#__PURE__*/object({
|
|
847
|
-
time: /*#__PURE__*/string(),
|
|
848
|
-
protonAccount: /*#__PURE__*/string()
|
|
849
|
-
}),
|
|
850
|
-
authorization: authorizationsParser
|
|
851
|
-
});
|
|
852
|
-
var generateAuthActionsWebAuthParser = /*#__PURE__*/object({
|
|
853
|
-
account: /*#__PURE__*/literal('webauthn'),
|
|
854
|
-
name: /*#__PURE__*/literal('exec'),
|
|
855
|
-
authorization: authorizationsParser,
|
|
856
|
-
data: /*#__PURE__*/object({
|
|
857
|
-
account: accountParser,
|
|
858
|
-
key: /*#__PURE__*/object({
|
|
859
|
-
key: /*#__PURE__*/array( /*#__PURE__*/string().or( /*#__PURE__*/object({
|
|
860
|
-
modulus: /*#__PURE__*/string(),
|
|
861
|
-
exponent: /*#__PURE__*/string()
|
|
862
|
-
}))),
|
|
863
|
-
user_presence: /*#__PURE__*/number(),
|
|
864
|
-
rpid: /*#__PURE__*/string()
|
|
865
|
-
}),
|
|
866
|
-
nonce: /*#__PURE__*/number(),
|
|
867
|
-
permissions: authorizationsParser,
|
|
868
|
-
signature: /*#__PURE__*/object({
|
|
869
|
-
auth_data: /*#__PURE__*/string(),
|
|
870
|
-
client_json: /*#__PURE__*/string(),
|
|
871
|
-
signature: /*#__PURE__*/string()
|
|
872
|
-
}),
|
|
873
|
-
trx: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/object({
|
|
874
|
-
actions: /*#__PURE__*/array(object({
|
|
875
|
-
account: literal(WRAP_CONTRACT),
|
|
876
|
-
name: literal(WRAP_AUTH_ACTION),
|
|
877
|
-
data: string().or(object({
|
|
878
|
-
time: string(),
|
|
879
|
-
protonAccount: string()
|
|
880
|
-
})),
|
|
881
|
-
authorization: authorizationsParser
|
|
882
|
-
})).length(1)
|
|
883
|
-
}))
|
|
884
|
-
})
|
|
885
|
-
});
|
|
886
|
-
var generateAuthParser = /*#__PURE__*/object({
|
|
887
|
-
signer: authorizationParser,
|
|
888
|
-
signatures: /*#__PURE__*/array(string()).length(1),
|
|
889
|
-
transaction: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/object({
|
|
890
|
-
actions: /*#__PURE__*/array(generateAuthActionsBaseParser.or(generateAuthActionsWebAuthParser)).length(1)
|
|
891
|
-
}))
|
|
922
|
+
var addressParser = /*#__PURE__*/object({
|
|
923
|
+
index: /*#__PURE__*/number(),
|
|
924
|
+
account: accountParser,
|
|
925
|
+
chain: /*#__PURE__*/string(),
|
|
926
|
+
address: /*#__PURE__*/string(),
|
|
927
|
+
address_hash: /*#__PURE__*/string()
|
|
892
928
|
});
|
|
893
929
|
var generateAddressBodyParser = /*#__PURE__*/object({
|
|
894
930
|
coin: string(),
|
|
@@ -901,6 +937,30 @@ var generateAddressResponse = /*#__PURE__*/object({
|
|
|
901
937
|
wallet: /*#__PURE__*/string(),
|
|
902
938
|
memo: /*#__PURE__*/string().optional()
|
|
903
939
|
});
|
|
940
|
+
|
|
941
|
+
var rateParser = /*#__PURE__*/object({
|
|
942
|
+
counterCurrency: /*#__PURE__*/string(),
|
|
943
|
+
price: /*#__PURE__*/number(),
|
|
944
|
+
priceChangePercent: /*#__PURE__*/number(),
|
|
945
|
+
marketCap: /*#__PURE__*/number(),
|
|
946
|
+
volume: /*#__PURE__*/number(),
|
|
947
|
+
timestamp: /*#__PURE__*/number()
|
|
948
|
+
});
|
|
949
|
+
var exchangeRateParser = /*#__PURE__*/object({
|
|
950
|
+
contract: /*#__PURE__*/string(),
|
|
951
|
+
symbol: /*#__PURE__*/string(),
|
|
952
|
+
rank: /*#__PURE__*/number(),
|
|
953
|
+
rates: /*#__PURE__*/array(rateParser)
|
|
954
|
+
});
|
|
955
|
+
var exchangeRatesParser = /*#__PURE__*/array(exchangeRateParser);
|
|
956
|
+
|
|
957
|
+
var Type;
|
|
958
|
+
|
|
959
|
+
(function (Type) {
|
|
960
|
+
Type["RECEIVE"] = "receive";
|
|
961
|
+
Type["SEND"] = "send";
|
|
962
|
+
})(Type || (Type = {}));
|
|
963
|
+
|
|
904
964
|
var depositBodyParser = /*#__PURE__*/object({
|
|
905
965
|
id: /*#__PURE__*/string(),
|
|
906
966
|
type: /*#__PURE__*/nativeEnum(Type),
|
|
@@ -908,67 +968,51 @@ var depositBodyParser = /*#__PURE__*/object({
|
|
|
908
968
|
coin: /*#__PURE__*/string(),
|
|
909
969
|
wallet: /*#__PURE__*/string()
|
|
910
970
|
});
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
}),
|
|
924
|
-
authorization: authorizationsParser
|
|
971
|
+
var transactionParser = /*#__PURE__*/object({
|
|
972
|
+
id: /*#__PURE__*/string(),
|
|
973
|
+
wallet: /*#__PURE__*/string(),
|
|
974
|
+
value: /*#__PURE__*/number(),
|
|
975
|
+
valueString: /*#__PURE__*/string(),
|
|
976
|
+
address: /*#__PURE__*/string(),
|
|
977
|
+
type: /*#__PURE__*/nativeEnum(Type),
|
|
978
|
+
state: /*#__PURE__*/string(),
|
|
979
|
+
confirmations: /*#__PURE__*/number(),
|
|
980
|
+
hash: /*#__PURE__*/string(),
|
|
981
|
+
blockHash: /*#__PURE__*/string().optional().nullable(),
|
|
982
|
+
blockHeight: /*#__PURE__*/number().optional().nullable()
|
|
925
983
|
});
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
signature: /*#__PURE__*/object({
|
|
943
|
-
auth_data: /*#__PURE__*/string(),
|
|
944
|
-
client_json: /*#__PURE__*/string(),
|
|
945
|
-
signature: /*#__PURE__*/string()
|
|
946
|
-
}),
|
|
947
|
-
trx: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/object({
|
|
948
|
-
actions: /*#__PURE__*/array(object({
|
|
949
|
-
account: accountParser,
|
|
950
|
-
name: literal('transfer'),
|
|
951
|
-
data: string().or(object({
|
|
952
|
-
from: string().refine(function (val) {
|
|
953
|
-
return val !== WRAP_CONTRACT;
|
|
954
|
-
}, {
|
|
955
|
-
message: WRAP_CONTRACT + " must be receiver"
|
|
956
|
-
}),
|
|
957
|
-
to: literal(WRAP_CONTRACT),
|
|
958
|
-
quantity: string(),
|
|
959
|
-
memo: string()
|
|
960
|
-
})),
|
|
961
|
-
authorization: authorizationsParser
|
|
962
|
-
})).length(1)
|
|
963
|
-
}))
|
|
964
|
-
})
|
|
984
|
+
|
|
985
|
+
var otcOrderResponseParser = /*#__PURE__*/object({
|
|
986
|
+
success: /*#__PURE__*/boolean(),
|
|
987
|
+
transaction_id: /*#__PURE__*/string(),
|
|
988
|
+
errormsg: /*#__PURE__*/string().optional()
|
|
989
|
+
});
|
|
990
|
+
var otcQuoteBodyParser = /*#__PURE__*/object({
|
|
991
|
+
baseAmount: /*#__PURE__*/number(),
|
|
992
|
+
baseSymbol: /*#__PURE__*/string(),
|
|
993
|
+
quoteSymbol: /*#__PURE__*/string()
|
|
994
|
+
});
|
|
995
|
+
var otcQuoteResponseParser = /*#__PURE__*/object({
|
|
996
|
+
success: /*#__PURE__*/boolean(),
|
|
997
|
+
token: /*#__PURE__*/string(),
|
|
998
|
+
qty: /*#__PURE__*/number(),
|
|
999
|
+
errormsg: /*#__PURE__*/string().optional()
|
|
965
1000
|
});
|
|
1001
|
+
|
|
1002
|
+
var withdrawData = {
|
|
1003
|
+
from: /*#__PURE__*/string().refine(function (val) {
|
|
1004
|
+
return val !== WRAP_CONTRACT;
|
|
1005
|
+
}, {
|
|
1006
|
+
message: WRAP_CONTRACT + " must be receiver"
|
|
1007
|
+
}),
|
|
1008
|
+
to: /*#__PURE__*/literal(WRAP_CONTRACT),
|
|
1009
|
+
quantity: /*#__PURE__*/string(),
|
|
1010
|
+
memo: /*#__PURE__*/string()
|
|
1011
|
+
};
|
|
966
1012
|
var withdrawBodyParser = /*#__PURE__*/object({
|
|
967
1013
|
signer: authorizationParser,
|
|
968
1014
|
signatures: /*#__PURE__*/array(string()).length(1),
|
|
969
|
-
transaction: /*#__PURE__*/
|
|
970
|
-
actions: /*#__PURE__*/array(withdrawBodyBaseAction.or(withdrawBodyWebAuthAction)).length(1)
|
|
971
|
-
})),
|
|
1015
|
+
transaction: /*#__PURE__*/singleActionTransactionParser('*', 'transfer', withdrawData),
|
|
972
1016
|
quoteId: /*#__PURE__*/string(),
|
|
973
1017
|
provider: /*#__PURE__*/string().optional()
|
|
974
1018
|
});
|
|
@@ -976,6 +1020,13 @@ var withdrawMetalResponseParser = /*#__PURE__*/object({
|
|
|
976
1020
|
success: /*#__PURE__*/boolean(),
|
|
977
1021
|
id: /*#__PURE__*/string()
|
|
978
1022
|
});
|
|
1023
|
+
var withdrawalFeeQuoteParser = /*#__PURE__*/object({
|
|
1024
|
+
quoteId: /*#__PURE__*/string(),
|
|
1025
|
+
estimatedFee: /*#__PURE__*/string(),
|
|
1026
|
+
currency: /*#__PURE__*/string(),
|
|
1027
|
+
network: /*#__PURE__*/string()
|
|
1028
|
+
});
|
|
1029
|
+
|
|
979
1030
|
var withdrawHistoryMetalSwapParser = /*#__PURE__*/object({
|
|
980
1031
|
id: /*#__PURE__*/string(),
|
|
981
1032
|
status: /*#__PURE__*/string(),
|
|
@@ -994,10 +1045,16 @@ var withdrawHistoryMetalResponseParser = /*#__PURE__*/object({
|
|
|
994
1045
|
totalPages: /*#__PURE__*/number(),
|
|
995
1046
|
totalElements: /*#__PURE__*/number()
|
|
996
1047
|
});
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1048
|
+
|
|
1049
|
+
var Status;
|
|
1050
|
+
|
|
1051
|
+
(function (Status) {
|
|
1052
|
+
Status["PENDING"] = "pending";
|
|
1053
|
+
Status["SUCCESS"] = "success";
|
|
1054
|
+
Status["FAIL"] = "fail";
|
|
1055
|
+
Status["PROCESSING"] = "processing";
|
|
1056
|
+
})(Status || (Status = {}));
|
|
1057
|
+
|
|
1001
1058
|
var wrapStartParser = /*#__PURE__*/object({
|
|
1002
1059
|
balance: ExtendedAssetParser,
|
|
1003
1060
|
id: /*#__PURE__*/string(),
|
|
@@ -1023,67 +1080,10 @@ var wrapParser = /*#__PURE__*/object({
|
|
|
1023
1080
|
wrap_hash: /*#__PURE__*/string(),
|
|
1024
1081
|
confirmations: /*#__PURE__*/number()
|
|
1025
1082
|
});
|
|
1026
|
-
var transactionParser = /*#__PURE__*/object({
|
|
1027
|
-
id: /*#__PURE__*/string(),
|
|
1028
|
-
wallet: /*#__PURE__*/string(),
|
|
1029
|
-
value: /*#__PURE__*/number(),
|
|
1030
|
-
valueString: /*#__PURE__*/string(),
|
|
1031
|
-
address: /*#__PURE__*/string(),
|
|
1032
|
-
type: /*#__PURE__*/nativeEnum(Type),
|
|
1033
|
-
state: /*#__PURE__*/string(),
|
|
1034
|
-
confirmations: /*#__PURE__*/number(),
|
|
1035
|
-
hash: /*#__PURE__*/string(),
|
|
1036
|
-
blockHash: /*#__PURE__*/string().optional().nullable(),
|
|
1037
|
-
blockHeight: /*#__PURE__*/number().optional().nullable()
|
|
1038
|
-
});
|
|
1039
|
-
var addressParser = /*#__PURE__*/object({
|
|
1040
|
-
index: /*#__PURE__*/number(),
|
|
1041
|
-
account: accountParser,
|
|
1042
|
-
chain: /*#__PURE__*/string(),
|
|
1043
|
-
address: /*#__PURE__*/string(),
|
|
1044
|
-
address_hash: /*#__PURE__*/string()
|
|
1045
|
-
});
|
|
1046
|
-
var otcOrderResponseParser = /*#__PURE__*/object({
|
|
1047
|
-
success: /*#__PURE__*/boolean(),
|
|
1048
|
-
transaction_id: /*#__PURE__*/string(),
|
|
1049
|
-
errormsg: /*#__PURE__*/string().optional()
|
|
1050
|
-
});
|
|
1051
|
-
var otcQuoteBodyParser = /*#__PURE__*/object({
|
|
1052
|
-
baseAmount: /*#__PURE__*/number(),
|
|
1053
|
-
baseSymbol: /*#__PURE__*/string(),
|
|
1054
|
-
quoteSymbol: /*#__PURE__*/string()
|
|
1055
|
-
});
|
|
1056
|
-
var otcQuoteResponseParser = /*#__PURE__*/object({
|
|
1057
|
-
success: /*#__PURE__*/boolean(),
|
|
1058
|
-
token: /*#__PURE__*/string(),
|
|
1059
|
-
qty: /*#__PURE__*/number(),
|
|
1060
|
-
errormsg: /*#__PURE__*/string().optional()
|
|
1061
|
-
});
|
|
1062
|
-
var rateParser = /*#__PURE__*/object({
|
|
1063
|
-
counterCurrency: /*#__PURE__*/string(),
|
|
1064
|
-
price: /*#__PURE__*/number(),
|
|
1065
|
-
priceChangePercent: /*#__PURE__*/number(),
|
|
1066
|
-
marketCap: /*#__PURE__*/number(),
|
|
1067
|
-
volume: /*#__PURE__*/number(),
|
|
1068
|
-
timestamp: /*#__PURE__*/number()
|
|
1069
|
-
});
|
|
1070
|
-
var exchangeRateParser = /*#__PURE__*/object({
|
|
1071
|
-
contract: /*#__PURE__*/string(),
|
|
1072
|
-
symbol: /*#__PURE__*/string(),
|
|
1073
|
-
rank: /*#__PURE__*/number(),
|
|
1074
|
-
rates: /*#__PURE__*/array(rateParser)
|
|
1075
|
-
});
|
|
1076
|
-
var exchangeRatesParser = /*#__PURE__*/array(exchangeRateParser);
|
|
1077
|
-
var withdrawalFeeQuoteParser = /*#__PURE__*/object({
|
|
1078
|
-
quoteId: /*#__PURE__*/string(),
|
|
1079
|
-
estimatedFee: /*#__PURE__*/string(),
|
|
1080
|
-
currency: /*#__PURE__*/string(),
|
|
1081
|
-
network: /*#__PURE__*/string()
|
|
1082
|
-
});
|
|
1083
1083
|
|
|
1084
1084
|
var isSameToken = function isSameToken(token1, token2) {
|
|
1085
1085
|
return token1.xtokenSymbol === token2.xtokenSymbol && token1.xtokenPrecision === token2.xtokenPrecision && token1.xtokenContract === token2.xtokenContract;
|
|
1086
1086
|
};
|
|
1087
1087
|
|
|
1088
|
-
export { Chains, Networks, Status, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, authorizationParser, authorizationsParser, depositBodyParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, initializeCoins, initializeConstants, isSameToken, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, rateParser,
|
|
1088
|
+
export { Chains, ExtendedAssetParser, Networks, Status, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, createAbstractAuthParser, depositBodyParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, initializeCoins, initializeConstants, isSameToken, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, rateParser, similarChains, singleActionTransactionParser, transactionParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
|
|
1089
1089
|
//# sourceMappingURL=wrap-constants.esm.js.map
|