@paraspell/sdk 5.8.0 → 5.10.0
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/README.md +26 -1
- package/dist/index.cjs +1481 -525
- package/dist/index.d.ts +542 -68
- package/dist/index.mjs +1475 -527
- package/package.json +13 -12
package/dist/index.cjs
CHANGED
|
@@ -570,7 +570,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
570
570
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
571
571
|
PERFORMANCE OF THIS SOFTWARE.
|
|
572
572
|
***************************************************************************** */
|
|
573
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
573
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
574
574
|
|
|
575
575
|
|
|
576
576
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
@@ -602,6 +602,12 @@ exports.Parents = void 0;
|
|
|
602
602
|
Parents[Parents["TWO"] = 2] = "TWO";
|
|
603
603
|
})(exports.Parents || (exports.Parents = {}));
|
|
604
604
|
|
|
605
|
+
exports.BatchMode = void 0;
|
|
606
|
+
(function (BatchMode) {
|
|
607
|
+
BatchMode["BATCH_ALL"] = "BATCH_ALL";
|
|
608
|
+
BatchMode["BATCH"] = "BATCH";
|
|
609
|
+
})(exports.BatchMode || (exports.BatchMode = {}));
|
|
610
|
+
|
|
605
611
|
// Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
606
612
|
var NoXCMSupportImplementedError = /*#__PURE__*/function (_Error) {
|
|
607
613
|
function NoXCMSupportImplementedError(node) {
|
|
@@ -613,8 +619,32 @@ var NoXCMSupportImplementedError = /*#__PURE__*/function (_Error) {
|
|
|
613
619
|
}
|
|
614
620
|
_inherits(NoXCMSupportImplementedError, _Error);
|
|
615
621
|
return _createClass(NoXCMSupportImplementedError);
|
|
616
|
-
}(
|
|
622
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
617
623
|
|
|
624
|
+
var Polkadot$1 = {
|
|
625
|
+
relayChainAssetSymbol: "DOT",
|
|
626
|
+
nativeAssetSymbol: "DOT",
|
|
627
|
+
nativeAssets: [
|
|
628
|
+
{
|
|
629
|
+
symbol: "DOT",
|
|
630
|
+
decimals: 10
|
|
631
|
+
}
|
|
632
|
+
],
|
|
633
|
+
otherAssets: [
|
|
634
|
+
]
|
|
635
|
+
};
|
|
636
|
+
var Kusama$1 = {
|
|
637
|
+
relayChainAssetSymbol: "KSM",
|
|
638
|
+
nativeAssetSymbol: "KSM",
|
|
639
|
+
nativeAssets: [
|
|
640
|
+
{
|
|
641
|
+
symbol: "KSM",
|
|
642
|
+
decimals: 12
|
|
643
|
+
}
|
|
644
|
+
],
|
|
645
|
+
otherAssets: [
|
|
646
|
+
]
|
|
647
|
+
};
|
|
618
648
|
var Acala$3 = {
|
|
619
649
|
paraId: 2000,
|
|
620
650
|
relayChainAssetSymbol: "DOT",
|
|
@@ -666,6 +696,11 @@ var Acala$3 = {
|
|
|
666
696
|
symbol: "EQD",
|
|
667
697
|
decimals: 9
|
|
668
698
|
},
|
|
699
|
+
{
|
|
700
|
+
assetId: "16",
|
|
701
|
+
symbol: "PDEX",
|
|
702
|
+
decimals: 12
|
|
703
|
+
},
|
|
669
704
|
{
|
|
670
705
|
assetId: "4",
|
|
671
706
|
symbol: "INTR",
|
|
@@ -726,6 +761,11 @@ var Acala$3 = {
|
|
|
726
761
|
symbol: "LDO",
|
|
727
762
|
decimals: 18
|
|
728
763
|
},
|
|
764
|
+
{
|
|
765
|
+
assetId: "17",
|
|
766
|
+
symbol: "HDX",
|
|
767
|
+
decimals: 12
|
|
768
|
+
},
|
|
729
769
|
{
|
|
730
770
|
assetId: "0x54a37a01cd75b616d63e0ab665bffdb0143c52ae",
|
|
731
771
|
symbol: "DAI",
|
|
@@ -791,6 +831,11 @@ var Acala$3 = {
|
|
|
791
831
|
symbol: "WBTC",
|
|
792
832
|
decimals: 8
|
|
793
833
|
},
|
|
834
|
+
{
|
|
835
|
+
assetId: "15",
|
|
836
|
+
symbol: "CFG",
|
|
837
|
+
decimals: 18
|
|
838
|
+
},
|
|
794
839
|
{
|
|
795
840
|
assetId: "3",
|
|
796
841
|
symbol: "IBTC",
|
|
@@ -1204,11 +1249,6 @@ var Centrifuge$3 = {
|
|
|
1204
1249
|
symbol: "USDC",
|
|
1205
1250
|
decimals: 6
|
|
1206
1251
|
},
|
|
1207
|
-
{
|
|
1208
|
-
assetId: "N",
|
|
1209
|
-
symbol: "CFG",
|
|
1210
|
-
decimals: 18
|
|
1211
|
-
},
|
|
1212
1252
|
{
|
|
1213
1253
|
assetId: "100002",
|
|
1214
1254
|
symbol: "LpBaseUSDC",
|
|
@@ -1418,6 +1458,26 @@ var Darwinia$3 = {
|
|
|
1418
1458
|
}
|
|
1419
1459
|
],
|
|
1420
1460
|
otherAssets: [
|
|
1461
|
+
{
|
|
1462
|
+
assetId: "1027",
|
|
1463
|
+
symbol: "ahUSDT",
|
|
1464
|
+
decimals: 6
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
assetId: "1026",
|
|
1468
|
+
symbol: "KTON",
|
|
1469
|
+
decimals: 18
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
assetId: "1028",
|
|
1473
|
+
symbol: "ahPINK",
|
|
1474
|
+
decimals: 10
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
assetId: "1029",
|
|
1478
|
+
symbol: "DOT",
|
|
1479
|
+
decimals: 10
|
|
1480
|
+
}
|
|
1421
1481
|
]
|
|
1422
1482
|
};
|
|
1423
1483
|
var Hydration$3 = {
|
|
@@ -1763,7 +1823,7 @@ var Litentry$3 = {
|
|
|
1763
1823
|
nativeAssets: [
|
|
1764
1824
|
{
|
|
1765
1825
|
symbol: "LIT",
|
|
1766
|
-
decimals:
|
|
1826
|
+
decimals: 18
|
|
1767
1827
|
}
|
|
1768
1828
|
],
|
|
1769
1829
|
otherAssets: [
|
|
@@ -2211,6 +2271,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2211
2271
|
symbol: "MYTH",
|
|
2212
2272
|
decimals: 18
|
|
2213
2273
|
},
|
|
2274
|
+
{
|
|
2275
|
+
assetId: "22222005",
|
|
2276
|
+
symbol: "love",
|
|
2277
|
+
decimals: 12
|
|
2278
|
+
},
|
|
2214
2279
|
{
|
|
2215
2280
|
assetId: "9999",
|
|
2216
2281
|
symbol: "TOM",
|
|
@@ -2226,6 +2291,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2226
2291
|
symbol: "WETH",
|
|
2227
2292
|
decimals: 18
|
|
2228
2293
|
},
|
|
2294
|
+
{
|
|
2295
|
+
assetId: "22222041",
|
|
2296
|
+
symbol: "PAD",
|
|
2297
|
+
decimals: 12
|
|
2298
|
+
},
|
|
2229
2299
|
{
|
|
2230
2300
|
assetId: "56",
|
|
2231
2301
|
symbol: "UNION",
|
|
@@ -2236,6 +2306,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2236
2306
|
symbol: "HUB",
|
|
2237
2307
|
decimals: 10
|
|
2238
2308
|
},
|
|
2309
|
+
{
|
|
2310
|
+
assetId: "22222025",
|
|
2311
|
+
symbol: "XCMS",
|
|
2312
|
+
decimals: 12
|
|
2313
|
+
},
|
|
2239
2314
|
{
|
|
2240
2315
|
assetId: "81",
|
|
2241
2316
|
symbol: "GVN",
|
|
@@ -2266,6 +2341,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2266
2341
|
symbol: "DUCK",
|
|
2267
2342
|
decimals: 10
|
|
2268
2343
|
},
|
|
2344
|
+
{
|
|
2345
|
+
assetId: "58",
|
|
2346
|
+
symbol: "MDMA",
|
|
2347
|
+
decimals: 12
|
|
2348
|
+
},
|
|
2269
2349
|
{
|
|
2270
2350
|
assetId: "222",
|
|
2271
2351
|
symbol: "SHL",
|
|
@@ -2311,21 +2391,46 @@ var AssetHubPolkadot$3 = {
|
|
|
2311
2391
|
symbol: "NFLR",
|
|
2312
2392
|
decimals: 10
|
|
2313
2393
|
},
|
|
2394
|
+
{
|
|
2395
|
+
assetId: "22222028",
|
|
2396
|
+
symbol: "COKE",
|
|
2397
|
+
decimals: 12
|
|
2398
|
+
},
|
|
2314
2399
|
{
|
|
2315
2400
|
assetId: "20090110",
|
|
2316
2401
|
symbol: "test1",
|
|
2317
2402
|
decimals: 10
|
|
2318
2403
|
},
|
|
2404
|
+
{
|
|
2405
|
+
assetId: "22222024",
|
|
2406
|
+
symbol: "POLISD",
|
|
2407
|
+
decimals: 12
|
|
2408
|
+
},
|
|
2319
2409
|
{
|
|
2320
2410
|
assetId: "256",
|
|
2321
2411
|
symbol: "ICE",
|
|
2322
2412
|
decimals: 20
|
|
2323
2413
|
},
|
|
2414
|
+
{
|
|
2415
|
+
assetId: "22222070",
|
|
2416
|
+
symbol: "Mill",
|
|
2417
|
+
decimals: 12
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
assetId: "22222019",
|
|
2421
|
+
symbol: "PI",
|
|
2422
|
+
decimals: 12
|
|
2423
|
+
},
|
|
2324
2424
|
{
|
|
2325
2425
|
assetId: "20090130",
|
|
2326
2426
|
symbol: "SUS",
|
|
2327
2427
|
decimals: 10
|
|
2328
2428
|
},
|
|
2429
|
+
{
|
|
2430
|
+
assetId: "108",
|
|
2431
|
+
symbol: "GAME",
|
|
2432
|
+
decimals: 10
|
|
2433
|
+
},
|
|
2329
2434
|
{
|
|
2330
2435
|
assetId: "1111",
|
|
2331
2436
|
symbol: "TESTV2",
|
|
@@ -2336,21 +2441,41 @@ var AssetHubPolkadot$3 = {
|
|
|
2336
2441
|
symbol: "USDT",
|
|
2337
2442
|
decimals: 16
|
|
2338
2443
|
},
|
|
2444
|
+
{
|
|
2445
|
+
assetId: "22222008",
|
|
2446
|
+
symbol: "ALIEN",
|
|
2447
|
+
decimals: 12
|
|
2448
|
+
},
|
|
2339
2449
|
{
|
|
2340
2450
|
assetId: "300",
|
|
2341
2451
|
symbol: "DOGE",
|
|
2342
2452
|
decimals: 6
|
|
2343
2453
|
},
|
|
2454
|
+
{
|
|
2455
|
+
assetId: "22222046",
|
|
2456
|
+
symbol: "$PGH",
|
|
2457
|
+
decimals: 12
|
|
2458
|
+
},
|
|
2344
2459
|
{
|
|
2345
2460
|
assetId: "4",
|
|
2346
2461
|
symbol: "EFI",
|
|
2347
2462
|
decimals: 18
|
|
2348
2463
|
},
|
|
2464
|
+
{
|
|
2465
|
+
assetId: "22222043",
|
|
2466
|
+
symbol: "DDT",
|
|
2467
|
+
decimals: 12
|
|
2468
|
+
},
|
|
2349
2469
|
{
|
|
2350
2470
|
assetId: "48",
|
|
2351
2471
|
symbol: "SAX",
|
|
2352
2472
|
decimals: 2
|
|
2353
2473
|
},
|
|
2474
|
+
{
|
|
2475
|
+
assetId: "22222064",
|
|
2476
|
+
symbol: "RIDEMY",
|
|
2477
|
+
decimals: 12
|
|
2478
|
+
},
|
|
2354
2479
|
{
|
|
2355
2480
|
assetId: "21",
|
|
2356
2481
|
symbol: "WBTC",
|
|
@@ -2361,6 +2486,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2361
2486
|
symbol: "DOKA",
|
|
2362
2487
|
decimals: 6
|
|
2363
2488
|
},
|
|
2489
|
+
{
|
|
2490
|
+
assetId: "22222050",
|
|
2491
|
+
symbol: "SHIVER",
|
|
2492
|
+
decimals: 12
|
|
2493
|
+
},
|
|
2364
2494
|
{
|
|
2365
2495
|
assetId: "28",
|
|
2366
2496
|
symbol: "BULL",
|
|
@@ -2426,6 +2556,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2426
2556
|
symbol: "SHIB",
|
|
2427
2557
|
decimals: 6
|
|
2428
2558
|
},
|
|
2559
|
+
{
|
|
2560
|
+
assetId: "20090147",
|
|
2561
|
+
symbol: "RVGAV",
|
|
2562
|
+
decimals: 10
|
|
2563
|
+
},
|
|
2429
2564
|
{
|
|
2430
2565
|
assetId: "46",
|
|
2431
2566
|
symbol: "PEPE",
|
|
@@ -2436,6 +2571,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2436
2571
|
symbol: "BSOD",
|
|
2437
2572
|
decimals: 10
|
|
2438
2573
|
},
|
|
2574
|
+
{
|
|
2575
|
+
assetId: "22222036",
|
|
2576
|
+
symbol: "Shit",
|
|
2577
|
+
decimals: 12
|
|
2578
|
+
},
|
|
2439
2579
|
{
|
|
2440
2580
|
assetId: "99",
|
|
2441
2581
|
symbol: "Cypress",
|
|
@@ -2447,9 +2587,14 @@ var AssetHubPolkadot$3 = {
|
|
|
2447
2587
|
decimals: 12
|
|
2448
2588
|
},
|
|
2449
2589
|
{
|
|
2450
|
-
assetId: "
|
|
2451
|
-
symbol: "
|
|
2452
|
-
decimals:
|
|
2590
|
+
assetId: "22222058",
|
|
2591
|
+
symbol: "PLS",
|
|
2592
|
+
decimals: 12
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
assetId: "22222002",
|
|
2596
|
+
symbol: "TeMeL",
|
|
2597
|
+
decimals: 12
|
|
2453
2598
|
},
|
|
2454
2599
|
{
|
|
2455
2600
|
assetId: "20090114",
|
|
@@ -2466,6 +2611,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2466
2611
|
symbol: "web3",
|
|
2467
2612
|
decimals: 18
|
|
2468
2613
|
},
|
|
2614
|
+
{
|
|
2615
|
+
assetId: "22222051",
|
|
2616
|
+
symbol: "NIN",
|
|
2617
|
+
decimals: 12
|
|
2618
|
+
},
|
|
2619
|
+
{
|
|
2620
|
+
assetId: "22222020",
|
|
2621
|
+
symbol: "CDOG",
|
|
2622
|
+
decimals: 12
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
assetId: "22222073",
|
|
2626
|
+
symbol: "0x4b61696279c58d",
|
|
2627
|
+
decimals: 12
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
assetId: "22222074",
|
|
2631
|
+
symbol: "$JAM",
|
|
2632
|
+
decimals: 12
|
|
2633
|
+
},
|
|
2469
2634
|
{
|
|
2470
2635
|
assetId: "20090111",
|
|
2471
2636
|
symbol: "txt",
|
|
@@ -2476,6 +2641,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2476
2641
|
symbol: "DED",
|
|
2477
2642
|
decimals: 18
|
|
2478
2643
|
},
|
|
2644
|
+
{
|
|
2645
|
+
assetId: "22222062",
|
|
2646
|
+
symbol: "ALPHA",
|
|
2647
|
+
decimals: 12
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
assetId: "75",
|
|
2651
|
+
symbol: "TeMe14",
|
|
2652
|
+
decimals: 12
|
|
2653
|
+
},
|
|
2479
2654
|
{
|
|
2480
2655
|
assetId: "20090119",
|
|
2481
2656
|
symbol: "MDGA",
|
|
@@ -2491,6 +2666,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2491
2666
|
symbol: "IBW",
|
|
2492
2667
|
decimals: 10
|
|
2493
2668
|
},
|
|
2669
|
+
{
|
|
2670
|
+
assetId: "22222075",
|
|
2671
|
+
symbol: "DUD",
|
|
2672
|
+
decimals: 12
|
|
2673
|
+
},
|
|
2674
|
+
{
|
|
2675
|
+
assetId: "22222022",
|
|
2676
|
+
symbol: "X",
|
|
2677
|
+
decimals: 12
|
|
2678
|
+
},
|
|
2494
2679
|
{
|
|
2495
2680
|
assetId: "122",
|
|
2496
2681
|
symbol: "TESTING",
|
|
@@ -2511,6 +2696,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2511
2696
|
symbol: "JAMD",
|
|
2512
2697
|
decimals: 10
|
|
2513
2698
|
},
|
|
2699
|
+
{
|
|
2700
|
+
assetId: "57",
|
|
2701
|
+
symbol: "MCP",
|
|
2702
|
+
decimals: 12
|
|
2703
|
+
},
|
|
2704
|
+
{
|
|
2705
|
+
assetId: "22222021",
|
|
2706
|
+
symbol: "BBB",
|
|
2707
|
+
decimals: 12
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
assetId: "22222009",
|
|
2711
|
+
symbol: "china",
|
|
2712
|
+
decimals: 12
|
|
2713
|
+
},
|
|
2514
2714
|
{
|
|
2515
2715
|
assetId: "14",
|
|
2516
2716
|
symbol: "LEAP",
|
|
@@ -2546,6 +2746,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2546
2746
|
symbol: "STINK",
|
|
2547
2747
|
decimals: 10
|
|
2548
2748
|
},
|
|
2749
|
+
{
|
|
2750
|
+
assetId: "22222068",
|
|
2751
|
+
symbol: "V",
|
|
2752
|
+
decimals: 12
|
|
2753
|
+
},
|
|
2549
2754
|
{
|
|
2550
2755
|
assetId: "20090143",
|
|
2551
2756
|
symbol: "DMSTR",
|
|
@@ -2577,9 +2782,14 @@ var AssetHubPolkadot$3 = {
|
|
|
2577
2782
|
decimals: 10
|
|
2578
2783
|
},
|
|
2579
2784
|
{
|
|
2580
|
-
assetId: "
|
|
2581
|
-
symbol: "
|
|
2582
|
-
decimals:
|
|
2785
|
+
assetId: "22222078",
|
|
2786
|
+
symbol: "JAMTON",
|
|
2787
|
+
decimals: 12
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
assetId: "73",
|
|
2791
|
+
symbol: "TeMe12",
|
|
2792
|
+
decimals: 12
|
|
2583
2793
|
},
|
|
2584
2794
|
{
|
|
2585
2795
|
assetId: "77",
|
|
@@ -2591,6 +2801,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2591
2801
|
symbol: "DOGE",
|
|
2592
2802
|
decimals: 10
|
|
2593
2803
|
},
|
|
2804
|
+
{
|
|
2805
|
+
assetId: "22222029",
|
|
2806
|
+
symbol: "dog",
|
|
2807
|
+
decimals: 12
|
|
2808
|
+
},
|
|
2594
2809
|
{
|
|
2595
2810
|
assetId: "9002",
|
|
2596
2811
|
symbol: "TAPE",
|
|
@@ -2606,6 +2821,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2606
2821
|
symbol: "GIO",
|
|
2607
2822
|
decimals: 10
|
|
2608
2823
|
},
|
|
2824
|
+
{
|
|
2825
|
+
assetId: "22222053",
|
|
2826
|
+
symbol: "DOTZ",
|
|
2827
|
+
decimals: 12
|
|
2828
|
+
},
|
|
2829
|
+
{
|
|
2830
|
+
assetId: "1747",
|
|
2831
|
+
symbol: "EMR",
|
|
2832
|
+
decimals: 10
|
|
2833
|
+
},
|
|
2609
2834
|
{
|
|
2610
2835
|
assetId: "31",
|
|
2611
2836
|
symbol: "WOOD",
|
|
@@ -2661,6 +2886,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2661
2886
|
symbol: "SKL",
|
|
2662
2887
|
decimals: 6
|
|
2663
2888
|
},
|
|
2889
|
+
{
|
|
2890
|
+
assetId: "22222077",
|
|
2891
|
+
symbol: "SAPIEN",
|
|
2892
|
+
decimals: 12
|
|
2893
|
+
},
|
|
2664
2894
|
{
|
|
2665
2895
|
assetId: "15",
|
|
2666
2896
|
symbol: "Meme",
|
|
@@ -2671,6 +2901,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2671
2901
|
symbol: "BUG",
|
|
2672
2902
|
decimals: 12
|
|
2673
2903
|
},
|
|
2904
|
+
{
|
|
2905
|
+
assetId: "22222013",
|
|
2906
|
+
symbol: "TM",
|
|
2907
|
+
decimals: 12
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
assetId: "22222010",
|
|
2911
|
+
symbol: "TP",
|
|
2912
|
+
decimals: 12
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
assetId: "22222071",
|
|
2916
|
+
symbol: "WUDFUD",
|
|
2917
|
+
decimals: 12
|
|
2918
|
+
},
|
|
2674
2919
|
{
|
|
2675
2920
|
assetId: "78",
|
|
2676
2921
|
symbol: "COCA",
|
|
@@ -2691,6 +2936,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2691
2936
|
symbol: "PEPE",
|
|
2692
2937
|
decimals: 10
|
|
2693
2938
|
},
|
|
2939
|
+
{
|
|
2940
|
+
assetId: "20090144",
|
|
2941
|
+
symbol: "CHUG",
|
|
2942
|
+
decimals: 10
|
|
2943
|
+
},
|
|
2694
2944
|
{
|
|
2695
2945
|
assetId: "2",
|
|
2696
2946
|
symbol: "BTC",
|
|
@@ -2711,6 +2961,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2711
2961
|
symbol: "POO",
|
|
2712
2962
|
decimals: 10
|
|
2713
2963
|
},
|
|
2964
|
+
{
|
|
2965
|
+
assetId: "22222031",
|
|
2966
|
+
symbol: "VRN",
|
|
2967
|
+
decimals: 12
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
assetId: "22222014",
|
|
2971
|
+
symbol: "GIT",
|
|
2972
|
+
decimals: 12
|
|
2973
|
+
},
|
|
2714
2974
|
{
|
|
2715
2975
|
assetId: "20090129",
|
|
2716
2976
|
symbol: "FCD",
|
|
@@ -2721,6 +2981,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2721
2981
|
symbol: "SATS",
|
|
2722
2982
|
decimals: 6
|
|
2723
2983
|
},
|
|
2984
|
+
{
|
|
2985
|
+
assetId: "22222034",
|
|
2986
|
+
symbol: "0xf09f9980",
|
|
2987
|
+
decimals: 12
|
|
2988
|
+
},
|
|
2989
|
+
{
|
|
2990
|
+
assetId: "74",
|
|
2991
|
+
symbol: "TeMe13",
|
|
2992
|
+
decimals: 12
|
|
2993
|
+
},
|
|
2724
2994
|
{
|
|
2725
2995
|
assetId: "70",
|
|
2726
2996
|
symbol: "STEEBOR",
|
|
@@ -2731,11 +3001,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2731
3001
|
symbol: "HTG",
|
|
2732
3002
|
decimals: 10
|
|
2733
3003
|
},
|
|
3004
|
+
{
|
|
3005
|
+
assetId: "12746",
|
|
3006
|
+
symbol: "TTTT",
|
|
3007
|
+
decimals: 6
|
|
3008
|
+
},
|
|
2734
3009
|
{
|
|
2735
3010
|
assetId: "32",
|
|
2736
3011
|
symbol: "CLAY",
|
|
2737
3012
|
decimals: 10
|
|
2738
3013
|
},
|
|
3014
|
+
{
|
|
3015
|
+
assetId: "22222035",
|
|
3016
|
+
symbol: ".WH",
|
|
3017
|
+
decimals: 12
|
|
3018
|
+
},
|
|
3019
|
+
{
|
|
3020
|
+
assetId: "82",
|
|
3021
|
+
symbol: "ANGRY",
|
|
3022
|
+
decimals: 12
|
|
3023
|
+
},
|
|
3024
|
+
{
|
|
3025
|
+
assetId: "22222065",
|
|
3026
|
+
symbol: "BBQ",
|
|
3027
|
+
decimals: 12
|
|
3028
|
+
},
|
|
2739
3029
|
{
|
|
2740
3030
|
assetId: "2106",
|
|
2741
3031
|
symbol: "STREAK",
|
|
@@ -2756,11 +3046,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2756
3046
|
symbol: "STAR",
|
|
2757
3047
|
decimals: 6
|
|
2758
3048
|
},
|
|
3049
|
+
{
|
|
3050
|
+
assetId: "22222001",
|
|
3051
|
+
symbol: "OMG2",
|
|
3052
|
+
decimals: 12
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
assetId: "22222042",
|
|
3056
|
+
symbol: "CORE",
|
|
3057
|
+
decimals: 12
|
|
3058
|
+
},
|
|
3059
|
+
{
|
|
3060
|
+
assetId: "22222018",
|
|
3061
|
+
symbol: "WOLF",
|
|
3062
|
+
decimals: 12
|
|
3063
|
+
},
|
|
2759
3064
|
{
|
|
2760
3065
|
assetId: "49",
|
|
2761
3066
|
symbol: "TeMe7",
|
|
2762
3067
|
decimals: 12
|
|
2763
3068
|
},
|
|
3069
|
+
{
|
|
3070
|
+
assetId: "22222044",
|
|
3071
|
+
symbol: "DONUT",
|
|
3072
|
+
decimals: 12
|
|
3073
|
+
},
|
|
2764
3074
|
{
|
|
2765
3075
|
assetId: "868367",
|
|
2766
3076
|
symbol: "VSC",
|
|
@@ -2776,6 +3086,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2776
3086
|
symbol: "JTO",
|
|
2777
3087
|
decimals: 10
|
|
2778
3088
|
},
|
|
3089
|
+
{
|
|
3090
|
+
assetId: "22222037",
|
|
3091
|
+
symbol: "KSM",
|
|
3092
|
+
decimals: 12
|
|
3093
|
+
},
|
|
2779
3094
|
{
|
|
2780
3095
|
assetId: "53",
|
|
2781
3096
|
symbol: "TeMe9",
|
|
@@ -2796,6 +3111,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2796
3111
|
symbol: "GAVUN",
|
|
2797
3112
|
decimals: 10
|
|
2798
3113
|
},
|
|
3114
|
+
{
|
|
3115
|
+
assetId: "22222059",
|
|
3116
|
+
symbol: "GOOD",
|
|
3117
|
+
decimals: 12
|
|
3118
|
+
},
|
|
2799
3119
|
{
|
|
2800
3120
|
assetId: "43",
|
|
2801
3121
|
symbol: "TeMe5",
|
|
@@ -2811,6 +3131,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2811
3131
|
symbol: "DOTA",
|
|
2812
3132
|
decimals: 6
|
|
2813
3133
|
},
|
|
3134
|
+
{
|
|
3135
|
+
assetId: "22222003",
|
|
3136
|
+
symbol: "TeMe2L",
|
|
3137
|
+
decimals: 12
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
assetId: "22222039",
|
|
3141
|
+
symbol: "DTS",
|
|
3142
|
+
decimals: 12
|
|
3143
|
+
},
|
|
2814
3144
|
{
|
|
2815
3145
|
assetId: "5",
|
|
2816
3146
|
symbol: "PLX",
|
|
@@ -2821,11 +3151,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2821
3151
|
symbol: "DOTA",
|
|
2822
3152
|
decimals: 4
|
|
2823
3153
|
},
|
|
3154
|
+
{
|
|
3155
|
+
assetId: "83",
|
|
3156
|
+
symbol: "BOYS",
|
|
3157
|
+
decimals: 12
|
|
3158
|
+
},
|
|
2824
3159
|
{
|
|
2825
3160
|
assetId: "7",
|
|
2826
3161
|
symbol: "lucky7",
|
|
2827
3162
|
decimals: 20
|
|
2828
3163
|
},
|
|
3164
|
+
{
|
|
3165
|
+
assetId: "22222055",
|
|
3166
|
+
symbol: "TOP",
|
|
3167
|
+
decimals: 12
|
|
3168
|
+
},
|
|
2829
3169
|
{
|
|
2830
3170
|
assetId: "4242",
|
|
2831
3171
|
symbol: "GAVUN",
|
|
@@ -2841,6 +3181,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2841
3181
|
symbol: "ETH",
|
|
2842
3182
|
decimals: 10
|
|
2843
3183
|
},
|
|
3184
|
+
{
|
|
3185
|
+
assetId: "22222072",
|
|
3186
|
+
symbol: "BNG",
|
|
3187
|
+
decimals: 12
|
|
3188
|
+
},
|
|
2844
3189
|
{
|
|
2845
3190
|
assetId: "201",
|
|
2846
3191
|
symbol: "WUD",
|
|
@@ -2876,6 +3221,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2876
3221
|
symbol: "BORK",
|
|
2877
3222
|
decimals: 10
|
|
2878
3223
|
},
|
|
3224
|
+
{
|
|
3225
|
+
assetId: "22222048",
|
|
3226
|
+
symbol: "PKSK",
|
|
3227
|
+
decimals: 12
|
|
3228
|
+
},
|
|
2879
3229
|
{
|
|
2880
3230
|
assetId: "33441",
|
|
2881
3231
|
symbol: "MPACT",
|
|
@@ -2901,6 +3251,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2901
3251
|
symbol: "PGOLD",
|
|
2902
3252
|
decimals: 7
|
|
2903
3253
|
},
|
|
3254
|
+
{
|
|
3255
|
+
assetId: "22222038",
|
|
3256
|
+
symbol: "VOR",
|
|
3257
|
+
decimals: 12
|
|
3258
|
+
},
|
|
2904
3259
|
{
|
|
2905
3260
|
assetId: "777",
|
|
2906
3261
|
symbol: "777",
|
|
@@ -2916,18 +3271,43 @@ var AssetHubPolkadot$3 = {
|
|
|
2916
3271
|
symbol: "test1",
|
|
2917
3272
|
decimals: 10
|
|
2918
3273
|
},
|
|
3274
|
+
{
|
|
3275
|
+
assetId: "22222076",
|
|
3276
|
+
symbol: "AAPL",
|
|
3277
|
+
decimals: 12
|
|
3278
|
+
},
|
|
2919
3279
|
{
|
|
2920
3280
|
assetId: "567",
|
|
2921
3281
|
symbol: "ANT",
|
|
2922
3282
|
decimals: 6
|
|
2923
3283
|
},
|
|
3284
|
+
{
|
|
3285
|
+
assetId: "457",
|
|
3286
|
+
symbol: "HGVH",
|
|
3287
|
+
decimals: 10
|
|
3288
|
+
},
|
|
3289
|
+
{
|
|
3290
|
+
assetId: "68",
|
|
3291
|
+
symbol: "Coin68",
|
|
3292
|
+
decimals: 12
|
|
3293
|
+
},
|
|
2924
3294
|
{
|
|
2925
3295
|
assetId: "54",
|
|
2926
3296
|
symbol: "TeMe10",
|
|
2927
3297
|
decimals: 12
|
|
2928
3298
|
},
|
|
2929
3299
|
{
|
|
2930
|
-
assetId: "
|
|
3300
|
+
assetId: "22222023",
|
|
3301
|
+
symbol: "LURPIS",
|
|
3302
|
+
decimals: 12
|
|
3303
|
+
},
|
|
3304
|
+
{
|
|
3305
|
+
assetId: "22222066",
|
|
3306
|
+
symbol: "DUW",
|
|
3307
|
+
decimals: 12
|
|
3308
|
+
},
|
|
3309
|
+
{
|
|
3310
|
+
assetId: "1230",
|
|
2931
3311
|
symbol: "HAM",
|
|
2932
3312
|
decimals: 10
|
|
2933
3313
|
},
|
|
@@ -2936,11 +3316,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2936
3316
|
symbol: "RNET",
|
|
2937
3317
|
decimals: 0
|
|
2938
3318
|
},
|
|
3319
|
+
{
|
|
3320
|
+
assetId: "22222027",
|
|
3321
|
+
symbol: "TDC",
|
|
3322
|
+
decimals: 12
|
|
3323
|
+
},
|
|
2939
3324
|
{
|
|
2940
3325
|
assetId: "9003",
|
|
2941
3326
|
symbol: "KTRL",
|
|
2942
3327
|
decimals: 10
|
|
2943
3328
|
},
|
|
3329
|
+
{
|
|
3330
|
+
assetId: "22222033",
|
|
3331
|
+
symbol: "H@SH",
|
|
3332
|
+
decimals: 12
|
|
3333
|
+
},
|
|
2944
3334
|
{
|
|
2945
3335
|
assetId: "1313",
|
|
2946
3336
|
symbol: "GGI",
|
|
@@ -2966,11 +3356,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2966
3356
|
symbol: "dot",
|
|
2967
3357
|
decimals: 0
|
|
2968
3358
|
},
|
|
3359
|
+
{
|
|
3360
|
+
assetId: "22222067",
|
|
3361
|
+
symbol: "ZALUPA",
|
|
3362
|
+
decimals: 12
|
|
3363
|
+
},
|
|
2969
3364
|
{
|
|
2970
3365
|
assetId: "90",
|
|
2971
3366
|
symbol: "ATC",
|
|
2972
3367
|
decimals: 6
|
|
2973
3368
|
},
|
|
3369
|
+
{
|
|
3370
|
+
assetId: "22222017",
|
|
3371
|
+
symbol: "SANTA",
|
|
3372
|
+
decimals: 12
|
|
3373
|
+
},
|
|
2974
3374
|
{
|
|
2975
3375
|
assetId: "80",
|
|
2976
3376
|
symbol: "GOVD",
|
|
@@ -2996,11 +3396,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2996
3396
|
symbol: "HYDRA",
|
|
2997
3397
|
decimals: 10
|
|
2998
3398
|
},
|
|
3399
|
+
{
|
|
3400
|
+
assetId: "22222057",
|
|
3401
|
+
symbol: "DIO",
|
|
3402
|
+
decimals: 12
|
|
3403
|
+
},
|
|
2999
3404
|
{
|
|
3000
3405
|
assetId: "10000",
|
|
3001
3406
|
symbol: "DOGE",
|
|
3002
3407
|
decimals: 6
|
|
3003
3408
|
},
|
|
3409
|
+
{
|
|
3410
|
+
assetId: "59",
|
|
3411
|
+
symbol: "OK",
|
|
3412
|
+
decimals: 12
|
|
3413
|
+
},
|
|
3004
3414
|
{
|
|
3005
3415
|
assetId: "2820",
|
|
3006
3416
|
symbol: "HOOT",
|
|
@@ -3011,6 +3421,21 @@ var AssetHubPolkadot$3 = {
|
|
|
3011
3421
|
symbol: "PP",
|
|
3012
3422
|
decimals: 10
|
|
3013
3423
|
},
|
|
3424
|
+
{
|
|
3425
|
+
assetId: "22222069",
|
|
3426
|
+
symbol: "HELLO",
|
|
3427
|
+
decimals: 12
|
|
3428
|
+
},
|
|
3429
|
+
{
|
|
3430
|
+
assetId: "22222007",
|
|
3431
|
+
symbol: "NaCl",
|
|
3432
|
+
decimals: 12
|
|
3433
|
+
},
|
|
3434
|
+
{
|
|
3435
|
+
assetId: "2567",
|
|
3436
|
+
symbol: "TSTRM",
|
|
3437
|
+
decimals: 6
|
|
3438
|
+
},
|
|
3014
3439
|
{
|
|
3015
3440
|
assetId: "51",
|
|
3016
3441
|
symbol: "JAMA",
|
|
@@ -3031,6 +3456,11 @@ var AssetHubPolkadot$3 = {
|
|
|
3031
3456
|
symbol: "clay",
|
|
3032
3457
|
decimals: 20
|
|
3033
3458
|
},
|
|
3459
|
+
{
|
|
3460
|
+
assetId: "22222016",
|
|
3461
|
+
symbol: "MRSHE",
|
|
3462
|
+
decimals: 12
|
|
3463
|
+
},
|
|
3034
3464
|
{
|
|
3035
3465
|
assetId: "20090134",
|
|
3036
3466
|
symbol: "DOTCOIN",
|
|
@@ -3041,11 +3471,31 @@ var AssetHubPolkadot$3 = {
|
|
|
3041
3471
|
symbol: "BRZ",
|
|
3042
3472
|
decimals: 6
|
|
3043
3473
|
},
|
|
3474
|
+
{
|
|
3475
|
+
assetId: "22222049",
|
|
3476
|
+
symbol: "LUCKY",
|
|
3477
|
+
decimals: 12
|
|
3478
|
+
},
|
|
3044
3479
|
{
|
|
3045
3480
|
assetId: "8008",
|
|
3046
3481
|
symbol: "HOBO",
|
|
3047
3482
|
decimals: 2
|
|
3048
3483
|
},
|
|
3484
|
+
{
|
|
3485
|
+
assetId: "20090146",
|
|
3486
|
+
symbol: "DOPE ",
|
|
3487
|
+
decimals: 10
|
|
3488
|
+
},
|
|
3489
|
+
{
|
|
3490
|
+
assetId: "22222047",
|
|
3491
|
+
symbol: "GWIF",
|
|
3492
|
+
decimals: 12
|
|
3493
|
+
},
|
|
3494
|
+
{
|
|
3495
|
+
assetId: "22222030",
|
|
3496
|
+
symbol: "PIGS",
|
|
3497
|
+
decimals: 12
|
|
3498
|
+
},
|
|
3049
3499
|
{
|
|
3050
3500
|
assetId: "60",
|
|
3051
3501
|
symbol: "ANT",
|
|
@@ -3061,6 +3511,11 @@ var AssetHubPolkadot$3 = {
|
|
|
3061
3511
|
symbol: "SITE",
|
|
3062
3512
|
decimals: 10
|
|
3063
3513
|
},
|
|
3514
|
+
{
|
|
3515
|
+
assetId: "20090145",
|
|
3516
|
+
symbol: "ROCK",
|
|
3517
|
+
decimals: 10
|
|
3518
|
+
},
|
|
3064
3519
|
{
|
|
3065
3520
|
assetId: "6666",
|
|
3066
3521
|
symbol: "CHAOS",
|
|
@@ -3106,6 +3561,21 @@ var AssetHubPolkadot$3 = {
|
|
|
3106
3561
|
symbol: "usdc",
|
|
3107
3562
|
decimals: 10
|
|
3108
3563
|
},
|
|
3564
|
+
{
|
|
3565
|
+
assetId: "22222000",
|
|
3566
|
+
symbol: "OMG",
|
|
3567
|
+
decimals: 12
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
assetId: "20090149",
|
|
3571
|
+
symbol: "TOD",
|
|
3572
|
+
decimals: 10
|
|
3573
|
+
},
|
|
3574
|
+
{
|
|
3575
|
+
assetId: "22222045",
|
|
3576
|
+
symbol: "O",
|
|
3577
|
+
decimals: 12
|
|
3578
|
+
},
|
|
3109
3579
|
{
|
|
3110
3580
|
assetId: "2000",
|
|
3111
3581
|
symbol: "DAO",
|
|
@@ -3116,6 +3586,11 @@ var AssetHubPolkadot$3 = {
|
|
|
3116
3586
|
symbol: "DOT",
|
|
3117
3587
|
decimals: 20
|
|
3118
3588
|
},
|
|
3589
|
+
{
|
|
3590
|
+
assetId: "22222056",
|
|
3591
|
+
symbol: "KEK",
|
|
3592
|
+
decimals: 12
|
|
3593
|
+
},
|
|
3119
3594
|
{
|
|
3120
3595
|
assetId: "6969",
|
|
3121
3596
|
symbol: "LEEMO",
|
|
@@ -3131,6 +3606,11 @@ var AssetHubPolkadot$3 = {
|
|
|
3131
3606
|
symbol: "KAS",
|
|
3132
3607
|
decimals: 12
|
|
3133
3608
|
},
|
|
3609
|
+
{
|
|
3610
|
+
assetId: "22222054",
|
|
3611
|
+
symbol: "DON",
|
|
3612
|
+
decimals: 12
|
|
3613
|
+
},
|
|
3134
3614
|
{
|
|
3135
3615
|
assetId: "1337",
|
|
3136
3616
|
symbol: "USDC",
|
|
@@ -3151,11 +3631,21 @@ var AssetHubPolkadot$3 = {
|
|
|
3151
3631
|
symbol: "BOOTY",
|
|
3152
3632
|
decimals: 10
|
|
3153
3633
|
},
|
|
3634
|
+
{
|
|
3635
|
+
assetId: "112233",
|
|
3636
|
+
symbol: "MTA",
|
|
3637
|
+
decimals: 10
|
|
3638
|
+
},
|
|
3154
3639
|
{
|
|
3155
3640
|
assetId: "17",
|
|
3156
3641
|
symbol: "WIFD",
|
|
3157
3642
|
decimals: 10
|
|
3158
3643
|
},
|
|
3644
|
+
{
|
|
3645
|
+
assetId: "63",
|
|
3646
|
+
symbol: "JBM",
|
|
3647
|
+
decimals: 12
|
|
3648
|
+
},
|
|
3159
3649
|
{
|
|
3160
3650
|
assetId: "1180",
|
|
3161
3651
|
symbol: "KRAK",
|
|
@@ -3181,6 +3671,16 @@ var AssetHubPolkadot$3 = {
|
|
|
3181
3671
|
symbol: "DAL",
|
|
3182
3672
|
decimals: 18
|
|
3183
3673
|
},
|
|
3674
|
+
{
|
|
3675
|
+
assetId: "22222032",
|
|
3676
|
+
symbol: "FKDC",
|
|
3677
|
+
decimals: 12
|
|
3678
|
+
},
|
|
3679
|
+
{
|
|
3680
|
+
assetId: "22222015",
|
|
3681
|
+
symbol: "B",
|
|
3682
|
+
decimals: 12
|
|
3683
|
+
},
|
|
3184
3684
|
{
|
|
3185
3685
|
assetId: "23",
|
|
3186
3686
|
symbol: "PINK",
|
|
@@ -3206,6 +3706,11 @@ var AssetHubPolkadot$3 = {
|
|
|
3206
3706
|
symbol: "HASH",
|
|
3207
3707
|
decimals: 18
|
|
3208
3708
|
},
|
|
3709
|
+
{
|
|
3710
|
+
assetId: "65",
|
|
3711
|
+
symbol: "TeMe11",
|
|
3712
|
+
decimals: 12
|
|
3713
|
+
},
|
|
3209
3714
|
{
|
|
3210
3715
|
assetId: "9001",
|
|
3211
3716
|
symbol: "BOMB",
|
|
@@ -3246,11 +3751,41 @@ var AssetHubPolkadot$3 = {
|
|
|
3246
3751
|
symbol: "ETH",
|
|
3247
3752
|
decimals: 10
|
|
3248
3753
|
},
|
|
3754
|
+
{
|
|
3755
|
+
assetId: "22222061",
|
|
3756
|
+
symbol: "MONAD",
|
|
3757
|
+
decimals: 12
|
|
3758
|
+
},
|
|
3759
|
+
{
|
|
3760
|
+
assetId: "22222006",
|
|
3761
|
+
symbol: "LFG",
|
|
3762
|
+
decimals: 12
|
|
3763
|
+
},
|
|
3764
|
+
{
|
|
3765
|
+
assetId: "64",
|
|
3766
|
+
symbol: "CPcoin",
|
|
3767
|
+
decimals: 12
|
|
3768
|
+
},
|
|
3249
3769
|
{
|
|
3250
3770
|
assetId: "4157",
|
|
3251
3771
|
symbol: "PDOG",
|
|
3252
3772
|
decimals: 10
|
|
3253
3773
|
},
|
|
3774
|
+
{
|
|
3775
|
+
assetId: "20090148",
|
|
3776
|
+
symbol: "BOB",
|
|
3777
|
+
decimals: 10
|
|
3778
|
+
},
|
|
3779
|
+
{
|
|
3780
|
+
assetId: "22222040",
|
|
3781
|
+
symbol: "NOFUN",
|
|
3782
|
+
decimals: 12
|
|
3783
|
+
},
|
|
3784
|
+
{
|
|
3785
|
+
assetId: "22222026",
|
|
3786
|
+
symbol: "DDOT",
|
|
3787
|
+
decimals: 12
|
|
3788
|
+
},
|
|
3254
3789
|
{
|
|
3255
3790
|
assetId: "660301",
|
|
3256
3791
|
symbol: "GRL",
|
|
@@ -3276,16 +3811,51 @@ var AssetHubPolkadot$3 = {
|
|
|
3276
3811
|
symbol: "WOOD",
|
|
3277
3812
|
decimals: 10
|
|
3278
3813
|
},
|
|
3814
|
+
{
|
|
3815
|
+
assetId: "22222060",
|
|
3816
|
+
symbol: "TATE",
|
|
3817
|
+
decimals: 12
|
|
3818
|
+
},
|
|
3819
|
+
{
|
|
3820
|
+
assetId: "22222011",
|
|
3821
|
+
symbol: "PM",
|
|
3822
|
+
decimals: 12
|
|
3823
|
+
},
|
|
3279
3824
|
{
|
|
3280
3825
|
assetId: "20090127",
|
|
3281
3826
|
symbol: "PAMPIT",
|
|
3282
3827
|
decimals: 10
|
|
3283
3828
|
},
|
|
3829
|
+
{
|
|
3830
|
+
assetId: "22222004",
|
|
3831
|
+
symbol: "TeMeL3",
|
|
3832
|
+
decimals: 12
|
|
3833
|
+
},
|
|
3834
|
+
{
|
|
3835
|
+
assetId: "62",
|
|
3836
|
+
symbol: "CPDOT",
|
|
3837
|
+
decimals: 12
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
assetId: "22222012",
|
|
3841
|
+
symbol: "DAMN",
|
|
3842
|
+
decimals: 12
|
|
3843
|
+
},
|
|
3284
3844
|
{
|
|
3285
3845
|
assetId: "2230",
|
|
3286
3846
|
symbol: "GBILL",
|
|
3287
3847
|
decimals: 8
|
|
3288
3848
|
},
|
|
3849
|
+
{
|
|
3850
|
+
assetId: "22222063",
|
|
3851
|
+
symbol: "MAXCAT",
|
|
3852
|
+
decimals: 12
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
assetId: "22222052",
|
|
3856
|
+
symbol: "MODE",
|
|
3857
|
+
decimals: 12
|
|
3858
|
+
},
|
|
3289
3859
|
{
|
|
3290
3860
|
assetId: "92",
|
|
3291
3861
|
symbol: "TeMe2",
|
|
@@ -3309,6 +3879,21 @@ var Altair$3 = {
|
|
|
3309
3879
|
}
|
|
3310
3880
|
],
|
|
3311
3881
|
otherAssets: [
|
|
3882
|
+
{
|
|
3883
|
+
assetId: "3",
|
|
3884
|
+
symbol: "KSM",
|
|
3885
|
+
decimals: 12
|
|
3886
|
+
},
|
|
3887
|
+
{
|
|
3888
|
+
assetId: "1",
|
|
3889
|
+
symbol: "USDT",
|
|
3890
|
+
decimals: 6
|
|
3891
|
+
},
|
|
3892
|
+
{
|
|
3893
|
+
assetId: "2",
|
|
3894
|
+
symbol: "aUSD",
|
|
3895
|
+
decimals: 12
|
|
3896
|
+
}
|
|
3312
3897
|
]
|
|
3313
3898
|
};
|
|
3314
3899
|
var Amplitude$3 = {
|
|
@@ -3322,6 +3907,21 @@ var Amplitude$3 = {
|
|
|
3322
3907
|
}
|
|
3323
3908
|
],
|
|
3324
3909
|
otherAssets: [
|
|
3910
|
+
{
|
|
3911
|
+
assetId: "2",
|
|
3912
|
+
symbol: "PICA",
|
|
3913
|
+
decimals: 12
|
|
3914
|
+
},
|
|
3915
|
+
{
|
|
3916
|
+
assetId: "1",
|
|
3917
|
+
symbol: "USDT",
|
|
3918
|
+
decimals: 6
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
assetId: "0",
|
|
3922
|
+
symbol: "KSM",
|
|
3923
|
+
decimals: 12
|
|
3924
|
+
}
|
|
3325
3925
|
]
|
|
3326
3926
|
};
|
|
3327
3927
|
var Bajun$3 = {
|
|
@@ -3594,6 +4194,11 @@ var Crab$3 = {
|
|
|
3594
4194
|
}
|
|
3595
4195
|
],
|
|
3596
4196
|
otherAssets: [
|
|
4197
|
+
{
|
|
4198
|
+
assetId: "1026",
|
|
4199
|
+
symbol: "CKTON",
|
|
4200
|
+
decimals: 18
|
|
4201
|
+
}
|
|
3597
4202
|
]
|
|
3598
4203
|
};
|
|
3599
4204
|
var CrustShadow$3 = {
|
|
@@ -3728,6 +4333,16 @@ var Curio$3 = {
|
|
|
3728
4333
|
assetId: "0",
|
|
3729
4334
|
symbol: "BSX",
|
|
3730
4335
|
decimals: 12
|
|
4336
|
+
},
|
|
4337
|
+
{
|
|
4338
|
+
assetId: "2",
|
|
4339
|
+
symbol: "VAL",
|
|
4340
|
+
decimals: 18
|
|
4341
|
+
},
|
|
4342
|
+
{
|
|
4343
|
+
assetId: "1",
|
|
4344
|
+
symbol: "XOR",
|
|
4345
|
+
decimals: 18
|
|
3731
4346
|
}
|
|
3732
4347
|
]
|
|
3733
4348
|
};
|
|
@@ -4060,7 +4675,7 @@ var Litmus$3 = {
|
|
|
4060
4675
|
nativeAssets: [
|
|
4061
4676
|
{
|
|
4062
4677
|
symbol: "LIT",
|
|
4063
|
-
decimals:
|
|
4678
|
+
decimals: 18
|
|
4064
4679
|
}
|
|
4065
4680
|
],
|
|
4066
4681
|
otherAssets: [
|
|
@@ -5483,11 +6098,6 @@ var AssetHubKusama$3 = {
|
|
|
5483
6098
|
symbol: "XEN",
|
|
5484
6099
|
decimals: 10
|
|
5485
6100
|
},
|
|
5486
|
-
{
|
|
5487
|
-
assetId: "4294967291",
|
|
5488
|
-
symbol: "PRIME",
|
|
5489
|
-
decimals: 7
|
|
5490
|
-
},
|
|
5491
6101
|
{
|
|
5492
6102
|
assetId: "777777",
|
|
5493
6103
|
symbol: "DEFI",
|
|
@@ -6574,6 +7184,8 @@ var Peaq$3 = {
|
|
|
6574
7184
|
]
|
|
6575
7185
|
};
|
|
6576
7186
|
var assets = {
|
|
7187
|
+
Polkadot: Polkadot$1,
|
|
7188
|
+
Kusama: Kusama$1,
|
|
6577
7189
|
Acala: Acala$3,
|
|
6578
7190
|
BridgeHubPolkadot: BridgeHubPolkadot$3,
|
|
6579
7191
|
BridgeHubKusama: BridgeHubKusama$3,
|
|
@@ -6669,6 +7281,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6669
7281
|
Khala: Khala$3,
|
|
6670
7282
|
KiltSpiritnet: KiltSpiritnet$3,
|
|
6671
7283
|
Kintsugi: Kintsugi$3,
|
|
7284
|
+
Kusama: Kusama$1,
|
|
6672
7285
|
Litentry: Litentry$3,
|
|
6673
7286
|
Litmus: Litmus$3,
|
|
6674
7287
|
Manta: Manta$3,
|
|
@@ -6685,6 +7298,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6685
7298
|
Picasso: Picasso$3,
|
|
6686
7299
|
Pioneer: Pioneer$3,
|
|
6687
7300
|
Polkadex: Polkadex$3,
|
|
7301
|
+
Polkadot: Polkadot$1,
|
|
6688
7302
|
Quartz: Quartz$3,
|
|
6689
7303
|
Robonomics: Robonomics$3,
|
|
6690
7304
|
Shiden: Shiden$3,
|
|
@@ -6695,30 +7309,316 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6695
7309
|
default: assets
|
|
6696
7310
|
});
|
|
6697
7311
|
|
|
6698
|
-
|
|
6699
|
-
var
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
7312
|
+
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
7313
|
+
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
7314
|
+
function InvalidCurrencyError(message) {
|
|
7315
|
+
var _this;
|
|
7316
|
+
_classCallCheck(this, InvalidCurrencyError);
|
|
7317
|
+
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
7318
|
+
_this.name = 'InvalidCurrencyError';
|
|
7319
|
+
return _this;
|
|
7320
|
+
}
|
|
7321
|
+
_inherits(InvalidCurrencyError, _Error);
|
|
7322
|
+
return _createClass(InvalidCurrencyError);
|
|
7323
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
7324
|
+
|
|
7325
|
+
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
7326
|
+
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
7327
|
+
function NodeNotSupportedError(message) {
|
|
7328
|
+
var _this;
|
|
7329
|
+
_classCallCheck(this, NodeNotSupportedError);
|
|
7330
|
+
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
7331
|
+
_this.name = 'NodeNotSupported';
|
|
7332
|
+
return _this;
|
|
7333
|
+
}
|
|
7334
|
+
_inherits(NodeNotSupportedError, _Error);
|
|
7335
|
+
return _createClass(NodeNotSupportedError);
|
|
7336
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
7337
|
+
|
|
7338
|
+
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
7339
|
+
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
7340
|
+
function ScenarioNotSupportedError(node, scenario, message) {
|
|
7341
|
+
var _this;
|
|
7342
|
+
_classCallCheck(this, ScenarioNotSupportedError);
|
|
7343
|
+
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
7344
|
+
_this.name = 'ScenarioNotSupported';
|
|
7345
|
+
return _this;
|
|
7346
|
+
}
|
|
7347
|
+
_inherits(ScenarioNotSupportedError, _Error);
|
|
7348
|
+
return _createClass(ScenarioNotSupportedError);
|
|
7349
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
7350
|
+
|
|
7351
|
+
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
7352
|
+
function IncompatibleNodesError(message) {
|
|
7353
|
+
var _this;
|
|
7354
|
+
_classCallCheck(this, IncompatibleNodesError);
|
|
7355
|
+
_this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== void 0 ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
|
|
7356
|
+
_this.name = 'IncompatibleNodes';
|
|
7357
|
+
return _this;
|
|
7358
|
+
}
|
|
7359
|
+
_inherits(IncompatibleNodesError, _Error);
|
|
7360
|
+
return _createClass(IncompatibleNodesError);
|
|
7361
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
7362
|
+
|
|
7363
|
+
var DuplicateAssetError = /*#__PURE__*/function (_Error) {
|
|
7364
|
+
function DuplicateAssetError(symbol) {
|
|
7365
|
+
var _this;
|
|
7366
|
+
_classCallCheck(this, DuplicateAssetError);
|
|
7367
|
+
_this = _callSuper(this, DuplicateAssetError, ["Multiple assets found with the same symbol: ".concat(symbol, ". Please specify asset ID directly by .currency({id: <ASSET_ID>})")]);
|
|
7368
|
+
_this.name = 'DuplicateAsset';
|
|
7369
|
+
return _this;
|
|
7370
|
+
}
|
|
7371
|
+
_inherits(DuplicateAssetError, _Error);
|
|
7372
|
+
return _createClass(DuplicateAssetError);
|
|
7373
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
7374
|
+
|
|
7375
|
+
var constructRelayToParaParameters = function constructRelayToParaParameters(_ref, version) {
|
|
7376
|
+
var api = _ref.api,
|
|
7377
|
+
destination = _ref.destination,
|
|
7378
|
+
address = _ref.address,
|
|
7379
|
+
amount = _ref.amount,
|
|
7380
|
+
paraIdTo = _ref.paraIdTo;
|
|
7381
|
+
var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7382
|
+
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
7383
|
+
var parameters = [createPolkadotXcmHeader('RelayToPara', version, destination, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, exports.Parents.ZERO), 0];
|
|
7384
|
+
if (includeFee) {
|
|
7385
|
+
parameters.push('Unlimited');
|
|
7386
|
+
}
|
|
7387
|
+
return parameters;
|
|
6707
7388
|
};
|
|
6708
|
-
var
|
|
6709
|
-
return
|
|
7389
|
+
var isTMulti = function isTMulti(value) {
|
|
7390
|
+
return value && _typeof(value) === 'object' || Array.isArray(value);
|
|
6710
7391
|
};
|
|
6711
|
-
var
|
|
6712
|
-
return
|
|
7392
|
+
var isTMultiLocation = function isTMultiLocation(value) {
|
|
7393
|
+
return value && typeof value.parents !== 'undefined' && typeof value.interior !== 'undefined';
|
|
7394
|
+
};
|
|
7395
|
+
var isTCurrencySpecifier = function isTCurrencySpecifier(value) {
|
|
7396
|
+
if (_typeof(value) !== 'object' || value === null) {
|
|
7397
|
+
return false;
|
|
7398
|
+
}
|
|
7399
|
+
return 'symbol' in value && typeof value.symbol === 'string' || 'id' in value && (typeof value.id === 'string' || typeof value.id === 'number' || typeof value.id === 'bigint');
|
|
7400
|
+
};
|
|
7401
|
+
var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
|
|
7402
|
+
return _defineProperty({}, exports.Version.V4, [{
|
|
7403
|
+
id: {
|
|
7404
|
+
parents: exports.Parents.TWO,
|
|
7405
|
+
interior: {
|
|
7406
|
+
X1: [{
|
|
7407
|
+
GlobalConsensus: ecosystem
|
|
7408
|
+
}]
|
|
7409
|
+
}
|
|
7410
|
+
},
|
|
7411
|
+
fun: {
|
|
7412
|
+
Fungible: amount
|
|
7413
|
+
}
|
|
7414
|
+
}]);
|
|
7415
|
+
};
|
|
7416
|
+
var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
|
|
7417
|
+
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
7418
|
+
if (!overriddenCurrency) {
|
|
7419
|
+
return _defineProperty({}, version, [{
|
|
7420
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7421
|
+
id: version === exports.Version.V4 ? {
|
|
7422
|
+
parents: parents,
|
|
7423
|
+
interior: interior
|
|
7424
|
+
} : {
|
|
7425
|
+
Concrete: {
|
|
7426
|
+
parents: parents,
|
|
7427
|
+
interior: interior
|
|
7428
|
+
}
|
|
7429
|
+
},
|
|
7430
|
+
fun: {
|
|
7431
|
+
Fungible: amount
|
|
7432
|
+
}
|
|
7433
|
+
}]);
|
|
7434
|
+
}
|
|
7435
|
+
return isTMultiLocation(overriddenCurrency) ? _defineProperty({}, version, [{
|
|
7436
|
+
id: version === exports.Version.V4 ? overriddenCurrency : {
|
|
7437
|
+
Concrete: overriddenCurrency
|
|
7438
|
+
},
|
|
7439
|
+
fun: {
|
|
7440
|
+
Fungible: amount
|
|
7441
|
+
}
|
|
7442
|
+
}]) : // It must be TMultiAsset if not TMultiLocation
|
|
7443
|
+
_defineProperty({}, version, overriddenCurrency);
|
|
7444
|
+
};
|
|
7445
|
+
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
7446
|
+
var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? exports.Parents.ZERO : exports.Parents.ONE;
|
|
7447
|
+
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
|
|
7448
|
+
Parachain: nodeId
|
|
7449
|
+
});
|
|
7450
|
+
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
7451
|
+
return _defineProperty({}, version, isMultiLocationDestination ? destination : {
|
|
7452
|
+
parents: parentsResolved,
|
|
7453
|
+
interior: interior
|
|
7454
|
+
});
|
|
7455
|
+
};
|
|
7456
|
+
var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
|
|
7457
|
+
var multiLocation = {
|
|
7458
|
+
parents: exports.Parents.TWO,
|
|
7459
|
+
interior: {
|
|
7460
|
+
X2: [{
|
|
7461
|
+
GlobalConsensus: ecosystem
|
|
7462
|
+
}, {
|
|
7463
|
+
Parachain: nodeId
|
|
7464
|
+
}]
|
|
7465
|
+
}
|
|
7466
|
+
};
|
|
7467
|
+
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
7468
|
+
return _defineProperty({}, version, isMultiLocationDestination ? destination : multiLocation);
|
|
7469
|
+
};
|
|
7470
|
+
var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
|
|
7471
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7472
|
+
var _yield$tx$paymentInfo, partialFee;
|
|
7473
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7474
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7475
|
+
case 0:
|
|
7476
|
+
_context.next = 2;
|
|
7477
|
+
return tx.paymentInfo(address);
|
|
7478
|
+
case 2:
|
|
7479
|
+
_yield$tx$paymentInfo = _context.sent;
|
|
7480
|
+
partialFee = _yield$tx$paymentInfo.partialFee;
|
|
7481
|
+
return _context.abrupt("return", partialFee.toBn());
|
|
7482
|
+
case 5:
|
|
7483
|
+
case "end":
|
|
7484
|
+
return _context.stop();
|
|
7485
|
+
}
|
|
7486
|
+
}, _callee);
|
|
7487
|
+
}));
|
|
7488
|
+
};
|
|
7489
|
+
// TODO: Refactor this function to eliminate the any type
|
|
7490
|
+
var findParachainJunction = function findParachainJunction(multilocation) {
|
|
7491
|
+
var interior = multilocation.interior;
|
|
7492
|
+
for (var key in interior) {
|
|
7493
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7494
|
+
var junctions = interior[key];
|
|
7495
|
+
if (Array.isArray(junctions)) {
|
|
7496
|
+
var _iterator = _createForOfIteratorHelper(junctions),
|
|
7497
|
+
_step;
|
|
7498
|
+
try {
|
|
7499
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7500
|
+
var junction = _step.value;
|
|
7501
|
+
if ('Parachain' in junction) {
|
|
7502
|
+
return Number(junction.Parachain);
|
|
7503
|
+
}
|
|
7504
|
+
}
|
|
7505
|
+
} catch (err) {
|
|
7506
|
+
_iterator.e(err);
|
|
7507
|
+
} finally {
|
|
7508
|
+
_iterator.f();
|
|
7509
|
+
}
|
|
7510
|
+
} else if (junctions !== undefined && 'Parachain' in junctions) {
|
|
7511
|
+
return Number(junctions.Parachain);
|
|
7512
|
+
}
|
|
7513
|
+
}
|
|
7514
|
+
return null;
|
|
7515
|
+
};
|
|
7516
|
+
var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(multiLocation) {
|
|
7517
|
+
var parachainId = findParachainJunction(multiLocation);
|
|
7518
|
+
if (parachainId === null) {
|
|
7519
|
+
throw new Error('Parachain ID not found in destination multi location.');
|
|
7520
|
+
}
|
|
7521
|
+
var node = getTNode(parachainId);
|
|
7522
|
+
if (node === null) {
|
|
7523
|
+
throw new Error('Node with specified paraId not found in destination multi location.');
|
|
7524
|
+
}
|
|
7525
|
+
return node;
|
|
7526
|
+
};
|
|
7527
|
+
|
|
7528
|
+
var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, symbol, isRelayDestination, isSymbol) {
|
|
7529
|
+
if (destination === 'Ethereum') {
|
|
7530
|
+
return combinedAssets.find(function (_ref) {
|
|
7531
|
+
var assetSymbol = _ref.symbol;
|
|
7532
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
|
|
7533
|
+
});
|
|
7534
|
+
}
|
|
7535
|
+
var otherAssetsMatches = otherAssets.filter(function (_ref2) {
|
|
7536
|
+
var assetSymbol = _ref2.symbol;
|
|
7537
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
|
|
7538
|
+
});
|
|
7539
|
+
var nativeAssetsMatches = nativeAssets.filter(function (_ref3) {
|
|
7540
|
+
var assetSymbol = _ref3.symbol;
|
|
7541
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
|
|
7542
|
+
});
|
|
7543
|
+
if (node === 'Astar' || node === 'Shiden') {
|
|
7544
|
+
return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
|
|
7545
|
+
}
|
|
7546
|
+
if (otherAssetsMatches.length > 1 && !isRelayDestination && isSymbol === undefined) {
|
|
7547
|
+
throw new DuplicateAssetError(symbol);
|
|
7548
|
+
}
|
|
7549
|
+
return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
|
|
7550
|
+
};
|
|
7551
|
+
var findAssetById = function findAssetById(assets, assetId) {
|
|
7552
|
+
return assets.find(function (_ref4) {
|
|
7553
|
+
var currentAssetId = _ref4.assetId;
|
|
7554
|
+
return currentAssetId === assetId;
|
|
7555
|
+
});
|
|
7556
|
+
};
|
|
7557
|
+
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
|
|
7558
|
+
var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7559
|
+
var isSymbol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
7560
|
+
var destination = arguments.length > 4 ? arguments[4] : undefined;
|
|
7561
|
+
if (isTMulti(currency)) {
|
|
7562
|
+
return null;
|
|
7563
|
+
}
|
|
7564
|
+
var currencyString = currency.toString();
|
|
7565
|
+
var _getAssetsObject = getAssetsObject(node),
|
|
7566
|
+
otherAssets = _getAssetsObject.otherAssets,
|
|
7567
|
+
nativeAssets = _getAssetsObject.nativeAssets,
|
|
7568
|
+
relayChainAssetSymbol = _getAssetsObject.relayChainAssetSymbol;
|
|
7569
|
+
var combinedAssets = destination === 'Ethereum' ? _toConsumableArray(getOtherAssets('Ethereum')) : [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets));
|
|
7570
|
+
var asset;
|
|
7571
|
+
if (isSymbol === true) {
|
|
7572
|
+
asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, currencyString, isRelayDestination, isSymbol);
|
|
7573
|
+
} else if (isSymbol === false) {
|
|
7574
|
+
asset = findAssetById(combinedAssets, currencyString);
|
|
7575
|
+
} else {
|
|
7576
|
+
asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, currencyString, isRelayDestination, isSymbol) || findAssetById(combinedAssets, currencyString);
|
|
7577
|
+
}
|
|
7578
|
+
if (asset) {
|
|
7579
|
+
return asset;
|
|
7580
|
+
}
|
|
7581
|
+
if (relayChainAssetSymbol.toLowerCase() === currencyString.toLowerCase() && isSymbol !== false) {
|
|
7582
|
+
var relayChainAsset = {
|
|
7583
|
+
symbol: relayChainAssetSymbol,
|
|
7584
|
+
decimals: getAssetDecimals(node, relayChainAssetSymbol)
|
|
7585
|
+
};
|
|
7586
|
+
return relayChainAsset;
|
|
7587
|
+
}
|
|
7588
|
+
return null;
|
|
7589
|
+
};
|
|
7590
|
+
|
|
7591
|
+
var assetsMap = assetsMapJson;
|
|
7592
|
+
var getAssetsObject = function getAssetsObject(node) {
|
|
7593
|
+
return assetsMap[node];
|
|
7594
|
+
};
|
|
7595
|
+
var getAssetId = function getAssetId(node, symbol) {
|
|
7596
|
+
var info = getAssetsObject(node).otherAssets.find(function (o) {
|
|
7597
|
+
return o.symbol === symbol;
|
|
7598
|
+
});
|
|
7599
|
+
return info != null ? info.assetId : null;
|
|
7600
|
+
};
|
|
7601
|
+
var getRelayChainSymbol = function getRelayChainSymbol(node) {
|
|
7602
|
+
return getAssetsObject(node).relayChainAssetSymbol;
|
|
7603
|
+
};
|
|
7604
|
+
var getNativeAssets = function getNativeAssets(node) {
|
|
7605
|
+
return getAssetsObject(node).nativeAssets;
|
|
6713
7606
|
};
|
|
6714
7607
|
var getOtherAssets = function getOtherAssets(node) {
|
|
6715
7608
|
return getAssetsObject(node).otherAssets;
|
|
6716
7609
|
};
|
|
6717
|
-
var
|
|
7610
|
+
var getAssets = function getAssets(node) {
|
|
6718
7611
|
var _getAssetsObject = getAssetsObject(node),
|
|
6719
|
-
relayChainAssetSymbol = _getAssetsObject.relayChainAssetSymbol,
|
|
6720
7612
|
nativeAssets = _getAssetsObject.nativeAssets,
|
|
6721
7613
|
otherAssets = _getAssetsObject.otherAssets;
|
|
7614
|
+
var relayChainAsset = getAssetBySymbolOrId(determineRelayChain(node), getRelayChainSymbol(node));
|
|
7615
|
+
return [].concat(_toConsumableArray(relayChainAsset ? [relayChainAsset] : []), _toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
|
|
7616
|
+
};
|
|
7617
|
+
var getAllAssetsSymbols = function getAllAssetsSymbols(node) {
|
|
7618
|
+
var _getAssetsObject2 = getAssetsObject(node),
|
|
7619
|
+
relayChainAssetSymbol = _getAssetsObject2.relayChainAssetSymbol,
|
|
7620
|
+
nativeAssets = _getAssetsObject2.nativeAssets,
|
|
7621
|
+
otherAssets = _getAssetsObject2.otherAssets;
|
|
6722
7622
|
var nativeAssetsSymbols = nativeAssets.map(function (_ref) {
|
|
6723
7623
|
var symbol = _ref.symbol;
|
|
6724
7624
|
return symbol;
|
|
@@ -6744,10 +7644,27 @@ var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
|
|
|
6744
7644
|
return s.toLowerCase();
|
|
6745
7645
|
}).includes(symbol.toLowerCase());
|
|
6746
7646
|
};
|
|
7647
|
+
var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
7648
|
+
var originAssets = getAssets(origin);
|
|
7649
|
+
var destinationAssets = getAssets(destination);
|
|
7650
|
+
if (destination === 'Ethereum' || origin === 'Ethereum') {
|
|
7651
|
+
return getOtherAssets('Ethereum');
|
|
7652
|
+
}
|
|
7653
|
+
if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
|
|
7654
|
+
var polkadotAsset = getAssetBySymbolOrId('Polkadot', 'DOT');
|
|
7655
|
+
var kusamaAsset = getAssetBySymbolOrId('Kusama', 'KSM');
|
|
7656
|
+
return [].concat(_toConsumableArray(polkadotAsset ? [polkadotAsset] : []), _toConsumableArray(kusamaAsset ? [kusamaAsset] : []));
|
|
7657
|
+
}
|
|
7658
|
+
return _toConsumableArray(originAssets.filter(function (asset) {
|
|
7659
|
+
return destinationAssets.some(function (a) {
|
|
7660
|
+
return a.symbol === asset.symbol;
|
|
7661
|
+
});
|
|
7662
|
+
}));
|
|
7663
|
+
};
|
|
6747
7664
|
var getAssetDecimals = function getAssetDecimals(node, symbol) {
|
|
6748
|
-
var
|
|
6749
|
-
otherAssets =
|
|
6750
|
-
nativeAssets =
|
|
7665
|
+
var _getAssetsObject3 = getAssetsObject(node),
|
|
7666
|
+
otherAssets = _getAssetsObject3.otherAssets,
|
|
7667
|
+
nativeAssets = _getAssetsObject3.nativeAssets;
|
|
6751
7668
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
|
|
6752
7669
|
return o.symbol === symbol;
|
|
6753
7670
|
});
|
|
@@ -7307,276 +8224,6 @@ var getSupportedPallets = function getSupportedPallets(node) {
|
|
|
7307
8224
|
return palletsMap$1[node].supportedPallets;
|
|
7308
8225
|
};
|
|
7309
8226
|
|
|
7310
|
-
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
7311
|
-
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
7312
|
-
function InvalidCurrencyError(message) {
|
|
7313
|
-
var _this;
|
|
7314
|
-
_classCallCheck(this, InvalidCurrencyError);
|
|
7315
|
-
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
7316
|
-
_this.name = 'InvalidCurrencyError';
|
|
7317
|
-
return _this;
|
|
7318
|
-
}
|
|
7319
|
-
_inherits(InvalidCurrencyError, _Error);
|
|
7320
|
-
return _createClass(InvalidCurrencyError);
|
|
7321
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
7322
|
-
|
|
7323
|
-
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
7324
|
-
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
7325
|
-
function NodeNotSupportedError(message) {
|
|
7326
|
-
var _this;
|
|
7327
|
-
_classCallCheck(this, NodeNotSupportedError);
|
|
7328
|
-
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
7329
|
-
_this.name = 'NodeNotSupported';
|
|
7330
|
-
return _this;
|
|
7331
|
-
}
|
|
7332
|
-
_inherits(NodeNotSupportedError, _Error);
|
|
7333
|
-
return _createClass(NodeNotSupportedError);
|
|
7334
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
7335
|
-
|
|
7336
|
-
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
7337
|
-
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
7338
|
-
function ScenarioNotSupportedError(node, scenario, message) {
|
|
7339
|
-
var _this;
|
|
7340
|
-
_classCallCheck(this, ScenarioNotSupportedError);
|
|
7341
|
-
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
7342
|
-
_this.name = 'ScenarioNotSupported';
|
|
7343
|
-
return _this;
|
|
7344
|
-
}
|
|
7345
|
-
_inherits(ScenarioNotSupportedError, _Error);
|
|
7346
|
-
return _createClass(ScenarioNotSupportedError);
|
|
7347
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
7348
|
-
|
|
7349
|
-
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
7350
|
-
function IncompatibleNodesError() {
|
|
7351
|
-
var _this;
|
|
7352
|
-
_classCallCheck(this, IncompatibleNodesError);
|
|
7353
|
-
_this = _callSuper(this, IncompatibleNodesError, ['Transactions between nodes on different relaychains are not yet possible.']);
|
|
7354
|
-
_this.name = 'IncompatibleNodes';
|
|
7355
|
-
return _this;
|
|
7356
|
-
}
|
|
7357
|
-
_inherits(IncompatibleNodesError, _Error);
|
|
7358
|
-
return _createClass(IncompatibleNodesError);
|
|
7359
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
7360
|
-
|
|
7361
|
-
var DuplicateAssetError = /*#__PURE__*/function (_Error) {
|
|
7362
|
-
function DuplicateAssetError(symbol) {
|
|
7363
|
-
var _this;
|
|
7364
|
-
_classCallCheck(this, DuplicateAssetError);
|
|
7365
|
-
_this = _callSuper(this, DuplicateAssetError, ["Multiple assets found with the same symbol: ".concat(symbol, ". Please specify asset ID directly by .currency({id: <ASSET_ID>})")]);
|
|
7366
|
-
_this.name = 'DuplicateAsset';
|
|
7367
|
-
return _this;
|
|
7368
|
-
}
|
|
7369
|
-
_inherits(DuplicateAssetError, _Error);
|
|
7370
|
-
return _createClass(DuplicateAssetError);
|
|
7371
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
7372
|
-
|
|
7373
|
-
var constructRelayToParaParameters = function constructRelayToParaParameters(_ref, version) {
|
|
7374
|
-
var api = _ref.api,
|
|
7375
|
-
destination = _ref.destination,
|
|
7376
|
-
address = _ref.address,
|
|
7377
|
-
amount = _ref.amount,
|
|
7378
|
-
paraIdTo = _ref.paraIdTo;
|
|
7379
|
-
var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7380
|
-
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
7381
|
-
var parameters = [createPolkadotXcmHeader('RelayToPara', version, destination, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, exports.Parents.ZERO), 0];
|
|
7382
|
-
if (includeFee) {
|
|
7383
|
-
parameters.push('Unlimited');
|
|
7384
|
-
}
|
|
7385
|
-
return parameters;
|
|
7386
|
-
};
|
|
7387
|
-
var isTMulti = function isTMulti(value) {
|
|
7388
|
-
return value && _typeof(value) === 'object' || Array.isArray(value);
|
|
7389
|
-
};
|
|
7390
|
-
var isTMultiLocation = function isTMultiLocation(value) {
|
|
7391
|
-
return value && typeof value.parents !== 'undefined' && typeof value.interior !== 'undefined';
|
|
7392
|
-
};
|
|
7393
|
-
var isTCurrencySpecifier = function isTCurrencySpecifier(value) {
|
|
7394
|
-
if (_typeof(value) !== 'object' || value === null) {
|
|
7395
|
-
return false;
|
|
7396
|
-
}
|
|
7397
|
-
return 'symbol' in value && typeof value.symbol === 'string' || 'id' in value && (typeof value.id === 'string' || typeof value.id === 'number' || typeof value.id === 'bigint');
|
|
7398
|
-
};
|
|
7399
|
-
var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
|
|
7400
|
-
return _defineProperty({}, exports.Version.V4, [{
|
|
7401
|
-
id: {
|
|
7402
|
-
parents: exports.Parents.TWO,
|
|
7403
|
-
interior: {
|
|
7404
|
-
X1: [{
|
|
7405
|
-
GlobalConsensus: ecosystem
|
|
7406
|
-
}]
|
|
7407
|
-
}
|
|
7408
|
-
},
|
|
7409
|
-
fun: {
|
|
7410
|
-
Fungible: amount
|
|
7411
|
-
}
|
|
7412
|
-
}]);
|
|
7413
|
-
};
|
|
7414
|
-
var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
|
|
7415
|
-
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
7416
|
-
if (!overriddenCurrency) {
|
|
7417
|
-
return _defineProperty({}, version, [{
|
|
7418
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7419
|
-
id: version === exports.Version.V4 ? {
|
|
7420
|
-
parents: parents,
|
|
7421
|
-
interior: interior
|
|
7422
|
-
} : {
|
|
7423
|
-
Concrete: {
|
|
7424
|
-
parents: parents,
|
|
7425
|
-
interior: interior
|
|
7426
|
-
}
|
|
7427
|
-
},
|
|
7428
|
-
fun: {
|
|
7429
|
-
Fungible: amount
|
|
7430
|
-
}
|
|
7431
|
-
}]);
|
|
7432
|
-
}
|
|
7433
|
-
return isTMultiLocation(overriddenCurrency) ? _defineProperty({}, version, [{
|
|
7434
|
-
id: version === exports.Version.V4 ? overriddenCurrency : {
|
|
7435
|
-
Concrete: overriddenCurrency
|
|
7436
|
-
},
|
|
7437
|
-
fun: {
|
|
7438
|
-
Fungible: amount
|
|
7439
|
-
}
|
|
7440
|
-
}]) : // It must be TMultiAsset if not TMultiLocation
|
|
7441
|
-
_defineProperty({}, version, overriddenCurrency);
|
|
7442
|
-
};
|
|
7443
|
-
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
7444
|
-
var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? exports.Parents.ZERO : exports.Parents.ONE;
|
|
7445
|
-
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
|
|
7446
|
-
Parachain: nodeId
|
|
7447
|
-
});
|
|
7448
|
-
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
7449
|
-
return _defineProperty({}, version, isMultiLocationDestination ? destination : {
|
|
7450
|
-
parents: parentsResolved,
|
|
7451
|
-
interior: interior
|
|
7452
|
-
});
|
|
7453
|
-
};
|
|
7454
|
-
var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
|
|
7455
|
-
var multiLocation = {
|
|
7456
|
-
parents: exports.Parents.TWO,
|
|
7457
|
-
interior: {
|
|
7458
|
-
X2: [{
|
|
7459
|
-
GlobalConsensus: ecosystem
|
|
7460
|
-
}, {
|
|
7461
|
-
Parachain: nodeId
|
|
7462
|
-
}]
|
|
7463
|
-
}
|
|
7464
|
-
};
|
|
7465
|
-
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
7466
|
-
return _defineProperty({}, version, isMultiLocationDestination ? destination : multiLocation);
|
|
7467
|
-
};
|
|
7468
|
-
var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
|
|
7469
|
-
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7470
|
-
var _yield$tx$paymentInfo, partialFee;
|
|
7471
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7472
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7473
|
-
case 0:
|
|
7474
|
-
_context.next = 2;
|
|
7475
|
-
return tx.paymentInfo(address);
|
|
7476
|
-
case 2:
|
|
7477
|
-
_yield$tx$paymentInfo = _context.sent;
|
|
7478
|
-
partialFee = _yield$tx$paymentInfo.partialFee;
|
|
7479
|
-
return _context.abrupt("return", partialFee.toBn());
|
|
7480
|
-
case 5:
|
|
7481
|
-
case "end":
|
|
7482
|
-
return _context.stop();
|
|
7483
|
-
}
|
|
7484
|
-
}, _callee);
|
|
7485
|
-
}));
|
|
7486
|
-
};
|
|
7487
|
-
// TODO: Refactor this function to eliminate the any type
|
|
7488
|
-
var findParachainJunction = function findParachainJunction(multilocation) {
|
|
7489
|
-
var interior = multilocation.interior;
|
|
7490
|
-
for (var key in interior) {
|
|
7491
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7492
|
-
var junctions = interior[key];
|
|
7493
|
-
if (Array.isArray(junctions)) {
|
|
7494
|
-
var _iterator = _createForOfIteratorHelper(junctions),
|
|
7495
|
-
_step;
|
|
7496
|
-
try {
|
|
7497
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7498
|
-
var junction = _step.value;
|
|
7499
|
-
if ('Parachain' in junction) {
|
|
7500
|
-
return Number(junction.Parachain);
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
} catch (err) {
|
|
7504
|
-
_iterator.e(err);
|
|
7505
|
-
} finally {
|
|
7506
|
-
_iterator.f();
|
|
7507
|
-
}
|
|
7508
|
-
} else if (junctions !== undefined && 'Parachain' in junctions) {
|
|
7509
|
-
return Number(junctions.Parachain);
|
|
7510
|
-
}
|
|
7511
|
-
}
|
|
7512
|
-
return null;
|
|
7513
|
-
};
|
|
7514
|
-
var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(multiLocation) {
|
|
7515
|
-
var parachainId = findParachainJunction(multiLocation);
|
|
7516
|
-
if (parachainId === null) {
|
|
7517
|
-
throw new Error('Parachain ID not found in destination multi location.');
|
|
7518
|
-
}
|
|
7519
|
-
var node = getTNode(parachainId);
|
|
7520
|
-
if (node === null) {
|
|
7521
|
-
throw new Error('Node with specified paraId not found in destination multi location.');
|
|
7522
|
-
}
|
|
7523
|
-
return node;
|
|
7524
|
-
};
|
|
7525
|
-
|
|
7526
|
-
var findAssetBySymbol = function findAssetBySymbol(otherAssets, nativeAssets, symbol, isRelayDestination) {
|
|
7527
|
-
var otherAssetsMatches = otherAssets.filter(function (_ref) {
|
|
7528
|
-
var assetSymbol = _ref.symbol;
|
|
7529
|
-
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
|
|
7530
|
-
});
|
|
7531
|
-
var nativeAssetsMatches = nativeAssets.filter(function (_ref2) {
|
|
7532
|
-
var assetSymbol = _ref2.symbol;
|
|
7533
|
-
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
|
|
7534
|
-
});
|
|
7535
|
-
if (otherAssetsMatches.length > 1 && !isRelayDestination) {
|
|
7536
|
-
throw new DuplicateAssetError(symbol);
|
|
7537
|
-
}
|
|
7538
|
-
return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
|
|
7539
|
-
};
|
|
7540
|
-
var findAssetById = function findAssetById(assets, assetId) {
|
|
7541
|
-
return assets.find(function (_ref3) {
|
|
7542
|
-
var currentAssetId = _ref3.assetId;
|
|
7543
|
-
return currentAssetId === assetId;
|
|
7544
|
-
});
|
|
7545
|
-
};
|
|
7546
|
-
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
|
|
7547
|
-
var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7548
|
-
var isSymbol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
7549
|
-
if (isTMulti(currency)) {
|
|
7550
|
-
return null;
|
|
7551
|
-
}
|
|
7552
|
-
var currencyString = currency.toString();
|
|
7553
|
-
var _getAssetsObject = getAssetsObject(node),
|
|
7554
|
-
otherAssets = _getAssetsObject.otherAssets,
|
|
7555
|
-
nativeAssets = _getAssetsObject.nativeAssets,
|
|
7556
|
-
relayChainAssetSymbol = _getAssetsObject.relayChainAssetSymbol;
|
|
7557
|
-
var combinedAssets = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets));
|
|
7558
|
-
var asset;
|
|
7559
|
-
if (isSymbol === true) {
|
|
7560
|
-
asset = findAssetBySymbol(otherAssets, nativeAssets, currencyString, isRelayDestination);
|
|
7561
|
-
} else if (isSymbol === false) {
|
|
7562
|
-
asset = findAssetById(combinedAssets, currencyString);
|
|
7563
|
-
} else {
|
|
7564
|
-
asset = findAssetBySymbol(otherAssets, nativeAssets, currencyString, isRelayDestination) || findAssetById(combinedAssets, currencyString);
|
|
7565
|
-
}
|
|
7566
|
-
if (asset) {
|
|
7567
|
-
return {
|
|
7568
|
-
symbol: asset.symbol,
|
|
7569
|
-
assetId: asset.assetId
|
|
7570
|
-
};
|
|
7571
|
-
}
|
|
7572
|
-
if (relayChainAssetSymbol === currencyString && isSymbol !== false) {
|
|
7573
|
-
return {
|
|
7574
|
-
symbol: relayChainAssetSymbol
|
|
7575
|
-
};
|
|
7576
|
-
}
|
|
7577
|
-
return null;
|
|
7578
|
-
};
|
|
7579
|
-
|
|
7580
8227
|
var getBalanceForeignXTokens = function getBalanceForeignXTokens(address, symbolOrId, symbol, id, api) {
|
|
7581
8228
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7582
8229
|
var response, entry;
|
|
@@ -7591,10 +8238,9 @@ var getBalanceForeignXTokens = function getBalanceForeignXTokens(address, symbol
|
|
|
7591
8238
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
7592
8239
|
_ref2$0$args = _slicedToArray(_ref2[0].args, 2);
|
|
7593
8240
|
_ref2$0$args[0];
|
|
7594
|
-
var asset = _ref2$0$args[1]
|
|
7595
|
-
|
|
8241
|
+
var asset = _ref2$0$args[1];
|
|
8242
|
+
_ref2[1];
|
|
7596
8243
|
var _a, _b, _c;
|
|
7597
|
-
console.log(asset.toHuman(), value1.toHuman());
|
|
7598
8244
|
return asset.toString() === symbolOrId || asset.toString() === id || asset.toString() === symbol || Object.values((_a = asset.toHuman()) !== null && _a !== void 0 ? _a : {}).toString() === symbolOrId || Object.values((_b = asset.toHuman()) !== null && _b !== void 0 ? _b : {}).toString() === id || Object.values((_c = asset.toHuman()) !== null && _c !== void 0 ? _c : {}).toString() === symbol;
|
|
7599
8245
|
});
|
|
7600
8246
|
return _context.abrupt("return", entry ? BigInt(entry[1].free.toString()) : null);
|
|
@@ -7602,33 +8248,105 @@ var getBalanceForeignXTokens = function getBalanceForeignXTokens(address, symbol
|
|
|
7602
8248
|
case "end":
|
|
7603
8249
|
return _context.stop();
|
|
7604
8250
|
}
|
|
7605
|
-
}, _callee);
|
|
7606
|
-
}));
|
|
8251
|
+
}, _callee);
|
|
8252
|
+
}));
|
|
8253
|
+
};
|
|
8254
|
+
var getAssetHubMultiLocation = function getAssetHubMultiLocation(symbol) {
|
|
8255
|
+
if (symbol === 'MYTH') {
|
|
8256
|
+
return {
|
|
8257
|
+
parents: 1,
|
|
8258
|
+
interior: {
|
|
8259
|
+
X1: {
|
|
8260
|
+
Parachain: '3369'
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
};
|
|
8264
|
+
} else if (symbol === 'KSM') {
|
|
8265
|
+
return {
|
|
8266
|
+
parents: 2,
|
|
8267
|
+
interior: {
|
|
8268
|
+
X1: {
|
|
8269
|
+
GlobalConsensus: 'Kusama'
|
|
8270
|
+
}
|
|
8271
|
+
}
|
|
8272
|
+
};
|
|
8273
|
+
}
|
|
8274
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
8275
|
+
var ethAsset = ethAssets.find(function (asset) {
|
|
8276
|
+
return asset.symbol === symbol;
|
|
8277
|
+
});
|
|
8278
|
+
if (ethAsset) {
|
|
8279
|
+
return {
|
|
8280
|
+
parents: 2,
|
|
8281
|
+
interior: {
|
|
8282
|
+
X2: [{
|
|
8283
|
+
GlobalConsensus: {
|
|
8284
|
+
Ethereum: {
|
|
8285
|
+
chainId: 1
|
|
8286
|
+
}
|
|
8287
|
+
}
|
|
8288
|
+
}, {
|
|
8289
|
+
AccountKey20: {
|
|
8290
|
+
network: null,
|
|
8291
|
+
key: ethAsset.assetId
|
|
8292
|
+
}
|
|
8293
|
+
}]
|
|
8294
|
+
}
|
|
8295
|
+
};
|
|
8296
|
+
}
|
|
8297
|
+
return null;
|
|
7607
8298
|
};
|
|
7608
|
-
var getBalanceForeignPolkadotXcm = function getBalanceForeignPolkadotXcm(address, id, api) {
|
|
8299
|
+
var getBalanceForeignPolkadotXcm = function getBalanceForeignPolkadotXcm(address, id, api, node, symbol) {
|
|
7609
8300
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
7610
|
-
var parsedId, response, obj;
|
|
8301
|
+
var _response, _obj, multiLocation, _response2, _obj2, parsedId, response, obj;
|
|
7611
8302
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
7612
8303
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7613
8304
|
case 0:
|
|
7614
8305
|
_context2.prev = 0;
|
|
7615
|
-
|
|
8306
|
+
if (!(node === 'Mythos')) {
|
|
8307
|
+
_context2.next = 7;
|
|
8308
|
+
break;
|
|
8309
|
+
}
|
|
7616
8310
|
_context2.next = 4;
|
|
7617
|
-
return api.query.
|
|
8311
|
+
return api.query.balances.account(address);
|
|
7618
8312
|
case 4:
|
|
8313
|
+
_response = _context2.sent;
|
|
8314
|
+
_obj = _response.toJSON();
|
|
8315
|
+
return _context2.abrupt("return", BigInt(_obj.free));
|
|
8316
|
+
case 7:
|
|
8317
|
+
if (!(node === 'AssetHubPolkadot')) {
|
|
8318
|
+
_context2.next = 15;
|
|
8319
|
+
break;
|
|
8320
|
+
}
|
|
8321
|
+
multiLocation = getAssetHubMultiLocation(symbol !== null && symbol !== void 0 ? symbol : id);
|
|
8322
|
+
if (!multiLocation) {
|
|
8323
|
+
_context2.next = 15;
|
|
8324
|
+
break;
|
|
8325
|
+
}
|
|
8326
|
+
_context2.next = 12;
|
|
8327
|
+
return api.query.foreignAssets.account(multiLocation, address);
|
|
8328
|
+
case 12:
|
|
8329
|
+
_response2 = _context2.sent;
|
|
8330
|
+
_obj2 = _response2.toJSON();
|
|
8331
|
+
return _context2.abrupt("return", BigInt(_obj2 === null ? 0 : _obj2.balance));
|
|
8332
|
+
case 15:
|
|
8333
|
+
parsedId = new types.u32(api.registry, id);
|
|
8334
|
+
_context2.next = 18;
|
|
8335
|
+
return api.query.assets.account(parsedId, address);
|
|
8336
|
+
case 18:
|
|
7619
8337
|
response = _context2.sent;
|
|
7620
8338
|
obj = response.toJSON();
|
|
7621
8339
|
return _context2.abrupt("return", BigInt(obj.balance));
|
|
7622
|
-
case
|
|
7623
|
-
_context2.prev =
|
|
8340
|
+
case 23:
|
|
8341
|
+
_context2.prev = 23;
|
|
7624
8342
|
_context2.t0 = _context2["catch"](0);
|
|
7625
8343
|
console.log('Error while fetching balance', _context2.t0);
|
|
7626
8344
|
return _context2.abrupt("return", null);
|
|
7627
|
-
case
|
|
8345
|
+
case 27:
|
|
7628
8346
|
case "end":
|
|
7629
8347
|
return _context2.stop();
|
|
7630
8348
|
}
|
|
7631
|
-
}, _callee2, null, [[0,
|
|
8349
|
+
}, _callee2, null, [[0, 23]]);
|
|
7632
8350
|
}));
|
|
7633
8351
|
};
|
|
7634
8352
|
var getBalanceForeign = function getBalanceForeign(address, node, symbolOrId, api) {
|
|
@@ -7666,7 +8384,7 @@ var getBalanceForeign = function getBalanceForeign(address, node, symbolOrId, ap
|
|
|
7666
8384
|
break;
|
|
7667
8385
|
}
|
|
7668
8386
|
_context3.next = 18;
|
|
7669
|
-
return getBalanceForeignPolkadotXcm(address, (_a = asset === null || asset === void 0 ? void 0 : asset.assetId) !== null && _a !== void 0 ? _a : symbolOrId, apiWithFallback);
|
|
8387
|
+
return getBalanceForeignPolkadotXcm(address, (_a = asset === null || asset === void 0 ? void 0 : asset.assetId) !== null && _a !== void 0 ? _a : symbolOrId, apiWithFallback, node, asset === null || asset === void 0 ? void 0 : asset.symbol);
|
|
7670
8388
|
case 18:
|
|
7671
8389
|
return _context3.abrupt("return", _context3.sent);
|
|
7672
8390
|
case 19:
|
|
@@ -7688,7 +8406,7 @@ var Centrifuge$1 = "1000000000000";
|
|
|
7688
8406
|
var ComposableFinance$1 = "100000000000";
|
|
7689
8407
|
var Darwinia$1 = "0";
|
|
7690
8408
|
var Hydration$1 = "1000000000000";
|
|
7691
|
-
var Litentry$1 = "
|
|
8409
|
+
var Litentry$1 = "100000000000000000";
|
|
7692
8410
|
var Moonbeam$1 = "0";
|
|
7693
8411
|
var Parallel$1 = "100000000000";
|
|
7694
8412
|
var AssetHubKusama$1 = "3333333";
|
|
@@ -7707,7 +8425,7 @@ var Imbue$1 = "1000000";
|
|
|
7707
8425
|
var Integritee$1 = "1000000000";
|
|
7708
8426
|
var InvArchTinker$1 = "1000000000";
|
|
7709
8427
|
var Karura$1 = "100000000000";
|
|
7710
|
-
var Litmus$1 = "
|
|
8428
|
+
var Litmus$1 = "100000000000000000";
|
|
7711
8429
|
var Moonriver$1 = "0";
|
|
7712
8430
|
var ParallelHeiko$1 = "10000000000";
|
|
7713
8431
|
var Picasso$1 = "100000000000";
|
|
@@ -8066,8 +8784,9 @@ var OpenChannelBuilder = /*#__PURE__*/function () {
|
|
|
8066
8784
|
}();
|
|
8067
8785
|
|
|
8068
8786
|
var RelayToParaBuilder = /*#__PURE__*/function () {
|
|
8069
|
-
function RelayToParaBuilder(api, to, paraIdTo) {
|
|
8787
|
+
function RelayToParaBuilder(api, to, batchManager, paraIdTo) {
|
|
8070
8788
|
_classCallCheck(this, RelayToParaBuilder);
|
|
8789
|
+
this.batchManager = batchManager;
|
|
8071
8790
|
this.api = api;
|
|
8072
8791
|
this.to = to;
|
|
8073
8792
|
this.paraIdTo = paraIdTo;
|
|
@@ -8109,6 +8828,15 @@ var RelayToParaBuilder = /*#__PURE__*/function () {
|
|
|
8109
8828
|
version: this._version
|
|
8110
8829
|
};
|
|
8111
8830
|
}
|
|
8831
|
+
}, {
|
|
8832
|
+
key: "addToBatch",
|
|
8833
|
+
value: function addToBatch() {
|
|
8834
|
+
this.batchManager.addTransaction({
|
|
8835
|
+
func: transferRelayToPara,
|
|
8836
|
+
options: this.buildOptions()
|
|
8837
|
+
});
|
|
8838
|
+
return new GeneralBuilder(this.batchManager, this.api, undefined, this.to);
|
|
8839
|
+
}
|
|
8112
8840
|
}, {
|
|
8113
8841
|
key: "build",
|
|
8114
8842
|
value: function build() {
|
|
@@ -8151,15 +8879,16 @@ var RelayToParaBuilder = /*#__PURE__*/function () {
|
|
|
8151
8879
|
}
|
|
8152
8880
|
}], [{
|
|
8153
8881
|
key: "create",
|
|
8154
|
-
value: function create(api, to, paraIdTo) {
|
|
8155
|
-
return new RelayToParaBuilder(api, to, paraIdTo);
|
|
8882
|
+
value: function create(api, to, batchManager, paraIdTo) {
|
|
8883
|
+
return new RelayToParaBuilder(api, to, batchManager, paraIdTo);
|
|
8156
8884
|
}
|
|
8157
8885
|
}]);
|
|
8158
8886
|
}();
|
|
8159
8887
|
|
|
8160
8888
|
var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
8161
|
-
function ParaToParaBuilder(api, from, to, currency, paraIdTo) {
|
|
8889
|
+
function ParaToParaBuilder(api, from, to, currency, batchManager, paraIdTo) {
|
|
8162
8890
|
_classCallCheck(this, ParaToParaBuilder);
|
|
8891
|
+
this.batchManager = batchManager;
|
|
8163
8892
|
this.api = api;
|
|
8164
8893
|
this.from = from;
|
|
8165
8894
|
this.to = to;
|
|
@@ -8212,6 +8941,16 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
8212
8941
|
version: this._version
|
|
8213
8942
|
};
|
|
8214
8943
|
}
|
|
8944
|
+
}, {
|
|
8945
|
+
key: "addToBatch",
|
|
8946
|
+
value: function addToBatch() {
|
|
8947
|
+
var options = this.buildOptions();
|
|
8948
|
+
this.batchManager.addTransaction({
|
|
8949
|
+
func: send,
|
|
8950
|
+
options: options
|
|
8951
|
+
});
|
|
8952
|
+
return new GeneralBuilder(this.batchManager, this.api, this.from);
|
|
8953
|
+
}
|
|
8215
8954
|
}, {
|
|
8216
8955
|
key: "build",
|
|
8217
8956
|
value: function build() {
|
|
@@ -8220,12 +8959,18 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
8220
8959
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8221
8960
|
while (1) switch (_context.prev = _context.next) {
|
|
8222
8961
|
case 0:
|
|
8962
|
+
if (this.batchManager.isEmpty()) {
|
|
8963
|
+
_context.next = 2;
|
|
8964
|
+
break;
|
|
8965
|
+
}
|
|
8966
|
+
throw new Error('Transaction manager contains batched items. Use buildBatch() to process them.');
|
|
8967
|
+
case 2:
|
|
8223
8968
|
options = this.buildOptions();
|
|
8224
|
-
_context.next =
|
|
8969
|
+
_context.next = 5;
|
|
8225
8970
|
return send(options);
|
|
8226
|
-
case
|
|
8971
|
+
case 5:
|
|
8227
8972
|
return _context.abrupt("return", _context.sent);
|
|
8228
|
-
case
|
|
8973
|
+
case 6:
|
|
8229
8974
|
case "end":
|
|
8230
8975
|
return _context.stop();
|
|
8231
8976
|
}
|
|
@@ -8254,15 +8999,16 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
8254
8999
|
}
|
|
8255
9000
|
}], [{
|
|
8256
9001
|
key: "createParaToPara",
|
|
8257
|
-
value: function createParaToPara(api, from, to, currency, paraIdTo) {
|
|
8258
|
-
return new ParaToParaBuilder(api, from, to, currency, paraIdTo);
|
|
9002
|
+
value: function createParaToPara(api, from, to, currency, batchManager, paraIdTo) {
|
|
9003
|
+
return new ParaToParaBuilder(api, from, to, currency, batchManager, paraIdTo);
|
|
8259
9004
|
}
|
|
8260
9005
|
}]);
|
|
8261
9006
|
}();
|
|
8262
9007
|
|
|
8263
9008
|
var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
8264
|
-
function ParaToRelayBuilder(api, from, amount, feeAsset) {
|
|
9009
|
+
function ParaToRelayBuilder(api, from, amount, batchManager, feeAsset) {
|
|
8265
9010
|
_classCallCheck(this, ParaToRelayBuilder);
|
|
9011
|
+
this.batchManager = batchManager;
|
|
8266
9012
|
this.api = api;
|
|
8267
9013
|
this.from = from;
|
|
8268
9014
|
this.amount = amount;
|
|
@@ -8304,6 +9050,16 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
|
8304
9050
|
version: this._version
|
|
8305
9051
|
};
|
|
8306
9052
|
}
|
|
9053
|
+
}, {
|
|
9054
|
+
key: "addToBatch",
|
|
9055
|
+
value: function addToBatch() {
|
|
9056
|
+
var options = this.buildOptions();
|
|
9057
|
+
this.batchManager.addTransaction({
|
|
9058
|
+
func: send,
|
|
9059
|
+
options: options
|
|
9060
|
+
});
|
|
9061
|
+
return new GeneralBuilder(this.batchManager, this.api, this.from);
|
|
9062
|
+
}
|
|
8307
9063
|
}, {
|
|
8308
9064
|
key: "build",
|
|
8309
9065
|
value: function build() {
|
|
@@ -8346,8 +9102,8 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
|
8346
9102
|
}
|
|
8347
9103
|
}], [{
|
|
8348
9104
|
key: "create",
|
|
8349
|
-
value: function create(api, from, amount, feeAsset) {
|
|
8350
|
-
return new ParaToRelayBuilder(api, from, amount, feeAsset);
|
|
9105
|
+
value: function create(api, from, amount, batchManager, feeAsset) {
|
|
9106
|
+
return new ParaToRelayBuilder(api, from, amount, batchManager, feeAsset);
|
|
8351
9107
|
}
|
|
8352
9108
|
}]);
|
|
8353
9109
|
}();
|
|
@@ -8362,7 +9118,7 @@ var MissingApiPromiseError = /*#__PURE__*/function (_Error) {
|
|
|
8362
9118
|
}
|
|
8363
9119
|
_inherits(MissingApiPromiseError, _Error);
|
|
8364
9120
|
return _createClass(MissingApiPromiseError);
|
|
8365
|
-
}(
|
|
9121
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8366
9122
|
|
|
8367
9123
|
var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
|
|
8368
9124
|
if (isTMultiLocation(address)) {
|
|
@@ -8525,9 +9281,104 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
|
|
|
8525
9281
|
}]);
|
|
8526
9282
|
}();
|
|
8527
9283
|
|
|
9284
|
+
var BatchTransactionManager = /*#__PURE__*/function () {
|
|
9285
|
+
function BatchTransactionManager() {
|
|
9286
|
+
_classCallCheck(this, BatchTransactionManager);
|
|
9287
|
+
this.transactions = [];
|
|
9288
|
+
}
|
|
9289
|
+
return _createClass(BatchTransactionManager, [{
|
|
9290
|
+
key: "addTransaction",
|
|
9291
|
+
value: function addTransaction(transaction) {
|
|
9292
|
+
this.transactions.push(transaction);
|
|
9293
|
+
}
|
|
9294
|
+
}, {
|
|
9295
|
+
key: "isEmpty",
|
|
9296
|
+
value: function isEmpty() {
|
|
9297
|
+
return this.transactions.length === 0;
|
|
9298
|
+
}
|
|
9299
|
+
}, {
|
|
9300
|
+
key: "buildBatch",
|
|
9301
|
+
value: function buildBatch(api_1, from_1, to_1) {
|
|
9302
|
+
return __awaiter(this, arguments, void 0, function (api, from, to) {
|
|
9303
|
+
var _this = this;
|
|
9304
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
|
9305
|
+
mode: exports.BatchMode.BATCH_ALL
|
|
9306
|
+
};
|
|
9307
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9308
|
+
var apiWithFallback, mode, sameFrom, results, txs;
|
|
9309
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9310
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9311
|
+
case 0:
|
|
9312
|
+
if (!(!from && !to)) {
|
|
9313
|
+
_context.next = 2;
|
|
9314
|
+
break;
|
|
9315
|
+
}
|
|
9316
|
+
throw new Error('From or to node is required');
|
|
9317
|
+
case 2:
|
|
9318
|
+
if (!(to && _typeof(to) === 'object')) {
|
|
9319
|
+
_context.next = 4;
|
|
9320
|
+
break;
|
|
9321
|
+
}
|
|
9322
|
+
throw new Error('Please provide ApiPromise instance.');
|
|
9323
|
+
case 4:
|
|
9324
|
+
if (!(api !== null && api !== void 0)) {
|
|
9325
|
+
_context.next = 8;
|
|
9326
|
+
break;
|
|
9327
|
+
}
|
|
9328
|
+
_context.t0 = api;
|
|
9329
|
+
_context.next = 11;
|
|
9330
|
+
break;
|
|
9331
|
+
case 8:
|
|
9332
|
+
_context.next = 10;
|
|
9333
|
+
return createApiInstanceForNode(from !== null && from !== void 0 ? from : determineRelayChain(to));
|
|
9334
|
+
case 10:
|
|
9335
|
+
_context.t0 = _context.sent;
|
|
9336
|
+
case 11:
|
|
9337
|
+
apiWithFallback = _context.t0;
|
|
9338
|
+
mode = options.mode;
|
|
9339
|
+
if (!(_this.transactions.length === 0)) {
|
|
9340
|
+
_context.next = 15;
|
|
9341
|
+
break;
|
|
9342
|
+
}
|
|
9343
|
+
throw new Error('No transactions to batch.');
|
|
9344
|
+
case 15:
|
|
9345
|
+
sameFrom = _this.transactions.every(function (tx) {
|
|
9346
|
+
if ('origin' in tx.options) {
|
|
9347
|
+
return tx.options.origin === from;
|
|
9348
|
+
}
|
|
9349
|
+
return true;
|
|
9350
|
+
});
|
|
9351
|
+
if (sameFrom) {
|
|
9352
|
+
_context.next = 18;
|
|
9353
|
+
break;
|
|
9354
|
+
}
|
|
9355
|
+
throw new Error('All transactions must have the same origin.');
|
|
9356
|
+
case 18:
|
|
9357
|
+
results = _this.transactions.map(function (options) {
|
|
9358
|
+
var func = options.func,
|
|
9359
|
+
txOptions = options.options;
|
|
9360
|
+
return func(txOptions);
|
|
9361
|
+
});
|
|
9362
|
+
_context.next = 21;
|
|
9363
|
+
return Promise.all(results);
|
|
9364
|
+
case 21:
|
|
9365
|
+
txs = _context.sent;
|
|
9366
|
+
return _context.abrupt("return", mode === exports.BatchMode.BATCH_ALL ? apiWithFallback.tx.utility.batchAll(txs) : apiWithFallback.tx.utility.batch(txs));
|
|
9367
|
+
case 23:
|
|
9368
|
+
case "end":
|
|
9369
|
+
return _context.stop();
|
|
9370
|
+
}
|
|
9371
|
+
}, _callee);
|
|
9372
|
+
})();
|
|
9373
|
+
});
|
|
9374
|
+
}
|
|
9375
|
+
}]);
|
|
9376
|
+
}();
|
|
9377
|
+
|
|
8528
9378
|
var ToGeneralBuilder = /*#__PURE__*/function () {
|
|
8529
|
-
function ToGeneralBuilder(api, from, to, paraIdTo) {
|
|
9379
|
+
function ToGeneralBuilder(api, from, to, batchManager, paraIdTo) {
|
|
8530
9380
|
_classCallCheck(this, ToGeneralBuilder);
|
|
9381
|
+
this.batchManager = batchManager;
|
|
8531
9382
|
this.api = api;
|
|
8532
9383
|
this.from = from;
|
|
8533
9384
|
this.to = to;
|
|
@@ -8536,7 +9387,7 @@ var ToGeneralBuilder = /*#__PURE__*/function () {
|
|
|
8536
9387
|
return _createClass(ToGeneralBuilder, [{
|
|
8537
9388
|
key: "currency",
|
|
8538
9389
|
value: function currency(_currency) {
|
|
8539
|
-
return ParaToParaBuilder.createParaToPara(this.api, this.from, this.to, _currency, this.paraIdTo);
|
|
9390
|
+
return ParaToParaBuilder.createParaToPara(this.api, this.from, this.to, _currency, this.batchManager, this.paraIdTo);
|
|
8540
9391
|
}
|
|
8541
9392
|
}, {
|
|
8542
9393
|
key: "openChannel",
|
|
@@ -8549,15 +9400,16 @@ var ToGeneralBuilder = /*#__PURE__*/function () {
|
|
|
8549
9400
|
}]);
|
|
8550
9401
|
}();
|
|
8551
9402
|
var FromGeneralBuilder = /*#__PURE__*/function () {
|
|
8552
|
-
function FromGeneralBuilder(api, from) {
|
|
9403
|
+
function FromGeneralBuilder(api, from, batchManager) {
|
|
8553
9404
|
_classCallCheck(this, FromGeneralBuilder);
|
|
9405
|
+
this.batchManager = batchManager;
|
|
8554
9406
|
this.api = api;
|
|
8555
9407
|
this.from = from;
|
|
8556
9408
|
}
|
|
8557
9409
|
return _createClass(FromGeneralBuilder, [{
|
|
8558
9410
|
key: "to",
|
|
8559
9411
|
value: function to(node, paraIdTo) {
|
|
8560
|
-
return new ToGeneralBuilder(this.api, this.from, node, paraIdTo);
|
|
9412
|
+
return new ToGeneralBuilder(this.api, this.from, node, this.batchManager, paraIdTo);
|
|
8561
9413
|
}
|
|
8562
9414
|
}, {
|
|
8563
9415
|
key: "feeAsset",
|
|
@@ -8568,7 +9420,7 @@ var FromGeneralBuilder = /*#__PURE__*/function () {
|
|
|
8568
9420
|
}, {
|
|
8569
9421
|
key: "amount",
|
|
8570
9422
|
value: function amount(_amount) {
|
|
8571
|
-
return ParaToRelayBuilder.create(this.api, this.from, _amount, this._feeAsset);
|
|
9423
|
+
return ParaToRelayBuilder.create(this.api, this.from, _amount, this.batchManager, this._feeAsset);
|
|
8572
9424
|
}
|
|
8573
9425
|
}, {
|
|
8574
9426
|
key: "closeChannel",
|
|
@@ -8581,29 +9433,100 @@ var FromGeneralBuilder = /*#__PURE__*/function () {
|
|
|
8581
9433
|
}]);
|
|
8582
9434
|
}();
|
|
8583
9435
|
var GeneralBuilder = /*#__PURE__*/function () {
|
|
8584
|
-
function GeneralBuilder(api) {
|
|
9436
|
+
function GeneralBuilder(batchManager, api, _from, _to) {
|
|
8585
9437
|
_classCallCheck(this, GeneralBuilder);
|
|
9438
|
+
this.batchManager = batchManager;
|
|
8586
9439
|
this.api = api;
|
|
9440
|
+
this._from = _from;
|
|
9441
|
+
this._to = _to;
|
|
8587
9442
|
}
|
|
8588
9443
|
return _createClass(GeneralBuilder, [{
|
|
8589
9444
|
key: "from",
|
|
8590
9445
|
value: function from(node) {
|
|
8591
|
-
return new FromGeneralBuilder(this.api, node);
|
|
9446
|
+
return new FromGeneralBuilder(this.api, node, this.batchManager);
|
|
8592
9447
|
}
|
|
8593
9448
|
}, {
|
|
8594
9449
|
key: "to",
|
|
8595
9450
|
value: function to(node, paraIdTo) {
|
|
8596
|
-
return RelayToParaBuilder.create(this.api, node, paraIdTo);
|
|
9451
|
+
return RelayToParaBuilder.create(this.api, node, this.batchManager, paraIdTo);
|
|
8597
9452
|
}
|
|
8598
9453
|
}, {
|
|
8599
9454
|
key: "claimFrom",
|
|
8600
9455
|
value: function claimFrom(node) {
|
|
8601
9456
|
return AssetClaimBuilder.create(this.api, node);
|
|
8602
9457
|
}
|
|
9458
|
+
}, {
|
|
9459
|
+
key: "buildBatch",
|
|
9460
|
+
value: function buildBatch(options) {
|
|
9461
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9462
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9463
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9464
|
+
case 0:
|
|
9465
|
+
return _context.abrupt("return", this.batchManager.buildBatch(this.api, this._from, this._to, options));
|
|
9466
|
+
case 1:
|
|
9467
|
+
case "end":
|
|
9468
|
+
return _context.stop();
|
|
9469
|
+
}
|
|
9470
|
+
}, _callee, this);
|
|
9471
|
+
}));
|
|
9472
|
+
}
|
|
8603
9473
|
}]);
|
|
8604
9474
|
}();
|
|
8605
9475
|
var Builder = function Builder(api) {
|
|
8606
|
-
return new GeneralBuilder(api);
|
|
9476
|
+
return new GeneralBuilder(new BatchTransactionManager(), api);
|
|
9477
|
+
};
|
|
9478
|
+
|
|
9479
|
+
var findEthAsset = function findEthAsset(currency) {
|
|
9480
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
9481
|
+
var ethAsset = ethAssets.find(function (asset) {
|
|
9482
|
+
return asset.symbol === currency;
|
|
9483
|
+
});
|
|
9484
|
+
if (!ethAsset) {
|
|
9485
|
+
throw new InvalidCurrencyError("Currency ".concat(currency, " is not supported for Ethereum transfers"));
|
|
9486
|
+
}
|
|
9487
|
+
return ethAsset;
|
|
9488
|
+
};
|
|
9489
|
+
|
|
9490
|
+
var createContext = function createContext(executionUrl, config) {
|
|
9491
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9492
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9493
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9494
|
+
case 0:
|
|
9495
|
+
_context.next = 2;
|
|
9496
|
+
return api.contextFactory({
|
|
9497
|
+
ethereum: {
|
|
9498
|
+
execution_url: executionUrl,
|
|
9499
|
+
beacon_url: config.BEACON_HTTP_API
|
|
9500
|
+
},
|
|
9501
|
+
polkadot: {
|
|
9502
|
+
url: {
|
|
9503
|
+
bridgeHub: config.BRIDGE_HUB_URL,
|
|
9504
|
+
assetHub: config.ASSET_HUB_URL,
|
|
9505
|
+
relaychain: config.RELAY_CHAIN_URL,
|
|
9506
|
+
parachains: config.PARACHAINS
|
|
9507
|
+
}
|
|
9508
|
+
},
|
|
9509
|
+
appContracts: {
|
|
9510
|
+
gateway: config.GATEWAY_CONTRACT,
|
|
9511
|
+
beefy: config.BEEFY_CONTRACT
|
|
9512
|
+
}
|
|
9513
|
+
});
|
|
9514
|
+
case 2:
|
|
9515
|
+
return _context.abrupt("return", _context.sent);
|
|
9516
|
+
case 3:
|
|
9517
|
+
case "end":
|
|
9518
|
+
return _context.stop();
|
|
9519
|
+
}
|
|
9520
|
+
}, _callee);
|
|
9521
|
+
}));
|
|
9522
|
+
};
|
|
9523
|
+
|
|
9524
|
+
var checkPlanFailure = function checkPlanFailure(plan) {
|
|
9525
|
+
if (plan.failure) {
|
|
9526
|
+
throw new Error("Failed to validate send: ".concat(plan.failure.errors.map(function (e) {
|
|
9527
|
+
return e.message;
|
|
9528
|
+
}).join('\n\n')));
|
|
9529
|
+
}
|
|
8607
9530
|
};
|
|
8608
9531
|
|
|
8609
9532
|
var transferEthToPolkadot = function transferEthToPolkadot(provider_1, _a) {
|
|
@@ -8614,65 +9537,31 @@ var transferEthToPolkadot = function transferEthToPolkadot(provider_1, _a) {
|
|
|
8614
9537
|
amount = _ref.amount,
|
|
8615
9538
|
currency = _ref.currency;
|
|
8616
9539
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8617
|
-
var
|
|
9540
|
+
var ethAsset, env, context, destParaId, plan, result;
|
|
8618
9541
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8619
9542
|
while (1) switch (_context.prev = _context.next) {
|
|
8620
9543
|
case 0:
|
|
8621
|
-
|
|
8622
|
-
ethAsset = ethAssets.find(function (asset) {
|
|
8623
|
-
return asset.symbol === currency;
|
|
8624
|
-
});
|
|
8625
|
-
if (ethAsset) {
|
|
8626
|
-
_context.next = 4;
|
|
8627
|
-
break;
|
|
8628
|
-
}
|
|
8629
|
-
throw new InvalidCurrencyError("Currency ".concat(currency, " is not supported for Ethereum transfers"));
|
|
8630
|
-
case 4:
|
|
9544
|
+
ethAsset = findEthAsset(currency);
|
|
8631
9545
|
env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
ethereum: {
|
|
8636
|
-
execution_url: provider,
|
|
8637
|
-
beacon_url: config.BEACON_HTTP_API
|
|
8638
|
-
},
|
|
8639
|
-
polkadot: {
|
|
8640
|
-
url: {
|
|
8641
|
-
bridgeHub: config.BRIDGE_HUB_URL,
|
|
8642
|
-
assetHub: config.ASSET_HUB_URL,
|
|
8643
|
-
relaychain: config.RELAY_CHAIN_URL,
|
|
8644
|
-
parachains: config.PARACHAINS
|
|
8645
|
-
}
|
|
8646
|
-
},
|
|
8647
|
-
appContracts: {
|
|
8648
|
-
gateway: config.GATEWAY_CONTRACT,
|
|
8649
|
-
beefy: config.BEEFY_CONTRACT
|
|
8650
|
-
}
|
|
8651
|
-
});
|
|
8652
|
-
case 8:
|
|
9546
|
+
_context.next = 4;
|
|
9547
|
+
return createContext(provider, env.config);
|
|
9548
|
+
case 4:
|
|
8653
9549
|
context = _context.sent;
|
|
8654
9550
|
destParaId = getParaId(to);
|
|
8655
|
-
_context.next =
|
|
9551
|
+
_context.next = 8;
|
|
8656
9552
|
return api.toPolkadot.validateSend(context, signer, address, ethAsset.assetId, destParaId, BigInt(amount), BigInt(0));
|
|
8657
|
-
case
|
|
9553
|
+
case 8:
|
|
8658
9554
|
plan = _context.sent;
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
break;
|
|
8662
|
-
}
|
|
8663
|
-
throw new Error("Failed to validate send: ".concat(plan.failure.errors.map(function (e) {
|
|
8664
|
-
return e.message;
|
|
8665
|
-
}).join('\n\n')));
|
|
8666
|
-
case 15:
|
|
8667
|
-
_context.next = 17;
|
|
9555
|
+
checkPlanFailure(plan);
|
|
9556
|
+
_context.next = 12;
|
|
8668
9557
|
return api.toPolkadot.send(context, signer, plan);
|
|
8669
|
-
case
|
|
9558
|
+
case 12:
|
|
8670
9559
|
result = _context.sent;
|
|
8671
9560
|
return _context.abrupt("return", {
|
|
8672
9561
|
result: result,
|
|
8673
9562
|
plan: plan
|
|
8674
9563
|
});
|
|
8675
|
-
case
|
|
9564
|
+
case 14:
|
|
8676
9565
|
case "end":
|
|
8677
9566
|
return _context.stop();
|
|
8678
9567
|
}
|
|
@@ -8867,7 +9756,7 @@ var getAssetSymbol = function getAssetSymbol(node, assetId) {
|
|
|
8867
9756
|
if (node === 'Polkadot' || node === 'Kusama') {
|
|
8868
9757
|
return getNativeAssetSymbol(node);
|
|
8869
9758
|
}
|
|
8870
|
-
var asset = getAssetBySymbolOrId(node, assetId);
|
|
9759
|
+
var asset = getAssetBySymbolOrId(node, assetId, false, true);
|
|
8871
9760
|
return asset === null || asset === void 0 ? void 0 : asset.symbol;
|
|
8872
9761
|
};
|
|
8873
9762
|
var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
|
|
@@ -9013,6 +9902,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
9013
9902
|
getAllAssetsSymbols: getAllAssetsSymbols,
|
|
9014
9903
|
getAssetDecimals: getAssetDecimals,
|
|
9015
9904
|
getAssetId: getAssetId,
|
|
9905
|
+
getAssets: getAssets,
|
|
9016
9906
|
getAssetsObject: getAssetsObject,
|
|
9017
9907
|
getBalanceForeign: getBalanceForeign,
|
|
9018
9908
|
getBalanceNative: getBalanceNative,
|
|
@@ -9021,6 +9911,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
9021
9911
|
getOtherAssets: getOtherAssets,
|
|
9022
9912
|
getParaId: getParaId,
|
|
9023
9913
|
getRelayChainSymbol: getRelayChainSymbol,
|
|
9914
|
+
getSupportedAssets: getSupportedAssets,
|
|
9024
9915
|
getTNode: getTNode,
|
|
9025
9916
|
getTransferInfo: getTransferInfo,
|
|
9026
9917
|
hasSupportForAsset: hasSupportForAsset
|
|
@@ -9186,6 +10077,11 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
9186
10077
|
value: function createPolkadotXcmHeader$1(scenario, version, destination, paraId) {
|
|
9187
10078
|
return createPolkadotXcmHeader(scenario, version, destination, paraId);
|
|
9188
10079
|
}
|
|
10080
|
+
}, {
|
|
10081
|
+
key: "getNativeAssetSymbol",
|
|
10082
|
+
value: function getNativeAssetSymbol$1() {
|
|
10083
|
+
return getNativeAssetSymbol(this.node);
|
|
10084
|
+
}
|
|
9189
10085
|
}]);
|
|
9190
10086
|
}();
|
|
9191
10087
|
|
|
@@ -9224,7 +10120,9 @@ var getCurrencySelection = function getCurrencySelection(_ref2, isAssetHub, curr
|
|
|
9224
10120
|
}
|
|
9225
10121
|
return currencySelection;
|
|
9226
10122
|
};
|
|
9227
|
-
var getParameters = function getParameters(isAssetHub, currencySelection, addressSelection, amount, fees, feeAsset
|
|
10123
|
+
var getParameters = function getParameters(isAssetHub, currencySelection, addressSelection, amount, fees, feeAsset
|
|
10124
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10125
|
+
) {
|
|
9228
10126
|
if (isAssetHub) {
|
|
9229
10127
|
return feeAsset !== undefined ? [currencySelection, feeAsset, addressSelection, fees] : [currencySelection, addressSelection, fees];
|
|
9230
10128
|
}
|
|
@@ -9262,7 +10160,6 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
9262
10160
|
parameters: parameters
|
|
9263
10161
|
};
|
|
9264
10162
|
}
|
|
9265
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9266
10163
|
return (_api$tx$module = api.tx[module])[section].apply(_api$tx$module, _toConsumableArray(parameters));
|
|
9267
10164
|
}
|
|
9268
10165
|
}]);
|
|
@@ -9304,9 +10201,11 @@ var Unique = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9304
10201
|
return _createClass(Unique, [{
|
|
9305
10202
|
key: "transferXTokens",
|
|
9306
10203
|
value: function transferXTokens(input) {
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
10204
|
+
var currencyID = input.currencyID;
|
|
10205
|
+
var currencySelection = {
|
|
10206
|
+
ForeignAssetId: currencyID
|
|
10207
|
+
};
|
|
10208
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9310
10209
|
}
|
|
9311
10210
|
}]);
|
|
9312
10211
|
}(ParachainNode);
|
|
@@ -9322,7 +10221,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9322
10221
|
value: function getCurrencySelection(_ref) {
|
|
9323
10222
|
var currency = _ref.currency,
|
|
9324
10223
|
currencyID = _ref.currencyID;
|
|
9325
|
-
if (currency ===
|
|
10224
|
+
if (currency === this.getNativeAssetSymbol()) {
|
|
9326
10225
|
return 'SelfReserve';
|
|
9327
10226
|
}
|
|
9328
10227
|
if (currencyID === undefined) {
|
|
@@ -9349,7 +10248,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9349
10248
|
return _createClass(BifrostPolkadot, [{
|
|
9350
10249
|
key: "transferXTokens",
|
|
9351
10250
|
value: function transferXTokens(input) {
|
|
9352
|
-
var currencySelection = _defineProperty({}, input.currency ===
|
|
10251
|
+
var currencySelection = _defineProperty({}, input.currency === this.getNativeAssetSymbol() ? 'Native' : 'Token', input.currency);
|
|
9353
10252
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9354
10253
|
}
|
|
9355
10254
|
}]);
|
|
@@ -9375,7 +10274,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9375
10274
|
value: function transferXTokens(input) {
|
|
9376
10275
|
var currency = input.currency,
|
|
9377
10276
|
currencyID = input.currencyID;
|
|
9378
|
-
var currencySelection = currency ===
|
|
10277
|
+
var currencySelection = currency === this.getNativeAssetSymbol() ? 'Native' : {
|
|
9379
10278
|
ForeignAsset: currencyID
|
|
9380
10279
|
};
|
|
9381
10280
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
@@ -9443,7 +10342,8 @@ var Litentry = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9443
10342
|
return _createClass(Litentry, [{
|
|
9444
10343
|
key: "transferXTokens",
|
|
9445
10344
|
value: function transferXTokens(input) {
|
|
9446
|
-
|
|
10345
|
+
var currencySelection = 'SelfReserve';
|
|
10346
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9447
10347
|
}
|
|
9448
10348
|
}]);
|
|
9449
10349
|
}(ParachainNode);
|
|
@@ -9459,7 +10359,7 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9459
10359
|
value: function transferXTokens(input) {
|
|
9460
10360
|
var currency = input.currency,
|
|
9461
10361
|
currencyID = input.currencyID;
|
|
9462
|
-
var currencySelection = currency ===
|
|
10362
|
+
var currencySelection = currency === this.getNativeAssetSymbol() ? 'SelfReserve' : {
|
|
9463
10363
|
ForeignAsset: currencyID
|
|
9464
10364
|
};
|
|
9465
10365
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
@@ -9492,7 +10392,8 @@ var Parallel = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9492
10392
|
return _createClass(Parallel, [{
|
|
9493
10393
|
key: "transferXTokens",
|
|
9494
10394
|
value: function transferXTokens(input) {
|
|
9495
|
-
|
|
10395
|
+
var currencyID = input.currencyID;
|
|
10396
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
9496
10397
|
}
|
|
9497
10398
|
}]);
|
|
9498
10399
|
}(ParachainNode);
|
|
@@ -9506,18 +10407,12 @@ var Altair = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9506
10407
|
return _createClass(Altair, [{
|
|
9507
10408
|
key: "transferXTokens",
|
|
9508
10409
|
value: function transferXTokens(input) {
|
|
9509
|
-
var
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
}], [{
|
|
9513
|
-
key: "getCurrencySelection",
|
|
9514
|
-
value: function getCurrencySelection(_ref) {
|
|
9515
|
-
var currency = _ref.currency,
|
|
9516
|
-
currencyID = _ref.currencyID;
|
|
9517
|
-
if (currency === 'AIR') return 'Native';
|
|
9518
|
-
return {
|
|
10410
|
+
var currency = input.currency,
|
|
10411
|
+
currencyID = input.currencyID;
|
|
10412
|
+
var currencySelection = currency === this.getNativeAssetSymbol() ? 'Native' : {
|
|
9519
10413
|
ForeignAsset: currencyID
|
|
9520
10414
|
};
|
|
10415
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9521
10416
|
}
|
|
9522
10417
|
}]);
|
|
9523
10418
|
}(ParachainNode);
|
|
@@ -9531,9 +10426,11 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9531
10426
|
return _createClass(Amplitude, [{
|
|
9532
10427
|
key: "transferXTokens",
|
|
9533
10428
|
value: function transferXTokens(input) {
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
10429
|
+
var currencyID = input.currencyID;
|
|
10430
|
+
var currencySelection = {
|
|
10431
|
+
XCM: currencyID
|
|
10432
|
+
};
|
|
10433
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9537
10434
|
}
|
|
9538
10435
|
}]);
|
|
9539
10436
|
}(ParachainNode);
|
|
@@ -9552,7 +10449,7 @@ var Bajun = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9552
10449
|
if (scenario !== 'ParaToPara') {
|
|
9553
10450
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
9554
10451
|
}
|
|
9555
|
-
var nativeSymbol = getNativeAssetSymbol(
|
|
10452
|
+
var nativeSymbol = this.getNativeAssetSymbol();
|
|
9556
10453
|
if (currency !== nativeSymbol) {
|
|
9557
10454
|
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currency));
|
|
9558
10455
|
}
|
|
@@ -9590,7 +10487,7 @@ var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9590
10487
|
return _createClass(BifrostKusama, [{
|
|
9591
10488
|
key: "transferXTokens",
|
|
9592
10489
|
value: function transferXTokens(input) {
|
|
9593
|
-
var currencySelection = _defineProperty({}, input.currency ===
|
|
10490
|
+
var currencySelection = _defineProperty({}, input.currency === this.getNativeAssetSymbol() ? 'Native' : 'Token', input.currency);
|
|
9594
10491
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9595
10492
|
}
|
|
9596
10493
|
}]);
|
|
@@ -9606,7 +10503,9 @@ var Pioneer = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9606
10503
|
key: "transferXTokens",
|
|
9607
10504
|
value: function transferXTokens(input) {
|
|
9608
10505
|
// Multiple asset options needs addressing
|
|
9609
|
-
|
|
10506
|
+
var fees = input.fees;
|
|
10507
|
+
var currencySelection = 'NativeToken';
|
|
10508
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection, fees);
|
|
9610
10509
|
}
|
|
9611
10510
|
}]);
|
|
9612
10511
|
}(ParachainNode);
|
|
@@ -9635,7 +10534,8 @@ var Picasso = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9635
10534
|
return _createClass(Picasso, [{
|
|
9636
10535
|
key: "transferXTokens",
|
|
9637
10536
|
value: function transferXTokens(input) {
|
|
9638
|
-
|
|
10537
|
+
var currencyID = input.currencyID;
|
|
10538
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
9639
10539
|
}
|
|
9640
10540
|
}]);
|
|
9641
10541
|
}(ParachainNode);
|
|
@@ -9649,7 +10549,7 @@ var ParallelHeiko = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9649
10549
|
return _createClass(ParallelHeiko, [{
|
|
9650
10550
|
key: "transferXTokens",
|
|
9651
10551
|
value: function transferXTokens(input) {
|
|
9652
|
-
return
|
|
10552
|
+
return getNode('Parallel').transferXTokens(input);
|
|
9653
10553
|
}
|
|
9654
10554
|
}]);
|
|
9655
10555
|
}(ParachainNode);
|
|
@@ -9665,7 +10565,7 @@ var Moonriver = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9665
10565
|
value: function transferXTokens(input) {
|
|
9666
10566
|
var currency = input.currency,
|
|
9667
10567
|
currencyID = input.currencyID;
|
|
9668
|
-
var currencySelection = currency ===
|
|
10568
|
+
var currencySelection = currency === this.getNativeAssetSymbol() ? 'SelfReserve' : {
|
|
9669
10569
|
ForeignAsset: currencyID
|
|
9670
10570
|
};
|
|
9671
10571
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
@@ -9694,7 +10594,7 @@ var Litmus = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9694
10594
|
key: "transferXTokens",
|
|
9695
10595
|
value: function transferXTokens(input) {
|
|
9696
10596
|
// Multiple asset options needs addressing
|
|
9697
|
-
return
|
|
10597
|
+
return getNode('Litentry').transferXTokens(input);
|
|
9698
10598
|
}
|
|
9699
10599
|
}]);
|
|
9700
10600
|
}(ParachainNode);
|
|
@@ -9731,9 +10631,10 @@ var Calamari = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9731
10631
|
value: function transferXTokens(input) {
|
|
9732
10632
|
// Currently only option for XCM transfer
|
|
9733
10633
|
var currencyID = input.currencyID;
|
|
9734
|
-
|
|
10634
|
+
var currencySelection = {
|
|
9735
10635
|
MantaCurrency: currencyID
|
|
9736
|
-
}
|
|
10636
|
+
};
|
|
10637
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9737
10638
|
}
|
|
9738
10639
|
}]);
|
|
9739
10640
|
}(ParachainNode);
|
|
@@ -9749,7 +10650,7 @@ var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9749
10650
|
value: function getCurrencySelection(_ref) {
|
|
9750
10651
|
var currency = _ref.currency,
|
|
9751
10652
|
currencyID = _ref.currencyID;
|
|
9752
|
-
if (currency ===
|
|
10653
|
+
if (currency === this.getNativeAssetSymbol()) {
|
|
9753
10654
|
return 'SelfReserve';
|
|
9754
10655
|
}
|
|
9755
10656
|
if (currencyID === undefined) {
|
|
@@ -9826,14 +10727,7 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9826
10727
|
return _createClass(Karura, [{
|
|
9827
10728
|
key: "transferXTokens",
|
|
9828
10729
|
value: function transferXTokens(input) {
|
|
9829
|
-
|
|
9830
|
-
currencyID = input.currencyID;
|
|
9831
|
-
var currencySelection = currencyID !== undefined ? {
|
|
9832
|
-
ForeignAsset: currencyID
|
|
9833
|
-
} : {
|
|
9834
|
-
Token: currency
|
|
9835
|
-
};
|
|
9836
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
10730
|
+
return getNode('Acala').transferXTokens(input);
|
|
9837
10731
|
}
|
|
9838
10732
|
}, {
|
|
9839
10733
|
key: "getProvider",
|
|
@@ -10152,13 +11046,15 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10152
11046
|
}, {
|
|
10153
11047
|
key: "transferXTokens",
|
|
10154
11048
|
value: function transferXTokens(input) {
|
|
10155
|
-
|
|
11049
|
+
var currencyID = input.currencyID;
|
|
11050
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
10156
11051
|
}
|
|
10157
11052
|
}, {
|
|
10158
11053
|
key: "canUseXTokens",
|
|
10159
11054
|
value: function canUseXTokens(_ref) {
|
|
10160
|
-
var currencySymbol = _ref.currencySymbol
|
|
10161
|
-
|
|
11055
|
+
var currencySymbol = _ref.currencySymbol,
|
|
11056
|
+
currencyId = _ref.currencyId;
|
|
11057
|
+
return currencySymbol !== this.getNativeAssetSymbol() || !!currencyId;
|
|
10162
11058
|
}
|
|
10163
11059
|
}]);
|
|
10164
11060
|
}(ParachainNode);
|
|
@@ -10172,9 +11068,11 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10172
11068
|
return _createClass(Darwinia, [{
|
|
10173
11069
|
key: "transferXTokens",
|
|
10174
11070
|
value: function transferXTokens(input) {
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
11071
|
+
var currencyID = input.currencyID;
|
|
11072
|
+
var currencySelection = input.currency === this.getNativeAssetSymbol() ? 'SelfReserve' : {
|
|
11073
|
+
ForeignAsset: currencyID
|
|
11074
|
+
};
|
|
11075
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
10178
11076
|
}
|
|
10179
11077
|
}, {
|
|
10180
11078
|
key: "transferRelayToPara",
|
|
@@ -10238,10 +11136,7 @@ var Quartz = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10238
11136
|
return _createClass(Quartz, [{
|
|
10239
11137
|
key: "transferXTokens",
|
|
10240
11138
|
value: function transferXTokens(input) {
|
|
10241
|
-
|
|
10242
|
-
return XTokensTransferImpl.transferXTokens(input, {
|
|
10243
|
-
ForeignAssetId: currencyID
|
|
10244
|
-
});
|
|
11139
|
+
return getNode('Unique').transferXTokens(input);
|
|
10245
11140
|
}
|
|
10246
11141
|
}]);
|
|
10247
11142
|
}(ParachainNode);
|
|
@@ -10257,19 +11152,19 @@ var Shiden = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10257
11152
|
value: function transferPolkadotXCM(input) {
|
|
10258
11153
|
// Same as Astar, works
|
|
10259
11154
|
// https://shiden.subscan.io/xcm_message/kusama-97eb47c25c781affa557f36dbd117d49f7e1ab4e
|
|
10260
|
-
|
|
10261
|
-
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method);
|
|
11155
|
+
return getNode('Astar').transferPolkadotXCM(input);
|
|
10262
11156
|
}
|
|
10263
11157
|
}, {
|
|
10264
11158
|
key: "transferXTokens",
|
|
10265
11159
|
value: function transferXTokens(input) {
|
|
10266
|
-
return
|
|
11160
|
+
return getNode('Astar').transferXTokens(input);
|
|
10267
11161
|
}
|
|
10268
11162
|
}, {
|
|
10269
11163
|
key: "canUseXTokens",
|
|
10270
11164
|
value: function canUseXTokens(_ref) {
|
|
10271
|
-
var currencySymbol = _ref.currencySymbol
|
|
10272
|
-
|
|
11165
|
+
var currencySymbol = _ref.currencySymbol,
|
|
11166
|
+
currencyId = _ref.currencyId;
|
|
11167
|
+
return currencySymbol !== this.getNativeAssetSymbol() || !!currencyId;
|
|
10273
11168
|
}
|
|
10274
11169
|
}]);
|
|
10275
11170
|
}(ParachainNode);
|
|
@@ -10283,9 +11178,11 @@ var Manta = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10283
11178
|
return _createClass(Manta, [{
|
|
10284
11179
|
key: "transferXTokens",
|
|
10285
11180
|
value: function transferXTokens(input) {
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
11181
|
+
var currencyID = input.currencyID;
|
|
11182
|
+
var currencySelection = {
|
|
11183
|
+
MantaCurrency: currencyID
|
|
11184
|
+
};
|
|
11185
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
10289
11186
|
}
|
|
10290
11187
|
}]);
|
|
10291
11188
|
}(ParachainNode);
|
|
@@ -10302,10 +11199,11 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10302
11199
|
if (input.scenario !== 'ParaToPara') {
|
|
10303
11200
|
throw new ScenarioNotSupportedError(this.node, input.scenario);
|
|
10304
11201
|
}
|
|
10305
|
-
if (input.currency !==
|
|
11202
|
+
if (input.currency !== this.getNativeAssetSymbol()) {
|
|
10306
11203
|
throw new InvalidCurrencyError("Asset ".concat(input.currency, " is not supported by node ").concat(this.node, "."));
|
|
10307
11204
|
}
|
|
10308
|
-
|
|
11205
|
+
var currencySelection = 'NodleNative';
|
|
11206
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
10309
11207
|
}
|
|
10310
11208
|
}, {
|
|
10311
11209
|
key: "transferRelayToPara",
|
|
@@ -10341,12 +11239,13 @@ var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10341
11239
|
if (input.scenario !== 'ParaToPara') {
|
|
10342
11240
|
throw new ScenarioNotSupportedError(this.node, input.scenario);
|
|
10343
11241
|
}
|
|
10344
|
-
if (input.currency !==
|
|
11242
|
+
if (input.currency !== this.getNativeAssetSymbol()) {
|
|
10345
11243
|
throw new InvalidCurrencyError("Asset ".concat(input.currency, " is not supported by node ").concat(this.node, "."));
|
|
10346
11244
|
}
|
|
10347
|
-
|
|
11245
|
+
var currencySelection = {
|
|
10348
11246
|
XCM: input.currencyID
|
|
10349
|
-
}
|
|
11247
|
+
};
|
|
11248
|
+
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
10350
11249
|
}
|
|
10351
11250
|
}, {
|
|
10352
11251
|
key: "transferRelayToPara",
|
|
@@ -10365,12 +11264,8 @@ var Polkadex = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10365
11264
|
return _createClass(Polkadex, [{
|
|
10366
11265
|
key: "transferXTokens",
|
|
10367
11266
|
value: function transferXTokens(input) {
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
}, {
|
|
10371
|
-
key: "getProvider",
|
|
10372
|
-
value: function getProvider() {
|
|
10373
|
-
return getAllNodeProviders(this.node)[1];
|
|
11267
|
+
var currencyID = input.currencyID;
|
|
11268
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
10374
11269
|
}
|
|
10375
11270
|
}]);
|
|
10376
11271
|
}(ParachainNode);
|
|
@@ -10384,7 +11279,7 @@ var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10384
11279
|
return _createClass(Zeitgeist, [{
|
|
10385
11280
|
key: "transferXTokens",
|
|
10386
11281
|
value: function transferXTokens(input) {
|
|
10387
|
-
var currencySelection = input.currency ===
|
|
11282
|
+
var currencySelection = input.currency === this.getNativeAssetSymbol() ? 'Ztg' : {
|
|
10388
11283
|
ForeignAsset: input.currencyID
|
|
10389
11284
|
};
|
|
10390
11285
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
@@ -10531,7 +11426,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10531
11426
|
key: "transferXTransfer",
|
|
10532
11427
|
value: function transferXTransfer(input) {
|
|
10533
11428
|
var currency = input.currency;
|
|
10534
|
-
if (currency !==
|
|
11429
|
+
if (currency !== this.getNativeAssetSymbol()) {
|
|
10535
11430
|
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currency));
|
|
10536
11431
|
}
|
|
10537
11432
|
return XTransferTransferImpl.transferXTransfer(input);
|
|
@@ -10684,15 +11579,16 @@ var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10684
11579
|
key: "transferPolkadotXCM",
|
|
10685
11580
|
value: function transferPolkadotXCM(input) {
|
|
10686
11581
|
var scenario = input.scenario,
|
|
10687
|
-
currencySymbol = input.currencySymbol
|
|
11582
|
+
currencySymbol = input.currencySymbol,
|
|
11583
|
+
destination = input.destination;
|
|
10688
11584
|
if (scenario !== 'ParaToPara') {
|
|
10689
11585
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
10690
11586
|
}
|
|
10691
|
-
var nativeSymbol = getNativeAssetSymbol(
|
|
11587
|
+
var nativeSymbol = this.getNativeAssetSymbol();
|
|
10692
11588
|
if (currencySymbol !== nativeSymbol) {
|
|
10693
11589
|
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currencySymbol));
|
|
10694
11590
|
}
|
|
10695
|
-
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', 'Unlimited');
|
|
11591
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, destination === 'AssetHubPolkadot' ? 'limitedTeleportAssets' : 'limitedReserveTransferAssets', 'Unlimited');
|
|
10696
11592
|
}
|
|
10697
11593
|
}, {
|
|
10698
11594
|
key: "transferRelayToPara",
|
|
@@ -10940,6 +11836,11 @@ var getAllNodeProviders = function getAllNodeProviders(node) {
|
|
|
10940
11836
|
return Object.values(providers !== null && providers !== void 0 ? providers : []);
|
|
10941
11837
|
};
|
|
10942
11838
|
var getNodeProvider = function getNodeProvider(node) {
|
|
11839
|
+
if (node === 'Polkadot') {
|
|
11840
|
+
return endpoints.prodRelayPolkadot.providers[0];
|
|
11841
|
+
} else if (node === 'Kusama') {
|
|
11842
|
+
return endpoints.prodRelayKusama.providers[0];
|
|
11843
|
+
}
|
|
10943
11844
|
return getNode(node).getProvider();
|
|
10944
11845
|
};
|
|
10945
11846
|
var createApiInstance = function createApiInstance(wsUrl) {
|
|
@@ -11027,7 +11928,7 @@ var KeepAliveError = /*#__PURE__*/function (_Error) {
|
|
|
11027
11928
|
}
|
|
11028
11929
|
_inherits(KeepAliveError, _Error);
|
|
11029
11930
|
return _createClass(KeepAliveError);
|
|
11030
|
-
}(
|
|
11931
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
11031
11932
|
|
|
11032
11933
|
var edMap = edMapJson;
|
|
11033
11934
|
var getExistentialDeposit = function getExistentialDeposit(node) {
|
|
@@ -11177,7 +12078,7 @@ var checkKeepAlive = function checkKeepAlive(_a) {
|
|
|
11177
12078
|
});
|
|
11178
12079
|
};
|
|
11179
12080
|
|
|
11180
|
-
var
|
|
12081
|
+
var transformSendOptions = function transformSendOptions(options) {
|
|
11181
12082
|
var currency = options.currency;
|
|
11182
12083
|
if (isTCurrencySpecifier(currency)) {
|
|
11183
12084
|
if ('symbol' in currency) {
|
|
@@ -11197,13 +12098,14 @@ var transformOptions = function transformOptions(options) {
|
|
|
11197
12098
|
isSymbol: undefined
|
|
11198
12099
|
});
|
|
11199
12100
|
};
|
|
12101
|
+
|
|
11200
12102
|
var sendCommon = function sendCommon(options) {
|
|
11201
12103
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11202
|
-
var _a, _b,
|
|
12104
|
+
var _a, _b, _transformSendOptions, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, isSymbol, _transformSendOptions2, serializedApiCallEnabled, isMultiLocationDestination, isMultiLocationCurrency, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, asset, apiWithFallback, amountStr, currencyStr;
|
|
11203
12105
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11204
12106
|
while (1) switch (_context.prev = _context.next) {
|
|
11205
12107
|
case 0:
|
|
11206
|
-
|
|
12108
|
+
_transformSendOptions = transformSendOptions(options), api = _transformSendOptions.api, origin = _transformSendOptions.origin, currency = _transformSendOptions.currency, amount = _transformSendOptions.amount, address = _transformSendOptions.address, destination = _transformSendOptions.destination, paraIdTo = _transformSendOptions.paraIdTo, destApiForKeepAlive = _transformSendOptions.destApiForKeepAlive, feeAsset = _transformSendOptions.feeAsset, version = _transformSendOptions.version, isSymbol = _transformSendOptions.isSymbol, _transformSendOptions2 = _transformSendOptions.serializedApiCallEnabled, serializedApiCallEnabled = _transformSendOptions2 === void 0 ? false : _transformSendOptions2;
|
|
11207
12109
|
if (!((!isTMulti(currency) || isTMultiLocation(currency)) && amount === null)) {
|
|
11208
12110
|
_context.next = 3;
|
|
11209
12111
|
break;
|
|
@@ -11253,85 +12155,91 @@ var sendCommon = function sendCommon(options) {
|
|
|
11253
12155
|
}
|
|
11254
12156
|
throw new InvalidCurrencyError('Fee asset index is out of bounds. Please provide a valid index.');
|
|
11255
12157
|
case 17:
|
|
12158
|
+
if (!(destination === 'Ethereum' && origin !== 'AssetHubPolkadot')) {
|
|
12159
|
+
_context.next = 19;
|
|
12160
|
+
break;
|
|
12161
|
+
}
|
|
12162
|
+
throw new IncompatibleNodesError('Transfers to Ethereum are only supported from AssetHubPolkadot.');
|
|
12163
|
+
case 19:
|
|
11256
12164
|
isMultiLocationDestination = _typeof(destination) === 'object';
|
|
11257
12165
|
isMultiLocationCurrency = _typeof(currency) === 'object';
|
|
11258
|
-
isBridge = origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot'
|
|
12166
|
+
isBridge = origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
|
|
11259
12167
|
isRelayDestination = destination === undefined;
|
|
11260
12168
|
if (!(!isRelayDestination && !isMultiLocationDestination)) {
|
|
11261
|
-
_context.next =
|
|
12169
|
+
_context.next = 28;
|
|
11262
12170
|
break;
|
|
11263
12171
|
}
|
|
11264
12172
|
originRelayChainSymbol = getRelayChainSymbol(origin);
|
|
11265
12173
|
destinationRelayChainSymbol = getRelayChainSymbol(destination);
|
|
11266
12174
|
if (!(!isBridge && originRelayChainSymbol !== destinationRelayChainSymbol)) {
|
|
11267
|
-
_context.next =
|
|
12175
|
+
_context.next = 28;
|
|
11268
12176
|
break;
|
|
11269
12177
|
}
|
|
11270
12178
|
throw new IncompatibleNodesError();
|
|
11271
|
-
case
|
|
12179
|
+
case 28:
|
|
11272
12180
|
originNode = getNode(origin);
|
|
11273
12181
|
assetCheckEnabled = isMultiLocationCurrency || isBridge ? false : originNode.assetCheckEnabled;
|
|
11274
|
-
asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isSymbol) : null;
|
|
12182
|
+
asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isSymbol, isTMultiLocation(destination) ? undefined : destination) : null;
|
|
11275
12183
|
if (!(!isBridge && asset === null && assetCheckEnabled)) {
|
|
11276
|
-
_context.next =
|
|
12184
|
+
_context.next = 33;
|
|
11277
12185
|
break;
|
|
11278
12186
|
}
|
|
11279
12187
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
|
|
11280
|
-
case
|
|
12188
|
+
case 33:
|
|
11281
12189
|
if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && isSymbol !== false && asset.assetId !== currency && !hasSupportForAsset(destination, asset.symbol))) {
|
|
11282
|
-
_context.next =
|
|
12190
|
+
_context.next = 35;
|
|
11283
12191
|
break;
|
|
11284
12192
|
}
|
|
11285
12193
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
|
|
11286
|
-
case
|
|
12194
|
+
case 35:
|
|
11287
12195
|
if (!(api !== null && api !== void 0)) {
|
|
11288
|
-
_context.next =
|
|
12196
|
+
_context.next = 39;
|
|
11289
12197
|
break;
|
|
11290
12198
|
}
|
|
11291
12199
|
_context.t0 = api;
|
|
11292
|
-
_context.next =
|
|
12200
|
+
_context.next = 42;
|
|
11293
12201
|
break;
|
|
11294
|
-
case 37:
|
|
11295
|
-
_context.next = 39;
|
|
11296
|
-
return createApiInstanceForNode(origin);
|
|
11297
12202
|
case 39:
|
|
12203
|
+
_context.next = 41;
|
|
12204
|
+
return createApiInstanceForNode(origin);
|
|
12205
|
+
case 41:
|
|
11298
12206
|
_context.t0 = _context.sent;
|
|
11299
|
-
case
|
|
12207
|
+
case 42:
|
|
11300
12208
|
apiWithFallback = _context.t0;
|
|
11301
12209
|
amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
|
|
11302
12210
|
if (!isTMulti(currency)) {
|
|
11303
|
-
_context.next =
|
|
12211
|
+
_context.next = 48;
|
|
11304
12212
|
break;
|
|
11305
12213
|
}
|
|
11306
12214
|
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
11307
|
-
_context.next =
|
|
12215
|
+
_context.next = 62;
|
|
11308
12216
|
break;
|
|
11309
|
-
case
|
|
12217
|
+
case 48:
|
|
11310
12218
|
if (!(_typeof(address) === 'object')) {
|
|
11311
|
-
_context.next =
|
|
12219
|
+
_context.next = 52;
|
|
11312
12220
|
break;
|
|
11313
12221
|
}
|
|
11314
12222
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
11315
|
-
_context.next =
|
|
12223
|
+
_context.next = 62;
|
|
11316
12224
|
break;
|
|
11317
|
-
case
|
|
12225
|
+
case 52:
|
|
11318
12226
|
if (!(_typeof(destination) === 'object')) {
|
|
11319
|
-
_context.next =
|
|
12227
|
+
_context.next = 56;
|
|
11320
12228
|
break;
|
|
11321
12229
|
}
|
|
11322
12230
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
11323
|
-
_context.next =
|
|
12231
|
+
_context.next = 62;
|
|
11324
12232
|
break;
|
|
11325
|
-
case
|
|
12233
|
+
case 56:
|
|
11326
12234
|
if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
|
|
11327
|
-
_context.next =
|
|
12235
|
+
_context.next = 60;
|
|
11328
12236
|
break;
|
|
11329
12237
|
}
|
|
11330
12238
|
console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
|
|
11331
|
-
_context.next =
|
|
12239
|
+
_context.next = 62;
|
|
11332
12240
|
break;
|
|
11333
|
-
case
|
|
11334
|
-
_context.next =
|
|
12241
|
+
case 60:
|
|
12242
|
+
_context.next = 62;
|
|
11335
12243
|
return checkKeepAlive({
|
|
11336
12244
|
originApi: apiWithFallback,
|
|
11337
12245
|
address: address,
|
|
@@ -11341,7 +12249,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
11341
12249
|
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : currency.toString(),
|
|
11342
12250
|
destNode: destination
|
|
11343
12251
|
});
|
|
11344
|
-
case
|
|
12252
|
+
case 62:
|
|
11345
12253
|
currencyStr = isTMulti(currency) ? undefined : currency.toString();
|
|
11346
12254
|
return _context.abrupt("return", originNode.transfer({
|
|
11347
12255
|
api: apiWithFallback,
|
|
@@ -11356,7 +12264,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
11356
12264
|
version: version,
|
|
11357
12265
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
11358
12266
|
}));
|
|
11359
|
-
case
|
|
12267
|
+
case 64:
|
|
11360
12268
|
case "end":
|
|
11361
12269
|
return _context.stop();
|
|
11362
12270
|
}
|
|
@@ -11368,13 +12276,10 @@ var sendSerializedApiCall = function sendSerializedApiCall(options) {
|
|
|
11368
12276
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11369
12277
|
while (1) switch (_context2.prev = _context2.next) {
|
|
11370
12278
|
case 0:
|
|
11371
|
-
_context2.
|
|
11372
|
-
return sendCommon(Object.assign(Object.assign({}, options), {
|
|
12279
|
+
return _context2.abrupt("return", sendCommon(Object.assign(Object.assign({}, options), {
|
|
11373
12280
|
serializedApiCallEnabled: true
|
|
11374
|
-
}));
|
|
11375
|
-
case
|
|
11376
|
-
return _context2.abrupt("return", _context2.sent);
|
|
11377
|
-
case 3:
|
|
12281
|
+
})));
|
|
12282
|
+
case 1:
|
|
11378
12283
|
case "end":
|
|
11379
12284
|
return _context2.stop();
|
|
11380
12285
|
}
|
|
@@ -11386,11 +12291,8 @@ var send = function send(options) {
|
|
|
11386
12291
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11387
12292
|
while (1) switch (_context3.prev = _context3.next) {
|
|
11388
12293
|
case 0:
|
|
11389
|
-
_context3.
|
|
11390
|
-
|
|
11391
|
-
case 2:
|
|
11392
|
-
return _context3.abrupt("return", _context3.sent);
|
|
11393
|
-
case 3:
|
|
12294
|
+
return _context3.abrupt("return", sendCommon(options));
|
|
12295
|
+
case 1:
|
|
11394
12296
|
case "end":
|
|
11395
12297
|
return _context3.stop();
|
|
11396
12298
|
}
|
|
@@ -11489,11 +12391,8 @@ var transferRelayToPara = function transferRelayToPara(options) {
|
|
|
11489
12391
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
11490
12392
|
while (1) switch (_context5.prev = _context5.next) {
|
|
11491
12393
|
case 0:
|
|
11492
|
-
_context5.
|
|
11493
|
-
|
|
11494
|
-
case 2:
|
|
11495
|
-
return _context5.abrupt("return", _context5.sent);
|
|
11496
|
-
case 3:
|
|
12394
|
+
return _context5.abrupt("return", transferRelayToParaCommon(options));
|
|
12395
|
+
case 1:
|
|
11497
12396
|
case "end":
|
|
11498
12397
|
return _context5.stop();
|
|
11499
12398
|
}
|
|
@@ -11505,13 +12404,10 @@ var transferRelayToParaSerializedApiCall = function transferRelayToParaSerialize
|
|
|
11505
12404
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
11506
12405
|
while (1) switch (_context6.prev = _context6.next) {
|
|
11507
12406
|
case 0:
|
|
11508
|
-
_context6.
|
|
11509
|
-
return transferRelayToParaCommon(Object.assign(Object.assign({}, options), {
|
|
12407
|
+
return _context6.abrupt("return", transferRelayToParaCommon(Object.assign(Object.assign({}, options), {
|
|
11510
12408
|
serializedApiCallEnabled: true
|
|
11511
|
-
}));
|
|
11512
|
-
case
|
|
11513
|
-
return _context6.abrupt("return", _context6.sent);
|
|
11514
|
-
case 3:
|
|
12409
|
+
})));
|
|
12410
|
+
case 1:
|
|
11515
12411
|
case "end":
|
|
11516
12412
|
return _context6.stop();
|
|
11517
12413
|
}
|
|
@@ -11519,8 +12415,60 @@ var transferRelayToParaSerializedApiCall = function transferRelayToParaSerialize
|
|
|
11519
12415
|
}));
|
|
11520
12416
|
};
|
|
11521
12417
|
|
|
12418
|
+
var buildEthTransferOptions = function buildEthTransferOptions(_a) {
|
|
12419
|
+
return __awaiter(void 0, [_a], void 0, function (_ref) {
|
|
12420
|
+
var currency = _ref.currency,
|
|
12421
|
+
to = _ref.to,
|
|
12422
|
+
address = _ref.address,
|
|
12423
|
+
destAddress = _ref.destAddress,
|
|
12424
|
+
amount = _ref.amount;
|
|
12425
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
12426
|
+
var ethAsset, env, EXECUTION_URL, context, destParaId, signer, plan;
|
|
12427
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12428
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12429
|
+
case 0:
|
|
12430
|
+
ethAsset = findEthAsset(currency);
|
|
12431
|
+
env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
|
|
12432
|
+
EXECUTION_URL = 'https://eth.llamarpc.com';
|
|
12433
|
+
_context.next = 5;
|
|
12434
|
+
return createContext(EXECUTION_URL, env.config);
|
|
12435
|
+
case 5:
|
|
12436
|
+
context = _context.sent;
|
|
12437
|
+
destParaId = getParaId(to);
|
|
12438
|
+
signer = {
|
|
12439
|
+
getAddress: function getAddress() {
|
|
12440
|
+
return Promise.resolve(address);
|
|
12441
|
+
}
|
|
12442
|
+
};
|
|
12443
|
+
_context.next = 10;
|
|
12444
|
+
return api.toPolkadot.validateSend(context, signer, destAddress, ethAsset.assetId, destParaId, BigInt(amount), BigInt(0));
|
|
12445
|
+
case 10:
|
|
12446
|
+
plan = _context.sent;
|
|
12447
|
+
checkPlanFailure(plan);
|
|
12448
|
+
if (plan.success) {
|
|
12449
|
+
_context.next = 14;
|
|
12450
|
+
break;
|
|
12451
|
+
}
|
|
12452
|
+
throw new Error('Failed to validate send');
|
|
12453
|
+
case 14:
|
|
12454
|
+
return _context.abrupt("return", {
|
|
12455
|
+
token: plan.success.token,
|
|
12456
|
+
destinationParaId: plan.success.destinationParaId,
|
|
12457
|
+
destinationFee: plan.success.destinationFee,
|
|
12458
|
+
amount: plan.success.amount
|
|
12459
|
+
});
|
|
12460
|
+
case 15:
|
|
12461
|
+
case "end":
|
|
12462
|
+
return _context.stop();
|
|
12463
|
+
}
|
|
12464
|
+
}, _callee);
|
|
12465
|
+
})();
|
|
12466
|
+
});
|
|
12467
|
+
};
|
|
12468
|
+
|
|
11522
12469
|
var index = /*#__PURE__*/Object.freeze({
|
|
11523
12470
|
__proto__: null,
|
|
12471
|
+
buildEthTransferOptions: buildEthTransferOptions,
|
|
11524
12472
|
send: send,
|
|
11525
12473
|
sendSerializedApiCall: sendSerializedApiCall,
|
|
11526
12474
|
transferRelayToPara: transferRelayToPara,
|
|
@@ -11544,12 +12492,14 @@ exports.OpenChannelBuilder = OpenChannelBuilder;
|
|
|
11544
12492
|
exports.SUPPORTED_PALLETS = SUPPORTED_PALLETS;
|
|
11545
12493
|
exports.ScenarioNotSupportedError = ScenarioNotSupportedError;
|
|
11546
12494
|
exports.assets = index$1;
|
|
12495
|
+
exports.buildEthTransferOptions = buildEthTransferOptions;
|
|
11547
12496
|
exports.closeChannels = index$3;
|
|
11548
12497
|
exports.createApiInstanceForNode = createApiInstanceForNode;
|
|
11549
12498
|
exports.getAllAssetsSymbols = getAllAssetsSymbols;
|
|
11550
12499
|
exports.getAllNodeProviders = getAllNodeProviders;
|
|
11551
12500
|
exports.getAssetDecimals = getAssetDecimals;
|
|
11552
12501
|
exports.getAssetId = getAssetId;
|
|
12502
|
+
exports.getAssets = getAssets;
|
|
11553
12503
|
exports.getAssetsObject = getAssetsObject;
|
|
11554
12504
|
exports.getBalanceForeign = getBalanceForeign;
|
|
11555
12505
|
exports.getBalanceNative = getBalanceNative;
|
|
@@ -11563,9 +12513,15 @@ exports.getNodeProvider = getNodeProvider;
|
|
|
11563
12513
|
exports.getOtherAssets = getOtherAssets;
|
|
11564
12514
|
exports.getParaId = getParaId;
|
|
11565
12515
|
exports.getRelayChainSymbol = getRelayChainSymbol;
|
|
12516
|
+
exports.getSupportedAssets = getSupportedAssets;
|
|
11566
12517
|
exports.getSupportedPallets = getSupportedPallets;
|
|
11567
12518
|
exports.getTNode = getTNode;
|
|
11568
12519
|
exports.getTransferInfo = getTransferInfo;
|
|
11569
12520
|
exports.hasSupportForAsset = hasSupportForAsset;
|
|
11570
12521
|
exports.openChannels = index$2;
|
|
12522
|
+
exports.send = send;
|
|
12523
|
+
exports.sendSerializedApiCall = sendSerializedApiCall;
|
|
12524
|
+
exports.transferRelayToPara = transferRelayToPara;
|
|
12525
|
+
exports.transferRelayToParaCommon = transferRelayToParaCommon;
|
|
12526
|
+
exports.transferRelayToParaSerializedApiCall = transferRelayToParaSerializedApiCall;
|
|
11571
12527
|
exports.xcmPallet = index;
|