@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
|
@@ -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__*/z.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
|
|
724
|
+
var authorizationParser = /*#__PURE__*/z.object({
|
|
725
|
+
actor: accountParser,
|
|
726
|
+
permission: /*#__PURE__*/z.string()
|
|
727
|
+
});
|
|
728
|
+
var authorizationsParser = /*#__PURE__*/z.array(authorizationParser).min(1);
|
|
729
|
+
var ExtendedAssetParser = /*#__PURE__*/z.object({
|
|
730
|
+
quantity: /*#__PURE__*/z.string(),
|
|
731
|
+
contract: accountParser
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
var rawTransactionParser = /*#__PURE__*/z.object({
|
|
735
|
+
expiration: /*#__PURE__*/z.string(),
|
|
736
|
+
ref_block_num: /*#__PURE__*/z.number(),
|
|
737
|
+
ref_block_prefix: /*#__PURE__*/z.number(),
|
|
738
|
+
max_net_usage_words: /*#__PURE__*/z.number(),
|
|
739
|
+
max_cpu_usage_ms: /*#__PURE__*/z.number(),
|
|
740
|
+
delay_sec: /*#__PURE__*/z.number(),
|
|
741
|
+
context_free_actions: /*#__PURE__*/z.array( /*#__PURE__*/z.any()),
|
|
742
|
+
transaction_extensions: /*#__PURE__*/z.array( /*#__PURE__*/z.any())
|
|
743
|
+
});
|
|
744
|
+
var baseActionParser = function baseActionParser(contract, action, data) {
|
|
745
|
+
return z.object({
|
|
746
|
+
account: contract === '*' ? accountParser : z.literal(contract),
|
|
747
|
+
name: z.literal(action),
|
|
748
|
+
data: z.object(data),
|
|
749
|
+
authorization: authorizationsParser
|
|
750
|
+
});
|
|
751
|
+
};
|
|
752
|
+
var baseActionSerializedParser = function baseActionSerializedParser(contract, action, data) {
|
|
753
|
+
return z.object({
|
|
754
|
+
account: contract === '*' ? accountParser : z.literal(contract),
|
|
755
|
+
name: z.literal(action),
|
|
756
|
+
data: z.string().or(z.object(data)),
|
|
757
|
+
authorization: authorizationsParser
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
var webauthActionParser = function webauthActionParser(contract, action, data) {
|
|
761
|
+
return z.object({
|
|
762
|
+
account: z.literal('webauthn'),
|
|
763
|
+
name: z.literal('exec'),
|
|
764
|
+
data: z.object({
|
|
765
|
+
account: accountParser,
|
|
766
|
+
key: z.object({
|
|
767
|
+
key: z.array(z.string().or(z.object({
|
|
768
|
+
modulus: z.string(),
|
|
769
|
+
exponent: z.string()
|
|
770
|
+
}))),
|
|
771
|
+
user_presence: z.number(),
|
|
772
|
+
rpid: z.string()
|
|
773
|
+
}),
|
|
774
|
+
nonce: z.number(),
|
|
775
|
+
permissions: authorizationsParser,
|
|
776
|
+
signature: z.object({
|
|
777
|
+
auth_data: z.string(),
|
|
778
|
+
client_json: z.string(),
|
|
779
|
+
signature: z.string()
|
|
780
|
+
}),
|
|
781
|
+
trx: rawTransactionParser.merge(z.object({
|
|
782
|
+
actions: z.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(z.object({
|
|
792
|
+
actions: z.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,83 +906,25 @@ var initializeConstants = function initializeConstants(chain) {
|
|
|
808
906
|
return constants;
|
|
809
907
|
};
|
|
810
908
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
})
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
909
|
+
var createAbstractAuthParser = function createAbstractAuthParser(contract, action, data) {
|
|
910
|
+
return z.object({
|
|
911
|
+
signer: authorizationParser,
|
|
912
|
+
signatures: z.array(z.string()).length(1),
|
|
913
|
+
transaction: singleActionTransactionParser(contract, action, data)
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
var generateAuthData = {
|
|
917
|
+
time: /*#__PURE__*/z.string(),
|
|
918
|
+
protonAccount: /*#__PURE__*/z.string()
|
|
919
|
+
};
|
|
920
|
+
var generateAuthParser = /*#__PURE__*/createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
|
|
822
921
|
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
var rawTransactionParser = /*#__PURE__*/z.object({
|
|
830
|
-
expiration: /*#__PURE__*/z.string(),
|
|
831
|
-
ref_block_num: /*#__PURE__*/z.number(),
|
|
832
|
-
ref_block_prefix: /*#__PURE__*/z.number(),
|
|
833
|
-
max_net_usage_words: /*#__PURE__*/z.number(),
|
|
834
|
-
max_cpu_usage_ms: /*#__PURE__*/z.number(),
|
|
835
|
-
delay_sec: /*#__PURE__*/z.number(),
|
|
836
|
-
context_free_actions: /*#__PURE__*/z.array( /*#__PURE__*/z.any()),
|
|
837
|
-
transaction_extensions: /*#__PURE__*/z.array( /*#__PURE__*/z.any())
|
|
838
|
-
});
|
|
839
|
-
var generateAuthActionsBaseParser = /*#__PURE__*/z.object({
|
|
840
|
-
account: /*#__PURE__*/z.literal(WRAP_CONTRACT),
|
|
841
|
-
name: /*#__PURE__*/z.literal(WRAP_AUTH_ACTION),
|
|
842
|
-
data: /*#__PURE__*/z.object({
|
|
843
|
-
time: /*#__PURE__*/z.string(),
|
|
844
|
-
protonAccount: /*#__PURE__*/z.string()
|
|
845
|
-
}),
|
|
846
|
-
authorization: authorizationsParser
|
|
847
|
-
});
|
|
848
|
-
var generateAuthActionsWebAuthParser = /*#__PURE__*/z.object({
|
|
849
|
-
account: /*#__PURE__*/z.literal('webauthn'),
|
|
850
|
-
name: /*#__PURE__*/z.literal('exec'),
|
|
851
|
-
authorization: authorizationsParser,
|
|
852
|
-
data: /*#__PURE__*/z.object({
|
|
853
|
-
account: accountParser,
|
|
854
|
-
key: /*#__PURE__*/z.object({
|
|
855
|
-
key: /*#__PURE__*/z.array( /*#__PURE__*/z.string().or( /*#__PURE__*/z.object({
|
|
856
|
-
modulus: /*#__PURE__*/z.string(),
|
|
857
|
-
exponent: /*#__PURE__*/z.string()
|
|
858
|
-
}))),
|
|
859
|
-
user_presence: /*#__PURE__*/z.number(),
|
|
860
|
-
rpid: /*#__PURE__*/z.string()
|
|
861
|
-
}),
|
|
862
|
-
nonce: /*#__PURE__*/z.number(),
|
|
863
|
-
permissions: authorizationsParser,
|
|
864
|
-
signature: /*#__PURE__*/z.object({
|
|
865
|
-
auth_data: /*#__PURE__*/z.string(),
|
|
866
|
-
client_json: /*#__PURE__*/z.string(),
|
|
867
|
-
signature: /*#__PURE__*/z.string()
|
|
868
|
-
}),
|
|
869
|
-
trx: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/z.object({
|
|
870
|
-
actions: /*#__PURE__*/z.array(z.object({
|
|
871
|
-
account: z.literal(WRAP_CONTRACT),
|
|
872
|
-
name: z.literal(WRAP_AUTH_ACTION),
|
|
873
|
-
data: z.string().or(z.object({
|
|
874
|
-
time: z.string(),
|
|
875
|
-
protonAccount: z.string()
|
|
876
|
-
})),
|
|
877
|
-
authorization: authorizationsParser
|
|
878
|
-
})).length(1)
|
|
879
|
-
}))
|
|
880
|
-
})
|
|
881
|
-
});
|
|
882
|
-
var generateAuthParser = /*#__PURE__*/z.object({
|
|
883
|
-
signer: authorizationParser,
|
|
884
|
-
signatures: /*#__PURE__*/z.array(z.string()).length(1),
|
|
885
|
-
transaction: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/z.object({
|
|
886
|
-
actions: /*#__PURE__*/z.array(generateAuthActionsBaseParser.or(generateAuthActionsWebAuthParser)).length(1)
|
|
887
|
-
}))
|
|
922
|
+
var addressParser = /*#__PURE__*/z.object({
|
|
923
|
+
index: /*#__PURE__*/z.number(),
|
|
924
|
+
account: accountParser,
|
|
925
|
+
chain: /*#__PURE__*/z.string(),
|
|
926
|
+
address: /*#__PURE__*/z.string(),
|
|
927
|
+
address_hash: /*#__PURE__*/z.string()
|
|
888
928
|
});
|
|
889
929
|
var generateAddressBodyParser = /*#__PURE__*/z.object({
|
|
890
930
|
coin: z.string(),
|
|
@@ -897,6 +937,28 @@ var generateAddressResponse = /*#__PURE__*/z.object({
|
|
|
897
937
|
wallet: /*#__PURE__*/z.string(),
|
|
898
938
|
memo: /*#__PURE__*/z.string().optional()
|
|
899
939
|
});
|
|
940
|
+
|
|
941
|
+
var rateParser = /*#__PURE__*/z.object({
|
|
942
|
+
counterCurrency: /*#__PURE__*/z.string(),
|
|
943
|
+
price: /*#__PURE__*/z.number(),
|
|
944
|
+
priceChangePercent: /*#__PURE__*/z.number(),
|
|
945
|
+
marketCap: /*#__PURE__*/z.number(),
|
|
946
|
+
volume: /*#__PURE__*/z.number(),
|
|
947
|
+
timestamp: /*#__PURE__*/z.number()
|
|
948
|
+
});
|
|
949
|
+
var exchangeRateParser = /*#__PURE__*/z.object({
|
|
950
|
+
contract: /*#__PURE__*/z.string(),
|
|
951
|
+
symbol: /*#__PURE__*/z.string(),
|
|
952
|
+
rank: /*#__PURE__*/z.number(),
|
|
953
|
+
rates: /*#__PURE__*/z.array(rateParser)
|
|
954
|
+
});
|
|
955
|
+
var exchangeRatesParser = /*#__PURE__*/z.array(exchangeRateParser);
|
|
956
|
+
|
|
957
|
+
(function (Type) {
|
|
958
|
+
Type["RECEIVE"] = "receive";
|
|
959
|
+
Type["SEND"] = "send";
|
|
960
|
+
})(exports.Type || (exports.Type = {}));
|
|
961
|
+
|
|
900
962
|
var depositBodyParser = /*#__PURE__*/z.object({
|
|
901
963
|
id: /*#__PURE__*/z.string(),
|
|
902
964
|
type: /*#__PURE__*/z.nativeEnum(exports.Type),
|
|
@@ -904,67 +966,51 @@ var depositBodyParser = /*#__PURE__*/z.object({
|
|
|
904
966
|
coin: /*#__PURE__*/z.string(),
|
|
905
967
|
wallet: /*#__PURE__*/z.string()
|
|
906
968
|
});
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
}),
|
|
920
|
-
authorization: authorizationsParser
|
|
969
|
+
var transactionParser = /*#__PURE__*/z.object({
|
|
970
|
+
id: /*#__PURE__*/z.string(),
|
|
971
|
+
wallet: /*#__PURE__*/z.string(),
|
|
972
|
+
value: /*#__PURE__*/z.number(),
|
|
973
|
+
valueString: /*#__PURE__*/z.string(),
|
|
974
|
+
address: /*#__PURE__*/z.string(),
|
|
975
|
+
type: /*#__PURE__*/z.nativeEnum(exports.Type),
|
|
976
|
+
state: /*#__PURE__*/z.string(),
|
|
977
|
+
confirmations: /*#__PURE__*/z.number(),
|
|
978
|
+
hash: /*#__PURE__*/z.string(),
|
|
979
|
+
blockHash: /*#__PURE__*/z.string().optional().nullable(),
|
|
980
|
+
blockHeight: /*#__PURE__*/z.number().optional().nullable()
|
|
921
981
|
});
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
account: accountParser,
|
|
928
|
-
key: /*#__PURE__*/z.object({
|
|
929
|
-
key: /*#__PURE__*/z.array( /*#__PURE__*/z.string().or( /*#__PURE__*/z.object({
|
|
930
|
-
modulus: /*#__PURE__*/z.string(),
|
|
931
|
-
exponent: /*#__PURE__*/z.string()
|
|
932
|
-
}))),
|
|
933
|
-
user_presence: /*#__PURE__*/z.number(),
|
|
934
|
-
rpid: /*#__PURE__*/z.string()
|
|
935
|
-
}),
|
|
936
|
-
nonce: /*#__PURE__*/z.number(),
|
|
937
|
-
permissions: authorizationsParser,
|
|
938
|
-
signature: /*#__PURE__*/z.object({
|
|
939
|
-
auth_data: /*#__PURE__*/z.string(),
|
|
940
|
-
client_json: /*#__PURE__*/z.string(),
|
|
941
|
-
signature: /*#__PURE__*/z.string()
|
|
942
|
-
}),
|
|
943
|
-
trx: /*#__PURE__*/rawTransactionParser.merge( /*#__PURE__*/z.object({
|
|
944
|
-
actions: /*#__PURE__*/z.array(z.object({
|
|
945
|
-
account: accountParser,
|
|
946
|
-
name: z.literal('transfer'),
|
|
947
|
-
data: z.string().or(z.object({
|
|
948
|
-
from: z.string().refine(function (val) {
|
|
949
|
-
return val !== WRAP_CONTRACT;
|
|
950
|
-
}, {
|
|
951
|
-
message: WRAP_CONTRACT + " must be receiver"
|
|
952
|
-
}),
|
|
953
|
-
to: z.literal(WRAP_CONTRACT),
|
|
954
|
-
quantity: z.string(),
|
|
955
|
-
memo: z.string()
|
|
956
|
-
})),
|
|
957
|
-
authorization: authorizationsParser
|
|
958
|
-
})).length(1)
|
|
959
|
-
}))
|
|
960
|
-
})
|
|
982
|
+
|
|
983
|
+
var otcOrderResponseParser = /*#__PURE__*/z.object({
|
|
984
|
+
success: /*#__PURE__*/z.boolean(),
|
|
985
|
+
transaction_id: /*#__PURE__*/z.string(),
|
|
986
|
+
errormsg: /*#__PURE__*/z.string().optional()
|
|
961
987
|
});
|
|
988
|
+
var otcQuoteBodyParser = /*#__PURE__*/z.object({
|
|
989
|
+
baseAmount: /*#__PURE__*/z.number(),
|
|
990
|
+
baseSymbol: /*#__PURE__*/z.string(),
|
|
991
|
+
quoteSymbol: /*#__PURE__*/z.string()
|
|
992
|
+
});
|
|
993
|
+
var otcQuoteResponseParser = /*#__PURE__*/z.object({
|
|
994
|
+
success: /*#__PURE__*/z.boolean(),
|
|
995
|
+
token: /*#__PURE__*/z.string(),
|
|
996
|
+
qty: /*#__PURE__*/z.number(),
|
|
997
|
+
errormsg: /*#__PURE__*/z.string().optional()
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
var withdrawData = {
|
|
1001
|
+
from: /*#__PURE__*/z.string().refine(function (val) {
|
|
1002
|
+
return val !== WRAP_CONTRACT;
|
|
1003
|
+
}, {
|
|
1004
|
+
message: WRAP_CONTRACT + " must be receiver"
|
|
1005
|
+
}),
|
|
1006
|
+
to: /*#__PURE__*/z.literal(WRAP_CONTRACT),
|
|
1007
|
+
quantity: /*#__PURE__*/z.string(),
|
|
1008
|
+
memo: /*#__PURE__*/z.string()
|
|
1009
|
+
};
|
|
962
1010
|
var withdrawBodyParser = /*#__PURE__*/z.object({
|
|
963
1011
|
signer: authorizationParser,
|
|
964
1012
|
signatures: /*#__PURE__*/z.array(z.string()).length(1),
|
|
965
|
-
transaction: /*#__PURE__*/
|
|
966
|
-
actions: /*#__PURE__*/z.array(withdrawBodyBaseAction.or(withdrawBodyWebAuthAction)).length(1)
|
|
967
|
-
})),
|
|
1013
|
+
transaction: /*#__PURE__*/singleActionTransactionParser('*', 'transfer', withdrawData),
|
|
968
1014
|
quoteId: /*#__PURE__*/z.string(),
|
|
969
1015
|
provider: /*#__PURE__*/z.string().optional()
|
|
970
1016
|
});
|
|
@@ -972,6 +1018,13 @@ var withdrawMetalResponseParser = /*#__PURE__*/z.object({
|
|
|
972
1018
|
success: /*#__PURE__*/z.boolean(),
|
|
973
1019
|
id: /*#__PURE__*/z.string()
|
|
974
1020
|
});
|
|
1021
|
+
var withdrawalFeeQuoteParser = /*#__PURE__*/z.object({
|
|
1022
|
+
quoteId: /*#__PURE__*/z.string(),
|
|
1023
|
+
estimatedFee: /*#__PURE__*/z.string(),
|
|
1024
|
+
currency: /*#__PURE__*/z.string(),
|
|
1025
|
+
network: /*#__PURE__*/z.string()
|
|
1026
|
+
});
|
|
1027
|
+
|
|
975
1028
|
var withdrawHistoryMetalSwapParser = /*#__PURE__*/z.object({
|
|
976
1029
|
id: /*#__PURE__*/z.string(),
|
|
977
1030
|
status: /*#__PURE__*/z.string(),
|
|
@@ -990,10 +1043,14 @@ var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.object({
|
|
|
990
1043
|
totalPages: /*#__PURE__*/z.number(),
|
|
991
1044
|
totalElements: /*#__PURE__*/z.number()
|
|
992
1045
|
});
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1046
|
+
|
|
1047
|
+
(function (Status) {
|
|
1048
|
+
Status["PENDING"] = "pending";
|
|
1049
|
+
Status["SUCCESS"] = "success";
|
|
1050
|
+
Status["FAIL"] = "fail";
|
|
1051
|
+
Status["PROCESSING"] = "processing";
|
|
1052
|
+
})(exports.Status || (exports.Status = {}));
|
|
1053
|
+
|
|
997
1054
|
var wrapStartParser = /*#__PURE__*/z.object({
|
|
998
1055
|
balance: ExtendedAssetParser,
|
|
999
1056
|
id: /*#__PURE__*/z.string(),
|
|
@@ -1019,74 +1076,21 @@ var wrapParser = /*#__PURE__*/z.object({
|
|
|
1019
1076
|
wrap_hash: /*#__PURE__*/z.string(),
|
|
1020
1077
|
confirmations: /*#__PURE__*/z.number()
|
|
1021
1078
|
});
|
|
1022
|
-
var transactionParser = /*#__PURE__*/z.object({
|
|
1023
|
-
id: /*#__PURE__*/z.string(),
|
|
1024
|
-
wallet: /*#__PURE__*/z.string(),
|
|
1025
|
-
value: /*#__PURE__*/z.number(),
|
|
1026
|
-
valueString: /*#__PURE__*/z.string(),
|
|
1027
|
-
address: /*#__PURE__*/z.string(),
|
|
1028
|
-
type: /*#__PURE__*/z.nativeEnum(exports.Type),
|
|
1029
|
-
state: /*#__PURE__*/z.string(),
|
|
1030
|
-
confirmations: /*#__PURE__*/z.number(),
|
|
1031
|
-
hash: /*#__PURE__*/z.string(),
|
|
1032
|
-
blockHash: /*#__PURE__*/z.string().optional().nullable(),
|
|
1033
|
-
blockHeight: /*#__PURE__*/z.number().optional().nullable()
|
|
1034
|
-
});
|
|
1035
|
-
var addressParser = /*#__PURE__*/z.object({
|
|
1036
|
-
index: /*#__PURE__*/z.number(),
|
|
1037
|
-
account: accountParser,
|
|
1038
|
-
chain: /*#__PURE__*/z.string(),
|
|
1039
|
-
address: /*#__PURE__*/z.string(),
|
|
1040
|
-
address_hash: /*#__PURE__*/z.string()
|
|
1041
|
-
});
|
|
1042
|
-
var otcOrderResponseParser = /*#__PURE__*/z.object({
|
|
1043
|
-
success: /*#__PURE__*/z.boolean(),
|
|
1044
|
-
transaction_id: /*#__PURE__*/z.string(),
|
|
1045
|
-
errormsg: /*#__PURE__*/z.string().optional()
|
|
1046
|
-
});
|
|
1047
|
-
var otcQuoteBodyParser = /*#__PURE__*/z.object({
|
|
1048
|
-
baseAmount: /*#__PURE__*/z.number(),
|
|
1049
|
-
baseSymbol: /*#__PURE__*/z.string(),
|
|
1050
|
-
quoteSymbol: /*#__PURE__*/z.string()
|
|
1051
|
-
});
|
|
1052
|
-
var otcQuoteResponseParser = /*#__PURE__*/z.object({
|
|
1053
|
-
success: /*#__PURE__*/z.boolean(),
|
|
1054
|
-
token: /*#__PURE__*/z.string(),
|
|
1055
|
-
qty: /*#__PURE__*/z.number(),
|
|
1056
|
-
errormsg: /*#__PURE__*/z.string().optional()
|
|
1057
|
-
});
|
|
1058
|
-
var rateParser = /*#__PURE__*/z.object({
|
|
1059
|
-
counterCurrency: /*#__PURE__*/z.string(),
|
|
1060
|
-
price: /*#__PURE__*/z.number(),
|
|
1061
|
-
priceChangePercent: /*#__PURE__*/z.number(),
|
|
1062
|
-
marketCap: /*#__PURE__*/z.number(),
|
|
1063
|
-
volume: /*#__PURE__*/z.number(),
|
|
1064
|
-
timestamp: /*#__PURE__*/z.number()
|
|
1065
|
-
});
|
|
1066
|
-
var exchangeRateParser = /*#__PURE__*/z.object({
|
|
1067
|
-
contract: /*#__PURE__*/z.string(),
|
|
1068
|
-
symbol: /*#__PURE__*/z.string(),
|
|
1069
|
-
rank: /*#__PURE__*/z.number(),
|
|
1070
|
-
rates: /*#__PURE__*/z.array(rateParser)
|
|
1071
|
-
});
|
|
1072
|
-
var exchangeRatesParser = /*#__PURE__*/z.array(exchangeRateParser);
|
|
1073
|
-
var withdrawalFeeQuoteParser = /*#__PURE__*/z.object({
|
|
1074
|
-
quoteId: /*#__PURE__*/z.string(),
|
|
1075
|
-
estimatedFee: /*#__PURE__*/z.string(),
|
|
1076
|
-
currency: /*#__PURE__*/z.string(),
|
|
1077
|
-
network: /*#__PURE__*/z.string()
|
|
1078
|
-
});
|
|
1079
1079
|
|
|
1080
1080
|
var isSameToken = function isSameToken(token1, token2) {
|
|
1081
1081
|
return token1.xtokenSymbol === token2.xtokenSymbol && token1.xtokenPrecision === token2.xtokenPrecision && token1.xtokenContract === token2.xtokenContract;
|
|
1082
1082
|
};
|
|
1083
1083
|
|
|
1084
|
+
exports.ExtendedAssetParser = ExtendedAssetParser;
|
|
1084
1085
|
exports.WRAP_AUTH_ACTION = WRAP_AUTH_ACTION;
|
|
1085
1086
|
exports.WRAP_CONTRACT = WRAP_CONTRACT;
|
|
1086
1087
|
exports.accountParser = accountParser;
|
|
1087
1088
|
exports.addressParser = addressParser;
|
|
1088
1089
|
exports.authorizationParser = authorizationParser;
|
|
1089
1090
|
exports.authorizationsParser = authorizationsParser;
|
|
1091
|
+
exports.baseActionParser = baseActionParser;
|
|
1092
|
+
exports.baseActionSerializedParser = baseActionSerializedParser;
|
|
1093
|
+
exports.createAbstractAuthParser = createAbstractAuthParser;
|
|
1090
1094
|
exports.depositBodyParser = depositBodyParser;
|
|
1091
1095
|
exports.exchangeRateParser = exchangeRateParser;
|
|
1092
1096
|
exports.exchangeRatesParser = exchangeRatesParser;
|
|
@@ -1101,9 +1105,10 @@ exports.otcOrderResponseParser = otcOrderResponseParser;
|
|
|
1101
1105
|
exports.otcQuoteBodyParser = otcQuoteBodyParser;
|
|
1102
1106
|
exports.otcQuoteResponseParser = otcQuoteResponseParser;
|
|
1103
1107
|
exports.rateParser = rateParser;
|
|
1104
|
-
exports.rawTransactionParser = rawTransactionParser;
|
|
1105
1108
|
exports.similarChains = similarChains;
|
|
1109
|
+
exports.singleActionTransactionParser = singleActionTransactionParser;
|
|
1106
1110
|
exports.transactionParser = transactionParser;
|
|
1111
|
+
exports.webauthActionParser = webauthActionParser;
|
|
1107
1112
|
exports.withdrawBodyParser = withdrawBodyParser;
|
|
1108
1113
|
exports.withdrawHistoryMetalResponseParser = withdrawHistoryMetalResponseParser;
|
|
1109
1114
|
exports.withdrawHistoryMetalSwapParser = withdrawHistoryMetalSwapParser;
|