@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.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var api = require('@polkadot/api');
|
|
3
|
+
var api$1 = require('@polkadot/api');
|
|
4
4
|
var ethers = require('ethers');
|
|
5
5
|
var endpoints = require('@polkadot/apps-config/endpoints');
|
|
6
6
|
var types = require('@polkadot/types');
|
|
7
7
|
var util = require('@polkadot/util');
|
|
8
|
+
var api = require('@snowbridge/api');
|
|
8
9
|
|
|
9
10
|
function _arrayLikeToArray(r, a) {
|
|
10
11
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -48,7 +49,7 @@ function _createClass(e, r, t) {
|
|
|
48
49
|
function _createForOfIteratorHelper(r, e) {
|
|
49
50
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
50
51
|
if (!t) {
|
|
51
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e
|
|
52
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
52
53
|
t && (r = t);
|
|
53
54
|
var n = 0,
|
|
54
55
|
F = function () {};
|
|
@@ -493,6 +494,12 @@ function _superPropBase(t, o) {
|
|
|
493
494
|
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
|
494
495
|
return t;
|
|
495
496
|
}
|
|
497
|
+
function _superPropGet(t, e, r, o) {
|
|
498
|
+
var p = _get(_getPrototypeOf(t.prototype ), e, r);
|
|
499
|
+
return function (t) {
|
|
500
|
+
return p.apply(r, t);
|
|
501
|
+
} ;
|
|
502
|
+
}
|
|
496
503
|
function _toConsumableArray(r) {
|
|
497
504
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
498
505
|
}
|
|
@@ -1234,7 +1241,7 @@ var Centrifuge$3 = {
|
|
|
1234
1241
|
},
|
|
1235
1242
|
{
|
|
1236
1243
|
assetId: "1655476167",
|
|
1237
|
-
symbol: "
|
|
1244
|
+
symbol: "DYF1",
|
|
1238
1245
|
decimals: 6
|
|
1239
1246
|
},
|
|
1240
1247
|
{
|
|
@@ -1504,6 +1511,11 @@ var Hydration$3 = {
|
|
|
1504
1511
|
symbol: "RING",
|
|
1505
1512
|
decimals: 18
|
|
1506
1513
|
},
|
|
1514
|
+
{
|
|
1515
|
+
assetId: "33",
|
|
1516
|
+
symbol: "vASTR",
|
|
1517
|
+
decimals: 18
|
|
1518
|
+
},
|
|
1507
1519
|
{
|
|
1508
1520
|
assetId: "15",
|
|
1509
1521
|
symbol: "vDOT",
|
|
@@ -1559,6 +1571,11 @@ var Hydration$3 = {
|
|
|
1559
1571
|
symbol: "NODL",
|
|
1560
1572
|
decimals: 11
|
|
1561
1573
|
},
|
|
1574
|
+
{
|
|
1575
|
+
assetId: "1000190",
|
|
1576
|
+
symbol: "WBTC",
|
|
1577
|
+
decimals: 8
|
|
1578
|
+
},
|
|
1562
1579
|
{
|
|
1563
1580
|
assetId: "22",
|
|
1564
1581
|
symbol: "USDC",
|
|
@@ -1618,6 +1635,11 @@ var Hydration$3 = {
|
|
|
1618
1635
|
assetId: "9",
|
|
1619
1636
|
symbol: "ASTR",
|
|
1620
1637
|
decimals: 18
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
assetId: "1000189",
|
|
1641
|
+
symbol: "WETH",
|
|
1642
|
+
decimals: 18
|
|
1621
1643
|
}
|
|
1622
1644
|
]
|
|
1623
1645
|
};
|
|
@@ -1868,6 +1890,11 @@ var Moonbeam$3 = {
|
|
|
1868
1890
|
symbol: "vGLMR",
|
|
1869
1891
|
decimals: 18
|
|
1870
1892
|
},
|
|
1893
|
+
{
|
|
1894
|
+
assetId: "184218609779515850660274730699350567246",
|
|
1895
|
+
symbol: "NCTR",
|
|
1896
|
+
decimals: 18
|
|
1897
|
+
},
|
|
1871
1898
|
{
|
|
1872
1899
|
assetId: "289989900872525819559124583375550296953",
|
|
1873
1900
|
symbol: "vMANTA",
|
|
@@ -2219,6 +2246,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2219
2246
|
symbol: "GABE",
|
|
2220
2247
|
decimals: 20
|
|
2221
2248
|
},
|
|
2249
|
+
{
|
|
2250
|
+
assetId: "47",
|
|
2251
|
+
symbol: "TeMe6Pump",
|
|
2252
|
+
decimals: 12
|
|
2253
|
+
},
|
|
2222
2254
|
{
|
|
2223
2255
|
assetId: "50",
|
|
2224
2256
|
symbol: "CATWIF",
|
|
@@ -2249,11 +2281,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2249
2281
|
symbol: "NFLR",
|
|
2250
2282
|
decimals: 10
|
|
2251
2283
|
},
|
|
2284
|
+
{
|
|
2285
|
+
assetId: "20090110",
|
|
2286
|
+
symbol: "test1",
|
|
2287
|
+
decimals: 10
|
|
2288
|
+
},
|
|
2252
2289
|
{
|
|
2253
2290
|
assetId: "256",
|
|
2254
2291
|
symbol: "ICE",
|
|
2255
2292
|
decimals: 20
|
|
2256
2293
|
},
|
|
2294
|
+
{
|
|
2295
|
+
assetId: "20090130",
|
|
2296
|
+
symbol: "SUS",
|
|
2297
|
+
decimals: 10
|
|
2298
|
+
},
|
|
2257
2299
|
{
|
|
2258
2300
|
assetId: "1111",
|
|
2259
2301
|
symbol: "TESTV2",
|
|
@@ -2274,6 +2316,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2274
2316
|
symbol: "EFI",
|
|
2275
2317
|
decimals: 18
|
|
2276
2318
|
},
|
|
2319
|
+
{
|
|
2320
|
+
assetId: "48",
|
|
2321
|
+
symbol: "SAX",
|
|
2322
|
+
decimals: 2
|
|
2323
|
+
},
|
|
2277
2324
|
{
|
|
2278
2325
|
assetId: "21",
|
|
2279
2326
|
symbol: "WBTC",
|
|
@@ -2289,6 +2336,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2289
2336
|
symbol: "BULL",
|
|
2290
2337
|
decimals: 6
|
|
2291
2338
|
},
|
|
2339
|
+
{
|
|
2340
|
+
assetId: "20090109",
|
|
2341
|
+
symbol: "MATIC",
|
|
2342
|
+
decimals: 10
|
|
2343
|
+
},
|
|
2292
2344
|
{
|
|
2293
2345
|
assetId: "67",
|
|
2294
2346
|
symbol: "LINK",
|
|
@@ -2314,6 +2366,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2314
2366
|
symbol: "PEPE",
|
|
2315
2367
|
decimals: 6
|
|
2316
2368
|
},
|
|
2369
|
+
{
|
|
2370
|
+
assetId: "10101",
|
|
2371
|
+
symbol: "COKE",
|
|
2372
|
+
decimals: 10
|
|
2373
|
+
},
|
|
2317
2374
|
{
|
|
2318
2375
|
assetId: "101",
|
|
2319
2376
|
symbol: "DOTMA",
|
|
@@ -2329,16 +2386,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2329
2386
|
symbol: "PEPE",
|
|
2330
2387
|
decimals: 10
|
|
2331
2388
|
},
|
|
2389
|
+
{
|
|
2390
|
+
assetId: "20090133",
|
|
2391
|
+
symbol: "BSOD",
|
|
2392
|
+
decimals: 10
|
|
2393
|
+
},
|
|
2332
2394
|
{
|
|
2333
2395
|
assetId: "99",
|
|
2334
2396
|
symbol: "Cypress",
|
|
2335
2397
|
decimals: 0
|
|
2336
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
assetId: "34",
|
|
2401
|
+
symbol: "MeTest",
|
|
2402
|
+
decimals: 12
|
|
2403
|
+
},
|
|
2337
2404
|
{
|
|
2338
2405
|
assetId: "7777",
|
|
2339
2406
|
symbol: "FUM",
|
|
2340
2407
|
decimals: 10
|
|
2341
2408
|
},
|
|
2409
|
+
{
|
|
2410
|
+
assetId: "20090114",
|
|
2411
|
+
symbol: "DOI",
|
|
2412
|
+
decimals: 10
|
|
2413
|
+
},
|
|
2342
2414
|
{
|
|
2343
2415
|
assetId: "16",
|
|
2344
2416
|
symbol: "COLA",
|
|
@@ -2349,16 +2421,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2349
2421
|
symbol: "web3",
|
|
2350
2422
|
decimals: 18
|
|
2351
2423
|
},
|
|
2424
|
+
{
|
|
2425
|
+
assetId: "20090111",
|
|
2426
|
+
symbol: "txt",
|
|
2427
|
+
decimals: 10
|
|
2428
|
+
},
|
|
2352
2429
|
{
|
|
2353
2430
|
assetId: "30035",
|
|
2354
2431
|
symbol: "DED",
|
|
2355
2432
|
decimals: 18
|
|
2356
2433
|
},
|
|
2434
|
+
{
|
|
2435
|
+
assetId: "20090119",
|
|
2436
|
+
symbol: "MDGA",
|
|
2437
|
+
decimals: 10
|
|
2438
|
+
},
|
|
2357
2439
|
{
|
|
2358
2440
|
assetId: "111",
|
|
2359
2441
|
symbol: "DEMO",
|
|
2360
2442
|
decimals: 6
|
|
2361
2443
|
},
|
|
2444
|
+
{
|
|
2445
|
+
assetId: "20090121",
|
|
2446
|
+
symbol: "IBW",
|
|
2447
|
+
decimals: 10
|
|
2448
|
+
},
|
|
2362
2449
|
{
|
|
2363
2450
|
assetId: "122",
|
|
2364
2451
|
symbol: "TESTING",
|
|
@@ -2409,6 +2496,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2409
2496
|
symbol: "STINK",
|
|
2410
2497
|
decimals: 10
|
|
2411
2498
|
},
|
|
2499
|
+
{
|
|
2500
|
+
assetId: "20090117",
|
|
2501
|
+
symbol: "DEDX",
|
|
2502
|
+
decimals: 10
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
assetId: "20090112",
|
|
2506
|
+
symbol: "SOLETH",
|
|
2507
|
+
decimals: 10
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
assetId: "20090131",
|
|
2511
|
+
symbol: "DVCAT",
|
|
2512
|
+
decimals: 10
|
|
2513
|
+
},
|
|
2412
2514
|
{
|
|
2413
2515
|
assetId: "1107",
|
|
2414
2516
|
symbol: "JAM",
|
|
@@ -2454,16 +2556,31 @@ var AssetHubPolkadot$3 = {
|
|
|
2454
2556
|
symbol: "COCOA",
|
|
2455
2557
|
decimals: 10
|
|
2456
2558
|
},
|
|
2559
|
+
{
|
|
2560
|
+
assetId: "20090115",
|
|
2561
|
+
symbol: "DOTCOIN",
|
|
2562
|
+
decimals: 10
|
|
2563
|
+
},
|
|
2457
2564
|
{
|
|
2458
2565
|
assetId: "301",
|
|
2459
2566
|
symbol: "HORN",
|
|
2460
2567
|
decimals: 6
|
|
2461
2568
|
},
|
|
2569
|
+
{
|
|
2570
|
+
assetId: "20090122",
|
|
2571
|
+
symbol: "0xf09fa590",
|
|
2572
|
+
decimals: 10
|
|
2573
|
+
},
|
|
2462
2574
|
{
|
|
2463
2575
|
assetId: "2020",
|
|
2464
2576
|
symbol: "HYDRA",
|
|
2465
2577
|
decimals: 10
|
|
2466
2578
|
},
|
|
2579
|
+
{
|
|
2580
|
+
assetId: "41",
|
|
2581
|
+
symbol: "TeMe4",
|
|
2582
|
+
decimals: 12
|
|
2583
|
+
},
|
|
2467
2584
|
{
|
|
2468
2585
|
assetId: "5318008",
|
|
2469
2586
|
symbol: "PXPS",
|
|
@@ -2499,6 +2616,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2499
2616
|
symbol: "COCA",
|
|
2500
2617
|
decimals: 6
|
|
2501
2618
|
},
|
|
2619
|
+
{
|
|
2620
|
+
assetId: "20090128",
|
|
2621
|
+
symbol: "DSTINK",
|
|
2622
|
+
decimals: 10
|
|
2623
|
+
},
|
|
2502
2624
|
{
|
|
2503
2625
|
assetId: "61",
|
|
2504
2626
|
symbol: "SUN",
|
|
@@ -2519,6 +2641,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2519
2641
|
symbol: "DBX",
|
|
2520
2642
|
decimals: 6
|
|
2521
2643
|
},
|
|
2644
|
+
{
|
|
2645
|
+
assetId: "20090106",
|
|
2646
|
+
symbol: "PMATIC",
|
|
2647
|
+
decimals: 10
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
assetId: "20090116",
|
|
2651
|
+
symbol: "POO",
|
|
2652
|
+
decimals: 10
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
assetId: "20090129",
|
|
2656
|
+
symbol: "FCD",
|
|
2657
|
+
decimals: 10
|
|
2658
|
+
},
|
|
2522
2659
|
{
|
|
2523
2660
|
assetId: "678",
|
|
2524
2661
|
symbol: "SATS",
|
|
@@ -2549,6 +2686,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2549
2686
|
symbol: "STAR",
|
|
2550
2687
|
decimals: 6
|
|
2551
2688
|
},
|
|
2689
|
+
{
|
|
2690
|
+
assetId: "49",
|
|
2691
|
+
symbol: "TeMe7",
|
|
2692
|
+
decimals: 12
|
|
2693
|
+
},
|
|
2552
2694
|
{
|
|
2553
2695
|
assetId: "868367",
|
|
2554
2696
|
symbol: "VSC",
|
|
@@ -2579,6 +2721,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2579
2721
|
symbol: "PJS",
|
|
2580
2722
|
decimals: 18
|
|
2581
2723
|
},
|
|
2724
|
+
{
|
|
2725
|
+
assetId: "43",
|
|
2726
|
+
symbol: "TeMe5",
|
|
2727
|
+
decimals: 12
|
|
2728
|
+
},
|
|
2729
|
+
{
|
|
2730
|
+
assetId: "7777777",
|
|
2731
|
+
symbol: "DWH",
|
|
2732
|
+
decimals: 10
|
|
2733
|
+
},
|
|
2582
2734
|
{
|
|
2583
2735
|
assetId: "2001",
|
|
2584
2736
|
symbol: "DOTA",
|
|
@@ -2619,11 +2771,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2619
2771
|
symbol: "USDt",
|
|
2620
2772
|
decimals: 6
|
|
2621
2773
|
},
|
|
2774
|
+
{
|
|
2775
|
+
assetId: "20090104",
|
|
2776
|
+
symbol: "DOTC",
|
|
2777
|
+
decimals: 10
|
|
2778
|
+
},
|
|
2622
2779
|
{
|
|
2623
2780
|
assetId: "20090103",
|
|
2624
2781
|
symbol: "BTC",
|
|
2625
2782
|
decimals: 20
|
|
2626
2783
|
},
|
|
2784
|
+
{
|
|
2785
|
+
assetId: "20090118",
|
|
2786
|
+
symbol: "NOTDED",
|
|
2787
|
+
decimals: 10
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
assetId: "20090124",
|
|
2791
|
+
symbol: "test1",
|
|
2792
|
+
decimals: 10
|
|
2793
|
+
},
|
|
2627
2794
|
{
|
|
2628
2795
|
assetId: "690",
|
|
2629
2796
|
symbol: "BORK",
|
|
@@ -2659,6 +2826,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2659
2826
|
symbol: "777",
|
|
2660
2827
|
decimals: 20
|
|
2661
2828
|
},
|
|
2829
|
+
{
|
|
2830
|
+
assetId: "86",
|
|
2831
|
+
symbol: "KOL",
|
|
2832
|
+
decimals: 12
|
|
2833
|
+
},
|
|
2834
|
+
{
|
|
2835
|
+
assetId: "20090113",
|
|
2836
|
+
symbol: "test1",
|
|
2837
|
+
decimals: 10
|
|
2838
|
+
},
|
|
2662
2839
|
{
|
|
2663
2840
|
assetId: "567",
|
|
2664
2841
|
symbol: "ANT",
|
|
@@ -2684,11 +2861,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2684
2861
|
symbol: "GGI",
|
|
2685
2862
|
decimals: 6
|
|
2686
2863
|
},
|
|
2864
|
+
{
|
|
2865
|
+
assetId: "20090120",
|
|
2866
|
+
symbol: "LUNCH",
|
|
2867
|
+
decimals: 10
|
|
2868
|
+
},
|
|
2687
2869
|
{
|
|
2688
2870
|
assetId: "24",
|
|
2689
2871
|
symbol: "PRDOG",
|
|
2690
2872
|
decimals: 10
|
|
2691
2873
|
},
|
|
2874
|
+
{
|
|
2875
|
+
assetId: "20090123",
|
|
2876
|
+
symbol: "GOVD",
|
|
2877
|
+
decimals: 10
|
|
2878
|
+
},
|
|
2692
2879
|
{
|
|
2693
2880
|
assetId: "2023",
|
|
2694
2881
|
symbol: "dot",
|
|
@@ -2729,11 +2916,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2729
2916
|
symbol: "HOOT",
|
|
2730
2917
|
decimals: 6
|
|
2731
2918
|
},
|
|
2919
|
+
{
|
|
2920
|
+
assetId: "20090125",
|
|
2921
|
+
symbol: "PP",
|
|
2922
|
+
decimals: 10
|
|
2923
|
+
},
|
|
2732
2924
|
{
|
|
2733
2925
|
assetId: "51",
|
|
2734
2926
|
symbol: "JAMA",
|
|
2735
2927
|
decimals: 6
|
|
2736
2928
|
},
|
|
2929
|
+
{
|
|
2930
|
+
assetId: "20090135",
|
|
2931
|
+
symbol: "DMX",
|
|
2932
|
+
decimals: 10
|
|
2933
|
+
},
|
|
2737
2934
|
{
|
|
2738
2935
|
assetId: "1234",
|
|
2739
2936
|
symbol: "BUNS",
|
|
@@ -2744,6 +2941,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2744
2941
|
symbol: "clay",
|
|
2745
2942
|
decimals: 20
|
|
2746
2943
|
},
|
|
2944
|
+
{
|
|
2945
|
+
assetId: "20090134",
|
|
2946
|
+
symbol: "DOTCOIN",
|
|
2947
|
+
decimals: 10
|
|
2948
|
+
},
|
|
2747
2949
|
{
|
|
2748
2950
|
assetId: "1000",
|
|
2749
2951
|
symbol: "BRZ",
|
|
@@ -2759,6 +2961,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2759
2961
|
symbol: "ANT",
|
|
2760
2962
|
decimals: 6
|
|
2761
2963
|
},
|
|
2964
|
+
{
|
|
2965
|
+
assetId: "20090126",
|
|
2966
|
+
symbol: "DOGMOON",
|
|
2967
|
+
decimals: 10
|
|
2968
|
+
},
|
|
2762
2969
|
{
|
|
2763
2970
|
assetId: "1992",
|
|
2764
2971
|
symbol: "SITE",
|
|
@@ -2784,6 +2991,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2784
2991
|
symbol: "no1",
|
|
2785
2992
|
decimals: 20
|
|
2786
2993
|
},
|
|
2994
|
+
{
|
|
2995
|
+
assetId: "20090132",
|
|
2996
|
+
symbol: "Beggar",
|
|
2997
|
+
decimals: 10
|
|
2998
|
+
},
|
|
2787
2999
|
{
|
|
2788
3000
|
assetId: "12",
|
|
2789
3001
|
symbol: "USDcp",
|
|
@@ -2794,6 +3006,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2794
3006
|
symbol: "WUD",
|
|
2795
3007
|
decimals: 10
|
|
2796
3008
|
},
|
|
3009
|
+
{
|
|
3010
|
+
assetId: "97",
|
|
3011
|
+
symbol: "TeMe3",
|
|
3012
|
+
decimals: 12
|
|
3013
|
+
},
|
|
3014
|
+
{
|
|
3015
|
+
assetId: "12345",
|
|
3016
|
+
symbol: "usdc",
|
|
3017
|
+
decimals: 10
|
|
3018
|
+
},
|
|
2797
3019
|
{
|
|
2798
3020
|
assetId: "2000",
|
|
2799
3021
|
symbol: "DAO",
|
|
@@ -2854,6 +3076,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2854
3076
|
symbol: "T54",
|
|
2855
3077
|
decimals: 10
|
|
2856
3078
|
},
|
|
3079
|
+
{
|
|
3080
|
+
assetId: "20090108",
|
|
3081
|
+
symbol: "MMM",
|
|
3082
|
+
decimals: 10
|
|
3083
|
+
},
|
|
2857
3084
|
{
|
|
2858
3085
|
assetId: "69",
|
|
2859
3086
|
symbol: "DAL",
|
|
@@ -2864,6 +3091,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2864
3091
|
symbol: "PINK",
|
|
2865
3092
|
decimals: 10
|
|
2866
3093
|
},
|
|
3094
|
+
{
|
|
3095
|
+
assetId: "20090105",
|
|
3096
|
+
symbol: "ETH",
|
|
3097
|
+
decimals: 10
|
|
3098
|
+
},
|
|
2867
3099
|
{
|
|
2868
3100
|
assetId: "37",
|
|
2869
3101
|
symbol: "DODA",
|
|
@@ -2879,6 +3111,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2879
3111
|
symbol: "BOMB",
|
|
2880
3112
|
decimals: 10
|
|
2881
3113
|
},
|
|
3114
|
+
{
|
|
3115
|
+
assetId: "7151",
|
|
3116
|
+
symbol: "TUKI",
|
|
3117
|
+
decimals: 8
|
|
3118
|
+
},
|
|
2882
3119
|
{
|
|
2883
3120
|
assetId: "149",
|
|
2884
3121
|
symbol: "EDU",
|
|
@@ -2904,6 +3141,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2904
3141
|
symbol: "WOOP",
|
|
2905
3142
|
decimals: 12
|
|
2906
3143
|
},
|
|
3144
|
+
{
|
|
3145
|
+
assetId: "20090107",
|
|
3146
|
+
symbol: "ETH",
|
|
3147
|
+
decimals: 10
|
|
3148
|
+
},
|
|
2907
3149
|
{
|
|
2908
3150
|
assetId: "4157",
|
|
2909
3151
|
symbol: "PDOG",
|
|
@@ -2934,10 +3176,25 @@ var AssetHubPolkadot$3 = {
|
|
|
2934
3176
|
symbol: "WOOD",
|
|
2935
3177
|
decimals: 10
|
|
2936
3178
|
},
|
|
3179
|
+
{
|
|
3180
|
+
assetId: "20090127",
|
|
3181
|
+
symbol: "PAMPIT",
|
|
3182
|
+
decimals: 10
|
|
3183
|
+
},
|
|
2937
3184
|
{
|
|
2938
3185
|
assetId: "2230",
|
|
2939
3186
|
symbol: "GBILL",
|
|
2940
3187
|
decimals: 8
|
|
3188
|
+
},
|
|
3189
|
+
{
|
|
3190
|
+
assetId: "92",
|
|
3191
|
+
symbol: "TeMe2",
|
|
3192
|
+
decimals: 12
|
|
3193
|
+
},
|
|
3194
|
+
{
|
|
3195
|
+
assetId: "2203",
|
|
3196
|
+
symbol: "PBTC",
|
|
3197
|
+
decimals: 10
|
|
2941
3198
|
}
|
|
2942
3199
|
]
|
|
2943
3200
|
};
|
|
@@ -5829,15 +6086,18 @@ var Polkadex$3 = {
|
|
|
5829
6086
|
symbol: "DOT",
|
|
5830
6087
|
decimals: 12
|
|
5831
6088
|
},
|
|
6089
|
+
{
|
|
6090
|
+
assetId: "119367686984583275840673742485354142551",
|
|
6091
|
+
symbol: "DED",
|
|
6092
|
+
decimals: 12
|
|
6093
|
+
},
|
|
5832
6094
|
{
|
|
5833
6095
|
assetId: "339306133874233608313826294843504252047",
|
|
5834
6096
|
symbol: "PINK",
|
|
5835
6097
|
decimals: 12
|
|
5836
6098
|
},
|
|
5837
6099
|
{
|
|
5838
|
-
assetId: "
|
|
5839
|
-
symbol: "DED",
|
|
5840
|
-
decimals: 12
|
|
6100
|
+
assetId: "313524628741076911470961827389955394913"
|
|
5841
6101
|
},
|
|
5842
6102
|
{
|
|
5843
6103
|
assetId: "3496813586714279103986568049643838918",
|
|
@@ -6013,6 +6273,47 @@ var Phala$3 = {
|
|
|
6013
6273
|
}
|
|
6014
6274
|
]
|
|
6015
6275
|
};
|
|
6276
|
+
var Ethereum$1 = {
|
|
6277
|
+
paraId: 1,
|
|
6278
|
+
relayChainAssetSymbol: "DOT",
|
|
6279
|
+
nativeAssetSymbol: "ETH",
|
|
6280
|
+
nativeAssets: [
|
|
6281
|
+
{
|
|
6282
|
+
symbol: "ETH",
|
|
6283
|
+
decimals: 18
|
|
6284
|
+
}
|
|
6285
|
+
],
|
|
6286
|
+
otherAssets: [
|
|
6287
|
+
{
|
|
6288
|
+
symbol: "WETH",
|
|
6289
|
+
assetId: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
|
|
6290
|
+
},
|
|
6291
|
+
{
|
|
6292
|
+
symbol: "WBTC",
|
|
6293
|
+
assetId: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
|
|
6294
|
+
},
|
|
6295
|
+
{
|
|
6296
|
+
symbol: "SHIB",
|
|
6297
|
+
assetId: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
|
|
6298
|
+
},
|
|
6299
|
+
{
|
|
6300
|
+
symbol: "PEPE",
|
|
6301
|
+
assetId: "0x6982508145454Ce325dDbE47a25d4ec3d2311933"
|
|
6302
|
+
},
|
|
6303
|
+
{
|
|
6304
|
+
symbol: "TON",
|
|
6305
|
+
assetId: "0x582d872A1B094FC48F5DE31D3B73F2D9bE47def1"
|
|
6306
|
+
},
|
|
6307
|
+
{
|
|
6308
|
+
symbol: "wstETH",
|
|
6309
|
+
assetId: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
6310
|
+
},
|
|
6311
|
+
{
|
|
6312
|
+
symbol: "tBTC",
|
|
6313
|
+
assetId: "0x18084fbA666a33d37592fA2633fD49a74DD93a88"
|
|
6314
|
+
}
|
|
6315
|
+
]
|
|
6316
|
+
};
|
|
6016
6317
|
var Khala$3 = {
|
|
6017
6318
|
paraId: 2004,
|
|
6018
6319
|
relayChainAssetSymbol: "KSM",
|
|
@@ -6111,6 +6412,67 @@ var Khala$3 = {
|
|
|
6111
6412
|
}
|
|
6112
6413
|
]
|
|
6113
6414
|
};
|
|
6415
|
+
var Mythos$3 = {
|
|
6416
|
+
paraId: 3369,
|
|
6417
|
+
relayChainAssetSymbol: "DOT",
|
|
6418
|
+
nativeAssetSymbol: "MYTH",
|
|
6419
|
+
nativeAssets: [
|
|
6420
|
+
{
|
|
6421
|
+
symbol: "MYTH",
|
|
6422
|
+
decimals: 18
|
|
6423
|
+
}
|
|
6424
|
+
],
|
|
6425
|
+
otherAssets: [
|
|
6426
|
+
]
|
|
6427
|
+
};
|
|
6428
|
+
var Peaq$3 = {
|
|
6429
|
+
paraId: 3338,
|
|
6430
|
+
relayChainAssetSymbol: "DOT",
|
|
6431
|
+
nativeAssetSymbol: "PEAQ",
|
|
6432
|
+
nativeAssets: [
|
|
6433
|
+
{
|
|
6434
|
+
symbol: "PEAQ",
|
|
6435
|
+
decimals: 18
|
|
6436
|
+
}
|
|
6437
|
+
],
|
|
6438
|
+
otherAssets: [
|
|
6439
|
+
{
|
|
6440
|
+
assetId: "1005",
|
|
6441
|
+
symbol: "USDT.wh",
|
|
6442
|
+
decimals: 6
|
|
6443
|
+
},
|
|
6444
|
+
{
|
|
6445
|
+
assetId: "1004",
|
|
6446
|
+
symbol: "DAI.wh",
|
|
6447
|
+
decimals: 18
|
|
6448
|
+
},
|
|
6449
|
+
{
|
|
6450
|
+
assetId: "1000",
|
|
6451
|
+
symbol: "GLMR",
|
|
6452
|
+
decimals: 18
|
|
6453
|
+
},
|
|
6454
|
+
{
|
|
6455
|
+
assetId: "1002",
|
|
6456
|
+
symbol: "WETH.wh",
|
|
6457
|
+
decimals: 18
|
|
6458
|
+
},
|
|
6459
|
+
{
|
|
6460
|
+
assetId: "1",
|
|
6461
|
+
symbol: "DOT",
|
|
6462
|
+
decimals: 10
|
|
6463
|
+
},
|
|
6464
|
+
{
|
|
6465
|
+
assetId: "1001",
|
|
6466
|
+
symbol: "USDC.wh",
|
|
6467
|
+
decimals: 6
|
|
6468
|
+
},
|
|
6469
|
+
{
|
|
6470
|
+
assetId: "1003",
|
|
6471
|
+
symbol: "WBTC.wh",
|
|
6472
|
+
decimals: 8
|
|
6473
|
+
}
|
|
6474
|
+
]
|
|
6475
|
+
};
|
|
6114
6476
|
var assets = {
|
|
6115
6477
|
Acala: Acala$3,
|
|
6116
6478
|
BridgeHubPolkadot: BridgeHubPolkadot$3,
|
|
@@ -6165,7 +6527,10 @@ var assets = {
|
|
|
6165
6527
|
Zeitgeist: Zeitgeist$3,
|
|
6166
6528
|
Collectives: Collectives$3,
|
|
6167
6529
|
Phala: Phala$3,
|
|
6168
|
-
|
|
6530
|
+
Ethereum: Ethereum$1,
|
|
6531
|
+
Khala: Khala$3,
|
|
6532
|
+
Mythos: Mythos$3,
|
|
6533
|
+
Peaq: Peaq$3
|
|
6169
6534
|
};
|
|
6170
6535
|
|
|
6171
6536
|
var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -6194,6 +6559,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6194
6559
|
Curio: Curio$3,
|
|
6195
6560
|
Darwinia: Darwinia$3,
|
|
6196
6561
|
Encointer: Encointer$3,
|
|
6562
|
+
Ethereum: Ethereum$1,
|
|
6197
6563
|
Hydration: Hydration$3,
|
|
6198
6564
|
Imbue: Imbue$3,
|
|
6199
6565
|
Integritee: Integritee$3,
|
|
@@ -6208,10 +6574,12 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6208
6574
|
Manta: Manta$3,
|
|
6209
6575
|
Moonbeam: Moonbeam$3,
|
|
6210
6576
|
Moonriver: Moonriver$3,
|
|
6577
|
+
Mythos: Mythos$3,
|
|
6211
6578
|
NeuroWeb: NeuroWeb$3,
|
|
6212
6579
|
Nodle: Nodle$3,
|
|
6213
6580
|
Parallel: Parallel$3,
|
|
6214
6581
|
ParallelHeiko: ParallelHeiko$3,
|
|
6582
|
+
Peaq: Peaq$3,
|
|
6215
6583
|
Pendulum: Pendulum$3,
|
|
6216
6584
|
Phala: Phala$3,
|
|
6217
6585
|
Picasso: Picasso$3,
|
|
@@ -6263,7 +6631,15 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(node) {
|
|
|
6263
6631
|
});
|
|
6264
6632
|
return [relayChainAssetSymbol].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
6265
6633
|
};
|
|
6266
|
-
var
|
|
6634
|
+
var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
|
|
6635
|
+
if (node === 'Polkadot') {
|
|
6636
|
+
return 'DOT';
|
|
6637
|
+
} else if (node === 'Kusama') {
|
|
6638
|
+
return 'KSM';
|
|
6639
|
+
}
|
|
6640
|
+
return getAssetsObject(node).nativeAssetSymbol;
|
|
6641
|
+
};
|
|
6642
|
+
var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
|
|
6267
6643
|
return getAllAssetsSymbols(node).includes(symbol);
|
|
6268
6644
|
};
|
|
6269
6645
|
var getAssetDecimals = function getAssetDecimals(node, symbol) {
|
|
@@ -6687,6 +7063,19 @@ var BridgeHubKusama$2 = {
|
|
|
6687
7063
|
"PolkadotXcm"
|
|
6688
7064
|
]
|
|
6689
7065
|
};
|
|
7066
|
+
var Mythos$2 = {
|
|
7067
|
+
defaultPallet: "PolkadotXcm",
|
|
7068
|
+
supportedPallets: [
|
|
7069
|
+
"PolkadotXcm"
|
|
7070
|
+
]
|
|
7071
|
+
};
|
|
7072
|
+
var Peaq$2 = {
|
|
7073
|
+
defaultPallet: "XTokens",
|
|
7074
|
+
supportedPallets: [
|
|
7075
|
+
"PolkadotXcm",
|
|
7076
|
+
"XTokens"
|
|
7077
|
+
]
|
|
7078
|
+
};
|
|
6690
7079
|
var pallets = {
|
|
6691
7080
|
AssetHubPolkadot: AssetHubPolkadot$2,
|
|
6692
7081
|
Acala: Acala$2,
|
|
@@ -6741,7 +7130,9 @@ var pallets = {
|
|
|
6741
7130
|
KiltSpiritnet: KiltSpiritnet$2,
|
|
6742
7131
|
Curio: Curio$2,
|
|
6743
7132
|
BridgeHubPolkadot: BridgeHubPolkadot$2,
|
|
6744
|
-
BridgeHubKusama: BridgeHubKusama$2
|
|
7133
|
+
BridgeHubKusama: BridgeHubKusama$2,
|
|
7134
|
+
Mythos: Mythos$2,
|
|
7135
|
+
Peaq: Peaq$2
|
|
6745
7136
|
};
|
|
6746
7137
|
|
|
6747
7138
|
var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -6784,10 +7175,12 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
6784
7175
|
Manta: Manta$2,
|
|
6785
7176
|
Moonbeam: Moonbeam$2,
|
|
6786
7177
|
Moonriver: Moonriver$2,
|
|
7178
|
+
Mythos: Mythos$2,
|
|
6787
7179
|
NeuroWeb: NeuroWeb$2,
|
|
6788
7180
|
Nodle: Nodle$2,
|
|
6789
7181
|
Parallel: Parallel$2,
|
|
6790
7182
|
ParallelHeiko: ParallelHeiko$2,
|
|
7183
|
+
Peaq: Peaq$2,
|
|
6791
7184
|
Pendulum: Pendulum$2,
|
|
6792
7185
|
Phala: Phala$2,
|
|
6793
7186
|
Picasso: Picasso$2,
|
|
@@ -6827,9 +7220,11 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
6827
7220
|
return parameters;
|
|
6828
7221
|
};
|
|
6829
7222
|
var isTMulti = function isTMulti(value) {
|
|
7223
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
6830
7224
|
return value && _typeof(value) === 'object' || Array.isArray(value);
|
|
6831
7225
|
};
|
|
6832
7226
|
var isTMultiLocation = function isTMultiLocation(value) {
|
|
7227
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
6833
7228
|
return value && typeof value.parents !== 'undefined' && typeof value.interior !== 'undefined';
|
|
6834
7229
|
};
|
|
6835
7230
|
var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
|
|
@@ -6851,6 +7246,7 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents, o
|
|
|
6851
7246
|
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
6852
7247
|
if (!overriddenCurrency) {
|
|
6853
7248
|
return _defineProperty({}, version, [{
|
|
7249
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6854
7250
|
id: version === exports.Version.V4 ? {
|
|
6855
7251
|
parents: parents,
|
|
6856
7252
|
interior: interior
|
|
@@ -6875,14 +7271,14 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents, o
|
|
|
6875
7271
|
}]) : // It must be TMultiAsset if not TMultiLocation
|
|
6876
7272
|
_defineProperty({}, version, overriddenCurrency);
|
|
6877
7273
|
};
|
|
6878
|
-
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId) {
|
|
6879
|
-
var
|
|
6880
|
-
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, {
|
|
7274
|
+
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
7275
|
+
var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? exports.Parents.ZERO : exports.Parents.ONE;
|
|
7276
|
+
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
|
|
6881
7277
|
Parachain: nodeId
|
|
6882
7278
|
});
|
|
6883
7279
|
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
6884
7280
|
return _defineProperty({}, version, isMultiLocationDestination ? destination : {
|
|
6885
|
-
parents:
|
|
7281
|
+
parents: parentsResolved,
|
|
6886
7282
|
interior: interior
|
|
6887
7283
|
});
|
|
6888
7284
|
};
|
|
@@ -6919,9 +7315,11 @@ var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
|
|
|
6919
7315
|
}, _callee);
|
|
6920
7316
|
}));
|
|
6921
7317
|
};
|
|
7318
|
+
// TODO: Refactor this function to eliminate the any type
|
|
6922
7319
|
var findParachainJunction = function findParachainJunction(multilocation) {
|
|
6923
7320
|
var interior = multilocation.interior;
|
|
6924
7321
|
for (var key in interior) {
|
|
7322
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
6925
7323
|
var junctions = interior[key];
|
|
6926
7324
|
if (Array.isArray(junctions)) {
|
|
6927
7325
|
var _iterator = _createForOfIteratorHelper(junctions),
|
|
@@ -6930,6 +7328,7 @@ var findParachainJunction = function findParachainJunction(multilocation) {
|
|
|
6930
7328
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6931
7329
|
var junction = _step.value;
|
|
6932
7330
|
if ('Parachain' in junction) {
|
|
7331
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6933
7332
|
return Number(junction.Parachain);
|
|
6934
7333
|
}
|
|
6935
7334
|
}
|
|
@@ -6939,6 +7338,7 @@ var findParachainJunction = function findParachainJunction(multilocation) {
|
|
|
6939
7338
|
_iterator.f();
|
|
6940
7339
|
}
|
|
6941
7340
|
} else if (junctions !== undefined && 'Parachain' in junctions) {
|
|
7341
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6942
7342
|
return Number(junctions.Parachain);
|
|
6943
7343
|
}
|
|
6944
7344
|
}
|
|
@@ -7142,6 +7542,8 @@ var KiltSpiritnet$1 = "10000000000000";
|
|
|
7142
7542
|
var Curio$1 = "10000000000000000";
|
|
7143
7543
|
var BridgeHubPolkadot$1 = "1000000000";
|
|
7144
7544
|
var BridgeHubKusama$1 = "33333333";
|
|
7545
|
+
var Mythos$1 = "10000000000000000";
|
|
7546
|
+
var Peaq$1 = "500";
|
|
7145
7547
|
var existentialDeposits = {
|
|
7146
7548
|
AssetHubPolkadot: AssetHubPolkadot$1,
|
|
7147
7549
|
Acala: Acala$1,
|
|
@@ -7198,7 +7600,9 @@ var existentialDeposits = {
|
|
|
7198
7600
|
KiltSpiritnet: KiltSpiritnet$1,
|
|
7199
7601
|
Curio: Curio$1,
|
|
7200
7602
|
BridgeHubPolkadot: BridgeHubPolkadot$1,
|
|
7201
|
-
BridgeHubKusama: BridgeHubKusama$1
|
|
7603
|
+
BridgeHubKusama: BridgeHubKusama$1,
|
|
7604
|
+
Mythos: Mythos$1,
|
|
7605
|
+
Peaq: Peaq$1
|
|
7202
7606
|
};
|
|
7203
7607
|
|
|
7204
7608
|
var edMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -7242,10 +7646,12 @@ var edMapJson = /*#__PURE__*/Object.freeze({
|
|
|
7242
7646
|
Manta: Manta$1,
|
|
7243
7647
|
Moonbeam: Moonbeam$1,
|
|
7244
7648
|
Moonriver: Moonriver$1,
|
|
7649
|
+
Mythos: Mythos$1,
|
|
7245
7650
|
NeuroWeb: NeuroWeb$1,
|
|
7246
7651
|
Nodle: Nodle$1,
|
|
7247
7652
|
Parallel: Parallel$1,
|
|
7248
7653
|
ParallelHeiko: ParallelHeiko$1,
|
|
7654
|
+
Peaq: Peaq$1,
|
|
7249
7655
|
Pendulum: Pendulum$1,
|
|
7250
7656
|
Phala: Phala$1,
|
|
7251
7657
|
Picasso: Picasso$1,
|
|
@@ -8007,6 +8413,209 @@ var Builder = function Builder(api) {
|
|
|
8007
8413
|
return new GeneralBuilder(api);
|
|
8008
8414
|
};
|
|
8009
8415
|
|
|
8416
|
+
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
8417
|
+
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
8418
|
+
function InvalidCurrencyError(message) {
|
|
8419
|
+
var _this;
|
|
8420
|
+
_classCallCheck(this, InvalidCurrencyError);
|
|
8421
|
+
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
8422
|
+
_this.name = 'InvalidCurrencyError';
|
|
8423
|
+
return _this;
|
|
8424
|
+
}
|
|
8425
|
+
_inherits(InvalidCurrencyError, _Error);
|
|
8426
|
+
return _createClass(InvalidCurrencyError);
|
|
8427
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8428
|
+
|
|
8429
|
+
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
8430
|
+
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
8431
|
+
function NodeNotSupportedError(message) {
|
|
8432
|
+
var _this;
|
|
8433
|
+
_classCallCheck(this, NodeNotSupportedError);
|
|
8434
|
+
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
8435
|
+
_this.name = 'NodeNotSupported';
|
|
8436
|
+
return _this;
|
|
8437
|
+
}
|
|
8438
|
+
_inherits(NodeNotSupportedError, _Error);
|
|
8439
|
+
return _createClass(NodeNotSupportedError);
|
|
8440
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8441
|
+
|
|
8442
|
+
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
8443
|
+
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
8444
|
+
function ScenarioNotSupportedError(node, scenario, message) {
|
|
8445
|
+
var _this;
|
|
8446
|
+
_classCallCheck(this, ScenarioNotSupportedError);
|
|
8447
|
+
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
8448
|
+
_this.name = 'ScenarioNotSupported';
|
|
8449
|
+
return _this;
|
|
8450
|
+
}
|
|
8451
|
+
_inherits(ScenarioNotSupportedError, _Error);
|
|
8452
|
+
return _createClass(ScenarioNotSupportedError);
|
|
8453
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8454
|
+
|
|
8455
|
+
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
8456
|
+
function IncompatibleNodesError() {
|
|
8457
|
+
var _this;
|
|
8458
|
+
_classCallCheck(this, IncompatibleNodesError);
|
|
8459
|
+
_this = _callSuper(this, IncompatibleNodesError, ['Transactions between nodes on different relaychains are not yet possible.']);
|
|
8460
|
+
_this.name = 'IncompatibleNodes';
|
|
8461
|
+
return _this;
|
|
8462
|
+
}
|
|
8463
|
+
_inherits(IncompatibleNodesError, _Error);
|
|
8464
|
+
return _createClass(IncompatibleNodesError);
|
|
8465
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8466
|
+
|
|
8467
|
+
var transferEthToPolkadot = function transferEthToPolkadot(provider_1, _a) {
|
|
8468
|
+
return __awaiter(void 0, [provider_1, _a], void 0, function (provider, _ref) {
|
|
8469
|
+
var signer = _ref.signer,
|
|
8470
|
+
address = _ref.address,
|
|
8471
|
+
to = _ref.to,
|
|
8472
|
+
amount = _ref.amount,
|
|
8473
|
+
currency = _ref.currency;
|
|
8474
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8475
|
+
var ethAssets, ethAsset, env, config, context, destParaId, plan, result;
|
|
8476
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8477
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8478
|
+
case 0:
|
|
8479
|
+
ethAssets = getOtherAssets('Ethereum');
|
|
8480
|
+
ethAsset = ethAssets.find(function (asset) {
|
|
8481
|
+
return asset.symbol === currency;
|
|
8482
|
+
});
|
|
8483
|
+
if (ethAsset) {
|
|
8484
|
+
_context.next = 4;
|
|
8485
|
+
break;
|
|
8486
|
+
}
|
|
8487
|
+
throw new InvalidCurrencyError("Currency ".concat(currency, " is not supported for Ethereum transfers"));
|
|
8488
|
+
case 4:
|
|
8489
|
+
env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
|
|
8490
|
+
config = env.config;
|
|
8491
|
+
_context.next = 8;
|
|
8492
|
+
return api.contextFactory({
|
|
8493
|
+
ethereum: {
|
|
8494
|
+
execution_url: provider,
|
|
8495
|
+
beacon_url: config.BEACON_HTTP_API
|
|
8496
|
+
},
|
|
8497
|
+
polkadot: {
|
|
8498
|
+
url: {
|
|
8499
|
+
bridgeHub: config.BRIDGE_HUB_URL,
|
|
8500
|
+
assetHub: config.ASSET_HUB_URL,
|
|
8501
|
+
relaychain: config.RELAY_CHAIN_URL,
|
|
8502
|
+
parachains: config.PARACHAINS
|
|
8503
|
+
}
|
|
8504
|
+
},
|
|
8505
|
+
appContracts: {
|
|
8506
|
+
gateway: config.GATEWAY_CONTRACT,
|
|
8507
|
+
beefy: config.BEEFY_CONTRACT
|
|
8508
|
+
}
|
|
8509
|
+
});
|
|
8510
|
+
case 8:
|
|
8511
|
+
context = _context.sent;
|
|
8512
|
+
destParaId = getParaId(to);
|
|
8513
|
+
_context.next = 12;
|
|
8514
|
+
return api.toPolkadot.validateSend(context, signer, address, ethAsset.assetId, destParaId, BigInt(amount), BigInt(0));
|
|
8515
|
+
case 12:
|
|
8516
|
+
plan = _context.sent;
|
|
8517
|
+
if (!plan.failure) {
|
|
8518
|
+
_context.next = 15;
|
|
8519
|
+
break;
|
|
8520
|
+
}
|
|
8521
|
+
throw new Error("Failed to validate send: ".concat(plan.failure.errors.map(function (e) {
|
|
8522
|
+
return e.message;
|
|
8523
|
+
}).join('\n\n')));
|
|
8524
|
+
case 15:
|
|
8525
|
+
_context.next = 17;
|
|
8526
|
+
return api.toPolkadot.send(context, signer, plan);
|
|
8527
|
+
case 17:
|
|
8528
|
+
result = _context.sent;
|
|
8529
|
+
return _context.abrupt("return", {
|
|
8530
|
+
result: result,
|
|
8531
|
+
plan: plan
|
|
8532
|
+
});
|
|
8533
|
+
case 19:
|
|
8534
|
+
case "end":
|
|
8535
|
+
return _context.stop();
|
|
8536
|
+
}
|
|
8537
|
+
}, _callee);
|
|
8538
|
+
})();
|
|
8539
|
+
});
|
|
8540
|
+
};
|
|
8541
|
+
|
|
8542
|
+
var EvmBuilderClass = /*#__PURE__*/function () {
|
|
8543
|
+
function EvmBuilderClass(provider) {
|
|
8544
|
+
_classCallCheck(this, EvmBuilderClass);
|
|
8545
|
+
this._provider = provider;
|
|
8546
|
+
this._options = {};
|
|
8547
|
+
}
|
|
8548
|
+
return _createClass(EvmBuilderClass, [{
|
|
8549
|
+
key: "to",
|
|
8550
|
+
value: function to(node) {
|
|
8551
|
+
this._options.to = node;
|
|
8552
|
+
return this;
|
|
8553
|
+
}
|
|
8554
|
+
}, {
|
|
8555
|
+
key: "amount",
|
|
8556
|
+
value: function amount(_amount) {
|
|
8557
|
+
this._options.amount = _amount;
|
|
8558
|
+
return this;
|
|
8559
|
+
}
|
|
8560
|
+
}, {
|
|
8561
|
+
key: "currency",
|
|
8562
|
+
value: function currency(_currency) {
|
|
8563
|
+
this._options.currency = _currency;
|
|
8564
|
+
return this;
|
|
8565
|
+
}
|
|
8566
|
+
}, {
|
|
8567
|
+
key: "address",
|
|
8568
|
+
value: function address(_address) {
|
|
8569
|
+
this._options.address = _address;
|
|
8570
|
+
return this;
|
|
8571
|
+
}
|
|
8572
|
+
}, {
|
|
8573
|
+
key: "signer",
|
|
8574
|
+
value: function signer(_signer) {
|
|
8575
|
+
this._options.signer = _signer;
|
|
8576
|
+
return this;
|
|
8577
|
+
}
|
|
8578
|
+
}, {
|
|
8579
|
+
key: "build",
|
|
8580
|
+
value: function build() {
|
|
8581
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8582
|
+
var requiredParams, _i, _requiredParams, param;
|
|
8583
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8584
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8585
|
+
case 0:
|
|
8586
|
+
requiredParams = ['to', 'amount', 'currency', 'address', 'signer'];
|
|
8587
|
+
_i = 0, _requiredParams = requiredParams;
|
|
8588
|
+
case 2:
|
|
8589
|
+
if (!(_i < _requiredParams.length)) {
|
|
8590
|
+
_context.next = 9;
|
|
8591
|
+
break;
|
|
8592
|
+
}
|
|
8593
|
+
param = _requiredParams[_i];
|
|
8594
|
+
if (!(this._options[param] === undefined)) {
|
|
8595
|
+
_context.next = 6;
|
|
8596
|
+
break;
|
|
8597
|
+
}
|
|
8598
|
+
throw new Error("Builder object is missing parameter: ".concat(param));
|
|
8599
|
+
case 6:
|
|
8600
|
+
_i++;
|
|
8601
|
+
_context.next = 2;
|
|
8602
|
+
break;
|
|
8603
|
+
case 9:
|
|
8604
|
+
_context.next = 11;
|
|
8605
|
+
return transferEthToPolkadot(this._provider, this._options);
|
|
8606
|
+
case 11:
|
|
8607
|
+
case "end":
|
|
8608
|
+
return _context.stop();
|
|
8609
|
+
}
|
|
8610
|
+
}, _callee, this);
|
|
8611
|
+
}));
|
|
8612
|
+
}
|
|
8613
|
+
}]);
|
|
8614
|
+
}();
|
|
8615
|
+
var EvmBuilder = function EvmBuilder(provider) {
|
|
8616
|
+
return new EvmBuilderClass(provider);
|
|
8617
|
+
};
|
|
8618
|
+
|
|
8010
8619
|
var createTx$1 = function createTx(originApi, address, amount, currencySymbol, originNode, destNode) {
|
|
8011
8620
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8012
8621
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -8112,20 +8721,12 @@ var getOriginFeeDetails = function getOriginFeeDetails(origin, destination, curr
|
|
|
8112
8721
|
}));
|
|
8113
8722
|
};
|
|
8114
8723
|
|
|
8115
|
-
var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
|
|
8116
|
-
if (node === 'Polkadot') {
|
|
8117
|
-
return 'DOT';
|
|
8118
|
-
} else if (node === 'Kusama') {
|
|
8119
|
-
return 'KSM';
|
|
8120
|
-
}
|
|
8121
|
-
return getAssetsObject(node).nativeAssetSymbol;
|
|
8122
|
-
};
|
|
8123
8724
|
var getAssetSymbol = function getAssetSymbol(node, assetId) {
|
|
8124
8725
|
if (node === 'Polkadot' || node === 'Kusama') {
|
|
8125
8726
|
return getNativeAssetSymbol(node);
|
|
8126
8727
|
}
|
|
8127
8728
|
var asset = getAssetBySymbolOrId(node, assetId);
|
|
8128
|
-
return asset;
|
|
8729
|
+
return asset === null || asset === void 0 ? void 0 : asset.symbol;
|
|
8129
8730
|
};
|
|
8130
8731
|
var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
|
|
8131
8732
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -8182,7 +8783,7 @@ var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
|
|
|
8182
8783
|
};
|
|
8183
8784
|
var getTransferInfo = function getTransferInfo(origin, destination, accountOrigin, accountDestination, assetSymbolOrId, amount) {
|
|
8184
8785
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
8185
|
-
var
|
|
8786
|
+
var _a, originApi, originBalance, _yield$getOriginFeeDe, destXcmFee, expectedBalanceAfterXCMDelivery, asset;
|
|
8186
8787
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8187
8788
|
while (1) switch (_context2.prev = _context2.next) {
|
|
8188
8789
|
case 0:
|
|
@@ -8210,7 +8811,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
|
|
|
8210
8811
|
return getAssetBalance(accountOrigin, origin, assetSymbolOrId);
|
|
8211
8812
|
case 15:
|
|
8212
8813
|
_context2.t1 = _context2.sent;
|
|
8213
|
-
_context2.t2 = asset
|
|
8814
|
+
_context2.t2 = asset !== null && asset !== void 0 ? asset : '';
|
|
8214
8815
|
_context2.t3 = {
|
|
8215
8816
|
balance: _context2.t1,
|
|
8216
8817
|
currency: _context2.t2
|
|
@@ -8224,7 +8825,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
|
|
|
8224
8825
|
return getOriginFeeDetails(origin, destination, assetSymbolOrId, amount, accountOrigin, originApi);
|
|
8225
8826
|
case 24:
|
|
8226
8827
|
_context2.t6 = _context2.sent;
|
|
8227
|
-
_context2.t7 = BigInt((
|
|
8828
|
+
_context2.t7 = BigInt((_a = getExistentialDeposit$1(origin)) !== null && _a !== void 0 ? _a : 0);
|
|
8228
8829
|
_context2.t8 = getNativeAssetSymbol(origin);
|
|
8229
8830
|
_context2.t9 = getMinNativeTransferableAmount(origin);
|
|
8230
8831
|
_context2.next = 30;
|
|
@@ -8273,6 +8874,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
8273
8874
|
getAssetsObject: getAssetsObject,
|
|
8274
8875
|
getBalanceForeign: getBalanceForeign,
|
|
8275
8876
|
getBalanceNative: getBalanceNative,
|
|
8877
|
+
getNativeAssetSymbol: getNativeAssetSymbol,
|
|
8276
8878
|
getNativeAssets: getNativeAssets,
|
|
8277
8879
|
getOtherAssets: getOtherAssets,
|
|
8278
8880
|
getParaId: getParaId,
|
|
@@ -8486,7 +9088,6 @@ var getParameters = function getParameters(isAssetHub, currencySelection, addres
|
|
|
8486
9088
|
}
|
|
8487
9089
|
return [currencySelection, amount, addressSelection, fees];
|
|
8488
9090
|
};
|
|
8489
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
8490
9091
|
var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
8491
9092
|
function XTokensTransferImpl() {
|
|
8492
9093
|
_classCallCheck(this, XTokensTransferImpl);
|
|
@@ -8519,6 +9120,7 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
8519
9120
|
parameters: parameters
|
|
8520
9121
|
};
|
|
8521
9122
|
}
|
|
9123
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8522
9124
|
return (_api$tx$module = api.tx[module])[section].apply(_api$tx$module, _toConsumableArray(parameters));
|
|
8523
9125
|
}
|
|
8524
9126
|
}]);
|
|
@@ -8567,19 +9169,6 @@ var Unique = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8567
9169
|
}]);
|
|
8568
9170
|
}(ParachainNode);
|
|
8569
9171
|
|
|
8570
|
-
// Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
8571
|
-
var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
8572
|
-
function InvalidCurrencyError(message) {
|
|
8573
|
-
var _this;
|
|
8574
|
-
_classCallCheck(this, InvalidCurrencyError);
|
|
8575
|
-
_this = _callSuper(this, InvalidCurrencyError, [message]);
|
|
8576
|
-
_this.name = 'InvalidCurrencyError';
|
|
8577
|
-
return _this;
|
|
8578
|
-
}
|
|
8579
|
-
_inherits(InvalidCurrencyError, _Error);
|
|
8580
|
-
return _createClass(InvalidCurrencyError);
|
|
8581
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
8582
|
-
|
|
8583
9172
|
var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
8584
9173
|
function Crust() {
|
|
8585
9174
|
_classCallCheck(this, Crust);
|
|
@@ -8810,10 +9399,29 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8810
9399
|
var Bajun = /*#__PURE__*/function (_ParachainNode) {
|
|
8811
9400
|
function Bajun() {
|
|
8812
9401
|
_classCallCheck(this, Bajun);
|
|
8813
|
-
return _callSuper(this, Bajun, ['Bajun', 'bajun', 'kusama', exports.Version.
|
|
9402
|
+
return _callSuper(this, Bajun, ['Bajun', 'bajun', 'kusama', exports.Version.V3]);
|
|
8814
9403
|
}
|
|
8815
9404
|
_inherits(Bajun, _ParachainNode);
|
|
8816
|
-
return _createClass(Bajun
|
|
9405
|
+
return _createClass(Bajun, [{
|
|
9406
|
+
key: "transferXTokens",
|
|
9407
|
+
value: function transferXTokens(input) {
|
|
9408
|
+
var scenario = input.scenario,
|
|
9409
|
+
currency = input.currency;
|
|
9410
|
+
if (scenario !== 'ParaToPara') {
|
|
9411
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
9412
|
+
}
|
|
9413
|
+
var nativeSymbol = getNativeAssetSymbol(this.node);
|
|
9414
|
+
if (currency !== nativeSymbol) {
|
|
9415
|
+
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currency));
|
|
9416
|
+
}
|
|
9417
|
+
return XTokensTransferImpl.transferXTokens(input, currency);
|
|
9418
|
+
}
|
|
9419
|
+
}, {
|
|
9420
|
+
key: "transferRelayToPara",
|
|
9421
|
+
value: function transferRelayToPara() {
|
|
9422
|
+
throw new NodeNotSupportedError();
|
|
9423
|
+
}
|
|
9424
|
+
}]);
|
|
8817
9425
|
}(ParachainNode);
|
|
8818
9426
|
|
|
8819
9427
|
var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
@@ -9032,44 +9640,6 @@ var Imbue = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9032
9640
|
}]);
|
|
9033
9641
|
}(ParachainNode);
|
|
9034
9642
|
|
|
9035
|
-
// Used to inform user, that Parachain they wish to use is not supported yet
|
|
9036
|
-
var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
9037
|
-
function NodeNotSupportedError(message) {
|
|
9038
|
-
var _this;
|
|
9039
|
-
_classCallCheck(this, NodeNotSupportedError);
|
|
9040
|
-
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
9041
|
-
_this.name = 'NodeNotSupported';
|
|
9042
|
-
return _this;
|
|
9043
|
-
}
|
|
9044
|
-
_inherits(NodeNotSupportedError, _Error);
|
|
9045
|
-
return _createClass(NodeNotSupportedError);
|
|
9046
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9047
|
-
|
|
9048
|
-
// Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
9049
|
-
var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
9050
|
-
function ScenarioNotSupportedError(node, scenario, message) {
|
|
9051
|
-
var _this;
|
|
9052
|
-
_classCallCheck(this, ScenarioNotSupportedError);
|
|
9053
|
-
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
9054
|
-
_this.name = 'ScenarioNotSupported';
|
|
9055
|
-
return _this;
|
|
9056
|
-
}
|
|
9057
|
-
_inherits(ScenarioNotSupportedError, _Error);
|
|
9058
|
-
return _createClass(ScenarioNotSupportedError);
|
|
9059
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9060
|
-
|
|
9061
|
-
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
9062
|
-
function IncompatibleNodesError() {
|
|
9063
|
-
var _this;
|
|
9064
|
-
_classCallCheck(this, IncompatibleNodesError);
|
|
9065
|
-
_this = _callSuper(this, IncompatibleNodesError, ['Transactions between nodes on different relaychains are not yet possible.']);
|
|
9066
|
-
_this.name = 'IncompatibleNodes';
|
|
9067
|
-
return _this;
|
|
9068
|
-
}
|
|
9069
|
-
_inherits(IncompatibleNodesError, _Error);
|
|
9070
|
-
return _createClass(IncompatibleNodesError);
|
|
9071
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
9072
|
-
|
|
9073
9643
|
var Integritee = /*#__PURE__*/function (_ParachainNode) {
|
|
9074
9644
|
function Integritee() {
|
|
9075
9645
|
_classCallCheck(this, Integritee);
|
|
@@ -9134,7 +9704,6 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9134
9704
|
|
|
9135
9705
|
// Contains basic structure of polkadotXCM call
|
|
9136
9706
|
var DEFAULT_FEE_ASSET = 0;
|
|
9137
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
9138
9707
|
var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
9139
9708
|
function PolkadotXCMTransferImpl() {
|
|
9140
9709
|
_classCallCheck(this, PolkadotXCMTransferImpl);
|
|
@@ -9190,6 +9759,49 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9190
9759
|
}
|
|
9191
9760
|
throw new InvalidCurrencyError('Polkadot <-> Kusama bridge does not support this currency');
|
|
9192
9761
|
}
|
|
9762
|
+
}, {
|
|
9763
|
+
key: "handleEthBridgeTransfer",
|
|
9764
|
+
value: function handleEthBridgeTransfer(input) {
|
|
9765
|
+
var api = input.api,
|
|
9766
|
+
scenario = input.scenario,
|
|
9767
|
+
destination = input.destination,
|
|
9768
|
+
paraIdTo = input.paraIdTo,
|
|
9769
|
+
address = input.address,
|
|
9770
|
+
currencyId = input.currencyId;
|
|
9771
|
+
if (!ethers.ethers.isAddress(address)) {
|
|
9772
|
+
throw new Error('Only Ethereum addresses are supported for Ethereum transfers');
|
|
9773
|
+
}
|
|
9774
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
9775
|
+
var ethAsset = ethAssets.find(function (asset) {
|
|
9776
|
+
return asset.symbol === currencyId;
|
|
9777
|
+
});
|
|
9778
|
+
if (!ethAsset) {
|
|
9779
|
+
throw new InvalidCurrencyError("Currency ".concat(currencyId, " is not supported for Ethereum transfers"));
|
|
9780
|
+
}
|
|
9781
|
+
var ETH_CHAIN_ID = 1;
|
|
9782
|
+
var ethJunction = {
|
|
9783
|
+
GlobalConsensus: {
|
|
9784
|
+
Ethereum: {
|
|
9785
|
+
chain_id: ETH_CHAIN_ID
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
};
|
|
9789
|
+
var modifiedInput = Object.assign(Object.assign({}, input), {
|
|
9790
|
+
header: createPolkadotXcmHeader(scenario, this.version, destination, paraIdTo, ethJunction, exports.Parents.TWO),
|
|
9791
|
+
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, this.version, paraIdTo),
|
|
9792
|
+
currencySelection: createCurrencySpec(input.amount, exports.Version.V3, exports.Parents.TWO, {
|
|
9793
|
+
parents: exports.Parents.TWO,
|
|
9794
|
+
interior: {
|
|
9795
|
+
X2: [ethJunction, {
|
|
9796
|
+
AccountKey20: {
|
|
9797
|
+
key: ethAsset.assetId
|
|
9798
|
+
}
|
|
9799
|
+
}]
|
|
9800
|
+
}
|
|
9801
|
+
})
|
|
9802
|
+
});
|
|
9803
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transferAssets', 'Unlimited');
|
|
9804
|
+
}
|
|
9193
9805
|
}, {
|
|
9194
9806
|
key: "transferPolkadotXCM",
|
|
9195
9807
|
value: function transferPolkadotXCM(input) {
|
|
@@ -9197,6 +9809,9 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9197
9809
|
if (input.destination === 'AssetHubKusama') {
|
|
9198
9810
|
return this.handleBridgeTransfer(input, 'Kusama');
|
|
9199
9811
|
}
|
|
9812
|
+
if (input.destination === 'Ethereum') {
|
|
9813
|
+
return this.handleEthBridgeTransfer(input);
|
|
9814
|
+
}
|
|
9200
9815
|
var method = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
|
|
9201
9816
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
|
|
9202
9817
|
}
|
|
@@ -9224,7 +9839,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9224
9839
|
};
|
|
9225
9840
|
return createCurrencySpec(amount, version, exports.Parents.ZERO, overridedMultiLocation, interior);
|
|
9226
9841
|
} else {
|
|
9227
|
-
return
|
|
9842
|
+
return _superPropGet(AssetHubPolkadot, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9228
9843
|
}
|
|
9229
9844
|
}
|
|
9230
9845
|
}]);
|
|
@@ -9409,7 +10024,7 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9409
10024
|
};
|
|
9410
10025
|
return createCurrencySpec(amount, version, exports.Parents.ZERO, overridedMultiLocation, interior);
|
|
9411
10026
|
} else {
|
|
9412
|
-
return
|
|
10027
|
+
return _superPropGet(Darwinia, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9413
10028
|
}
|
|
9414
10029
|
}
|
|
9415
10030
|
}]);
|
|
@@ -9641,7 +10256,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9641
10256
|
if (scenario === 'ParaToPara') {
|
|
9642
10257
|
return {};
|
|
9643
10258
|
} else {
|
|
9644
|
-
return
|
|
10259
|
+
return _superPropGet(Collectives, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
9645
10260
|
}
|
|
9646
10261
|
}
|
|
9647
10262
|
}]);
|
|
@@ -9689,7 +10304,6 @@ var getDestination = function getDestination(_ref) {
|
|
|
9689
10304
|
}
|
|
9690
10305
|
};
|
|
9691
10306
|
};
|
|
9692
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
9693
10307
|
var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
9694
10308
|
function XTransferTransferImpl() {
|
|
9695
10309
|
_classCallCheck(this, XTransferTransferImpl);
|
|
@@ -9776,7 +10390,7 @@ var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9776
10390
|
key: "transferPolkadotXCM",
|
|
9777
10391
|
value: function transferPolkadotXCM(input) {
|
|
9778
10392
|
if (input.scenario !== 'ParaToPara') {
|
|
9779
|
-
throw new ScenarioNotSupportedError(
|
|
10393
|
+
throw new ScenarioNotSupportedError(this.node, input.scenario);
|
|
9780
10394
|
}
|
|
9781
10395
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveTransferAssets');
|
|
9782
10396
|
}
|
|
@@ -9883,9 +10497,76 @@ var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9883
10497
|
}]);
|
|
9884
10498
|
}(ParachainNode);
|
|
9885
10499
|
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
10500
|
+
var Ethereum = /*#__PURE__*/function (_ParachainNode) {
|
|
10501
|
+
function Ethereum() {
|
|
10502
|
+
_classCallCheck(this, Ethereum);
|
|
10503
|
+
return _callSuper(this, Ethereum, ['Ethereum', 'ethereum', 'polkadot', exports.Version.V3]);
|
|
10504
|
+
}
|
|
10505
|
+
_inherits(Ethereum, _ParachainNode);
|
|
10506
|
+
return _createClass(Ethereum);
|
|
10507
|
+
}(ParachainNode);
|
|
10508
|
+
|
|
10509
|
+
var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
10510
|
+
function Mythos() {
|
|
10511
|
+
_classCallCheck(this, Mythos);
|
|
10512
|
+
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', exports.Version.V3]);
|
|
10513
|
+
}
|
|
10514
|
+
_inherits(Mythos, _ParachainNode);
|
|
10515
|
+
return _createClass(Mythos, [{
|
|
10516
|
+
key: "transferPolkadotXCM",
|
|
10517
|
+
value: function transferPolkadotXCM(input) {
|
|
10518
|
+
var scenario = input.scenario,
|
|
10519
|
+
currencySymbol = input.currencySymbol;
|
|
10520
|
+
if (scenario !== 'ParaToPara') {
|
|
10521
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
10522
|
+
}
|
|
10523
|
+
var nativeSymbol = getNativeAssetSymbol(this.node);
|
|
10524
|
+
if (currencySymbol !== nativeSymbol) {
|
|
10525
|
+
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(currencySymbol));
|
|
10526
|
+
}
|
|
10527
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', 'Unlimited');
|
|
10528
|
+
}
|
|
10529
|
+
}, {
|
|
10530
|
+
key: "transferRelayToPara",
|
|
10531
|
+
value: function transferRelayToPara() {
|
|
10532
|
+
throw new NodeNotSupportedError();
|
|
10533
|
+
}
|
|
10534
|
+
}]);
|
|
10535
|
+
}(ParachainNode);
|
|
10536
|
+
|
|
10537
|
+
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
10538
|
+
function Peaq() {
|
|
10539
|
+
_classCallCheck(this, Peaq);
|
|
10540
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', exports.Version.V2]);
|
|
10541
|
+
}
|
|
10542
|
+
_inherits(Peaq, _ParachainNode);
|
|
10543
|
+
return _createClass(Peaq, [{
|
|
10544
|
+
key: "transferXTokens",
|
|
10545
|
+
value: function transferXTokens(input) {
|
|
10546
|
+
var scenario = input.scenario,
|
|
10547
|
+
currencyID = input.currencyID;
|
|
10548
|
+
if (scenario !== 'ParaToPara') {
|
|
10549
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
10550
|
+
}
|
|
10551
|
+
return XTokensTransferImpl.transferXTokens(input, currencyID);
|
|
10552
|
+
}
|
|
10553
|
+
}, {
|
|
10554
|
+
key: "transferRelayToPara",
|
|
10555
|
+
value: function transferRelayToPara() {
|
|
10556
|
+
throw new NodeNotSupportedError();
|
|
10557
|
+
}
|
|
10558
|
+
}, {
|
|
10559
|
+
key: "getProvider",
|
|
10560
|
+
value: function getProvider() {
|
|
10561
|
+
return 'wss://peaq.api.onfinality.io/public-ws';
|
|
10562
|
+
}
|
|
10563
|
+
}]);
|
|
10564
|
+
}(ParachainNode);
|
|
10565
|
+
|
|
10566
|
+
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'];
|
|
10567
|
+
var NODE_NAMES = [].concat(NODE_NAMES_DOT_KSM, ['Ethereum']);
|
|
10568
|
+
var NODES_WITH_RELAY_CHAINS = [].concat(_toConsumableArray(NODE_NAMES), ['Polkadot', 'Kusama']);
|
|
10569
|
+
var NODES_WITH_RELAY_CHAINS_DOT_KSM = [].concat(NODE_NAMES_DOT_KSM, ['Polkadot', 'Kusama']);
|
|
9889
10570
|
var nodes = {
|
|
9890
10571
|
AssetHubPolkadot: new AssetHubPolkadot(),
|
|
9891
10572
|
Acala: new Acala(),
|
|
@@ -9940,7 +10621,10 @@ var nodes = {
|
|
|
9940
10621
|
Phala: new Phala(),
|
|
9941
10622
|
Subsocial: new Subsocial(),
|
|
9942
10623
|
KiltSpiritnet: new KiltSpiritnet(),
|
|
9943
|
-
Curio: new Curio()
|
|
10624
|
+
Curio: new Curio(),
|
|
10625
|
+
Ethereum: new Ethereum(),
|
|
10626
|
+
Mythos: new Mythos(),
|
|
10627
|
+
Peaq: new Peaq()
|
|
9944
10628
|
};
|
|
9945
10629
|
var SUPPORTED_PALLETS = ['XTokens', 'OrmlXTokens', 'PolkadotXcm', 'RelayerXcm', 'XTransfer'];
|
|
9946
10630
|
|
|
@@ -10082,7 +10766,7 @@ var getAllNodeProviders = function getAllNodeProviders(node) {
|
|
|
10082
10766
|
var _a;
|
|
10083
10767
|
var _ref9 = (_a = getNodeEndpointOption(node)) !== null && _a !== void 0 ? _a : {},
|
|
10084
10768
|
providers = _ref9.providers;
|
|
10085
|
-
if (providers.length < 1) {
|
|
10769
|
+
if (providers && Object.values(providers).length < 1) {
|
|
10086
10770
|
throw new Error("Node ".concat(node, " does not have any providers."));
|
|
10087
10771
|
}
|
|
10088
10772
|
return Object.values(providers !== null && providers !== void 0 ? providers : []);
|
|
@@ -10096,9 +10780,9 @@ var createApiInstance = function createApiInstance(wsUrl) {
|
|
|
10096
10780
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10097
10781
|
while (1) switch (_context.prev = _context.next) {
|
|
10098
10782
|
case 0:
|
|
10099
|
-
wsProvider = new api.WsProvider(wsUrl);
|
|
10783
|
+
wsProvider = new api$1.WsProvider(wsUrl);
|
|
10100
10784
|
_context.next = 3;
|
|
10101
|
-
return api.ApiPromise.create({
|
|
10785
|
+
return api$1.ApiPromise.create({
|
|
10102
10786
|
provider: wsProvider
|
|
10103
10787
|
});
|
|
10104
10788
|
case 3:
|
|
@@ -10141,7 +10825,8 @@ var createApiInstanceForNode = function createApiInstanceForNode(node) {
|
|
|
10141
10825
|
var lowercaseFirstLetter = function lowercaseFirstLetter(str) {
|
|
10142
10826
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
10143
10827
|
};
|
|
10144
|
-
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10
|
|
10828
|
+
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
10829
|
+
) {
|
|
10145
10830
|
var _api$tx$module;
|
|
10146
10831
|
var module = _ref10.module,
|
|
10147
10832
|
section = _ref10.section,
|
|
@@ -10430,7 +11115,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10430
11115
|
break;
|
|
10431
11116
|
}
|
|
10432
11117
|
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
10433
|
-
_context.next =
|
|
11118
|
+
_context.next = 59;
|
|
10434
11119
|
break;
|
|
10435
11120
|
case 45:
|
|
10436
11121
|
if (!(_typeof(address) === 'object')) {
|
|
@@ -10438,7 +11123,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10438
11123
|
break;
|
|
10439
11124
|
}
|
|
10440
11125
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
10441
|
-
_context.next =
|
|
11126
|
+
_context.next = 59;
|
|
10442
11127
|
break;
|
|
10443
11128
|
case 49:
|
|
10444
11129
|
if (!(_typeof(destination) === 'object')) {
|
|
@@ -10446,10 +11131,18 @@ var sendCommon = function sendCommon(options) {
|
|
|
10446
11131
|
break;
|
|
10447
11132
|
}
|
|
10448
11133
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
10449
|
-
_context.next =
|
|
11134
|
+
_context.next = 59;
|
|
10450
11135
|
break;
|
|
10451
11136
|
case 53:
|
|
10452
|
-
|
|
11137
|
+
if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
|
|
11138
|
+
_context.next = 57;
|
|
11139
|
+
break;
|
|
11140
|
+
}
|
|
11141
|
+
console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
|
|
11142
|
+
_context.next = 59;
|
|
11143
|
+
break;
|
|
11144
|
+
case 57:
|
|
11145
|
+
_context.next = 59;
|
|
10453
11146
|
return checkKeepAlive({
|
|
10454
11147
|
originApi: apiWithFallback,
|
|
10455
11148
|
address: address,
|
|
@@ -10459,7 +11152,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10459
11152
|
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : currency.toString(),
|
|
10460
11153
|
destNode: destination
|
|
10461
11154
|
});
|
|
10462
|
-
case
|
|
11155
|
+
case 59:
|
|
10463
11156
|
currencyStr = isTMulti(currency) ? undefined : currency.toString();
|
|
10464
11157
|
currencyId = assetCheckEnabled ? asset === null || asset === void 0 ? void 0 : asset.assetId : currencyStr;
|
|
10465
11158
|
return _context.abrupt("return", originNode.transfer({
|
|
@@ -10475,7 +11168,7 @@ var sendCommon = function sendCommon(options) {
|
|
|
10475
11168
|
version: version,
|
|
10476
11169
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
10477
11170
|
}));
|
|
10478
|
-
case
|
|
11171
|
+
case 62:
|
|
10479
11172
|
case "end":
|
|
10480
11173
|
return _context.stop();
|
|
10481
11174
|
}
|
|
@@ -10551,7 +11244,7 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10551
11244
|
break;
|
|
10552
11245
|
}
|
|
10553
11246
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
10554
|
-
_context4.next =
|
|
11247
|
+
_context4.next = 28;
|
|
10555
11248
|
break;
|
|
10556
11249
|
case 18:
|
|
10557
11250
|
if (!isAddressMultiLocation) {
|
|
@@ -10559,10 +11252,18 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10559
11252
|
break;
|
|
10560
11253
|
}
|
|
10561
11254
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
10562
|
-
_context4.next =
|
|
11255
|
+
_context4.next = 28;
|
|
10563
11256
|
break;
|
|
10564
11257
|
case 22:
|
|
10565
|
-
|
|
11258
|
+
if (!(destination === 'Ethereum')) {
|
|
11259
|
+
_context4.next = 26;
|
|
11260
|
+
break;
|
|
11261
|
+
}
|
|
11262
|
+
console.warn('Keep alive check is not supported when using Ethereum as destination.');
|
|
11263
|
+
_context4.next = 28;
|
|
11264
|
+
break;
|
|
11265
|
+
case 26:
|
|
11266
|
+
_context4.next = 28;
|
|
10566
11267
|
return checkKeepAlive({
|
|
10567
11268
|
originApi: apiWithFallback,
|
|
10568
11269
|
address: address,
|
|
@@ -10571,7 +11272,7 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10571
11272
|
currencySymbol: getRelayChainSymbol(destination),
|
|
10572
11273
|
destNode: destination
|
|
10573
11274
|
});
|
|
10574
|
-
case
|
|
11275
|
+
case 28:
|
|
10575
11276
|
serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(destination) : destination).transferRelayToPara({
|
|
10576
11277
|
api: apiWithFallback,
|
|
10577
11278
|
destination: destination,
|
|
@@ -10582,13 +11283,13 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
10582
11283
|
version: version
|
|
10583
11284
|
});
|
|
10584
11285
|
if (!serializedApiCallEnabled) {
|
|
10585
|
-
_context4.next =
|
|
11286
|
+
_context4.next = 31;
|
|
10586
11287
|
break;
|
|
10587
11288
|
}
|
|
10588
11289
|
return _context4.abrupt("return", serializedApiCall);
|
|
10589
|
-
case
|
|
11290
|
+
case 31:
|
|
10590
11291
|
return _context4.abrupt("return", callPolkadotJsTxFunction(apiWithFallback, serializedApiCall));
|
|
10591
|
-
case
|
|
11292
|
+
case 32:
|
|
10592
11293
|
case "end":
|
|
10593
11294
|
return _context4.stop();
|
|
10594
11295
|
}
|
|
@@ -10640,12 +11341,17 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
10640
11341
|
});
|
|
10641
11342
|
|
|
10642
11343
|
exports.Builder = Builder;
|
|
11344
|
+
exports.CloseChannelBuilder = CloseChannelBuilder;
|
|
11345
|
+
exports.EvmBuilder = EvmBuilder;
|
|
10643
11346
|
exports.IncompatibleNodesError = IncompatibleNodesError;
|
|
10644
11347
|
exports.InvalidCurrencyError = InvalidCurrencyError;
|
|
10645
11348
|
exports.NODES_WITH_RELAY_CHAINS = NODES_WITH_RELAY_CHAINS;
|
|
11349
|
+
exports.NODES_WITH_RELAY_CHAINS_DOT_KSM = NODES_WITH_RELAY_CHAINS_DOT_KSM;
|
|
10646
11350
|
exports.NODE_NAMES = NODE_NAMES;
|
|
11351
|
+
exports.NODE_NAMES_DOT_KSM = NODE_NAMES_DOT_KSM;
|
|
10647
11352
|
exports.NoXCMSupportImplementedError = NoXCMSupportImplementedError;
|
|
10648
11353
|
exports.NodeNotSupportedError = NodeNotSupportedError;
|
|
11354
|
+
exports.OpenChannelBuilder = OpenChannelBuilder;
|
|
10649
11355
|
exports.SUPPORTED_PALLETS = SUPPORTED_PALLETS;
|
|
10650
11356
|
exports.ScenarioNotSupportedError = ScenarioNotSupportedError;
|
|
10651
11357
|
exports.assets = index$1;
|
|
@@ -10660,6 +11366,7 @@ exports.getBalanceForeign = getBalanceForeign;
|
|
|
10660
11366
|
exports.getBalanceNative = getBalanceNative;
|
|
10661
11367
|
exports.getDefaultPallet = getDefaultPallet;
|
|
10662
11368
|
exports.getExistentialDeposit = getExistentialDeposit;
|
|
11369
|
+
exports.getNativeAssetSymbol = getNativeAssetSymbol;
|
|
10663
11370
|
exports.getNativeAssets = getNativeAssets;
|
|
10664
11371
|
exports.getNode = getNode;
|
|
10665
11372
|
exports.getNodeEndpointOption = getNodeEndpointOption;
|