@paraspell/sdk 5.6.0 → 5.7.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 +5 -7
- package/dist/index.cjs +814 -107
- package/dist/index.d.ts +70 -23
- package/dist/index.mjs +806 -105
- package/package.json +16 -26
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { ethers } from 'ethers';
|
|
|
3
3
|
import { prodRelayPolkadot, prodRelayKusama } from '@polkadot/apps-config/endpoints';
|
|
4
4
|
import { u32 } from '@polkadot/types';
|
|
5
5
|
import { BN } from '@polkadot/util';
|
|
6
|
+
import { toPolkadot, environment, contextFactory } from '@snowbridge/api';
|
|
6
7
|
|
|
7
8
|
function _arrayLikeToArray(r, a) {
|
|
8
9
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -46,7 +47,7 @@ function _createClass(e, r, t) {
|
|
|
46
47
|
function _createForOfIteratorHelper(r, e) {
|
|
47
48
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
48
49
|
if (!t) {
|
|
49
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e
|
|
50
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
50
51
|
t && (r = t);
|
|
51
52
|
var n = 0,
|
|
52
53
|
F = function () {};
|
|
@@ -491,6 +492,12 @@ function _superPropBase(t, o) {
|
|
|
491
492
|
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
|
492
493
|
return t;
|
|
493
494
|
}
|
|
495
|
+
function _superPropGet(t, e, r, o) {
|
|
496
|
+
var p = _get(_getPrototypeOf(t.prototype ), e, r);
|
|
497
|
+
return function (t) {
|
|
498
|
+
return p.apply(r, t);
|
|
499
|
+
} ;
|
|
500
|
+
}
|
|
494
501
|
function _toConsumableArray(r) {
|
|
495
502
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
496
503
|
}
|
|
@@ -1232,7 +1239,7 @@ var Centrifuge$3 = {
|
|
|
1232
1239
|
},
|
|
1233
1240
|
{
|
|
1234
1241
|
assetId: "1655476167",
|
|
1235
|
-
symbol: "
|
|
1242
|
+
symbol: "DYF1",
|
|
1236
1243
|
decimals: 6
|
|
1237
1244
|
},
|
|
1238
1245
|
{
|
|
@@ -1502,6 +1509,11 @@ var Hydration$3 = {
|
|
|
1502
1509
|
symbol: "RING",
|
|
1503
1510
|
decimals: 18
|
|
1504
1511
|
},
|
|
1512
|
+
{
|
|
1513
|
+
assetId: "33",
|
|
1514
|
+
symbol: "vASTR",
|
|
1515
|
+
decimals: 18
|
|
1516
|
+
},
|
|
1505
1517
|
{
|
|
1506
1518
|
assetId: "15",
|
|
1507
1519
|
symbol: "vDOT",
|
|
@@ -1557,6 +1569,11 @@ var Hydration$3 = {
|
|
|
1557
1569
|
symbol: "NODL",
|
|
1558
1570
|
decimals: 11
|
|
1559
1571
|
},
|
|
1572
|
+
{
|
|
1573
|
+
assetId: "1000190",
|
|
1574
|
+
symbol: "WBTC",
|
|
1575
|
+
decimals: 8
|
|
1576
|
+
},
|
|
1560
1577
|
{
|
|
1561
1578
|
assetId: "22",
|
|
1562
1579
|
symbol: "USDC",
|
|
@@ -1616,6 +1633,11 @@ var Hydration$3 = {
|
|
|
1616
1633
|
assetId: "9",
|
|
1617
1634
|
symbol: "ASTR",
|
|
1618
1635
|
decimals: 18
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
assetId: "1000189",
|
|
1639
|
+
symbol: "WETH",
|
|
1640
|
+
decimals: 18
|
|
1619
1641
|
}
|
|
1620
1642
|
]
|
|
1621
1643
|
};
|
|
@@ -1866,6 +1888,11 @@ var Moonbeam$3 = {
|
|
|
1866
1888
|
symbol: "vGLMR",
|
|
1867
1889
|
decimals: 18
|
|
1868
1890
|
},
|
|
1891
|
+
{
|
|
1892
|
+
assetId: "184218609779515850660274730699350567246",
|
|
1893
|
+
symbol: "NCTR",
|
|
1894
|
+
decimals: 18
|
|
1895
|
+
},
|
|
1869
1896
|
{
|
|
1870
1897
|
assetId: "289989900872525819559124583375550296953",
|
|
1871
1898
|
symbol: "vMANTA",
|
|
@@ -2217,6 +2244,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2217
2244
|
symbol: "GABE",
|
|
2218
2245
|
decimals: 20
|
|
2219
2246
|
},
|
|
2247
|
+
{
|
|
2248
|
+
assetId: "47",
|
|
2249
|
+
symbol: "TeMe6Pump",
|
|
2250
|
+
decimals: 12
|
|
2251
|
+
},
|
|
2220
2252
|
{
|
|
2221
2253
|
assetId: "50",
|
|
2222
2254
|
symbol: "CATWIF",
|
|
@@ -2247,11 +2279,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2247
2279
|
symbol: "NFLR",
|
|
2248
2280
|
decimals: 10
|
|
2249
2281
|
},
|
|
2282
|
+
{
|
|
2283
|
+
assetId: "20090110",
|
|
2284
|
+
symbol: "test1",
|
|
2285
|
+
decimals: 10
|
|
2286
|
+
},
|
|
2250
2287
|
{
|
|
2251
2288
|
assetId: "256",
|
|
2252
2289
|
symbol: "ICE",
|
|
2253
2290
|
decimals: 20
|
|
2254
2291
|
},
|
|
2292
|
+
{
|
|
2293
|
+
assetId: "20090130",
|
|
2294
|
+
symbol: "SUS",
|
|
2295
|
+
decimals: 10
|
|
2296
|
+
},
|
|
2255
2297
|
{
|
|
2256
2298
|
assetId: "1111",
|
|
2257
2299
|
symbol: "TESTV2",
|
|
@@ -2272,6 +2314,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2272
2314
|
symbol: "EFI",
|
|
2273
2315
|
decimals: 18
|
|
2274
2316
|
},
|
|
2317
|
+
{
|
|
2318
|
+
assetId: "48",
|
|
2319
|
+
symbol: "SAX",
|
|
2320
|
+
decimals: 2
|
|
2321
|
+
},
|
|
2275
2322
|
{
|
|
2276
2323
|
assetId: "21",
|
|
2277
2324
|
symbol: "WBTC",
|
|
@@ -2287,6 +2334,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2287
2334
|
symbol: "BULL",
|
|
2288
2335
|
decimals: 6
|
|
2289
2336
|
},
|
|
2337
|
+
{
|
|
2338
|
+
assetId: "20090109",
|
|
2339
|
+
symbol: "MATIC",
|
|
2340
|
+
decimals: 10
|
|
2341
|
+
},
|
|
2290
2342
|
{
|
|
2291
2343
|
assetId: "67",
|
|
2292
2344
|
symbol: "LINK",
|
|
@@ -2312,6 +2364,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2312
2364
|
symbol: "PEPE",
|
|
2313
2365
|
decimals: 6
|
|
2314
2366
|
},
|
|
2367
|
+
{
|
|
2368
|
+
assetId: "10101",
|
|
2369
|
+
symbol: "COKE",
|
|
2370
|
+
decimals: 10
|
|
2371
|
+
},
|
|
2315
2372
|
{
|
|
2316
2373
|
assetId: "101",
|
|
2317
2374
|
symbol: "DOTMA",
|
|
@@ -2327,16 +2384,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2327
2384
|
symbol: "PEPE",
|
|
2328
2385
|
decimals: 10
|
|
2329
2386
|
},
|
|
2387
|
+
{
|
|
2388
|
+
assetId: "20090133",
|
|
2389
|
+
symbol: "BSOD",
|
|
2390
|
+
decimals: 10
|
|
2391
|
+
},
|
|
2330
2392
|
{
|
|
2331
2393
|
assetId: "99",
|
|
2332
2394
|
symbol: "Cypress",
|
|
2333
2395
|
decimals: 0
|
|
2334
2396
|
},
|
|
2397
|
+
{
|
|
2398
|
+
assetId: "34",
|
|
2399
|
+
symbol: "MeTest",
|
|
2400
|
+
decimals: 12
|
|
2401
|
+
},
|
|
2335
2402
|
{
|
|
2336
2403
|
assetId: "7777",
|
|
2337
2404
|
symbol: "FUM",
|
|
2338
2405
|
decimals: 10
|
|
2339
2406
|
},
|
|
2407
|
+
{
|
|
2408
|
+
assetId: "20090114",
|
|
2409
|
+
symbol: "DOI",
|
|
2410
|
+
decimals: 10
|
|
2411
|
+
},
|
|
2340
2412
|
{
|
|
2341
2413
|
assetId: "16",
|
|
2342
2414
|
symbol: "COLA",
|
|
@@ -2347,16 +2419,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2347
2419
|
symbol: "web3",
|
|
2348
2420
|
decimals: 18
|
|
2349
2421
|
},
|
|
2422
|
+
{
|
|
2423
|
+
assetId: "20090111",
|
|
2424
|
+
symbol: "txt",
|
|
2425
|
+
decimals: 10
|
|
2426
|
+
},
|
|
2350
2427
|
{
|
|
2351
2428
|
assetId: "30035",
|
|
2352
2429
|
symbol: "DED",
|
|
2353
2430
|
decimals: 18
|
|
2354
2431
|
},
|
|
2432
|
+
{
|
|
2433
|
+
assetId: "20090119",
|
|
2434
|
+
symbol: "MDGA",
|
|
2435
|
+
decimals: 10
|
|
2436
|
+
},
|
|
2355
2437
|
{
|
|
2356
2438
|
assetId: "111",
|
|
2357
2439
|
symbol: "DEMO",
|
|
2358
2440
|
decimals: 6
|
|
2359
2441
|
},
|
|
2442
|
+
{
|
|
2443
|
+
assetId: "20090121",
|
|
2444
|
+
symbol: "IBW",
|
|
2445
|
+
decimals: 10
|
|
2446
|
+
},
|
|
2360
2447
|
{
|
|
2361
2448
|
assetId: "122",
|
|
2362
2449
|
symbol: "TESTING",
|
|
@@ -2407,6 +2494,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2407
2494
|
symbol: "STINK",
|
|
2408
2495
|
decimals: 10
|
|
2409
2496
|
},
|
|
2497
|
+
{
|
|
2498
|
+
assetId: "20090117",
|
|
2499
|
+
symbol: "DEDX",
|
|
2500
|
+
decimals: 10
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
assetId: "20090112",
|
|
2504
|
+
symbol: "SOLETH",
|
|
2505
|
+
decimals: 10
|
|
2506
|
+
},
|
|
2507
|
+
{
|
|
2508
|
+
assetId: "20090131",
|
|
2509
|
+
symbol: "DVCAT",
|
|
2510
|
+
decimals: 10
|
|
2511
|
+
},
|
|
2410
2512
|
{
|
|
2411
2513
|
assetId: "1107",
|
|
2412
2514
|
symbol: "JAM",
|
|
@@ -2452,16 +2554,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2452
2554
|
symbol: "COCOA",
|
|
2453
2555
|
decimals: 10
|
|
2454
2556
|
},
|
|
2557
|
+
{
|
|
2558
|
+
assetId: "20090115",
|
|
2559
|
+
symbol: "DOTCOIN",
|
|
2560
|
+
decimals: 10
|
|
2561
|
+
},
|
|
2455
2562
|
{
|
|
2456
2563
|
assetId: "301",
|
|
2457
2564
|
symbol: "HORN",
|
|
2458
2565
|
decimals: 6
|
|
2459
2566
|
},
|
|
2567
|
+
{
|
|
2568
|
+
assetId: "20090122",
|
|
2569
|
+
symbol: "0xf09fa590",
|
|
2570
|
+
decimals: 10
|
|
2571
|
+
},
|
|
2460
2572
|
{
|
|
2461
2573
|
assetId: "2020",
|
|
2462
2574
|
symbol: "HYDRA",
|
|
2463
2575
|
decimals: 10
|
|
2464
2576
|
},
|
|
2577
|
+
{
|
|
2578
|
+
assetId: "41",
|
|
2579
|
+
symbol: "TeMe4",
|
|
2580
|
+
decimals: 12
|
|
2581
|
+
},
|
|
2465
2582
|
{
|
|
2466
2583
|
assetId: "5318008",
|
|
2467
2584
|
symbol: "PXPS",
|
|
@@ -2497,6 +2614,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2497
2614
|
symbol: "COCA",
|
|
2498
2615
|
decimals: 6
|
|
2499
2616
|
},
|
|
2617
|
+
{
|
|
2618
|
+
assetId: "20090128",
|
|
2619
|
+
symbol: "DSTINK",
|
|
2620
|
+
decimals: 10
|
|
2621
|
+
},
|
|
2500
2622
|
{
|
|
2501
2623
|
assetId: "61",
|
|
2502
2624
|
symbol: "SUN",
|
|
@@ -2517,6 +2639,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2517
2639
|
symbol: "DBX",
|
|
2518
2640
|
decimals: 6
|
|
2519
2641
|
},
|
|
2642
|
+
{
|
|
2643
|
+
assetId: "20090106",
|
|
2644
|
+
symbol: "PMATIC",
|
|
2645
|
+
decimals: 10
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
assetId: "20090116",
|
|
2649
|
+
symbol: "POO",
|
|
2650
|
+
decimals: 10
|
|
2651
|
+
},
|
|
2652
|
+
{
|
|
2653
|
+
assetId: "20090129",
|
|
2654
|
+
symbol: "FCD",
|
|
2655
|
+
decimals: 10
|
|
2656
|
+
},
|
|
2520
2657
|
{
|
|
2521
2658
|
assetId: "678",
|
|
2522
2659
|
symbol: "SATS",
|
|
@@ -2547,6 +2684,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2547
2684
|
symbol: "STAR",
|
|
2548
2685
|
decimals: 6
|
|
2549
2686
|
},
|
|
2687
|
+
{
|
|
2688
|
+
assetId: "49",
|
|
2689
|
+
symbol: "TeMe7",
|
|
2690
|
+
decimals: 12
|
|
2691
|
+
},
|
|
2550
2692
|
{
|
|
2551
2693
|
assetId: "868367",
|
|
2552
2694
|
symbol: "VSC",
|
|
@@ -2577,6 +2719,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2577
2719
|
symbol: "PJS",
|
|
2578
2720
|
decimals: 18
|
|
2579
2721
|
},
|
|
2722
|
+
{
|
|
2723
|
+
assetId: "43",
|
|
2724
|
+
symbol: "TeMe5",
|
|
2725
|
+
decimals: 12
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
assetId: "7777777",
|
|
2729
|
+
symbol: "DWH",
|
|
2730
|
+
decimals: 10
|
|
2731
|
+
},
|
|
2580
2732
|
{
|
|
2581
2733
|
assetId: "2001",
|
|
2582
2734
|
symbol: "DOTA",
|
|
@@ -2617,11 +2769,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2617
2769
|
symbol: "USDt",
|
|
2618
2770
|
decimals: 6
|
|
2619
2771
|
},
|
|
2772
|
+
{
|
|
2773
|
+
assetId: "20090104",
|
|
2774
|
+
symbol: "DOTC",
|
|
2775
|
+
decimals: 10
|
|
2776
|
+
},
|
|
2620
2777
|
{
|
|
2621
2778
|
assetId: "20090103",
|
|
2622
2779
|
symbol: "BTC",
|
|
2623
2780
|
decimals: 20
|
|
2624
2781
|
},
|
|
2782
|
+
{
|
|
2783
|
+
assetId: "20090118",
|
|
2784
|
+
symbol: "NOTDED",
|
|
2785
|
+
decimals: 10
|
|
2786
|
+
},
|
|
2787
|
+
{
|
|
2788
|
+
assetId: "20090124",
|
|
2789
|
+
symbol: "test1",
|
|
2790
|
+
decimals: 10
|
|
2791
|
+
},
|
|
2625
2792
|
{
|
|
2626
2793
|
assetId: "690",
|
|
2627
2794
|
symbol: "BORK",
|
|
@@ -2657,6 +2824,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2657
2824
|
symbol: "777",
|
|
2658
2825
|
decimals: 20
|
|
2659
2826
|
},
|
|
2827
|
+
{
|
|
2828
|
+
assetId: "86",
|
|
2829
|
+
symbol: "KOL",
|
|
2830
|
+
decimals: 12
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
assetId: "20090113",
|
|
2834
|
+
symbol: "test1",
|
|
2835
|
+
decimals: 10
|
|
2836
|
+
},
|
|
2660
2837
|
{
|
|
2661
2838
|
assetId: "567",
|
|
2662
2839
|
symbol: "ANT",
|
|
@@ -2682,11 +2859,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2682
2859
|
symbol: "GGI",
|
|
2683
2860
|
decimals: 6
|
|
2684
2861
|
},
|
|
2862
|
+
{
|
|
2863
|
+
assetId: "20090120",
|
|
2864
|
+
symbol: "LUNCH",
|
|
2865
|
+
decimals: 10
|
|
2866
|
+
},
|
|
2685
2867
|
{
|
|
2686
2868
|
assetId: "24",
|
|
2687
2869
|
symbol: "PRDOG",
|
|
2688
2870
|
decimals: 10
|
|
2689
2871
|
},
|
|
2872
|
+
{
|
|
2873
|
+
assetId: "20090123",
|
|
2874
|
+
symbol: "GOVD",
|
|
2875
|
+
decimals: 10
|
|
2876
|
+
},
|
|
2690
2877
|
{
|
|
2691
2878
|
assetId: "2023",
|
|
2692
2879
|
symbol: "dot",
|
|
@@ -2727,11 +2914,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2727
2914
|
symbol: "HOOT",
|
|
2728
2915
|
decimals: 6
|
|
2729
2916
|
},
|
|
2917
|
+
{
|
|
2918
|
+
assetId: "20090125",
|
|
2919
|
+
symbol: "PP",
|
|
2920
|
+
decimals: 10
|
|
2921
|
+
},
|
|
2730
2922
|
{
|
|
2731
2923
|
assetId: "51",
|
|
2732
2924
|
symbol: "JAMA",
|
|
2733
2925
|
decimals: 6
|
|
2734
2926
|
},
|
|
2927
|
+
{
|
|
2928
|
+
assetId: "20090135",
|
|
2929
|
+
symbol: "DMX",
|
|
2930
|
+
decimals: 10
|
|
2931
|
+
},
|
|
2735
2932
|
{
|
|
2736
2933
|
assetId: "1234",
|
|
2737
2934
|
symbol: "BUNS",
|
|
@@ -2742,6 +2939,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2742
2939
|
symbol: "clay",
|
|
2743
2940
|
decimals: 20
|
|
2744
2941
|
},
|
|
2942
|
+
{
|
|
2943
|
+
assetId: "20090134",
|
|
2944
|
+
symbol: "DOTCOIN",
|
|
2945
|
+
decimals: 10
|
|
2946
|
+
},
|
|
2745
2947
|
{
|
|
2746
2948
|
assetId: "1000",
|
|
2747
2949
|
symbol: "BRZ",
|
|
@@ -2757,6 +2959,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2757
2959
|
symbol: "ANT",
|
|
2758
2960
|
decimals: 6
|
|
2759
2961
|
},
|
|
2962
|
+
{
|
|
2963
|
+
assetId: "20090126",
|
|
2964
|
+
symbol: "DOGMOON",
|
|
2965
|
+
decimals: 10
|
|
2966
|
+
},
|
|
2760
2967
|
{
|
|
2761
2968
|
assetId: "1992",
|
|
2762
2969
|
symbol: "SITE",
|
|
@@ -2782,6 +2989,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2782
2989
|
symbol: "no1",
|
|
2783
2990
|
decimals: 20
|
|
2784
2991
|
},
|
|
2992
|
+
{
|
|
2993
|
+
assetId: "20090132",
|
|
2994
|
+
symbol: "Beggar",
|
|
2995
|
+
decimals: 10
|
|
2996
|
+
},
|
|
2785
2997
|
{
|
|
2786
2998
|
assetId: "12",
|
|
2787
2999
|
symbol: "USDcp",
|
|
@@ -2792,6 +3004,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2792
3004
|
symbol: "WUD",
|
|
2793
3005
|
decimals: 10
|
|
2794
3006
|
},
|
|
3007
|
+
{
|
|
3008
|
+
assetId: "97",
|
|
3009
|
+
symbol: "TeMe3",
|
|
3010
|
+
decimals: 12
|
|
3011
|
+
},
|
|
3012
|
+
{
|
|
3013
|
+
assetId: "12345",
|
|
3014
|
+
symbol: "usdc",
|
|
3015
|
+
decimals: 10
|
|
3016
|
+
},
|
|
2795
3017
|
{
|
|
2796
3018
|
assetId: "2000",
|
|
2797
3019
|
symbol: "DAO",
|
|
@@ -2852,6 +3074,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2852
3074
|
symbol: "T54",
|
|
2853
3075
|
decimals: 10
|
|
2854
3076
|
},
|
|
3077
|
+
{
|
|
3078
|
+
assetId: "20090108",
|
|
3079
|
+
symbol: "MMM",
|
|
3080
|
+
decimals: 10
|
|
3081
|
+
},
|
|
2855
3082
|
{
|
|
2856
3083
|
assetId: "69",
|
|
2857
3084
|
symbol: "DAL",
|
|
@@ -2862,6 +3089,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2862
3089
|
symbol: "PINK",
|
|
2863
3090
|
decimals: 10
|
|
2864
3091
|
},
|
|
3092
|
+
{
|
|
3093
|
+
assetId: "20090105",
|
|
3094
|
+
symbol: "ETH",
|
|
3095
|
+
decimals: 10
|
|
3096
|
+
},
|
|
2865
3097
|
{
|
|
2866
3098
|
assetId: "37",
|
|
2867
3099
|
symbol: "DODA",
|
|
@@ -2877,6 +3109,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2877
3109
|
symbol: "BOMB",
|
|
2878
3110
|
decimals: 10
|
|
2879
3111
|
},
|
|
3112
|
+
{
|
|
3113
|
+
assetId: "7151",
|
|
3114
|
+
symbol: "TUKI",
|
|
3115
|
+
decimals: 8
|
|
3116
|
+
},
|
|
2880
3117
|
{
|
|
2881
3118
|
assetId: "149",
|
|
2882
3119
|
symbol: "EDU",
|
|
@@ -2902,6 +3139,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2902
3139
|
symbol: "WOOP",
|
|
2903
3140
|
decimals: 12
|
|
2904
3141
|
},
|
|
3142
|
+
{
|
|
3143
|
+
assetId: "20090107",
|
|
3144
|
+
symbol: "ETH",
|
|
3145
|
+
decimals: 10
|
|
3146
|
+
},
|
|
2905
3147
|
{
|
|
2906
3148
|
assetId: "4157",
|
|
2907
3149
|
symbol: "PDOG",
|
|
@@ -2932,10 +3174,25 @@ var AssetHubPolkadot$3 = {
|
|
|
2932
3174
|
symbol: "WOOD",
|
|
2933
3175
|
decimals: 10
|
|
2934
3176
|
},
|
|
3177
|
+
{
|
|
3178
|
+
assetId: "20090127",
|
|
3179
|
+
symbol: "PAMPIT",
|
|
3180
|
+
decimals: 10
|
|
3181
|
+
},
|
|
2935
3182
|
{
|
|
2936
3183
|
assetId: "2230",
|
|
2937
3184
|
symbol: "GBILL",
|
|
2938
3185
|
decimals: 8
|
|
3186
|
+
},
|
|
3187
|
+
{
|
|
3188
|
+
assetId: "92",
|
|
3189
|
+
symbol: "TeMe2",
|
|
3190
|
+
decimals: 12
|
|
3191
|
+
},
|
|
3192
|
+
{
|
|
3193
|
+
assetId: "2203",
|
|
3194
|
+
symbol: "PBTC",
|
|
3195
|
+
decimals: 10
|
|
2939
3196
|
}
|
|
2940
3197
|
]
|
|
2941
3198
|
};
|
|
@@ -5827,15 +6084,18 @@ var Polkadex$3 = {
|
|
|
5827
6084
|
symbol: "DOT",
|
|
5828
6085
|
decimals: 12
|
|
5829
6086
|
},
|
|
6087
|
+
{
|
|
6088
|
+
assetId: "119367686984583275840673742485354142551",
|
|
6089
|
+
symbol: "DED",
|
|
6090
|
+
decimals: 12
|
|
6091
|
+
},
|
|
5830
6092
|
{
|
|
5831
6093
|
assetId: "339306133874233608313826294843504252047",
|
|
5832
6094
|
symbol: "PINK",
|
|
5833
6095
|
decimals: 12
|
|
5834
6096
|
},
|
|
5835
6097
|
{
|
|
5836
|
-
assetId: "
|
|
5837
|
-
symbol: "DED",
|
|
5838
|
-
decimals: 12
|
|
6098
|
+
assetId: "313524628741076911470961827389955394913"
|
|
5839
6099
|
},
|
|
5840
6100
|
{
|
|
5841
6101
|
assetId: "3496813586714279103986568049643838918",
|
|
@@ -6011,6 +6271,47 @@ var Phala$3 = {
|
|
|
6011
6271
|
}
|
|
6012
6272
|
]
|
|
6013
6273
|
};
|
|
6274
|
+
var Ethereum$1 = {
|
|
6275
|
+
paraId: 1,
|
|
6276
|
+
relayChainAssetSymbol: "DOT",
|
|
6277
|
+
nativeAssetSymbol: "ETH",
|
|
6278
|
+
nativeAssets: [
|
|
6279
|
+
{
|
|
6280
|
+
symbol: "ETH",
|
|
6281
|
+
decimals: 18
|
|
6282
|
+
}
|
|
6283
|
+
],
|
|
6284
|
+
otherAssets: [
|
|
6285
|
+
{
|
|
6286
|
+
symbol: "WETH",
|
|
6287
|
+
assetId: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
|
|
6288
|
+
},
|
|
6289
|
+
{
|
|
6290
|
+
symbol: "WBTC",
|
|
6291
|
+
assetId: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
|
|
6292
|
+
},
|
|
6293
|
+
{
|
|
6294
|
+
symbol: "SHIB",
|
|
6295
|
+
assetId: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
|
|
6296
|
+
},
|
|
6297
|
+
{
|
|
6298
|
+
symbol: "PEPE",
|
|
6299
|
+
assetId: "0x6982508145454Ce325dDbE47a25d4ec3d2311933"
|
|
6300
|
+
},
|
|
6301
|
+
{
|
|
6302
|
+
symbol: "TON",
|
|
6303
|
+
assetId: "0x582d872A1B094FC48F5DE31D3B73F2D9bE47def1"
|
|
6304
|
+
},
|
|
6305
|
+
{
|
|
6306
|
+
symbol: "wstETH",
|
|
6307
|
+
assetId: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
6308
|
+
},
|
|
6309
|
+
{
|
|
6310
|
+
symbol: "tBTC",
|
|
6311
|
+
assetId: "0x18084fbA666a33d37592fA2633fD49a74DD93a88"
|
|
6312
|
+
}
|
|
6313
|
+
]
|
|
6314
|
+
};
|
|
6014
6315
|
var Khala$3 = {
|
|
6015
6316
|
paraId: 2004,
|
|
6016
6317
|
relayChainAssetSymbol: "KSM",
|
|
@@ -6109,6 +6410,67 @@ var Khala$3 = {
|
|
|
6109
6410
|
}
|
|
6110
6411
|
]
|
|
6111
6412
|
};
|
|
6413
|
+
var Mythos$3 = {
|
|
6414
|
+
paraId: 3369,
|
|
6415
|
+
relayChainAssetSymbol: "DOT",
|
|
6416
|
+
nativeAssetSymbol: "MYTH",
|
|
6417
|
+
nativeAssets: [
|
|
6418
|
+
{
|
|
6419
|
+
symbol: "MYTH",
|
|
6420
|
+
decimals: 18
|
|
6421
|
+
}
|
|
6422
|
+
],
|
|
6423
|
+
otherAssets: [
|
|
6424
|
+
]
|
|
6425
|
+
};
|
|
6426
|
+
var Peaq$3 = {
|
|
6427
|
+
paraId: 3338,
|
|
6428
|
+
relayChainAssetSymbol: "DOT",
|
|
6429
|
+
nativeAssetSymbol: "PEAQ",
|
|
6430
|
+
nativeAssets: [
|
|
6431
|
+
{
|
|
6432
|
+
symbol: "PEAQ",
|
|
6433
|
+
decimals: 18
|
|
6434
|
+
}
|
|
6435
|
+
],
|
|
6436
|
+
otherAssets: [
|
|
6437
|
+
{
|
|
6438
|
+
assetId: "1005",
|
|
6439
|
+
symbol: "USDT.wh",
|
|
6440
|
+
decimals: 6
|
|
6441
|
+
},
|
|
6442
|
+
{
|
|
6443
|
+
assetId: "1004",
|
|
6444
|
+
symbol: "DAI.wh",
|
|
6445
|
+
decimals: 18
|
|
6446
|
+
},
|
|
6447
|
+
{
|
|
6448
|
+
assetId: "1000",
|
|
6449
|
+
symbol: "GLMR",
|
|
6450
|
+
decimals: 18
|
|
6451
|
+
},
|
|
6452
|
+
{
|
|
6453
|
+
assetId: "1002",
|
|
6454
|
+
symbol: "WETH.wh",
|
|
6455
|
+
decimals: 18
|
|
6456
|
+
},
|
|
6457
|
+
{
|
|
6458
|
+
assetId: "1",
|
|
6459
|
+
symbol: "DOT",
|
|
6460
|
+
decimals: 10
|
|
6461
|
+
},
|
|
6462
|
+
{
|
|
6463
|
+
assetId: "1001",
|
|
6464
|
+
symbol: "USDC.wh",
|
|
6465
|
+
decimals: 6
|
|
6466
|
+
},
|
|
6467
|
+
{
|
|
6468
|
+
assetId: "1003",
|
|
6469
|
+
symbol: "WBTC.wh",
|
|
6470
|
+
decimals: 8
|
|
6471
|
+
}
|
|
6472
|
+
]
|
|
6473
|
+
};
|
|
6112
6474
|
var assets = {
|
|
6113
6475
|
Acala: Acala$3,
|
|
6114
6476
|
BridgeHubPolkadot: BridgeHubPolkadot$3,
|
|
@@ -6163,7 +6525,10 @@ var assets = {
|
|
|
6163
6525
|
Zeitgeist: Zeitgeist$3,
|
|
6164
6526
|
Collectives: Collectives$3,
|
|
6165
6527
|
Phala: Phala$3,
|
|
6166
|
-
|
|
6528
|
+
Ethereum: Ethereum$1,
|
|
6529
|
+
Khala: Khala$3,
|
|
6530
|
+
Mythos: Mythos$3,
|
|
6531
|
+
Peaq: Peaq$3
|
|
6167
6532
|
};
|
|
6168
6533
|
|
|
6169
6534
|
var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -6192,6 +6557,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6192
6557
|
Curio: Curio$3,
|
|
6193
6558
|
Darwinia: Darwinia$3,
|
|
6194
6559
|
Encointer: Encointer$3,
|
|
6560
|
+
Ethereum: Ethereum$1,
|
|
6195
6561
|
Hydration: Hydration$3,
|
|
6196
6562
|
Imbue: Imbue$3,
|
|
6197
6563
|
Integritee: Integritee$3,
|
|
@@ -6206,10 +6572,12 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6206
6572
|
Manta: Manta$3,
|
|
6207
6573
|
Moonbeam: Moonbeam$3,
|
|
6208
6574
|
Moonriver: Moonriver$3,
|
|
6575
|
+
Mythos: Mythos$3,
|
|
6209
6576
|
NeuroWeb: NeuroWeb$3,
|
|
6210
6577
|
Nodle: Nodle$3,
|
|
6211
6578
|
Parallel: Parallel$3,
|
|
6212
6579
|
ParallelHeiko: ParallelHeiko$3,
|
|
6580
|
+
Peaq: Peaq$3,
|
|
6213
6581
|
Pendulum: Pendulum$3,
|
|
6214
6582
|
Phala: Phala$3,
|
|
6215
6583
|
Picasso: Picasso$3,
|
|
@@ -6261,7 +6629,15 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(node) {
|
|
|
6261
6629
|
});
|
|
6262
6630
|
return [relayChainAssetSymbol].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
6263
6631
|
};
|
|
6264
|
-
var
|
|
6632
|
+
var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
|
|
6633
|
+
if (node === 'Polkadot') {
|
|
6634
|
+
return 'DOT';
|
|
6635
|
+
} else if (node === 'Kusama') {
|
|
6636
|
+
return 'KSM';
|
|
6637
|
+
}
|
|
6638
|
+
return getAssetsObject(node).nativeAssetSymbol;
|
|
6639
|
+
};
|
|
6640
|
+
var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
|
|
6265
6641
|
return getAllAssetsSymbols(node).includes(symbol);
|
|
6266
6642
|
};
|
|
6267
6643
|
var getAssetDecimals = function getAssetDecimals(node, symbol) {
|
|
@@ -6685,6 +7061,19 @@ var BridgeHubKusama$2 = {
|
|
|
6685
7061
|
"PolkadotXcm"
|
|
6686
7062
|
]
|
|
6687
7063
|
};
|
|
7064
|
+
var Mythos$2 = {
|
|
7065
|
+
defaultPallet: "PolkadotXcm",
|
|
7066
|
+
supportedPallets: [
|
|
7067
|
+
"PolkadotXcm"
|
|
7068
|
+
]
|
|
7069
|
+
};
|
|
7070
|
+
var Peaq$2 = {
|
|
7071
|
+
defaultPallet: "XTokens",
|
|
7072
|
+
supportedPallets: [
|
|
7073
|
+
"PolkadotXcm",
|
|
7074
|
+
"XTokens"
|
|
7075
|
+
]
|
|
7076
|
+
};
|
|
6688
7077
|
var pallets = {
|
|
6689
7078
|
AssetHubPolkadot: AssetHubPolkadot$2,
|
|
6690
7079
|
Acala: Acala$2,
|
|
@@ -6739,7 +7128,9 @@ var pallets = {
|
|
|
6739
7128
|
KiltSpiritnet: KiltSpiritnet$2,
|
|
6740
7129
|
Curio: Curio$2,
|
|
6741
7130
|
BridgeHubPolkadot: BridgeHubPolkadot$2,
|
|
6742
|
-
BridgeHubKusama: BridgeHubKusama$2
|
|
7131
|
+
BridgeHubKusama: BridgeHubKusama$2,
|
|
7132
|
+
Mythos: Mythos$2,
|
|
7133
|
+
Peaq: Peaq$2
|
|
6743
7134
|
};
|
|
6744
7135
|
|
|
6745
7136
|
var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -6782,10 +7173,12 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6782
7173
|
Manta: Manta$2,
|
|
6783
7174
|
Moonbeam: Moonbeam$2,
|
|
6784
7175
|
Moonriver: Moonriver$2,
|
|
7176
|
+
Mythos: Mythos$2,
|
|
6785
7177
|
NeuroWeb: NeuroWeb$2,
|
|
6786
7178
|
Nodle: Nodle$2,
|
|
6787
7179
|
Parallel: Parallel$2,
|
|
6788
7180
|
ParallelHeiko: ParallelHeiko$2,
|
|
7181
|
+
Peaq: Peaq$2,
|
|
6789
7182
|
Pendulum: Pendulum$2,
|
|
6790
7183
|
Phala: Phala$2,
|
|
6791
7184
|
Picasso: Picasso$2,
|
|
@@ -6825,9 +7218,11 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
6825
7218
|
return parameters;
|
|
6826
7219
|
};
|
|
6827
7220
|
var isTMulti = function isTMulti(value) {
|
|
7221
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
6828
7222
|
return value && _typeof(value) === 'object' || Array.isArray(value);
|
|
6829
7223
|
};
|
|
6830
7224
|
var isTMultiLocation = function isTMultiLocation(value) {
|
|
7225
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
6831
7226
|
return value && typeof value.parents !== 'undefined' && typeof value.interior !== 'undefined';
|
|
6832
7227
|
};
|
|
6833
7228
|
var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
|
|
@@ -6849,6 +7244,7 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents, o
|
|
|
6849
7244
|
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
6850
7245
|
if (!overriddenCurrency) {
|
|
6851
7246
|
return _defineProperty({}, version, [{
|
|
7247
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6852
7248
|
id: version === Version.V4 ? {
|
|
6853
7249
|
parents: parents,
|
|
6854
7250
|
interior: interior
|
|
@@ -6873,14 +7269,14 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents, o
|
|
|
6873
7269
|
}]) : // It must be TMultiAsset if not TMultiLocation
|
|
6874
7270
|
_defineProperty({}, version, overriddenCurrency);
|
|
6875
7271
|
};
|
|
6876
|
-
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId) {
|
|
6877
|
-
var
|
|
6878
|
-
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, {
|
|
7272
|
+
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
7273
|
+
var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
|
|
7274
|
+
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
|
|
6879
7275
|
Parachain: nodeId
|
|
6880
7276
|
});
|
|
6881
7277
|
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
6882
7278
|
return _defineProperty({}, version, isMultiLocationDestination ? destination : {
|
|
6883
|
-
parents:
|
|
7279
|
+
parents: parentsResolved,
|
|
6884
7280
|
interior: interior
|
|
6885
7281
|
});
|
|
6886
7282
|
};
|
|
@@ -6917,9 +7313,11 @@ var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
|
|
|
6917
7313
|
}, _callee);
|
|
6918
7314
|
}));
|
|
6919
7315
|
};
|
|
7316
|
+
// TODO: Refactor this function to eliminate the any type
|
|
6920
7317
|
var findParachainJunction = function findParachainJunction(multilocation) {
|
|
6921
7318
|
var interior = multilocation.interior;
|
|
6922
7319
|
for (var key in interior) {
|
|
7320
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
6923
7321
|
var junctions = interior[key];
|
|
6924
7322
|
if (Array.isArray(junctions)) {
|
|
6925
7323
|
var _iterator = _createForOfIteratorHelper(junctions),
|
|
@@ -6928,6 +7326,7 @@ var findParachainJunction = function findParachainJunction(multilocation) {
|
|
|
6928
7326
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6929
7327
|
var junction = _step.value;
|
|
6930
7328
|
if ('Parachain' in junction) {
|
|
7329
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6931
7330
|
return Number(junction.Parachain);
|
|
6932
7331
|
}
|
|
6933
7332
|
}
|
|
@@ -6937,6 +7336,7 @@ var findParachainJunction = function findParachainJunction(multilocation) {
|
|
|
6937
7336
|
_iterator.f();
|
|
6938
7337
|
}
|
|
6939
7338
|
} else if (junctions !== undefined && 'Parachain' in junctions) {
|
|
7339
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6940
7340
|
return Number(junctions.Parachain);
|
|
6941
7341
|
}
|
|
6942
7342
|
}
|
|
@@ -7140,6 +7540,8 @@ var KiltSpiritnet$1 = "10000000000000";
|
|
|
7140
7540
|
var Curio$1 = "10000000000000000";
|
|
7141
7541
|
var BridgeHubPolkadot$1 = "1000000000";
|
|
7142
7542
|
var BridgeHubKusama$1 = "33333333";
|
|
7543
|
+
var Mythos$1 = "10000000000000000";
|
|
7544
|
+
var Peaq$1 = "500";
|
|
7143
7545
|
var existentialDeposits = {
|
|
7144
7546
|
AssetHubPolkadot: AssetHubPolkadot$1,
|
|
7145
7547
|
Acala: Acala$1,
|
|
@@ -7196,7 +7598,9 @@ var existentialDeposits = {
|
|
|
7196
7598
|
KiltSpiritnet: KiltSpiritnet$1,
|
|
7197
7599
|
Curio: Curio$1,
|
|
7198
7600
|
BridgeHubPolkadot: BridgeHubPolkadot$1,
|
|
7199
|
-
BridgeHubKusama: BridgeHubKusama$1
|
|
7601
|
+
BridgeHubKusama: BridgeHubKusama$1,
|
|
7602
|
+
Mythos: Mythos$1,
|
|
7603
|
+
Peaq: Peaq$1
|
|
7200
7604
|
};
|
|
7201
7605
|
|
|
7202
7606
|
var edMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -7240,10 +7644,12 @@ var edMapJson = /*#__PURE__*/Object.freeze({
|
|
|
7240
7644
|
Manta: Manta$1,
|
|
7241
7645
|
Moonbeam: Moonbeam$1,
|
|
7242
7646
|
Moonriver: Moonriver$1,
|
|
7647
|
+
Mythos: Mythos$1,
|
|
7243
7648
|
NeuroWeb: NeuroWeb$1,
|
|
7244
7649
|
Nodle: Nodle$1,
|
|
7245
7650
|
Parallel: Parallel$1,
|
|
7246
7651
|
ParallelHeiko: ParallelHeiko$1,
|
|
7652
|
+
Peaq: Peaq$1,
|
|
7247
7653
|
Pendulum: Pendulum$1,
|
|
7248
7654
|
Phala: Phala$1,
|
|
7249
7655
|
Picasso: Picasso$1,
|
|
@@ -8005,6 +8411,209 @@ var Builder = function Builder(api) {
|
|
|
8005
8411
|
return new GeneralBuilder(api);
|
|
8006
8412
|
};
|
|
8007
8413
|
|
|
8414
|
+
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
8415
|
+
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
8416
|
+
function InvalidCurrencyError(message) {
|
|
8417
|
+
var _this;
|
|
8418
|
+
_classCallCheck(this, InvalidCurrencyError);
|
|
8419
|
+
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
8420
|
+
_this.name = 'InvalidCurrencyError';
|
|
8421
|
+
return _this;
|
|
8422
|
+
}
|
|
8423
|
+
_inherits(InvalidCurrencyError, _Error);
|
|
8424
|
+
return _createClass(InvalidCurrencyError);
|
|
8425
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8426
|
+
|
|
8427
|
+
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
8428
|
+
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
8429
|
+
function NodeNotSupportedError(message) {
|
|
8430
|
+
var _this;
|
|
8431
|
+
_classCallCheck(this, NodeNotSupportedError);
|
|
8432
|
+
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
8433
|
+
_this.name = 'NodeNotSupported';
|
|
8434
|
+
return _this;
|
|
8435
|
+
}
|
|
8436
|
+
_inherits(NodeNotSupportedError, _Error);
|
|
8437
|
+
return _createClass(NodeNotSupportedError);
|
|
8438
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8439
|
+
|
|
8440
|
+
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
8441
|
+
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
8442
|
+
function ScenarioNotSupportedError(node, scenario, message) {
|
|
8443
|
+
var _this;
|
|
8444
|
+
_classCallCheck(this, ScenarioNotSupportedError);
|
|
8445
|
+
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
8446
|
+
_this.name = 'ScenarioNotSupported';
|
|
8447
|
+
return _this;
|
|
8448
|
+
}
|
|
8449
|
+
_inherits(ScenarioNotSupportedError, _Error);
|
|
8450
|
+
return _createClass(ScenarioNotSupportedError);
|
|
8451
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8452
|
+
|
|
8453
|
+
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
8454
|
+
function IncompatibleNodesError() {
|
|
8455
|
+
var _this;
|
|
8456
|
+
_classCallCheck(this, IncompatibleNodesError);
|
|
8457
|
+
_this = _callSuper(this, IncompatibleNodesError, ['Transactions between nodes on different relaychains are not yet possible.']);
|
|
8458
|
+
_this.name = 'IncompatibleNodes';
|
|
8459
|
+
return _this;
|
|
8460
|
+
}
|
|
8461
|
+
_inherits(IncompatibleNodesError, _Error);
|
|
8462
|
+
return _createClass(IncompatibleNodesError);
|
|
8463
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8464
|
+
|
|
8465
|
+
var transferEthToPolkadot = function transferEthToPolkadot(provider_1, _a) {
|
|
8466
|
+
return __awaiter(void 0, [provider_1, _a], void 0, function (provider, _ref) {
|
|
8467
|
+
var signer = _ref.signer,
|
|
8468
|
+
address = _ref.address,
|
|
8469
|
+
to = _ref.to,
|
|
8470
|
+
amount = _ref.amount,
|
|
8471
|
+
currency = _ref.currency;
|
|
8472
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8473
|
+
var ethAssets, ethAsset, env, config, context, destParaId, plan, result;
|
|
8474
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8475
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8476
|
+
case 0:
|
|
8477
|
+
ethAssets = getOtherAssets('Ethereum');
|
|
8478
|
+
ethAsset = ethAssets.find(function (asset) {
|
|
8479
|
+
return asset.symbol === currency;
|
|
8480
|
+
});
|
|
8481
|
+
if (ethAsset) {
|
|
8482
|
+
_context.next = 4;
|
|
8483
|
+
break;
|
|
8484
|
+
}
|
|
8485
|
+
throw new InvalidCurrencyError("Currency ".concat(currency, " is not supported for Ethereum transfers"));
|
|
8486
|
+
case 4:
|
|
8487
|
+
env = environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
|
|
8488
|
+
config = env.config;
|
|
8489
|
+
_context.next = 8;
|
|
8490
|
+
return contextFactory({
|
|
8491
|
+
ethereum: {
|
|
8492
|
+
execution_url: provider,
|
|
8493
|
+
beacon_url: config.BEACON_HTTP_API
|
|
8494
|
+
},
|
|
8495
|
+
polkadot: {
|
|
8496
|
+
url: {
|
|
8497
|
+
bridgeHub: config.BRIDGE_HUB_URL,
|
|
8498
|
+
assetHub: config.ASSET_HUB_URL,
|
|
8499
|
+
relaychain: config.RELAY_CHAIN_URL,
|
|
8500
|
+
parachains: config.PARACHAINS
|
|
8501
|
+
}
|
|
8502
|
+
},
|
|
8503
|
+
appContracts: {
|
|
8504
|
+
gateway: config.GATEWAY_CONTRACT,
|
|
8505
|
+
beefy: config.BEEFY_CONTRACT
|
|
8506
|
+
}
|
|
8507
|
+
});
|
|
8508
|
+
case 8:
|
|
8509
|
+
context = _context.sent;
|
|
8510
|
+
destParaId = getParaId(to);
|
|
8511
|
+
_context.next = 12;
|
|
8512
|
+
return toPolkadot.validateSend(context, signer, address, ethAsset.assetId, destParaId, BigInt(amount), BigInt(0));
|
|
8513
|
+
case 12:
|
|
8514
|
+
plan = _context.sent;
|
|
8515
|
+
if (!plan.failure) {
|
|
8516
|
+
_context.next = 15;
|
|
8517
|
+
break;
|
|
8518
|
+
}
|
|
8519
|
+
throw new Error("Failed to validate send: ".concat(plan.failure.errors.map(function (e) {
|
|
8520
|
+
return e.message;
|
|
8521
|
+
}).join('\n\n')));
|
|
8522
|
+
case 15:
|
|
8523
|
+
_context.next = 17;
|
|
8524
|
+
return toPolkadot.send(context, signer, plan);
|
|
8525
|
+
case 17:
|
|
8526
|
+
result = _context.sent;
|
|
8527
|
+
return _context.abrupt("return", {
|
|
8528
|
+
result: result,
|
|
8529
|
+
plan: plan
|
|
8530
|
+
});
|
|
8531
|
+
case 19:
|
|
8532
|
+
case "end":
|
|
8533
|
+
return _context.stop();
|
|
8534
|
+
}
|
|
8535
|
+
}, _callee);
|
|
8536
|
+
})();
|
|
8537
|
+
});
|
|
8538
|
+
};
|
|
8539
|
+
|
|
8540
|
+
var EvmBuilderClass = /*#__PURE__*/function () {
|
|
8541
|
+
function EvmBuilderClass(provider) {
|
|
8542
|
+
_classCallCheck(this, EvmBuilderClass);
|
|
8543
|
+
this._provider = provider;
|
|
8544
|
+
this._options = {};
|
|
8545
|
+
}
|
|
8546
|
+
return _createClass(EvmBuilderClass, [{
|
|
8547
|
+
key: "to",
|
|
8548
|
+
value: function to(node) {
|
|
8549
|
+
this._options.to = node;
|
|
8550
|
+
return this;
|
|
8551
|
+
}
|
|
8552
|
+
}, {
|
|
8553
|
+
key: "amount",
|
|
8554
|
+
value: function amount(_amount) {
|
|
8555
|
+
this._options.amount = _amount;
|
|
8556
|
+
return this;
|
|
8557
|
+
}
|
|
8558
|
+
}, {
|
|
8559
|
+
key: "currency",
|
|
8560
|
+
value: function currency(_currency) {
|
|
8561
|
+
this._options.currency = _currency;
|
|
8562
|
+
return this;
|
|
8563
|
+
}
|
|
8564
|
+
}, {
|
|
8565
|
+
key: "address",
|
|
8566
|
+
value: function address(_address) {
|
|
8567
|
+
this._options.address = _address;
|
|
8568
|
+
return this;
|
|
8569
|
+
}
|
|
8570
|
+
}, {
|
|
8571
|
+
key: "signer",
|
|
8572
|
+
value: function signer(_signer) {
|
|
8573
|
+
this._options.signer = _signer;
|
|
8574
|
+
return this;
|
|
8575
|
+
}
|
|
8576
|
+
}, {
|
|
8577
|
+
key: "build",
|
|
8578
|
+
value: function build() {
|
|
8579
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8580
|
+
var requiredParams, _i, _requiredParams, param;
|
|
8581
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8582
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8583
|
+
case 0:
|
|
8584
|
+
requiredParams = ['to', 'amount', 'currency', 'address', 'signer'];
|
|
8585
|
+
_i = 0, _requiredParams = requiredParams;
|
|
8586
|
+
case 2:
|
|
8587
|
+
if (!(_i < _requiredParams.length)) {
|
|
8588
|
+
_context.next = 9;
|
|
8589
|
+
break;
|
|
8590
|
+
}
|
|
8591
|
+
param = _requiredParams[_i];
|
|
8592
|
+
if (!(this._options[param] === undefined)) {
|
|
8593
|
+
_context.next = 6;
|
|
8594
|
+
break;
|
|
8595
|
+
}
|
|
8596
|
+
throw new Error("Builder object is missing parameter: ".concat(param));
|
|
8597
|
+
case 6:
|
|
8598
|
+
_i++;
|
|
8599
|
+
_context.next = 2;
|
|
8600
|
+
break;
|
|
8601
|
+
case 9:
|
|
8602
|
+
_context.next = 11;
|
|
8603
|
+
return transferEthToPolkadot(this._provider, this._options);
|
|
8604
|
+
case 11:
|
|
8605
|
+
case "end":
|
|
8606
|
+
return _context.stop();
|
|
8607
|
+
}
|
|
8608
|
+
}, _callee, this);
|
|
8609
|
+
}));
|
|
8610
|
+
}
|
|
8611
|
+
}]);
|
|
8612
|
+
}();
|
|
8613
|
+
var EvmBuilder = function EvmBuilder(provider) {
|
|
8614
|
+
return new EvmBuilderClass(provider);
|
|
8615
|
+
};
|
|
8616
|
+
|
|
8008
8617
|
var createTx$1 = function createTx(originApi, address, amount, currencySymbol, originNode, destNode) {
|
|
8009
8618
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8010
8619
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -8110,20 +8719,12 @@ var getOriginFeeDetails = function getOriginFeeDetails(origin, destination, curr
|
|
|
8110
8719
|
}));
|
|
8111
8720
|
};
|
|
8112
8721
|
|
|
8113
|
-
var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
|
|
8114
|
-
if (node === 'Polkadot') {
|
|
8115
|
-
return 'DOT';
|
|
8116
|
-
} else if (node === 'Kusama') {
|
|
8117
|
-
return 'KSM';
|
|
8118
|
-
}
|
|
8119
|
-
return getAssetsObject(node).nativeAssetSymbol;
|
|
8120
|
-
};
|
|
8121
8722
|
var getAssetSymbol = function getAssetSymbol(node, assetId) {
|
|
8122
8723
|
if (node === 'Polkadot' || node === 'Kusama') {
|
|
8123
8724
|
return getNativeAssetSymbol(node);
|
|
8124
8725
|
}
|
|
8125
8726
|
var asset = getAssetBySymbolOrId(node, assetId);
|
|
8126
|
-
return asset;
|
|
8727
|
+
return asset === null || asset === void 0 ? void 0 : asset.symbol;
|
|
8127
8728
|
};
|
|
8128
8729
|
var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
|
|
8129
8730
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -8180,7 +8781,7 @@ var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
|
|
|
8180
8781
|
};
|
|
8181
8782
|
var getTransferInfo = function getTransferInfo(origin, destination, accountOrigin, accountDestination, assetSymbolOrId, amount) {
|
|
8182
8783
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
8183
|
-
var
|
|
8784
|
+
var _a, originApi, originBalance, _yield$getOriginFeeDe, destXcmFee, expectedBalanceAfterXCMDelivery, asset;
|
|
8184
8785
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8185
8786
|
while (1) switch (_context2.prev = _context2.next) {
|
|
8186
8787
|
case 0:
|
|
@@ -8208,7 +8809,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
|
|
|
8208
8809
|
return getAssetBalance(accountOrigin, origin, assetSymbolOrId);
|
|
8209
8810
|
case 15:
|
|
8210
8811
|
_context2.t1 = _context2.sent;
|
|
8211
|
-
_context2.t2 = asset
|
|
8812
|
+
_context2.t2 = asset !== null && asset !== void 0 ? asset : '';
|
|
8212
8813
|
_context2.t3 = {
|
|
8213
8814
|
balance: _context2.t1,
|
|
8214
8815
|
currency: _context2.t2
|
|
@@ -8222,7 +8823,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
|
|
|
8222
8823
|
return getOriginFeeDetails(origin, destination, assetSymbolOrId, amount, accountOrigin, originApi);
|
|
8223
8824
|
case 24:
|
|
8224
8825
|
_context2.t6 = _context2.sent;
|
|
8225
|
-
_context2.t7 = BigInt((
|
|
8826
|
+
_context2.t7 = BigInt((_a = getExistentialDeposit$1(origin)) !== null && _a !== void 0 ? _a : 0);
|
|
8226
8827
|
_context2.t8 = getNativeAssetSymbol(origin);
|
|
8227
8828
|
_context2.t9 = getMinNativeTransferableAmount(origin);
|
|
8228
8829
|
_context2.next = 30;
|
|
@@ -8271,6 +8872,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
8271
8872
|
getAssetsObject: getAssetsObject,
|
|
8272
8873
|
getBalanceForeign: getBalanceForeign,
|
|
8273
8874
|
getBalanceNative: getBalanceNative,
|
|
8875
|
+
getNativeAssetSymbol: getNativeAssetSymbol,
|
|
8274
8876
|
getNativeAssets: getNativeAssets,
|
|
8275
8877
|
getOtherAssets: getOtherAssets,
|
|
8276
8878
|
getParaId: getParaId,
|
|
@@ -8484,7 +9086,6 @@ var getParameters = function getParameters(isAssetHub, currencySelection, addres
|
|
|
8484
9086
|
}
|
|
8485
9087
|
return [currencySelection, amount, addressSelection, fees];
|
|
8486
9088
|
};
|
|
8487
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
8488
9089
|
var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
8489
9090
|
function XTokensTransferImpl() {
|
|
8490
9091
|
_classCallCheck(this, XTokensTransferImpl);
|
|
@@ -8517,6 +9118,7 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
8517
9118
|
parameters: parameters
|
|
8518
9119
|
};
|
|
8519
9120
|
}
|
|
9121
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8520
9122
|
return (_api$tx$module = api.tx[module])[section].apply(_api$tx$module, _toConsumableArray(parameters));
|
|
8521
9123
|
}
|
|
8522
9124
|
}]);
|
|
@@ -8565,19 +9167,6 @@ var Unique = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8565
9167
|
}]);
|
|
8566
9168
|
}(ParachainNode);
|
|
8567
9169
|
|
|
8568
|
-
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
8569
|
-
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
8570
|
-
function InvalidCurrencyError(message) {
|
|
8571
|
-
var _this;
|
|
8572
|
-
_classCallCheck(this, InvalidCurrencyError);
|
|
8573
|
-
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
8574
|
-
_this.name = 'InvalidCurrencyError';
|
|
8575
|
-
return _this;
|
|
8576
|
-
}
|
|
8577
|
-
_inherits(InvalidCurrencyError, _Error);
|
|
8578
|
-
return _createClass(InvalidCurrencyError);
|
|
8579
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8580
|
-
|
|
8581
9170
|
var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
8582
9171
|
function Crust() {
|
|
8583
9172
|
_classCallCheck(this, Crust);
|
|
@@ -8808,10 +9397,29 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8808
9397
|
var Bajun = /*#__PURE__*/function (_ParachainNode) {
|
|
8809
9398
|
function Bajun() {
|
|
8810
9399
|
_classCallCheck(this, Bajun);
|
|
8811
|
-
return _callSuper(this, Bajun, ['Bajun', 'bajun', 'kusama', Version.
|
|
9400
|
+
return _callSuper(this, Bajun, ['Bajun', 'bajun', 'kusama', Version.V3]);
|
|
8812
9401
|
}
|
|
8813
9402
|
_inherits(Bajun, _ParachainNode);
|
|
8814
|
-
return _createClass(Bajun
|
|
9403
|
+
return _createClass(Bajun, [{
|
|
9404
|
+
key: "transferXTokens",
|
|
9405
|
+
value: function transferXTokens(input) {
|
|
9406
|
+
var scenario = input.scenario,
|
|
9407
|
+
currency = input.currency;
|
|
9408
|
+
if (scenario !== 'ParaToPara') {
|
|
9409
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
9410
|
+
}
|
|
9411
|
+
var nativeSymbol = getNativeAssetSymbol(this.node);
|
|
9412
|
+
if (currency !== nativeSymbol) {
|
|
9413
|
+
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currency));
|
|
9414
|
+
}
|
|
9415
|
+
return XTokensTransferImpl.transferXTokens(input, currency);
|
|
9416
|
+
}
|
|
9417
|
+
}, {
|
|
9418
|
+
key: "transferRelayToPara",
|
|
9419
|
+
value: function transferRelayToPara() {
|
|
9420
|
+
throw new NodeNotSupportedError();
|
|
9421
|
+
}
|
|
9422
|
+
}]);
|
|
8815
9423
|
}(ParachainNode);
|
|
8816
9424
|
|
|
8817
9425
|
var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
@@ -9030,44 +9638,6 @@ var Imbue = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9030
9638
|
}]);
|
|
9031
9639
|
}(ParachainNode);
|
|
9032
9640
|
|
|
9033
|
-
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
9034
|
-
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
9035
|
-
function NodeNotSupportedError(message) {
|
|
9036
|
-
var _this;
|
|
9037
|
-
_classCallCheck(this, NodeNotSupportedError);
|
|
9038
|
-
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
9039
|
-
_this.name = 'NodeNotSupported';
|
|
9040
|
-
return _this;
|
|
9041
|
-
}
|
|
9042
|
-
_inherits(NodeNotSupportedError, _Error);
|
|
9043
|
-
return _createClass(NodeNotSupportedError);
|
|
9044
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9045
|
-
|
|
9046
|
-
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
9047
|
-
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
9048
|
-
function ScenarioNotSupportedError(node, scenario, message) {
|
|
9049
|
-
var _this;
|
|
9050
|
-
_classCallCheck(this, ScenarioNotSupportedError);
|
|
9051
|
-
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
9052
|
-
_this.name = 'ScenarioNotSupported';
|
|
9053
|
-
return _this;
|
|
9054
|
-
}
|
|
9055
|
-
_inherits(ScenarioNotSupportedError, _Error);
|
|
9056
|
-
return _createClass(ScenarioNotSupportedError);
|
|
9057
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9058
|
-
|
|
9059
|
-
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
9060
|
-
function IncompatibleNodesError() {
|
|
9061
|
-
var _this;
|
|
9062
|
-
_classCallCheck(this, IncompatibleNodesError);
|
|
9063
|
-
_this = _callSuper(this, IncompatibleNodesError, ['Transactions between nodes on different relaychains are not yet possible.']);
|
|
9064
|
-
_this.name = 'IncompatibleNodes';
|
|
9065
|
-
return _this;
|
|
9066
|
-
}
|
|
9067
|
-
_inherits(IncompatibleNodesError, _Error);
|
|
9068
|
-
return _createClass(IncompatibleNodesError);
|
|
9069
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9070
|
-
|
|
9071
9641
|
var Integritee = /*#__PURE__*/function (_ParachainNode) {
|
|
9072
9642
|
function Integritee() {
|
|
9073
9643
|
_classCallCheck(this, Integritee);
|
|
@@ -9132,7 +9702,6 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9132
9702
|
|
|
9133
9703
|
// Contains basic structure of polkadotXCM call
|
|
9134
9704
|
var DEFAULT_FEE_ASSET = 0;
|
|
9135
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
9136
9705
|
var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
9137
9706
|
function PolkadotXCMTransferImpl() {
|
|
9138
9707
|
_classCallCheck(this, PolkadotXCMTransferImpl);
|
|
@@ -9188,6 +9757,49 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9188
9757
|
}
|
|
9189
9758
|
throw new InvalidCurrencyError('Polkadot <-> Kusama bridge does not support this currency');
|
|
9190
9759
|
}
|
|
9760
|
+
}, {
|
|
9761
|
+
key: "handleEthBridgeTransfer",
|
|
9762
|
+
value: function handleEthBridgeTransfer(input) {
|
|
9763
|
+
var api = input.api,
|
|
9764
|
+
scenario = input.scenario,
|
|
9765
|
+
destination = input.destination,
|
|
9766
|
+
paraIdTo = input.paraIdTo,
|
|
9767
|
+
address = input.address,
|
|
9768
|
+
currencyId = input.currencyId;
|
|
9769
|
+
if (!ethers.isAddress(address)) {
|
|
9770
|
+
throw new Error('Only Ethereum addresses are supported for Ethereum transfers');
|
|
9771
|
+
}
|
|
9772
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
9773
|
+
var ethAsset = ethAssets.find(function (asset) {
|
|
9774
|
+
return asset.symbol === currencyId;
|
|
9775
|
+
});
|
|
9776
|
+
if (!ethAsset) {
|
|
9777
|
+
throw new InvalidCurrencyError("Currency ".concat(currencyId, " is not supported for Ethereum transfers"));
|
|
9778
|
+
}
|
|
9779
|
+
var ETH_CHAIN_ID = 1;
|
|
9780
|
+
var ethJunction = {
|
|
9781
|
+
GlobalConsensus: {
|
|
9782
|
+
Ethereum: {
|
|
9783
|
+
chain_id: ETH_CHAIN_ID
|
|
9784
|
+
}
|
|
9785
|
+
}
|
|
9786
|
+
};
|
|
9787
|
+
var modifiedInput = Object.assign(Object.assign({}, input), {
|
|
9788
|
+
header: createPolkadotXcmHeader(scenario, this.version, destination, paraIdTo, ethJunction, Parents.TWO),
|
|
9789
|
+
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, this.version, paraIdTo),
|
|
9790
|
+
currencySelection: createCurrencySpec(input.amount, Version.V3, Parents.TWO, {
|
|
9791
|
+
parents: Parents.TWO,
|
|
9792
|
+
interior: {
|
|
9793
|
+
X2: [ethJunction, {
|
|
9794
|
+
AccountKey20: {
|
|
9795
|
+
key: ethAsset.assetId
|
|
9796
|
+
}
|
|
9797
|
+
}]
|
|
9798
|
+
}
|
|
9799
|
+
})
|
|
9800
|
+
});
|
|
9801
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transferAssets', 'Unlimited');
|
|
9802
|
+
}
|
|
9191
9803
|
}, {
|
|
9192
9804
|
key: "transferPolkadotXCM",
|
|
9193
9805
|
value: function transferPolkadotXCM(input) {
|
|
@@ -9195,6 +9807,9 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9195
9807
|
if (input.destination === 'AssetHubKusama') {
|
|
9196
9808
|
return this.handleBridgeTransfer(input, 'Kusama');
|
|
9197
9809
|
}
|
|
9810
|
+
if (input.destination === 'Ethereum') {
|
|
9811
|
+
return this.handleEthBridgeTransfer(input);
|
|
9812
|
+
}
|
|
9198
9813
|
var method = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
|
|
9199
9814
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
|
|
9200
9815
|
}
|
|
@@ -9222,7 +9837,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9222
9837
|
};
|
|
9223
9838
|
return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
|
|
9224
9839
|
} else {
|
|
9225
|
-
return
|
|
9840
|
+
return _superPropGet(AssetHubPolkadot, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9226
9841
|
}
|
|
9227
9842
|
}
|
|
9228
9843
|
}]);
|
|
@@ -9407,7 +10022,7 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9407
10022
|
};
|
|
9408
10023
|
return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
|
|
9409
10024
|
} else {
|
|
9410
|
-
return
|
|
10025
|
+
return _superPropGet(Darwinia, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9411
10026
|
}
|
|
9412
10027
|
}
|
|
9413
10028
|
}]);
|
|
@@ -9639,7 +10254,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9639
10254
|
if (scenario === 'ParaToPara') {
|
|
9640
10255
|
return {};
|
|
9641
10256
|
} else {
|
|
9642
|
-
return
|
|
10257
|
+
return _superPropGet(Collectives, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9643
10258
|
}
|
|
9644
10259
|
}
|
|
9645
10260
|
}]);
|
|
@@ -9687,7 +10302,6 @@ var getDestination = function getDestination(_ref) {
|
|
|
9687
10302
|
}
|
|
9688
10303
|
};
|
|
9689
10304
|
};
|
|
9690
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
9691
10305
|
var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
9692
10306
|
function XTransferTransferImpl() {
|
|
9693
10307
|
_classCallCheck(this, XTransferTransferImpl);
|
|
@@ -9774,7 +10388,7 @@ var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9774
10388
|
key: "transferPolkadotXCM",
|
|
9775
10389
|
value: function transferPolkadotXCM(input) {
|
|
9776
10390
|
if (input.scenario !== 'ParaToPara') {
|
|
9777
|
-
throw new ScenarioNotSupportedError(
|
|
10391
|
+
throw new ScenarioNotSupportedError(this.node, input.scenario);
|
|
9778
10392
|
}
|
|
9779
10393
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveTransferAssets');
|
|
9780
10394
|
}
|
|
@@ -9881,9 +10495,76 @@ var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9881
10495
|
}]);
|
|
9882
10496
|
}(ParachainNode);
|
|
9883
10497
|
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
10498
|
+
var Ethereum = /*#__PURE__*/function (_ParachainNode) {
|
|
10499
|
+
function Ethereum() {
|
|
10500
|
+
_classCallCheck(this, Ethereum);
|
|
10501
|
+
return _callSuper(this, Ethereum, ['Ethereum', 'ethereum', 'polkadot', Version.V3]);
|
|
10502
|
+
}
|
|
10503
|
+
_inherits(Ethereum, _ParachainNode);
|
|
10504
|
+
return _createClass(Ethereum);
|
|
10505
|
+
}(ParachainNode);
|
|
10506
|
+
|
|
10507
|
+
var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
10508
|
+
function Mythos() {
|
|
10509
|
+
_classCallCheck(this, Mythos);
|
|
10510
|
+
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', Version.V3]);
|
|
10511
|
+
}
|
|
10512
|
+
_inherits(Mythos, _ParachainNode);
|
|
10513
|
+
return _createClass(Mythos, [{
|
|
10514
|
+
key: "transferPolkadotXCM",
|
|
10515
|
+
value: function transferPolkadotXCM(input) {
|
|
10516
|
+
var scenario = input.scenario,
|
|
10517
|
+
currencySymbol = input.currencySymbol;
|
|
10518
|
+
if (scenario !== 'ParaToPara') {
|
|
10519
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
10520
|
+
}
|
|
10521
|
+
var nativeSymbol = getNativeAssetSymbol(this.node);
|
|
10522
|
+
if (currencySymbol !== nativeSymbol) {
|
|
10523
|
+
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currencySymbol));
|
|
10524
|
+
}
|
|
10525
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', 'Unlimited');
|
|
10526
|
+
}
|
|
10527
|
+
}, {
|
|
10528
|
+
key: "transferRelayToPara",
|
|
10529
|
+
value: function transferRelayToPara() {
|
|
10530
|
+
throw new NodeNotSupportedError();
|
|
10531
|
+
}
|
|
10532
|
+
}]);
|
|
10533
|
+
}(ParachainNode);
|
|
10534
|
+
|
|
10535
|
+
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
10536
|
+
function Peaq() {
|
|
10537
|
+
_classCallCheck(this, Peaq);
|
|
10538
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', Version.V2]);
|
|
10539
|
+
}
|
|
10540
|
+
_inherits(Peaq, _ParachainNode);
|
|
10541
|
+
return _createClass(Peaq, [{
|
|
10542
|
+
key: "transferXTokens",
|
|
10543
|
+
value: function transferXTokens(input) {
|
|
10544
|
+
var scenario = input.scenario,
|
|
10545
|
+
currencyID = input.currencyID;
|
|
10546
|
+
if (scenario !== 'ParaToPara') {
|
|
10547
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
10548
|
+
}
|
|
10549
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
10550
|
+
}
|
|
10551
|
+
}, {
|
|
10552
|
+
key: "transferRelayToPara",
|
|
10553
|
+
value: function transferRelayToPara() {
|
|
10554
|
+
throw new NodeNotSupportedError();
|
|
10555
|
+
}
|
|
10556
|
+
}, {
|
|
10557
|
+
key: "getProvider",
|
|
10558
|
+
value: function getProvider() {
|
|
10559
|
+
return 'wss://peaq.api.onfinality.io/public-ws';
|
|
10560
|
+
}
|
|
10561
|
+
}]);
|
|
10562
|
+
}(ParachainNode);
|
|
10563
|
+
|
|
10564
|
+
var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Litmus', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'Robonomics', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq'];
|
|
10565
|
+
var NODE_NAMES = [].concat(NODE_NAMES_DOT_KSM, ['Ethereum']);
|
|
10566
|
+
var NODES_WITH_RELAY_CHAINS = [].concat(_toConsumableArray(NODE_NAMES), ['Polkadot', 'Kusama']);
|
|
10567
|
+
var NODES_WITH_RELAY_CHAINS_DOT_KSM = [].concat(NODE_NAMES_DOT_KSM, ['Polkadot', 'Kusama']);
|
|
9887
10568
|
var nodes = {
|
|
9888
10569
|
AssetHubPolkadot: new AssetHubPolkadot(),
|
|
9889
10570
|
Acala: new Acala(),
|
|
@@ -9938,7 +10619,10 @@ var nodes = {
|
|
|
9938
10619
|
Phala: new Phala(),
|
|
9939
10620
|
Subsocial: new Subsocial(),
|
|
9940
10621
|
KiltSpiritnet: new KiltSpiritnet(),
|
|
9941
|
-
Curio: new Curio()
|
|
10622
|
+
Curio: new Curio(),
|
|
10623
|
+
Ethereum: new Ethereum(),
|
|
10624
|
+
Mythos: new Mythos(),
|
|
10625
|
+
Peaq: new Peaq()
|
|
9942
10626
|
};
|
|
9943
10627
|
var SUPPORTED_PALLETS = ['XTokens', 'OrmlXTokens', 'PolkadotXcm', 'RelayerXcm', 'XTransfer'];
|
|
9944
10628
|
|
|
@@ -10080,7 +10764,7 @@ var getAllNodeProviders = function getAllNodeProviders(node) {
|
|
|
10080
10764
|
var _a;
|
|
10081
10765
|
var _ref9 = (_a = getNodeEndpointOption(node)) !== null && _a !== void 0 ? _a : {},
|
|
10082
10766
|
providers = _ref9.providers;
|
|
10083
|
-
if (providers.length < 1) {
|
|
10767
|
+
if (providers && Object.values(providers).length < 1) {
|
|
10084
10768
|
throw new Error("Node ".concat(node, " does not have any providers."));
|
|
10085
10769
|
}
|
|
10086
10770
|
return Object.values(providers !== null && providers !== void 0 ? providers : []);
|
|
@@ -10139,7 +10823,8 @@ var createApiInstanceForNode = function createApiInstanceForNode(node) {
|
|
|
10139
10823
|
var lowercaseFirstLetter = function lowercaseFirstLetter(str) {
|
|
10140
10824
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
10141
10825
|
};
|
|
10142
|
-
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10
|
|
10826
|
+
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
10827
|
+
) {
|
|
10143
10828
|
var _api$tx$module;
|
|
10144
10829
|
var module = _ref10.module,
|
|
10145
10830
|
section = _ref10.section,
|
|
@@ -10428,7 +11113,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10428
11113
|
break;
|
|
10429
11114
|
}
|
|
10430
11115
|
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
10431
|
-
_context.next =
|
|
11116
|
+
_context.next = 59;
|
|
10432
11117
|
break;
|
|
10433
11118
|
case 45:
|
|
10434
11119
|
if (!(_typeof(address) === 'object')) {
|
|
@@ -10436,7 +11121,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10436
11121
|
break;
|
|
10437
11122
|
}
|
|
10438
11123
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
10439
|
-
_context.next =
|
|
11124
|
+
_context.next = 59;
|
|
10440
11125
|
break;
|
|
10441
11126
|
case 49:
|
|
10442
11127
|
if (!(_typeof(destination) === 'object')) {
|
|
@@ -10444,10 +11129,18 @@ var sendCommon = function sendCommon(options) {
|
|
|
10444
11129
|
break;
|
|
10445
11130
|
}
|
|
10446
11131
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
10447
|
-
_context.next =
|
|
11132
|
+
_context.next = 59;
|
|
10448
11133
|
break;
|
|
10449
11134
|
case 53:
|
|
10450
|
-
|
|
11135
|
+
if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
|
|
11136
|
+
_context.next = 57;
|
|
11137
|
+
break;
|
|
11138
|
+
}
|
|
11139
|
+
console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
|
|
11140
|
+
_context.next = 59;
|
|
11141
|
+
break;
|
|
11142
|
+
case 57:
|
|
11143
|
+
_context.next = 59;
|
|
10451
11144
|
return checkKeepAlive({
|
|
10452
11145
|
originApi: apiWithFallback,
|
|
10453
11146
|
address: address,
|
|
@@ -10457,7 +11150,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10457
11150
|
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : currency.toString(),
|
|
10458
11151
|
destNode: destination
|
|
10459
11152
|
});
|
|
10460
|
-
case
|
|
11153
|
+
case 59:
|
|
10461
11154
|
currencyStr = isTMulti(currency) ? undefined : currency.toString();
|
|
10462
11155
|
currencyId = assetCheckEnabled ? asset === null || asset === void 0 ? void 0 : asset.assetId : currencyStr;
|
|
10463
11156
|
return _context.abrupt("return", originNode.transfer({
|
|
@@ -10473,7 +11166,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10473
11166
|
version: version,
|
|
10474
11167
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
10475
11168
|
}));
|
|
10476
|
-
case
|
|
11169
|
+
case 62:
|
|
10477
11170
|
case "end":
|
|
10478
11171
|
return _context.stop();
|
|
10479
11172
|
}
|
|
@@ -10549,7 +11242,7 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10549
11242
|
break;
|
|
10550
11243
|
}
|
|
10551
11244
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
10552
|
-
_context4.next =
|
|
11245
|
+
_context4.next = 28;
|
|
10553
11246
|
break;
|
|
10554
11247
|
case 18:
|
|
10555
11248
|
if (!isAddressMultiLocation) {
|
|
@@ -10557,10 +11250,18 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10557
11250
|
break;
|
|
10558
11251
|
}
|
|
10559
11252
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
10560
|
-
_context4.next =
|
|
11253
|
+
_context4.next = 28;
|
|
10561
11254
|
break;
|
|
10562
11255
|
case 22:
|
|
10563
|
-
|
|
11256
|
+
if (!(destination === 'Ethereum')) {
|
|
11257
|
+
_context4.next = 26;
|
|
11258
|
+
break;
|
|
11259
|
+
}
|
|
11260
|
+
console.warn('Keep alive check is not supported when using Ethereum as destination.');
|
|
11261
|
+
_context4.next = 28;
|
|
11262
|
+
break;
|
|
11263
|
+
case 26:
|
|
11264
|
+
_context4.next = 28;
|
|
10564
11265
|
return checkKeepAlive({
|
|
10565
11266
|
originApi: apiWithFallback,
|
|
10566
11267
|
address: address,
|
|
@@ -10569,7 +11270,7 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10569
11270
|
currencySymbol: getRelayChainSymbol(destination),
|
|
10570
11271
|
destNode: destination
|
|
10571
11272
|
});
|
|
10572
|
-
case
|
|
11273
|
+
case 28:
|
|
10573
11274
|
serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(destination) : destination).transferRelayToPara({
|
|
10574
11275
|
api: apiWithFallback,
|
|
10575
11276
|
destination: destination,
|
|
@@ -10580,13 +11281,13 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10580
11281
|
version: version
|
|
10581
11282
|
});
|
|
10582
11283
|
if (!serializedApiCallEnabled) {
|
|
10583
|
-
_context4.next =
|
|
11284
|
+
_context4.next = 31;
|
|
10584
11285
|
break;
|
|
10585
11286
|
}
|
|
10586
11287
|
return _context4.abrupt("return", serializedApiCall);
|
|
10587
|
-
case
|
|
11288
|
+
case 31:
|
|
10588
11289
|
return _context4.abrupt("return", callPolkadotJsTxFunction(apiWithFallback, serializedApiCall));
|
|
10589
|
-
case
|
|
11290
|
+
case 32:
|
|
10590
11291
|
case "end":
|
|
10591
11292
|
return _context4.stop();
|
|
10592
11293
|
}
|
|
@@ -10637,4 +11338,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
10637
11338
|
transferRelayToParaSerializedApiCall: transferRelayToParaSerializedApiCall
|
|
10638
11339
|
});
|
|
10639
11340
|
|
|
10640
|
-
export { Builder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, index$3 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, index as xcmPallet };
|
|
11341
|
+
export { Builder, CloseChannelBuilder, EvmBuilder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, OpenChannelBuilder, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, index$3 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, index as xcmPallet };
|