@proton/wrap-constants 0.0.34 → 0.0.38
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 +365 -107
- package/dist/parsers/address.d.ts +5 -15
- package/dist/parsers/auth.d.ts +19 -41
- package/dist/parsers/index.d.ts +1 -0
- package/dist/parsers/pool.d.ts +21 -0
- package/dist/parsers/withdraw.d.ts +73 -47
- package/dist/wrap-constants.cjs.development.js +50 -25
- 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 +50 -25
- 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 +4 -4
- package/src/parsers/index.ts +1 -0
- package/src/parsers/pool.ts +21 -0
package/src/coins.ts
CHANGED
|
@@ -50,6 +50,7 @@ export interface Coin {
|
|
|
50
50
|
xtokenContract : string;
|
|
51
51
|
wallets : Wallet[];
|
|
52
52
|
image : string;
|
|
53
|
+
coingeckoId : string;
|
|
53
54
|
balance? : Asset;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -134,7 +135,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
134
135
|
}
|
|
135
136
|
]: []),
|
|
136
137
|
],
|
|
137
|
-
image: '/img/tokens/xpr.png'
|
|
138
|
+
image: '/img/tokens/xpr.png',
|
|
139
|
+
coingeckoId: 'proton'
|
|
138
140
|
},
|
|
139
141
|
{
|
|
140
142
|
allowSwap: true,
|
|
@@ -186,7 +188,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
186
188
|
hasWithdrawMemo: false
|
|
187
189
|
}]: [])
|
|
188
190
|
],
|
|
189
|
-
image: '/img/tokens/xusdc.png'
|
|
191
|
+
image: '/img/tokens/xusdc.png',
|
|
192
|
+
coingeckoId: 'usd-coin'
|
|
190
193
|
},
|
|
191
194
|
{
|
|
192
195
|
allowSwap: true,
|
|
@@ -209,7 +212,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
209
212
|
hasWithdrawMemo: false
|
|
210
213
|
}]: [])
|
|
211
214
|
],
|
|
212
|
-
image: '/img/tokens/xmt.png'
|
|
215
|
+
image: '/img/tokens/xmt.png',
|
|
216
|
+
coingeckoId: 'metal'
|
|
213
217
|
},
|
|
214
218
|
{
|
|
215
219
|
allowSwap: true,
|
|
@@ -241,7 +245,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
241
245
|
hasWithdrawMemo: false
|
|
242
246
|
}]: [])
|
|
243
247
|
],
|
|
244
|
-
image: '/img/tokens/xbtc.png'
|
|
248
|
+
image: '/img/tokens/xbtc.png',
|
|
249
|
+
coingeckoId: 'bitcoin'
|
|
245
250
|
},
|
|
246
251
|
{
|
|
247
252
|
allowSwap: true,
|
|
@@ -273,7 +278,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
273
278
|
hasWithdrawMemo: false
|
|
274
279
|
}]: [])
|
|
275
280
|
],
|
|
276
|
-
image: '/img/tokens/xeth.png'
|
|
281
|
+
image: '/img/tokens/xeth.png',
|
|
282
|
+
coingeckoId: 'ethereum'
|
|
277
283
|
},
|
|
278
284
|
{
|
|
279
285
|
allowSwap: IS_MAINNET,
|
|
@@ -305,7 +311,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
305
311
|
hasWithdrawMemo: false
|
|
306
312
|
}]: [])
|
|
307
313
|
],
|
|
308
|
-
image: '/img/tokens/xusdt.png'
|
|
314
|
+
image: '/img/tokens/xusdt.png',
|
|
315
|
+
coingeckoId: 'tether'
|
|
309
316
|
},
|
|
310
317
|
{
|
|
311
318
|
allowSwap: false,
|
|
@@ -328,7 +335,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
328
335
|
hasWithdrawMemo: false
|
|
329
336
|
}]: [])
|
|
330
337
|
],
|
|
331
|
-
image: '/img/tokens/xtusd.png'
|
|
338
|
+
image: '/img/tokens/xtusd.png',
|
|
339
|
+
coingeckoId: 'true-usd'
|
|
332
340
|
},
|
|
333
341
|
{
|
|
334
342
|
allowSwap: false,
|
|
@@ -351,7 +359,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
351
359
|
hasWithdrawMemo: false
|
|
352
360
|
}]: [])
|
|
353
361
|
],
|
|
354
|
-
image: '/img/tokens/xpax.png'
|
|
362
|
+
image: '/img/tokens/xpax.png',
|
|
363
|
+
coingeckoId: 'usdp'
|
|
355
364
|
},
|
|
356
365
|
{
|
|
357
366
|
allowSwap: false,
|
|
@@ -383,7 +392,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
383
392
|
hasWithdrawMemo: false
|
|
384
393
|
}]: [])
|
|
385
394
|
],
|
|
386
|
-
image: '/img/tokens/xpaxg.png'
|
|
395
|
+
image: '/img/tokens/xpaxg.png',
|
|
396
|
+
coingeckoId: 'pax-gold'
|
|
387
397
|
},
|
|
388
398
|
{
|
|
389
399
|
allowSwap: IS_MAINNET,
|
|
@@ -415,7 +425,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
415
425
|
hasWithdrawMemo: false
|
|
416
426
|
}]: [])
|
|
417
427
|
],
|
|
418
|
-
image: '/img/tokens/xuni.png'
|
|
428
|
+
image: '/img/tokens/xuni.png',
|
|
429
|
+
coingeckoId: 'uniswap'
|
|
419
430
|
},
|
|
420
431
|
{
|
|
421
432
|
allowSwap: false,
|
|
@@ -438,7 +449,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
438
449
|
hasWithdrawMemo: false
|
|
439
450
|
}]: [])
|
|
440
451
|
],
|
|
441
|
-
image: '/img/tokens/xinch.png'
|
|
452
|
+
image: '/img/tokens/xinch.png',
|
|
453
|
+
coingeckoId: '1inch'
|
|
442
454
|
},
|
|
443
455
|
{
|
|
444
456
|
allowSwap: false,
|
|
@@ -461,7 +473,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
461
473
|
hasWithdrawMemo: false
|
|
462
474
|
}]: [])
|
|
463
475
|
],
|
|
464
|
-
image: '/img/tokens/xlink.png'
|
|
476
|
+
image: '/img/tokens/xlink.png',
|
|
477
|
+
coingeckoId: 'chainlink'
|
|
465
478
|
},
|
|
466
479
|
{
|
|
467
480
|
allowSwap: IS_MAINNET,
|
|
@@ -493,7 +506,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
493
506
|
hasWithdrawMemo: false
|
|
494
507
|
}]: [])
|
|
495
508
|
],
|
|
496
|
-
image: '/img/tokens/xltc.png'
|
|
509
|
+
image: '/img/tokens/xltc.png',
|
|
510
|
+
coingeckoId: 'litecoin'
|
|
497
511
|
},
|
|
498
512
|
{
|
|
499
513
|
allowSwap: IS_MAINNET,
|
|
@@ -525,7 +539,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
525
539
|
hasWithdrawMemo: false
|
|
526
540
|
}]: [])
|
|
527
541
|
],
|
|
528
|
-
image: '/img/tokens/xbch.png'
|
|
542
|
+
image: '/img/tokens/xbch.png',
|
|
543
|
+
coingeckoId: 'bitcoin-cash'
|
|
529
544
|
},
|
|
530
545
|
{
|
|
531
546
|
allowSwap: false,
|
|
@@ -557,7 +572,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
557
572
|
hasWithdrawMemo: true
|
|
558
573
|
}]: [])
|
|
559
574
|
],
|
|
560
|
-
image: '/img/tokens/xxlm.png'
|
|
575
|
+
image: '/img/tokens/xxlm.png',
|
|
576
|
+
coingeckoId: 'stellar'
|
|
561
577
|
},
|
|
562
578
|
{
|
|
563
579
|
allowSwap: IS_MAINNET,
|
|
@@ -570,7 +586,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
570
586
|
xtokenPrecision: 4,
|
|
571
587
|
xtokenContract: 'sense',
|
|
572
588
|
wallets: [],
|
|
573
|
-
image: '/img/tokens/xsense.png'
|
|
589
|
+
image: '/img/tokens/xsense.png',
|
|
590
|
+
coingeckoId: 'sense'
|
|
574
591
|
},
|
|
575
592
|
{
|
|
576
593
|
allowSwap: false,
|
|
@@ -593,7 +610,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
593
610
|
hasWithdrawMemo: false
|
|
594
611
|
}]: [])
|
|
595
612
|
],
|
|
596
|
-
image: '/img/tokens/xdot.png'
|
|
613
|
+
image: '/img/tokens/xdot.png',
|
|
614
|
+
coingeckoId: 'polkadot'
|
|
597
615
|
},
|
|
598
616
|
{
|
|
599
617
|
allowSwap: true,
|
|
@@ -616,7 +634,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
616
634
|
hasWithdrawMemo: false
|
|
617
635
|
}]: [])
|
|
618
636
|
],
|
|
619
|
-
image: '/img/tokens/xbnb.png'
|
|
637
|
+
image: '/img/tokens/xbnb.png',
|
|
638
|
+
coingeckoId: 'binancecoin'
|
|
620
639
|
},
|
|
621
640
|
{
|
|
622
641
|
allowSwap: true,
|
|
@@ -648,7 +667,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
648
667
|
hasWithdrawMemo: true
|
|
649
668
|
}]: [])
|
|
650
669
|
],
|
|
651
|
-
image: '/img/tokens/xeos.png'
|
|
670
|
+
image: '/img/tokens/xeos.png',
|
|
671
|
+
coingeckoId: 'eos'
|
|
652
672
|
},
|
|
653
673
|
{
|
|
654
674
|
allowSwap: false,
|
|
@@ -671,7 +691,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
671
691
|
hasWithdrawMemo: false
|
|
672
692
|
}]: [])
|
|
673
693
|
],
|
|
674
|
-
image: '/img/tokens/xhbar.png'
|
|
694
|
+
image: '/img/tokens/xhbar.png',
|
|
695
|
+
coingeckoId: 'hedera-hashgraph'
|
|
675
696
|
},
|
|
676
697
|
|
|
677
698
|
// Synthethic
|
|
@@ -696,7 +717,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
696
717
|
hasWithdrawMemo: false
|
|
697
718
|
}]: []),
|
|
698
719
|
],
|
|
699
|
-
image: '/img/tokens/xdoge.png'
|
|
720
|
+
image: '/img/tokens/xdoge.png',
|
|
721
|
+
coingeckoId: 'dogecoin'
|
|
700
722
|
},
|
|
701
723
|
{
|
|
702
724
|
allowSwap: IS_MAINNET,
|
|
@@ -719,7 +741,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
719
741
|
hasWithdrawMemo: false
|
|
720
742
|
}]: [])
|
|
721
743
|
],
|
|
722
|
-
image: '/img/tokens/xada.png'
|
|
744
|
+
image: '/img/tokens/xada.png',
|
|
745
|
+
coingeckoId: 'cardano'
|
|
723
746
|
},
|
|
724
747
|
{
|
|
725
748
|
allowSwap: false,
|
|
@@ -732,7 +755,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
732
755
|
xtokenPrecision: 6,
|
|
733
756
|
xtokenContract: 'xtokens',
|
|
734
757
|
wallets: [],
|
|
735
|
-
image: '/img/tokens/xtheta.png'
|
|
758
|
+
image: '/img/tokens/xtheta.png',
|
|
759
|
+
coingeckoId: 'theta-token'
|
|
736
760
|
},
|
|
737
761
|
{
|
|
738
762
|
allowSwap: false,
|
|
@@ -745,7 +769,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
745
769
|
xtokenPrecision: 6,
|
|
746
770
|
xtokenContract: 'xtokens',
|
|
747
771
|
wallets: [],
|
|
748
|
-
image: '/img/tokens/xfil.png'
|
|
772
|
+
image: '/img/tokens/xfil.png',
|
|
773
|
+
coingeckoId: 'filecoin'
|
|
749
774
|
},
|
|
750
775
|
{
|
|
751
776
|
allowSwap: false,
|
|
@@ -758,7 +783,8 @@ export const initializeCoins = (protonChain: string): {
|
|
|
758
783
|
xtokenPrecision: 6,
|
|
759
784
|
xtokenContract: 'xtokens',
|
|
760
785
|
wallets: [],
|
|
761
|
-
image: '/img/tokens/xtrx.png'
|
|
786
|
+
image: '/img/tokens/xtrx.png',
|
|
787
|
+
coingeckoId: 'tron'
|
|
762
788
|
},
|
|
763
789
|
// End synthetic
|
|
764
790
|
]
|
package/src/parsers/actions.ts
CHANGED
|
@@ -13,21 +13,21 @@ const rawTransactionParser = z.object({
|
|
|
13
13
|
transaction_extensions: z.array(z.any())
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
export const baseActionParser = (contract: string, action: string, data:
|
|
16
|
+
export const baseActionParser = <T extends ZodRawShape>(contract: string, action: string, data: T) => z.object({
|
|
17
17
|
account: contract === '*' ? accountParser : z.literal(contract),
|
|
18
18
|
name: z.literal(action),
|
|
19
19
|
data: z.object(data),
|
|
20
20
|
authorization: authorizationsParser
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
export const baseActionSerializedParser = (contract: string, action: string, data:
|
|
23
|
+
export const baseActionSerializedParser = <T extends ZodRawShape>(contract: string, action: string, data: T) => z.object({
|
|
24
24
|
account: contract === '*' ? accountParser : z.literal(contract),
|
|
25
25
|
name: z.literal(action),
|
|
26
26
|
data: z.string().or(z.object(data)),
|
|
27
27
|
authorization: authorizationsParser
|
|
28
28
|
})
|
|
29
29
|
|
|
30
|
-
export const webauthActionParser = (contract: string, action: string, data:
|
|
30
|
+
export const webauthActionParser = <T extends ZodRawShape>(contract: string, action: string, data: T) => z.object({
|
|
31
31
|
account: z.literal('webauthn'),
|
|
32
32
|
name: z.literal('exec'),
|
|
33
33
|
data: z.object({
|
|
@@ -58,7 +58,7 @@ export const webauthActionParser = (contract: string, action: string, data: ZodR
|
|
|
58
58
|
authorization: authorizationsParser
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
export const singleActionTransactionParser = (contract: string, action: string, data:
|
|
61
|
+
export const singleActionTransactionParser = <T extends ZodRawShape>(contract: string, action: string, data: T) => {
|
|
62
62
|
const baseAction = baseActionParser(contract, action, data)
|
|
63
63
|
const webauthAction = webauthActionParser(contract, action, data)
|
|
64
64
|
|
package/src/parsers/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface RawPool {
|
|
2
|
+
lt_symbol: string;
|
|
3
|
+
creator: string;
|
|
4
|
+
memo: string;
|
|
5
|
+
pool1: {
|
|
6
|
+
quantity: string;
|
|
7
|
+
contract: string;
|
|
8
|
+
};
|
|
9
|
+
pool2: {
|
|
10
|
+
quantity: string;
|
|
11
|
+
contract: string;
|
|
12
|
+
};
|
|
13
|
+
hash: string;
|
|
14
|
+
fee: {
|
|
15
|
+
exchange_fee: number;
|
|
16
|
+
add_liquidity_fee: number;
|
|
17
|
+
remove_liquidity_fee: number;
|
|
18
|
+
};
|
|
19
|
+
active: boolean;
|
|
20
|
+
reserved?: any;
|
|
21
|
+
}
|