@paraspell/sdk 5.0.1 → 5.2.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 +28 -15
- package/dist/index.cjs +784 -213
- package/dist/index.d.ts +235 -112
- package/dist/index.mjs +784 -213
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -336,6 +336,15 @@ function _toPropertyKey(t) {
|
|
|
336
336
|
var i = _toPrimitive(t, "string");
|
|
337
337
|
return "symbol" == typeof i ? i : i + "";
|
|
338
338
|
}
|
|
339
|
+
function _typeof(o) {
|
|
340
|
+
"@babel/helpers - typeof";
|
|
341
|
+
|
|
342
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
343
|
+
return typeof o;
|
|
344
|
+
} : function (o) {
|
|
345
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
346
|
+
}, _typeof(o);
|
|
347
|
+
}
|
|
339
348
|
function _classCallCheck(instance, Constructor) {
|
|
340
349
|
if (!(instance instanceof Constructor)) {
|
|
341
350
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -496,6 +505,57 @@ function _arrayLikeToArray(arr, len) {
|
|
|
496
505
|
function _nonIterableSpread() {
|
|
497
506
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
498
507
|
}
|
|
508
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
509
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
510
|
+
if (!it) {
|
|
511
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
512
|
+
if (it) o = it;
|
|
513
|
+
var i = 0;
|
|
514
|
+
var F = function () {};
|
|
515
|
+
return {
|
|
516
|
+
s: F,
|
|
517
|
+
n: function () {
|
|
518
|
+
if (i >= o.length) return {
|
|
519
|
+
done: true
|
|
520
|
+
};
|
|
521
|
+
return {
|
|
522
|
+
done: false,
|
|
523
|
+
value: o[i++]
|
|
524
|
+
};
|
|
525
|
+
},
|
|
526
|
+
e: function (e) {
|
|
527
|
+
throw e;
|
|
528
|
+
},
|
|
529
|
+
f: F
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
533
|
+
}
|
|
534
|
+
var normalCompletion = true,
|
|
535
|
+
didErr = false,
|
|
536
|
+
err;
|
|
537
|
+
return {
|
|
538
|
+
s: function () {
|
|
539
|
+
it = it.call(o);
|
|
540
|
+
},
|
|
541
|
+
n: function () {
|
|
542
|
+
var step = it.next();
|
|
543
|
+
normalCompletion = step.done;
|
|
544
|
+
return step;
|
|
545
|
+
},
|
|
546
|
+
e: function (e) {
|
|
547
|
+
didErr = true;
|
|
548
|
+
err = e;
|
|
549
|
+
},
|
|
550
|
+
f: function () {
|
|
551
|
+
try {
|
|
552
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
553
|
+
} finally {
|
|
554
|
+
if (didErr) throw err;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
499
559
|
|
|
500
560
|
/******************************************************************************
|
|
501
561
|
Copyright (c) Microsoft Corporation.
|
|
@@ -541,10 +601,10 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
541
601
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
542
602
|
};
|
|
543
603
|
|
|
544
|
-
// derrived from https://github.com/kodadot/packages/blob/main/minimark/src/common/types.ts
|
|
545
604
|
var Version;
|
|
546
605
|
(function (Version) {
|
|
547
606
|
Version["V1"] = "V1";
|
|
607
|
+
Version["V2"] = "V2";
|
|
548
608
|
Version["V3"] = "V3";
|
|
549
609
|
})(Version || (Version = {}));
|
|
550
610
|
var Parents;
|
|
@@ -920,6 +980,11 @@ var Astar$3 = {
|
|
|
920
980
|
symbol: "aSEED",
|
|
921
981
|
decimals: 12
|
|
922
982
|
},
|
|
983
|
+
{
|
|
984
|
+
assetId: "18446744073709551634",
|
|
985
|
+
symbol: "xcPEN",
|
|
986
|
+
decimals: 12
|
|
987
|
+
},
|
|
923
988
|
{
|
|
924
989
|
assetId: "1336",
|
|
925
990
|
symbol: "TDOT",
|
|
@@ -1074,6 +1139,11 @@ var Centrifuge$3 = {
|
|
|
1074
1139
|
symbol: "localUSDC",
|
|
1075
1140
|
decimals: 6
|
|
1076
1141
|
},
|
|
1142
|
+
{
|
|
1143
|
+
assetId: "1615768079",
|
|
1144
|
+
symbol: "NS3SR",
|
|
1145
|
+
decimals: 6
|
|
1146
|
+
},
|
|
1077
1147
|
{
|
|
1078
1148
|
assetId: "100006",
|
|
1079
1149
|
symbol: "LpCeloUSDC",
|
|
@@ -1128,6 +1198,11 @@ var Centrifuge$3 = {
|
|
|
1128
1198
|
assetId: "4139607887",
|
|
1129
1199
|
symbol: "LTF",
|
|
1130
1200
|
decimals: 6
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
assetId: "1615768079",
|
|
1204
|
+
symbol: "NS3JR",
|
|
1205
|
+
decimals: 6
|
|
1131
1206
|
}
|
|
1132
1207
|
]
|
|
1133
1208
|
};
|
|
@@ -1307,48 +1382,68 @@ var HydraDX$3 = {
|
|
|
1307
1382
|
],
|
|
1308
1383
|
otherAssets: [
|
|
1309
1384
|
{
|
|
1310
|
-
assetId: "
|
|
1311
|
-
symbol: "
|
|
1385
|
+
assetId: "100",
|
|
1386
|
+
symbol: "4-Pool",
|
|
1387
|
+
decimals: 18
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
assetId: "0",
|
|
1391
|
+
symbol: "HDX",
|
|
1392
|
+
decimals: 12
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
assetId: "10",
|
|
1396
|
+
symbol: "USDT",
|
|
1312
1397
|
decimals: 6
|
|
1313
1398
|
},
|
|
1314
1399
|
{
|
|
1315
|
-
assetId: "
|
|
1400
|
+
assetId: "4",
|
|
1316
1401
|
symbol: "WETH",
|
|
1317
1402
|
decimals: 18
|
|
1318
1403
|
},
|
|
1319
1404
|
{
|
|
1320
|
-
assetId: "
|
|
1321
|
-
symbol: "
|
|
1322
|
-
decimals:
|
|
1405
|
+
assetId: "21",
|
|
1406
|
+
symbol: "USDC",
|
|
1407
|
+
decimals: 6
|
|
1323
1408
|
},
|
|
1324
1409
|
{
|
|
1325
|
-
assetId: "
|
|
1326
|
-
symbol: "
|
|
1327
|
-
decimals:
|
|
1410
|
+
assetId: "28",
|
|
1411
|
+
symbol: "KILT",
|
|
1412
|
+
decimals: 15
|
|
1328
1413
|
},
|
|
1329
1414
|
{
|
|
1330
|
-
assetId: "
|
|
1331
|
-
symbol: "
|
|
1332
|
-
decimals:
|
|
1415
|
+
assetId: "20",
|
|
1416
|
+
symbol: "WETH",
|
|
1417
|
+
decimals: 18
|
|
1333
1418
|
},
|
|
1334
1419
|
{
|
|
1335
|
-
assetId: "
|
|
1336
|
-
symbol: "
|
|
1420
|
+
assetId: "101",
|
|
1421
|
+
symbol: "2-Pool",
|
|
1337
1422
|
decimals: 18
|
|
1338
1423
|
},
|
|
1339
1424
|
{
|
|
1340
|
-
assetId: "
|
|
1341
|
-
symbol: "
|
|
1425
|
+
assetId: "16",
|
|
1426
|
+
symbol: "GLMR",
|
|
1427
|
+
decimals: 18
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
assetId: "11",
|
|
1431
|
+
symbol: "iBTC",
|
|
1432
|
+
decimals: 8
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
assetId: "1000099",
|
|
1436
|
+
symbol: "ACA",
|
|
1342
1437
|
decimals: 12
|
|
1343
1438
|
},
|
|
1344
1439
|
{
|
|
1345
|
-
assetId: "
|
|
1346
|
-
symbol: "
|
|
1440
|
+
assetId: "14",
|
|
1441
|
+
symbol: "BNC",
|
|
1347
1442
|
decimals: 12
|
|
1348
1443
|
},
|
|
1349
1444
|
{
|
|
1350
|
-
assetId: "
|
|
1351
|
-
symbol: "
|
|
1445
|
+
assetId: "6",
|
|
1446
|
+
symbol: "APE",
|
|
1352
1447
|
decimals: 18
|
|
1353
1448
|
},
|
|
1354
1449
|
{
|
|
@@ -1357,64 +1452,84 @@ var HydraDX$3 = {
|
|
|
1357
1452
|
decimals: 8
|
|
1358
1453
|
},
|
|
1359
1454
|
{
|
|
1360
|
-
assetId: "
|
|
1361
|
-
symbol: "
|
|
1455
|
+
assetId: "15",
|
|
1456
|
+
symbol: "vDOT",
|
|
1457
|
+
decimals: 10
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
assetId: "2",
|
|
1461
|
+
symbol: "DAI",
|
|
1362
1462
|
decimals: 18
|
|
1363
1463
|
},
|
|
1364
1464
|
{
|
|
1365
|
-
assetId: "
|
|
1366
|
-
symbol: "
|
|
1465
|
+
assetId: "13",
|
|
1466
|
+
symbol: "CFG",
|
|
1367
1467
|
decimals: 18
|
|
1368
1468
|
},
|
|
1369
1469
|
{
|
|
1370
|
-
assetId: "
|
|
1371
|
-
symbol: "
|
|
1470
|
+
assetId: "27",
|
|
1471
|
+
symbol: "CRU",
|
|
1372
1472
|
decimals: 12
|
|
1373
1473
|
},
|
|
1374
1474
|
{
|
|
1375
|
-
assetId: "
|
|
1376
|
-
symbol: "
|
|
1377
|
-
decimals:
|
|
1475
|
+
assetId: "102",
|
|
1476
|
+
symbol: "2-Pool",
|
|
1477
|
+
decimals: 18
|
|
1378
1478
|
},
|
|
1379
1479
|
{
|
|
1380
|
-
assetId: "
|
|
1381
|
-
symbol: "
|
|
1480
|
+
assetId: "5",
|
|
1481
|
+
symbol: "DOT",
|
|
1382
1482
|
decimals: 10
|
|
1383
1483
|
},
|
|
1384
1484
|
{
|
|
1385
|
-
assetId: "
|
|
1386
|
-
symbol: "
|
|
1387
|
-
decimals:
|
|
1485
|
+
assetId: "18",
|
|
1486
|
+
symbol: "DAI",
|
|
1487
|
+
decimals: 18
|
|
1388
1488
|
},
|
|
1389
1489
|
{
|
|
1390
|
-
assetId: "
|
|
1490
|
+
assetId: "7",
|
|
1391
1491
|
symbol: "USDC",
|
|
1392
1492
|
decimals: 6
|
|
1393
1493
|
},
|
|
1394
1494
|
{
|
|
1395
|
-
assetId: "
|
|
1396
|
-
symbol: "
|
|
1397
|
-
decimals:
|
|
1495
|
+
assetId: "26",
|
|
1496
|
+
symbol: "NODL",
|
|
1497
|
+
decimals: 11
|
|
1398
1498
|
},
|
|
1399
1499
|
{
|
|
1400
|
-
assetId: "
|
|
1401
|
-
symbol: "
|
|
1500
|
+
assetId: "22",
|
|
1501
|
+
symbol: "USDC",
|
|
1402
1502
|
decimals: 6
|
|
1403
1503
|
},
|
|
1404
1504
|
{
|
|
1405
|
-
assetId: "
|
|
1406
|
-
symbol: "
|
|
1505
|
+
assetId: "24",
|
|
1506
|
+
symbol: "SUB",
|
|
1507
|
+
decimals: 10
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
assetId: "8",
|
|
1511
|
+
symbol: "PHA",
|
|
1407
1512
|
decimals: 12
|
|
1408
1513
|
},
|
|
1409
1514
|
{
|
|
1410
|
-
assetId: "
|
|
1411
|
-
symbol: "
|
|
1412
|
-
decimals:
|
|
1515
|
+
assetId: "1000100",
|
|
1516
|
+
symbol: "LDOT",
|
|
1517
|
+
decimals: 10
|
|
1413
1518
|
},
|
|
1414
1519
|
{
|
|
1415
|
-
assetId: "
|
|
1416
|
-
symbol: "
|
|
1417
|
-
decimals:
|
|
1520
|
+
assetId: "1",
|
|
1521
|
+
symbol: "LRNA",
|
|
1522
|
+
decimals: 12
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
assetId: "12",
|
|
1526
|
+
symbol: "ZTG",
|
|
1527
|
+
decimals: 10
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
assetId: "1000081",
|
|
1531
|
+
symbol: "PEN",
|
|
1532
|
+
decimals: 12
|
|
1418
1533
|
},
|
|
1419
1534
|
{
|
|
1420
1535
|
assetId: "3",
|
|
@@ -1427,8 +1542,8 @@ var HydraDX$3 = {
|
|
|
1427
1542
|
decimals: 10
|
|
1428
1543
|
},
|
|
1429
1544
|
{
|
|
1430
|
-
assetId: "
|
|
1431
|
-
symbol: "
|
|
1545
|
+
assetId: "25",
|
|
1546
|
+
symbol: "UNQ",
|
|
1432
1547
|
decimals: 18
|
|
1433
1548
|
},
|
|
1434
1549
|
{
|
|
@@ -1437,19 +1552,9 @@ var HydraDX$3 = {
|
|
|
1437
1552
|
decimals: 6
|
|
1438
1553
|
},
|
|
1439
1554
|
{
|
|
1440
|
-
assetId: "
|
|
1441
|
-
symbol: "
|
|
1442
|
-
decimals: 18
|
|
1443
|
-
},
|
|
1444
|
-
{
|
|
1445
|
-
assetId: "25",
|
|
1446
|
-
symbol: "UNQ",
|
|
1555
|
+
assetId: "9",
|
|
1556
|
+
symbol: "ASTR",
|
|
1447
1557
|
decimals: 18
|
|
1448
|
-
},
|
|
1449
|
-
{
|
|
1450
|
-
assetId: "12",
|
|
1451
|
-
symbol: "ZTG",
|
|
1452
|
-
decimals: 10
|
|
1453
1558
|
}
|
|
1454
1559
|
]
|
|
1455
1560
|
};
|
|
@@ -1489,6 +1594,11 @@ var Interlay$3 = {
|
|
|
1489
1594
|
symbol: "WBNB.wh",
|
|
1490
1595
|
decimals: 18
|
|
1491
1596
|
},
|
|
1597
|
+
{
|
|
1598
|
+
assetId: "13",
|
|
1599
|
+
symbol: "HDX",
|
|
1600
|
+
decimals: 12
|
|
1601
|
+
},
|
|
1492
1602
|
{
|
|
1493
1603
|
assetId: "5",
|
|
1494
1604
|
symbol: "TBTC.wh",
|
|
@@ -1538,6 +1648,11 @@ var Interlay$3 = {
|
|
|
1538
1648
|
assetId: "4",
|
|
1539
1649
|
symbol: "DAI.wh",
|
|
1540
1650
|
decimals: 18
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
assetId: "12",
|
|
1654
|
+
symbol: "USDC",
|
|
1655
|
+
decimals: 6
|
|
1541
1656
|
}
|
|
1542
1657
|
]
|
|
1543
1658
|
};
|
|
@@ -1575,11 +1690,21 @@ var Moonbeam$3 = {
|
|
|
1575
1690
|
symbol: "ZTG",
|
|
1576
1691
|
decimals: 10
|
|
1577
1692
|
},
|
|
1693
|
+
{
|
|
1694
|
+
assetId: "283870493414747423842723289889816153538",
|
|
1695
|
+
symbol: "UNQ",
|
|
1696
|
+
decimals: 18
|
|
1697
|
+
},
|
|
1578
1698
|
{
|
|
1579
1699
|
assetId: "90225766094594282577230355136633846906",
|
|
1580
1700
|
symbol: "PDEX",
|
|
1581
1701
|
decimals: 12
|
|
1582
1702
|
},
|
|
1703
|
+
{
|
|
1704
|
+
assetId: "314077021455772878282433861213184736939",
|
|
1705
|
+
symbol: "PEAQ",
|
|
1706
|
+
decimals: 18
|
|
1707
|
+
},
|
|
1583
1708
|
{
|
|
1584
1709
|
assetId: "144012926827374458669278577633504620722",
|
|
1585
1710
|
symbol: "FIL",
|
|
@@ -1630,6 +1755,11 @@ var Moonbeam$3 = {
|
|
|
1630
1755
|
symbol: "LDOT",
|
|
1631
1756
|
decimals: 10
|
|
1632
1757
|
},
|
|
1758
|
+
{
|
|
1759
|
+
assetId: "124463719055550872076363892993240202694",
|
|
1760
|
+
symbol: "DED",
|
|
1761
|
+
decimals: 10
|
|
1762
|
+
},
|
|
1633
1763
|
{
|
|
1634
1764
|
assetId: "224077081838586484055667086558292981199",
|
|
1635
1765
|
symbol: "ASTR",
|
|
@@ -1645,6 +1775,11 @@ var Moonbeam$3 = {
|
|
|
1645
1775
|
symbol: "USDC",
|
|
1646
1776
|
decimals: 6
|
|
1647
1777
|
},
|
|
1778
|
+
{
|
|
1779
|
+
assetId: "142155548796783636521833385094843759961",
|
|
1780
|
+
symbol: "BNCS",
|
|
1781
|
+
decimals: 12
|
|
1782
|
+
},
|
|
1648
1783
|
{
|
|
1649
1784
|
assetId: "89994634370519791027168048838578580624",
|
|
1650
1785
|
symbol: "SUB",
|
|
@@ -1665,6 +1800,11 @@ var Moonbeam$3 = {
|
|
|
1665
1800
|
symbol: "vGLMR",
|
|
1666
1801
|
decimals: 18
|
|
1667
1802
|
},
|
|
1803
|
+
{
|
|
1804
|
+
assetId: "289989900872525819559124583375550296953",
|
|
1805
|
+
symbol: "vMANTA",
|
|
1806
|
+
decimals: 18
|
|
1807
|
+
},
|
|
1668
1808
|
{
|
|
1669
1809
|
assetId: "110021739665376159354538090254163045594",
|
|
1670
1810
|
symbol: "aUSD",
|
|
@@ -1730,11 +1870,21 @@ var Moonbeam$3 = {
|
|
|
1730
1870
|
symbol: "vFIL",
|
|
1731
1871
|
decimals: 18
|
|
1732
1872
|
},
|
|
1873
|
+
{
|
|
1874
|
+
assetId: "114018676402354620972806895487280206446",
|
|
1875
|
+
symbol: "vASTR",
|
|
1876
|
+
decimals: 18
|
|
1877
|
+
},
|
|
1733
1878
|
{
|
|
1734
1879
|
assetId: "238111524681612888331172110363070489924",
|
|
1735
1880
|
symbol: "OTP",
|
|
1736
1881
|
decimals: 12
|
|
1737
1882
|
},
|
|
1883
|
+
{
|
|
1884
|
+
assetId: "112679793397406599376365943185137098326",
|
|
1885
|
+
symbol: "STINK",
|
|
1886
|
+
decimals: 10
|
|
1887
|
+
},
|
|
1738
1888
|
{
|
|
1739
1889
|
assetId: "132685552157663328694213725410064821485",
|
|
1740
1890
|
symbol: "PHA",
|
|
@@ -1946,16 +2096,36 @@ var AssetHubPolkadot$3 = {
|
|
|
1946
2096
|
}
|
|
1947
2097
|
],
|
|
1948
2098
|
otherAssets: [
|
|
2099
|
+
{
|
|
2100
|
+
assetId: "9999",
|
|
2101
|
+
symbol: "TOM",
|
|
2102
|
+
decimals: 10
|
|
2103
|
+
},
|
|
1949
2104
|
{
|
|
1950
2105
|
assetId: "100",
|
|
1951
2106
|
symbol: "WETH",
|
|
1952
2107
|
decimals: 18
|
|
1953
2108
|
},
|
|
2109
|
+
{
|
|
2110
|
+
assetId: "482",
|
|
2111
|
+
symbol: "HUB",
|
|
2112
|
+
decimals: 10
|
|
2113
|
+
},
|
|
1954
2114
|
{
|
|
1955
2115
|
assetId: "123",
|
|
1956
2116
|
symbol: "123",
|
|
1957
2117
|
decimals: 20
|
|
1958
2118
|
},
|
|
2119
|
+
{
|
|
2120
|
+
assetId: "9000",
|
|
2121
|
+
symbol: "PLAY",
|
|
2122
|
+
decimals: 10
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
assetId: "69420",
|
|
2126
|
+
symbol: "GABE",
|
|
2127
|
+
decimals: 20
|
|
2128
|
+
},
|
|
1959
2129
|
{
|
|
1960
2130
|
assetId: "25518",
|
|
1961
2131
|
symbol: "BEER",
|
|
@@ -2011,6 +2181,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2011
2181
|
symbol: "Cypress",
|
|
2012
2182
|
decimals: 0
|
|
2013
2183
|
},
|
|
2184
|
+
{
|
|
2185
|
+
assetId: "7777",
|
|
2186
|
+
symbol: "FUM",
|
|
2187
|
+
decimals: 10
|
|
2188
|
+
},
|
|
2014
2189
|
{
|
|
2015
2190
|
assetId: "11",
|
|
2016
2191
|
symbol: "web3",
|
|
@@ -2021,6 +2196,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2021
2196
|
symbol: "DED",
|
|
2022
2197
|
decimals: 18
|
|
2023
2198
|
},
|
|
2199
|
+
{
|
|
2200
|
+
assetId: "111",
|
|
2201
|
+
symbol: "DEMO",
|
|
2202
|
+
decimals: 6
|
|
2203
|
+
},
|
|
2024
2204
|
{
|
|
2025
2205
|
assetId: "555",
|
|
2026
2206
|
symbol: "GAME",
|
|
@@ -2041,6 +2221,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2041
2221
|
symbol: "TST",
|
|
2042
2222
|
decimals: 10
|
|
2043
2223
|
},
|
|
2224
|
+
{
|
|
2225
|
+
assetId: "8889",
|
|
2226
|
+
symbol: "BNDT",
|
|
2227
|
+
decimals: 10
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
assetId: "8886",
|
|
2231
|
+
symbol: "BANDIT",
|
|
2232
|
+
decimals: 10
|
|
2233
|
+
},
|
|
2044
2234
|
{
|
|
2045
2235
|
assetId: "42069",
|
|
2046
2236
|
symbol: "STINK",
|
|
@@ -2051,6 +2241,16 @@ var AssetHubPolkadot$3 = {
|
|
|
2051
2241
|
symbol: "TRQ",
|
|
2052
2242
|
decimals: 18
|
|
2053
2243
|
},
|
|
2244
|
+
{
|
|
2245
|
+
assetId: "9002",
|
|
2246
|
+
symbol: "TAPE",
|
|
2247
|
+
decimals: 10
|
|
2248
|
+
},
|
|
2249
|
+
{
|
|
2250
|
+
assetId: "33",
|
|
2251
|
+
symbol: "COCOA",
|
|
2252
|
+
decimals: 10
|
|
2253
|
+
},
|
|
2054
2254
|
{
|
|
2055
2255
|
assetId: "15",
|
|
2056
2256
|
symbol: "Meme",
|
|
@@ -2061,6 +2261,11 @@ var AssetHubPolkadot$3 = {
|
|
|
2061
2261
|
symbol: "BTC",
|
|
2062
2262
|
decimals: 20
|
|
2063
2263
|
},
|
|
2264
|
+
{
|
|
2265
|
+
assetId: "9527",
|
|
2266
|
+
symbol: "LSCAT",
|
|
2267
|
+
decimals: 10
|
|
2268
|
+
},
|
|
2064
2269
|
{
|
|
2065
2270
|
assetId: "868367",
|
|
2066
2271
|
symbol: "VSC",
|
|
@@ -2079,13 +2284,18 @@ var AssetHubPolkadot$3 = {
|
|
|
2079
2284
|
{
|
|
2080
2285
|
assetId: "18",
|
|
2081
2286
|
symbol: "DOTA",
|
|
2082
|
-
decimals:
|
|
2287
|
+
decimals: 4
|
|
2083
2288
|
},
|
|
2084
2289
|
{
|
|
2085
2290
|
assetId: "7",
|
|
2086
2291
|
symbol: "lucky7",
|
|
2087
2292
|
decimals: 20
|
|
2088
2293
|
},
|
|
2294
|
+
{
|
|
2295
|
+
assetId: "4294967295",
|
|
2296
|
+
symbol: "(>'')>",
|
|
2297
|
+
decimals: 0
|
|
2298
|
+
},
|
|
2089
2299
|
{
|
|
2090
2300
|
assetId: "1984",
|
|
2091
2301
|
symbol: "USDt",
|
|
@@ -2116,6 +2326,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2116
2326
|
symbol: "HAM",
|
|
2117
2327
|
decimals: 10
|
|
2118
2328
|
},
|
|
2329
|
+
{
|
|
2330
|
+
assetId: "9003",
|
|
2331
|
+
symbol: "KTRL",
|
|
2332
|
+
decimals: 10
|
|
2333
|
+
},
|
|
2334
|
+
{
|
|
2335
|
+
assetId: "1313",
|
|
2336
|
+
symbol: "GGI",
|
|
2337
|
+
decimals: 6
|
|
2338
|
+
},
|
|
2339
|
+
{
|
|
2340
|
+
assetId: "24",
|
|
2341
|
+
symbol: "PRDOG",
|
|
2342
|
+
decimals: 10
|
|
2343
|
+
},
|
|
2119
2344
|
{
|
|
2120
2345
|
assetId: "2023",
|
|
2121
2346
|
symbol: "dot",
|
|
@@ -2131,11 +2356,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2131
2356
|
symbol: "HOOT",
|
|
2132
2357
|
decimals: 6
|
|
2133
2358
|
},
|
|
2359
|
+
{
|
|
2360
|
+
assetId: "404",
|
|
2361
|
+
symbol: "clay",
|
|
2362
|
+
decimals: 20
|
|
2363
|
+
},
|
|
2134
2364
|
{
|
|
2135
2365
|
assetId: "1000",
|
|
2136
2366
|
symbol: "BRZ",
|
|
2137
2367
|
decimals: 6
|
|
2138
2368
|
},
|
|
2369
|
+
{
|
|
2370
|
+
assetId: "8008",
|
|
2371
|
+
symbol: "HOBO",
|
|
2372
|
+
decimals: 2
|
|
2373
|
+
},
|
|
2374
|
+
{
|
|
2375
|
+
assetId: "6666",
|
|
2376
|
+
symbol: "CHAOS",
|
|
2377
|
+
decimals: 10
|
|
2378
|
+
},
|
|
2139
2379
|
{
|
|
2140
2380
|
assetId: "1",
|
|
2141
2381
|
symbol: "no1",
|
|
@@ -2146,11 +2386,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2146
2386
|
symbol: "USDcp",
|
|
2147
2387
|
decimals: 0
|
|
2148
2388
|
},
|
|
2389
|
+
{
|
|
2390
|
+
assetId: "31337",
|
|
2391
|
+
symbol: "WUD",
|
|
2392
|
+
decimals: 10
|
|
2393
|
+
},
|
|
2149
2394
|
{
|
|
2150
2395
|
assetId: "3",
|
|
2151
2396
|
symbol: "DOT",
|
|
2152
2397
|
decimals: 20
|
|
2153
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
assetId: "6969",
|
|
2401
|
+
symbol: "LEEMO",
|
|
2402
|
+
decimals: 10
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
assetId: "1983",
|
|
2406
|
+
symbol: "KAS",
|
|
2407
|
+
decimals: 12
|
|
2408
|
+
},
|
|
2154
2409
|
{
|
|
2155
2410
|
assetId: "1337",
|
|
2156
2411
|
symbol: "USDC",
|
|
@@ -2161,6 +2416,21 @@ var AssetHubPolkadot$3 = {
|
|
|
2161
2416
|
symbol: "DANGER",
|
|
2162
2417
|
decimals: 8
|
|
2163
2418
|
},
|
|
2419
|
+
{
|
|
2420
|
+
assetId: "17",
|
|
2421
|
+
symbol: "WIFD",
|
|
2422
|
+
decimals: 10
|
|
2423
|
+
},
|
|
2424
|
+
{
|
|
2425
|
+
assetId: "25",
|
|
2426
|
+
symbol: "T54",
|
|
2427
|
+
decimals: 10
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
assetId: "69",
|
|
2431
|
+
symbol: "DAL",
|
|
2432
|
+
decimals: 18
|
|
2433
|
+
},
|
|
2164
2434
|
{
|
|
2165
2435
|
assetId: "23",
|
|
2166
2436
|
symbol: "PINK",
|
|
@@ -2171,6 +2441,26 @@ var AssetHubPolkadot$3 = {
|
|
|
2171
2441
|
symbol: "HASH",
|
|
2172
2442
|
decimals: 18
|
|
2173
2443
|
},
|
|
2444
|
+
{
|
|
2445
|
+
assetId: "9001",
|
|
2446
|
+
symbol: "BOMB",
|
|
2447
|
+
decimals: 10
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
assetId: "149",
|
|
2451
|
+
symbol: "EDU",
|
|
2452
|
+
decimals: 10
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
assetId: "1980",
|
|
2456
|
+
symbol: "GAVIN",
|
|
2457
|
+
decimals: 0
|
|
2458
|
+
},
|
|
2459
|
+
{
|
|
2460
|
+
assetId: "4157",
|
|
2461
|
+
symbol: "PDOG",
|
|
2462
|
+
decimals: 10
|
|
2463
|
+
},
|
|
2174
2464
|
{
|
|
2175
2465
|
assetId: "660301",
|
|
2176
2466
|
symbol: "GRL",
|
|
@@ -2186,10 +2476,20 @@ var AssetHubPolkadot$3 = {
|
|
|
2186
2476
|
symbol: "CUBO",
|
|
2187
2477
|
decimals: 9
|
|
2188
2478
|
},
|
|
2479
|
+
{
|
|
2480
|
+
assetId: "888",
|
|
2481
|
+
symbol: "ASX",
|
|
2482
|
+
decimals: 10
|
|
2483
|
+
},
|
|
2189
2484
|
{
|
|
2190
2485
|
assetId: "2024",
|
|
2191
2486
|
symbol: "WOOD",
|
|
2192
2487
|
decimals: 10
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
assetId: "2230",
|
|
2491
|
+
symbol: "GBILL",
|
|
2492
|
+
decimals: 8
|
|
2193
2493
|
}
|
|
2194
2494
|
]
|
|
2195
2495
|
};
|
|
@@ -2550,6 +2850,19 @@ var Imbue$3 = {
|
|
|
2550
2850
|
otherAssets: [
|
|
2551
2851
|
]
|
|
2552
2852
|
};
|
|
2853
|
+
var KiltSpiritnet$3 = {
|
|
2854
|
+
paraId: 2086,
|
|
2855
|
+
relayChainAssetSymbol: "DOT",
|
|
2856
|
+
nativeAssetSymbol: "KILT",
|
|
2857
|
+
nativeAssets: [
|
|
2858
|
+
{
|
|
2859
|
+
symbol: "KILT",
|
|
2860
|
+
decimals: 15
|
|
2861
|
+
}
|
|
2862
|
+
],
|
|
2863
|
+
otherAssets: [
|
|
2864
|
+
]
|
|
2865
|
+
};
|
|
2553
2866
|
var Integritee$3 = {
|
|
2554
2867
|
paraId: 2015,
|
|
2555
2868
|
relayChainAssetSymbol: "KSM",
|
|
@@ -3115,6 +3428,11 @@ var Moonriver$3 = {
|
|
|
3115
3428
|
symbol: "HKO",
|
|
3116
3429
|
decimals: 12
|
|
3117
3430
|
},
|
|
3431
|
+
{
|
|
3432
|
+
assetId: "138512078356357941985706694377215053953",
|
|
3433
|
+
symbol: "TNKR",
|
|
3434
|
+
decimals: 12
|
|
3435
|
+
},
|
|
3118
3436
|
{
|
|
3119
3437
|
assetId: "328179947973504579459046439826496046832",
|
|
3120
3438
|
symbol: "KBTC",
|
|
@@ -3863,6 +4181,11 @@ var Shiden$3 = {
|
|
|
3863
4181
|
symbol: "SYG",
|
|
3864
4182
|
decimals: 10
|
|
3865
4183
|
},
|
|
4184
|
+
{
|
|
4185
|
+
assetId: "18446744073709551634",
|
|
4186
|
+
symbol: "BILL",
|
|
4187
|
+
decimals: 8
|
|
4188
|
+
},
|
|
3866
4189
|
{
|
|
3867
4190
|
assetId: "18446744073709551626",
|
|
3868
4191
|
symbol: "SKU",
|
|
@@ -3991,6 +4314,11 @@ var AssetHubKusama$3 = {
|
|
|
3991
4314
|
symbol: "USDC",
|
|
3992
4315
|
decimals: 4
|
|
3993
4316
|
},
|
|
4317
|
+
{
|
|
4318
|
+
assetId: "120",
|
|
4319
|
+
symbol: "OAT",
|
|
4320
|
+
decimals: 4
|
|
4321
|
+
},
|
|
3994
4322
|
{
|
|
3995
4323
|
assetId: "1111",
|
|
3996
4324
|
symbol: "MTVD",
|
|
@@ -4306,6 +4634,11 @@ var AssetHubKusama$3 = {
|
|
|
4306
4634
|
symbol: "PNN",
|
|
4307
4635
|
decimals: 10
|
|
4308
4636
|
},
|
|
4637
|
+
{
|
|
4638
|
+
assetId: "1121",
|
|
4639
|
+
symbol: "OAT",
|
|
4640
|
+
decimals: 12
|
|
4641
|
+
},
|
|
4309
4642
|
{
|
|
4310
4643
|
assetId: "117",
|
|
4311
4644
|
symbol: "TNKR",
|
|
@@ -4411,6 +4744,11 @@ var AssetHubKusama$3 = {
|
|
|
4411
4744
|
symbol: "HEI",
|
|
4412
4745
|
decimals: 10
|
|
4413
4746
|
},
|
|
4747
|
+
{
|
|
4748
|
+
assetId: "1311",
|
|
4749
|
+
symbol: "GCT",
|
|
4750
|
+
decimals: 4
|
|
4751
|
+
},
|
|
4414
4752
|
{
|
|
4415
4753
|
assetId: "7",
|
|
4416
4754
|
symbol: "DOS",
|
|
@@ -4506,6 +4844,11 @@ var AssetHubKusama$3 = {
|
|
|
4506
4844
|
symbol: "SATS",
|
|
4507
4845
|
decimals: 1
|
|
4508
4846
|
},
|
|
4847
|
+
{
|
|
4848
|
+
assetId: "177",
|
|
4849
|
+
symbol: "KST",
|
|
4850
|
+
decimals: 4
|
|
4851
|
+
},
|
|
4509
4852
|
{
|
|
4510
4853
|
assetId: "3000",
|
|
4511
4854
|
symbol: "GRAIN",
|
|
@@ -5197,6 +5540,11 @@ var Zeitgeist$3 = {
|
|
|
5197
5540
|
symbol: "USDC",
|
|
5198
5541
|
decimals: 6
|
|
5199
5542
|
},
|
|
5543
|
+
{
|
|
5544
|
+
assetId: "4",
|
|
5545
|
+
symbol: "USDC",
|
|
5546
|
+
decimals: 6
|
|
5547
|
+
},
|
|
5200
5548
|
{
|
|
5201
5549
|
assetId: "2",
|
|
5202
5550
|
symbol: "WSX",
|
|
@@ -5211,6 +5559,11 @@ var Zeitgeist$3 = {
|
|
|
5211
5559
|
assetId: "0",
|
|
5212
5560
|
symbol: "DOT",
|
|
5213
5561
|
decimals: 10
|
|
5562
|
+
},
|
|
5563
|
+
{
|
|
5564
|
+
assetId: "5",
|
|
5565
|
+
symbol: "USDT",
|
|
5566
|
+
decimals: 6
|
|
5214
5567
|
}
|
|
5215
5568
|
]
|
|
5216
5569
|
};
|
|
@@ -5433,6 +5786,7 @@ var assets = {
|
|
|
5433
5786
|
CrustShadow: CrustShadow$3,
|
|
5434
5787
|
Encointer: Encointer$3,
|
|
5435
5788
|
Imbue: Imbue$3,
|
|
5789
|
+
KiltSpiritnet: KiltSpiritnet$3,
|
|
5436
5790
|
Integritee: Integritee$3,
|
|
5437
5791
|
InvArchTinker: InvArchTinker$3,
|
|
5438
5792
|
Karura: Karura$3,
|
|
@@ -5492,6 +5846,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
5492
5846
|
InvArchTinker: InvArchTinker$3,
|
|
5493
5847
|
Karura: Karura$3,
|
|
5494
5848
|
Khala: Khala$3,
|
|
5849
|
+
KiltSpiritnet: KiltSpiritnet$3,
|
|
5495
5850
|
Kintsugi: Kintsugi$3,
|
|
5496
5851
|
Litentry: Litentry$3,
|
|
5497
5852
|
Litmus: Litmus$3,
|
|
@@ -5597,18 +5952,18 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
5597
5952
|
amount = _ref.amount,
|
|
5598
5953
|
paraIdTo = _ref.paraIdTo;
|
|
5599
5954
|
var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
5600
|
-
var paraId = paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination);
|
|
5601
|
-
var parameters = [createPolkadotXcmHeader('RelayToPara', version, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, Parents.ZERO), 0];
|
|
5955
|
+
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
5956
|
+
var parameters = [createPolkadotXcmHeader('RelayToPara', version, destination, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, Parents.ZERO), 0];
|
|
5602
5957
|
if (includeFee) {
|
|
5603
5958
|
parameters.push('Unlimited');
|
|
5604
5959
|
}
|
|
5605
5960
|
return parameters;
|
|
5606
5961
|
};
|
|
5607
|
-
var createCurrencySpec = function createCurrencySpec(amount, version, parents) {
|
|
5608
|
-
var interior = arguments.length >
|
|
5962
|
+
var createCurrencySpec = function createCurrencySpec(amount, version, parents, overridedMultiLocation) {
|
|
5963
|
+
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
5609
5964
|
return _defineProperty({}, version, [{
|
|
5610
5965
|
id: {
|
|
5611
|
-
Concrete: {
|
|
5966
|
+
Concrete: overridedMultiLocation !== null && overridedMultiLocation !== void 0 ? overridedMultiLocation : {
|
|
5612
5967
|
parents: parents,
|
|
5613
5968
|
interior: interior
|
|
5614
5969
|
}
|
|
@@ -5618,14 +5973,15 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents) {
|
|
|
5618
5973
|
}
|
|
5619
5974
|
}]);
|
|
5620
5975
|
};
|
|
5621
|
-
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, nodeId) {
|
|
5976
|
+
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId) {
|
|
5622
5977
|
var parents = scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
|
|
5623
5978
|
var interior = scenario === 'ParaToRelay' ? 'Here' : {
|
|
5624
5979
|
X1: {
|
|
5625
5980
|
Parachain: nodeId
|
|
5626
5981
|
}
|
|
5627
5982
|
};
|
|
5628
|
-
|
|
5983
|
+
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
5984
|
+
return _defineProperty({}, scenario === 'RelayToPara' ? Version.V3 : version, isMultiLocationDestination ? destination : {
|
|
5629
5985
|
parents: parents,
|
|
5630
5986
|
interior: interior
|
|
5631
5987
|
});
|
|
@@ -5649,6 +6005,42 @@ var calculateTransactionFee = function calculateTransactionFee(tx, address) {
|
|
|
5649
6005
|
}, _callee);
|
|
5650
6006
|
}));
|
|
5651
6007
|
};
|
|
6008
|
+
var findParachainJunction = function findParachainJunction(multilocation) {
|
|
6009
|
+
var interior = multilocation.interior;
|
|
6010
|
+
for (var key in interior) {
|
|
6011
|
+
var junctions = interior[key];
|
|
6012
|
+
if (Array.isArray(junctions)) {
|
|
6013
|
+
var _iterator = _createForOfIteratorHelper(junctions),
|
|
6014
|
+
_step;
|
|
6015
|
+
try {
|
|
6016
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6017
|
+
var junction = _step.value;
|
|
6018
|
+
if ('Parachain' in junction) {
|
|
6019
|
+
return Number(junction.Parachain);
|
|
6020
|
+
}
|
|
6021
|
+
}
|
|
6022
|
+
} catch (err) {
|
|
6023
|
+
_iterator.e(err);
|
|
6024
|
+
} finally {
|
|
6025
|
+
_iterator.f();
|
|
6026
|
+
}
|
|
6027
|
+
} else if (junctions !== undefined && 'Parachain' in junctions) {
|
|
6028
|
+
return Number(junctions.Parachain);
|
|
6029
|
+
}
|
|
6030
|
+
}
|
|
6031
|
+
return null;
|
|
6032
|
+
};
|
|
6033
|
+
var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(multiLocation) {
|
|
6034
|
+
var parachainId = findParachainJunction(multiLocation);
|
|
6035
|
+
if (parachainId === null) {
|
|
6036
|
+
throw new Error('Parachain ID not found in destination multi location.');
|
|
6037
|
+
}
|
|
6038
|
+
var node = getTNode(parachainId);
|
|
6039
|
+
if (node === null) {
|
|
6040
|
+
throw new Error('Node with specified paraId not found in destination multi location.');
|
|
6041
|
+
}
|
|
6042
|
+
return node;
|
|
6043
|
+
};
|
|
5652
6044
|
|
|
5653
6045
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
5654
6046
|
return 'transferXTokens' in obj;
|
|
@@ -5703,10 +6095,12 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5703
6095
|
address = options.address,
|
|
5704
6096
|
destination = options.destination,
|
|
5705
6097
|
paraIdTo = options.paraIdTo,
|
|
6098
|
+
overridedCurrencyMultiLocation = options.overridedCurrencyMultiLocation,
|
|
6099
|
+
feeAsset = options.feeAsset,
|
|
5706
6100
|
_options$serializedAp = options.serializedApiCallEnabled,
|
|
5707
6101
|
serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
|
|
5708
6102
|
var scenario = destination !== undefined ? 'ParaToPara' : 'ParaToRelay';
|
|
5709
|
-
var paraId = destination !== undefined ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
6103
|
+
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
5710
6104
|
if (supportsXTokens(this)) {
|
|
5711
6105
|
return this.transferXTokens({
|
|
5712
6106
|
api: api,
|
|
@@ -5719,6 +6113,8 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5719
6113
|
scenario: scenario,
|
|
5720
6114
|
paraIdTo: paraId,
|
|
5721
6115
|
destination: destination,
|
|
6116
|
+
overridedCurrencyMultiLocation: overridedCurrencyMultiLocation,
|
|
6117
|
+
feeAsset: feeAsset,
|
|
5722
6118
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
5723
6119
|
});
|
|
5724
6120
|
} else if (supportsXTransfer(this)) {
|
|
@@ -5731,16 +6127,18 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5731
6127
|
paraId: paraId,
|
|
5732
6128
|
origin: this.node,
|
|
5733
6129
|
destination: destination,
|
|
6130
|
+
overridedCurrencyMultiLocation: overridedCurrencyMultiLocation,
|
|
5734
6131
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
5735
6132
|
});
|
|
5736
6133
|
} else if (supportsPolkadotXCM(this)) {
|
|
5737
6134
|
return this.transferPolkadotXCM({
|
|
5738
6135
|
api: api,
|
|
5739
|
-
header: this.createPolkadotXcmHeader(scenario, paraId),
|
|
6136
|
+
header: this.createPolkadotXcmHeader(scenario, destination, paraId),
|
|
5740
6137
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, this.version, paraId),
|
|
5741
|
-
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId),
|
|
6138
|
+
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId, overridedCurrencyMultiLocation),
|
|
5742
6139
|
scenario: scenario,
|
|
5743
6140
|
currencySymbol: currencySymbol,
|
|
6141
|
+
feeAsset: feeAsset,
|
|
5744
6142
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
5745
6143
|
});
|
|
5746
6144
|
} else {
|
|
@@ -5781,13 +6179,13 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5781
6179
|
}
|
|
5782
6180
|
}, {
|
|
5783
6181
|
key: "createCurrencySpec",
|
|
5784
|
-
value: function createCurrencySpec$1(amount, scenario, version,
|
|
5785
|
-
return createCurrencySpec(amount, version, scenario === 'ParaToRelay' ? Parents.ONE : Parents.ZERO);
|
|
6182
|
+
value: function createCurrencySpec$1(amount, scenario, version, _, overridedMultiLocation) {
|
|
6183
|
+
return createCurrencySpec(amount, version, scenario === 'ParaToRelay' ? Parents.ONE : Parents.ZERO, overridedMultiLocation);
|
|
5786
6184
|
}
|
|
5787
6185
|
}, {
|
|
5788
6186
|
key: "createPolkadotXcmHeader",
|
|
5789
|
-
value: function createPolkadotXcmHeader$1(scenario, paraId) {
|
|
5790
|
-
return createPolkadotXcmHeader(scenario, this.version, paraId);
|
|
6187
|
+
value: function createPolkadotXcmHeader$1(scenario, destination, paraId) {
|
|
6188
|
+
return createPolkadotXcmHeader(scenario, this.version, destination, paraId);
|
|
5791
6189
|
}
|
|
5792
6190
|
}]);
|
|
5793
6191
|
}();
|
|
@@ -5813,6 +6211,26 @@ var getModifiedCurrencySelection = function getModifiedCurrencySelection(version
|
|
|
5813
6211
|
}
|
|
5814
6212
|
});
|
|
5815
6213
|
};
|
|
6214
|
+
var getCurrencySelection = function getCurrencySelection(_ref2, isAssetHub, currencySelection) {
|
|
6215
|
+
var origin = _ref2.origin,
|
|
6216
|
+
amount = _ref2.amount,
|
|
6217
|
+
currencyID = _ref2.currencyID,
|
|
6218
|
+
paraIdTo = _ref2.paraIdTo,
|
|
6219
|
+
overridedCurrencyMultiLocation = _ref2.overridedCurrencyMultiLocation;
|
|
6220
|
+
var _getNode = getNode(origin),
|
|
6221
|
+
version = _getNode.version;
|
|
6222
|
+
if (overridedCurrencyMultiLocation !== undefined) return _defineProperty({}, version, overridedCurrencyMultiLocation);
|
|
6223
|
+
if (isAssetHub) {
|
|
6224
|
+
return getModifiedCurrencySelection(version, amount, currencyID, paraIdTo);
|
|
6225
|
+
}
|
|
6226
|
+
return currencySelection;
|
|
6227
|
+
};
|
|
6228
|
+
var getParameters = function getParameters(isAssetHub, currencySelection, addressSelection, amount, fees, feeAsset) {
|
|
6229
|
+
if (isAssetHub) {
|
|
6230
|
+
return feeAsset !== undefined ? [currencySelection, feeAsset, addressSelection, fees] : [currencySelection, addressSelection, fees];
|
|
6231
|
+
}
|
|
6232
|
+
return [currencySelection, amount, addressSelection, fees];
|
|
6233
|
+
};
|
|
5816
6234
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
5817
6235
|
var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
5818
6236
|
function XTokensTransferImpl() {
|
|
@@ -5820,30 +6238,33 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
5820
6238
|
}
|
|
5821
6239
|
return _createClass(XTokensTransferImpl, null, [{
|
|
5822
6240
|
key: "transferXTokens",
|
|
5823
|
-
value: function transferXTokens(
|
|
5824
|
-
var
|
|
5825
|
-
amount = _ref2.amount,
|
|
5826
|
-
currencyID = _ref2.currencyID,
|
|
5827
|
-
addressSelection = _ref2.addressSelection,
|
|
5828
|
-
origin = _ref2.origin,
|
|
5829
|
-
destination = _ref2.destination,
|
|
5830
|
-
paraIdTo = _ref2.paraIdTo,
|
|
5831
|
-
serializedApiCallEnabled = _ref2.serializedApiCallEnabled;
|
|
6241
|
+
value: function transferXTokens(input, currencySelection) {
|
|
6242
|
+
var _api$tx$module;
|
|
5832
6243
|
var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Unlimited';
|
|
5833
6244
|
var pallet = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'XTokens';
|
|
6245
|
+
var api = input.api,
|
|
6246
|
+
amount = input.amount,
|
|
6247
|
+
addressSelection = input.addressSelection,
|
|
6248
|
+
destination = input.destination,
|
|
6249
|
+
feeAsset = input.feeAsset,
|
|
6250
|
+
serializedApiCallEnabled = input.serializedApiCallEnabled;
|
|
6251
|
+
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
6252
|
+
if (isMultiLocationDestination) {
|
|
6253
|
+
throw new Error('Multilocation destinations are not supported for specific transfer you are trying to create. In special cases such as xTokens or xTransfer pallet try using address multilocation instead (for both destination and address in same multilocation set (eg. X2 - Parachain, Address). For further assistance please open issue in our repository.');
|
|
6254
|
+
}
|
|
5834
6255
|
var module = lowercaseFirstLetter(pallet.toString());
|
|
5835
6256
|
var isAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
|
|
5836
|
-
var
|
|
5837
|
-
var modifiedCurrencySelection = isAssetHub ? getModifiedCurrencySelection(node.version, amount, currencyID, paraIdTo) : currencySelection;
|
|
6257
|
+
var modifiedCurrencySelection = getCurrencySelection(input, isAssetHub, currencySelection);
|
|
5838
6258
|
var section = isAssetHub ? 'transferMultiasset' : 'transfer';
|
|
6259
|
+
var parameters = getParameters(isAssetHub, modifiedCurrencySelection, addressSelection, amount, fees, feeAsset);
|
|
5839
6260
|
if (serializedApiCallEnabled === true) {
|
|
5840
6261
|
return {
|
|
5841
6262
|
module: module,
|
|
5842
6263
|
section: section,
|
|
5843
|
-
parameters:
|
|
6264
|
+
parameters: parameters
|
|
5844
6265
|
};
|
|
5845
6266
|
}
|
|
5846
|
-
return
|
|
6267
|
+
return (_api$tx$module = api.tx[module])[section].apply(_api$tx$module, _toConsumableArray(parameters));
|
|
5847
6268
|
}
|
|
5848
6269
|
}]);
|
|
5849
6270
|
}();
|
|
@@ -6505,6 +6926,7 @@ var Karura$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6505
6926
|
}(ParachainNode);
|
|
6506
6927
|
|
|
6507
6928
|
// Contains basic structure of polkadotXCM call
|
|
6929
|
+
var DEFAULT_FEE_ASSET = 0;
|
|
6508
6930
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
6509
6931
|
var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
6510
6932
|
function PolkadotXCMTransferImpl() {
|
|
@@ -6517,16 +6939,18 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
|
6517
6939
|
header = _ref.header,
|
|
6518
6940
|
addressSelection = _ref.addressSelection,
|
|
6519
6941
|
currencySelection = _ref.currencySelection,
|
|
6942
|
+
_ref$feeAsset = _ref.feeAsset,
|
|
6943
|
+
feeAsset = _ref$feeAsset === void 0 ? DEFAULT_FEE_ASSET : _ref$feeAsset,
|
|
6520
6944
|
serializedApiCallEnabled = _ref.serializedApiCallEnabled;
|
|
6521
6945
|
var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
6522
6946
|
if (serializedApiCallEnabled === true) {
|
|
6523
6947
|
return {
|
|
6524
6948
|
module: 'polkadotXcm',
|
|
6525
6949
|
section: method,
|
|
6526
|
-
parameters: [header, addressSelection, currencySelection,
|
|
6950
|
+
parameters: [header, addressSelection, currencySelection, feeAsset].concat(_toConsumableArray(fees !== undefined ? [fees] : []))
|
|
6527
6951
|
};
|
|
6528
6952
|
}
|
|
6529
|
-
return fees !== undefined ? api.tx.polkadotXcm[method](header, addressSelection, currencySelection,
|
|
6953
|
+
return fees !== undefined ? api.tx.polkadotXcm[method](header, addressSelection, currencySelection, feeAsset, fees) : api.tx.polkadotXcm[method](header, addressSelection, currencySelection, feeAsset);
|
|
6530
6954
|
}
|
|
6531
6955
|
}]);
|
|
6532
6956
|
}();
|
|
@@ -6558,7 +6982,7 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6558
6982
|
}
|
|
6559
6983
|
}, {
|
|
6560
6984
|
key: "createCurrencySpec",
|
|
6561
|
-
value: function createCurrencySpec$1(amount, scenario, version, currencyId) {
|
|
6985
|
+
value: function createCurrencySpec$1(amount, scenario, version, currencyId, overridedMultiLocation) {
|
|
6562
6986
|
if (scenario === 'ParaToPara') {
|
|
6563
6987
|
var interior = {
|
|
6564
6988
|
X2: [{
|
|
@@ -6567,7 +6991,7 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6567
6991
|
GeneralIndex: currencyId
|
|
6568
6992
|
}]
|
|
6569
6993
|
};
|
|
6570
|
-
return createCurrencySpec(amount, version, Parents.ZERO, interior);
|
|
6994
|
+
return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
|
|
6571
6995
|
} else {
|
|
6572
6996
|
return _get(_getPrototypeOf(AssetHubPolkadot.prototype), "createCurrencySpec", this).call(this, amount, scenario, version, currencyId);
|
|
6573
6997
|
}
|
|
@@ -6614,7 +7038,7 @@ var CoretimeKusama$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6614
7038
|
function CoretimeKusama() {
|
|
6615
7039
|
var _this;
|
|
6616
7040
|
_classCallCheck(this, CoretimeKusama);
|
|
6617
|
-
_this = _callSuper(this, CoretimeKusama, ['CoretimeKusama', '
|
|
7041
|
+
_this = _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama', Version.V3]);
|
|
6618
7042
|
_this._assetCheckEnabled = false;
|
|
6619
7043
|
return _this;
|
|
6620
7044
|
}
|
|
@@ -6717,10 +7141,11 @@ var Astar$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6717
7141
|
address = options.address,
|
|
6718
7142
|
destination = options.destination,
|
|
6719
7143
|
paraIdTo = options.paraIdTo,
|
|
7144
|
+
overridedCurrencyMultiLocation = options.overridedCurrencyMultiLocation,
|
|
6720
7145
|
_options$serializedAp = options.serializedApiCallEnabled,
|
|
6721
7146
|
serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
|
|
6722
7147
|
var scenario = destination !== undefined ? 'ParaToPara' : 'ParaToRelay';
|
|
6723
|
-
var paraId = destination !== undefined ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
7148
|
+
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
6724
7149
|
var node = this.node;
|
|
6725
7150
|
if (supportsXTokens(this) && currencySymbol !== 'ASTR') {
|
|
6726
7151
|
return this.transferXTokens({
|
|
@@ -6734,14 +7159,15 @@ var Astar$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6734
7159
|
scenario: scenario,
|
|
6735
7160
|
paraIdTo: paraId,
|
|
6736
7161
|
destination: destination,
|
|
7162
|
+
overridedCurrencyMultiLocation: overridedCurrencyMultiLocation,
|
|
6737
7163
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
6738
7164
|
});
|
|
6739
7165
|
} else if (supportsPolkadotXCM(this)) {
|
|
6740
7166
|
return this.transferPolkadotXCM({
|
|
6741
7167
|
api: api,
|
|
6742
|
-
header: this.createPolkadotXcmHeader(scenario, paraId),
|
|
7168
|
+
header: this.createPolkadotXcmHeader(scenario, destination, paraId),
|
|
6743
7169
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, this.version, paraId),
|
|
6744
|
-
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId),
|
|
7170
|
+
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId, overridedCurrencyMultiLocation),
|
|
6745
7171
|
scenario: scenario,
|
|
6746
7172
|
currencySymbol: currencySymbol,
|
|
6747
7173
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
@@ -6772,14 +7198,14 @@ var Darwinia$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6772
7198
|
}
|
|
6773
7199
|
}, {
|
|
6774
7200
|
key: "createCurrencySpec",
|
|
6775
|
-
value: function createCurrencySpec$1(amount, scenario, version, currencyId) {
|
|
7201
|
+
value: function createCurrencySpec$1(amount, scenario, version, currencyId, overridedMultiLocation) {
|
|
6776
7202
|
if (scenario === 'ParaToPara') {
|
|
6777
7203
|
var interior = {
|
|
6778
7204
|
X1: {
|
|
6779
7205
|
PalletInstance: 5
|
|
6780
7206
|
}
|
|
6781
7207
|
};
|
|
6782
|
-
return createCurrencySpec(amount, version, Parents.ZERO, interior);
|
|
7208
|
+
return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
|
|
6783
7209
|
} else {
|
|
6784
7210
|
return _get(_getPrototypeOf(Darwinia.prototype), "createCurrencySpec", this).call(this, amount, scenario, version, currencyId);
|
|
6785
7211
|
}
|
|
@@ -6864,10 +7290,11 @@ var Shiden$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6864
7290
|
address = options.address,
|
|
6865
7291
|
destination = options.destination,
|
|
6866
7292
|
paraIdTo = options.paraIdTo,
|
|
7293
|
+
overridedCurrencyMultiLocation = options.overridedCurrencyMultiLocation,
|
|
6867
7294
|
_options$serializedAp = options.serializedApiCallEnabled,
|
|
6868
7295
|
serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
|
|
6869
7296
|
var scenario = destination !== undefined ? 'ParaToPara' : 'ParaToRelay';
|
|
6870
|
-
var paraId = destination !== undefined ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
7297
|
+
var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
6871
7298
|
var node = this.node;
|
|
6872
7299
|
if (supportsXTokens(this) && currencySymbol !== 'SDN') {
|
|
6873
7300
|
return this.transferXTokens({
|
|
@@ -6877,18 +7304,19 @@ var Shiden$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6877
7304
|
amount: amount,
|
|
6878
7305
|
addressSelection: generateAddressPayload(api, scenario, 'XTokens', address, this.version, paraId),
|
|
6879
7306
|
fees: getFees(scenario),
|
|
7307
|
+
origin: this.node,
|
|
6880
7308
|
scenario: scenario,
|
|
6881
7309
|
paraIdTo: paraId,
|
|
6882
|
-
origin: this.node,
|
|
6883
7310
|
destination: destination,
|
|
7311
|
+
overridedCurrencyMultiLocation: overridedCurrencyMultiLocation,
|
|
6884
7312
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
6885
7313
|
});
|
|
6886
7314
|
} else if (supportsPolkadotXCM(this)) {
|
|
6887
7315
|
return this.transferPolkadotXCM({
|
|
6888
7316
|
api: api,
|
|
6889
|
-
header: this.createPolkadotXcmHeader(scenario, paraId),
|
|
7317
|
+
header: this.createPolkadotXcmHeader(scenario, destination, paraId),
|
|
6890
7318
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, this.version, paraId),
|
|
6891
|
-
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId),
|
|
7319
|
+
currencySelection: this.createCurrencySpec(amount, scenario, this.version, currencyId, overridedCurrencyMultiLocation),
|
|
6892
7320
|
scenario: scenario,
|
|
6893
7321
|
currencySymbol: currencySymbol,
|
|
6894
7322
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
@@ -7068,6 +7496,33 @@ var determineDestWeight = function determineDestWeight(destNode) {
|
|
|
7068
7496
|
}
|
|
7069
7497
|
throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
|
|
7070
7498
|
};
|
|
7499
|
+
var getDestination = function getDestination(_ref) {
|
|
7500
|
+
var recipientAddress = _ref.recipientAddress,
|
|
7501
|
+
paraId = _ref.paraId,
|
|
7502
|
+
api = _ref.api;
|
|
7503
|
+
var isMultiLocation = _typeof(recipientAddress) === 'object';
|
|
7504
|
+
if (isMultiLocation) {
|
|
7505
|
+
return recipientAddress;
|
|
7506
|
+
}
|
|
7507
|
+
var isEthAddress = ethers.utils.isAddress(recipientAddress);
|
|
7508
|
+
var addressJunction = isEthAddress ? {
|
|
7509
|
+
AccountKey20: {
|
|
7510
|
+
key: recipientAddress
|
|
7511
|
+
}
|
|
7512
|
+
} : {
|
|
7513
|
+
AccountId32: {
|
|
7514
|
+
id: createAccID(api, recipientAddress)
|
|
7515
|
+
}
|
|
7516
|
+
};
|
|
7517
|
+
return {
|
|
7518
|
+
parents: Parents.ONE,
|
|
7519
|
+
interior: {
|
|
7520
|
+
X2: [{
|
|
7521
|
+
Parachain: paraId
|
|
7522
|
+
}, addressJunction]
|
|
7523
|
+
}
|
|
7524
|
+
};
|
|
7525
|
+
};
|
|
7071
7526
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
7072
7527
|
var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
7073
7528
|
function XTransferTransferImpl() {
|
|
@@ -7075,28 +7530,19 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
7075
7530
|
}
|
|
7076
7531
|
return _createClass(XTransferTransferImpl, null, [{
|
|
7077
7532
|
key: "transferXTransfer",
|
|
7078
|
-
value: function transferXTransfer(
|
|
7079
|
-
var api =
|
|
7080
|
-
amount =
|
|
7081
|
-
origin =
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
X2: [{
|
|
7092
|
-
Parachain: paraId
|
|
7093
|
-
}, _defineProperty({}, isEthAddress ? 'AccountKey20' : 'AccountId32', Object.assign({}, isEthAddress ? {
|
|
7094
|
-
key: recipientAddress
|
|
7095
|
-
} : {
|
|
7096
|
-
id: createAccID(api, recipientAddress)
|
|
7097
|
-
}))]
|
|
7098
|
-
}
|
|
7099
|
-
};
|
|
7533
|
+
value: function transferXTransfer(input) {
|
|
7534
|
+
var api = input.api,
|
|
7535
|
+
amount = input.amount,
|
|
7536
|
+
origin = input.origin,
|
|
7537
|
+
destination = input.destination,
|
|
7538
|
+
serializedApiCallEnabled = input.serializedApiCallEnabled,
|
|
7539
|
+
overridedCurrencyMultiLocation = input.overridedCurrencyMultiLocation;
|
|
7540
|
+
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
7541
|
+
if (isMultiLocationDestination) {
|
|
7542
|
+
throw new Error('Multilocation destinations are not supported for specific transfer you are trying to create. In special cases such as xTokens or xTransfer pallet try using address multilocation instead (for both destination and address in same multilocation set (eg. X2 - Parachain, Address). For further assistance please open issue in our repository.');
|
|
7543
|
+
}
|
|
7544
|
+
var currencySpec = Object.values(createCurrencySpec(amount, Version.V1, Parents.ZERO, overridedCurrencyMultiLocation))[0][0];
|
|
7545
|
+
var dest = getDestination(input);
|
|
7100
7546
|
if (serializedApiCallEnabled === true) {
|
|
7101
7547
|
return {
|
|
7102
7548
|
module: 'xTransfer',
|
|
@@ -7154,8 +7600,30 @@ var Subsocial$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7154
7600
|
return _createClass(Subsocial);
|
|
7155
7601
|
}(ParachainNode);
|
|
7156
7602
|
|
|
7603
|
+
var KiltSpiritnet$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
7604
|
+
function KiltSpiritnet() {
|
|
7605
|
+
_classCallCheck(this, KiltSpiritnet);
|
|
7606
|
+
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', Version.V2]);
|
|
7607
|
+
}
|
|
7608
|
+
_inherits(KiltSpiritnet, _ParachainNode);
|
|
7609
|
+
return _createClass(KiltSpiritnet, [{
|
|
7610
|
+
key: "transferPolkadotXCM",
|
|
7611
|
+
value: function transferPolkadotXCM(input) {
|
|
7612
|
+
if (input.scenario !== 'ParaToPara') {
|
|
7613
|
+
throw new ScenarioNotSupportedError('KiltSpiritnet', input.scenario);
|
|
7614
|
+
}
|
|
7615
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveTransferAssets');
|
|
7616
|
+
}
|
|
7617
|
+
}, {
|
|
7618
|
+
key: "transferRelayToPara",
|
|
7619
|
+
value: function transferRelayToPara() {
|
|
7620
|
+
throw new NodeNotSupportedError();
|
|
7621
|
+
}
|
|
7622
|
+
}]);
|
|
7623
|
+
}(ParachainNode);
|
|
7624
|
+
|
|
7157
7625
|
// Contains supported Parachains and exports supported XCM Pallets
|
|
7158
|
-
var NODE_NAMES = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'HydraDX', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Litmus', 'Mangata', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'Robonomics', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial'];
|
|
7626
|
+
var NODE_NAMES = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'HydraDX', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Litmus', 'Mangata', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'Robonomics', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet'];
|
|
7159
7627
|
var NODES_WITH_RELAY_CHAINS = [].concat(NODE_NAMES, ['Polkadot', 'Kusama']);
|
|
7160
7628
|
var nodes = {
|
|
7161
7629
|
AssetHubPolkadot: new AssetHubPolkadot$2(),
|
|
@@ -7208,7 +7676,8 @@ var nodes = {
|
|
|
7208
7676
|
Collectives: new Collectives$2(),
|
|
7209
7677
|
Khala: new Khala$2(),
|
|
7210
7678
|
Phala: new Phala$2(),
|
|
7211
|
-
Subsocial: new Subsocial$2()
|
|
7679
|
+
Subsocial: new Subsocial$2(),
|
|
7680
|
+
KiltSpiritnet: new KiltSpiritnet$2()
|
|
7212
7681
|
};
|
|
7213
7682
|
var SUPPORTED_PALLETS = ['XTokens', 'OrmlXTokens', 'PolkadotXcm', 'RelayerXcm', 'XTransfer'];
|
|
7214
7683
|
|
|
@@ -7227,10 +7696,14 @@ var getFees = function getFees(scenario) {
|
|
|
7227
7696
|
throw new Error("Fees for scenario ".concat(scenario, " are not defined."));
|
|
7228
7697
|
};
|
|
7229
7698
|
var generateAddressPayload = function generateAddressPayload(api, scenario, pallet, recipientAddress, version, nodeId) {
|
|
7699
|
+
var isMultiLocation = _typeof(recipientAddress) === 'object';
|
|
7700
|
+
if (isMultiLocation) {
|
|
7701
|
+
return _defineProperty({}, version, recipientAddress);
|
|
7702
|
+
}
|
|
7230
7703
|
var isEthAddress = ethers.utils.isAddress(recipientAddress);
|
|
7231
7704
|
if (scenario === 'ParaToRelay') {
|
|
7232
7705
|
return _defineProperty({}, version, {
|
|
7233
|
-
parents: pallet === 'XTokens' ?
|
|
7706
|
+
parents: pallet === 'XTokens' ? Parents.ONE : Parents.ZERO,
|
|
7234
7707
|
interior: {
|
|
7235
7708
|
X1: {
|
|
7236
7709
|
AccountId32: Object.assign(Object.assign({}, version === Version.V1 && {
|
|
@@ -7244,46 +7717,60 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
|
|
|
7244
7717
|
}
|
|
7245
7718
|
if (scenario === 'ParaToPara' && pallet === 'XTokens') {
|
|
7246
7719
|
return _defineProperty({}, version, {
|
|
7247
|
-
parents:
|
|
7720
|
+
parents: Parents.ONE,
|
|
7248
7721
|
interior: {
|
|
7249
7722
|
X2: [{
|
|
7250
7723
|
Parachain: nodeId
|
|
7251
|
-
},
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7724
|
+
}, isEthAddress ? {
|
|
7725
|
+
AccountKey20: Object.assign(Object.assign({}, version === Version.V1 && {
|
|
7726
|
+
network: 'any'
|
|
7727
|
+
}), {
|
|
7728
|
+
key: recipientAddress
|
|
7729
|
+
})
|
|
7255
7730
|
} : {
|
|
7256
|
-
|
|
7257
|
-
|
|
7731
|
+
AccountId32: Object.assign(Object.assign({}, version === Version.V1 && {
|
|
7732
|
+
network: 'any'
|
|
7733
|
+
}), {
|
|
7734
|
+
id: createAccID(api, recipientAddress)
|
|
7735
|
+
})
|
|
7736
|
+
}]
|
|
7258
7737
|
}
|
|
7259
7738
|
});
|
|
7260
7739
|
}
|
|
7261
7740
|
if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
7262
7741
|
return _defineProperty({}, version, {
|
|
7263
|
-
parents:
|
|
7742
|
+
parents: Parents.ZERO,
|
|
7264
7743
|
interior: {
|
|
7265
|
-
X1:
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7744
|
+
X1: isEthAddress ? {
|
|
7745
|
+
AccountKey20: Object.assign(Object.assign({}, version === Version.V1 && {
|
|
7746
|
+
network: 'any'
|
|
7747
|
+
}), {
|
|
7748
|
+
key: recipientAddress
|
|
7749
|
+
})
|
|
7269
7750
|
} : {
|
|
7270
|
-
|
|
7271
|
-
|
|
7751
|
+
AccountId32: Object.assign(Object.assign({}, version === Version.V1 && {
|
|
7752
|
+
network: 'any'
|
|
7753
|
+
}), {
|
|
7754
|
+
id: createAccID(api, recipientAddress)
|
|
7755
|
+
})
|
|
7756
|
+
}
|
|
7272
7757
|
}
|
|
7273
7758
|
});
|
|
7274
7759
|
}
|
|
7275
|
-
return {
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7760
|
+
return _defineProperty({}, Version.V3, {
|
|
7761
|
+
parents: Parents.ZERO,
|
|
7762
|
+
interior: {
|
|
7763
|
+
X1: isEthAddress ? {
|
|
7764
|
+
AccountKey20: {
|
|
7280
7765
|
key: recipientAddress
|
|
7281
|
-
}
|
|
7766
|
+
}
|
|
7767
|
+
} : {
|
|
7768
|
+
AccountId32: {
|
|
7282
7769
|
id: createAccID(api, recipientAddress)
|
|
7283
|
-
}
|
|
7770
|
+
}
|
|
7284
7771
|
}
|
|
7285
7772
|
}
|
|
7286
|
-
};
|
|
7773
|
+
});
|
|
7287
7774
|
};
|
|
7288
7775
|
var getNode = function getNode(node) {
|
|
7289
7776
|
return nodes[node];
|
|
@@ -7292,8 +7779,8 @@ var getNodeEndpointOption = function getNodeEndpointOption(node) {
|
|
|
7292
7779
|
var _getNode = getNode(node),
|
|
7293
7780
|
type = _getNode.type,
|
|
7294
7781
|
name = _getNode.name;
|
|
7295
|
-
var
|
|
7296
|
-
linked =
|
|
7782
|
+
var _ref6 = type === 'polkadot' ? prodRelayPolkadot : prodRelayKusama,
|
|
7783
|
+
linked = _ref6.linked;
|
|
7297
7784
|
if (linked === undefined) return undefined;
|
|
7298
7785
|
var preferredOption = linked.find(function (o) {
|
|
7299
7786
|
return o.info === name && Object.values(o.providers).length > 0;
|
|
@@ -7304,8 +7791,8 @@ var getNodeEndpointOption = function getNodeEndpointOption(node) {
|
|
|
7304
7791
|
};
|
|
7305
7792
|
var getAllNodeProviders = function getAllNodeProviders(node) {
|
|
7306
7793
|
var _a;
|
|
7307
|
-
var
|
|
7308
|
-
providers =
|
|
7794
|
+
var _ref7 = (_a = getNodeEndpointOption(node)) !== null && _a !== void 0 ? _a : {},
|
|
7795
|
+
providers = _ref7.providers;
|
|
7309
7796
|
if (providers.length < 1) {
|
|
7310
7797
|
throw new Error("Node ".concat(node, " does not have any providers."));
|
|
7311
7798
|
}
|
|
@@ -7365,18 +7852,22 @@ var createApiInstanceForNode = function createApiInstanceForNode(node) {
|
|
|
7365
7852
|
var lowercaseFirstLetter = function lowercaseFirstLetter(str) {
|
|
7366
7853
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
7367
7854
|
};
|
|
7368
|
-
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api,
|
|
7855
|
+
var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref8) {
|
|
7369
7856
|
var _api$tx$module;
|
|
7370
|
-
var module =
|
|
7371
|
-
section =
|
|
7372
|
-
parameters =
|
|
7857
|
+
var module = _ref8.module,
|
|
7858
|
+
section = _ref8.section,
|
|
7859
|
+
parameters = _ref8.parameters;
|
|
7373
7860
|
return (_api$tx$module = api.tx[module])[section].apply(_api$tx$module, _toConsumableArray(parameters));
|
|
7374
7861
|
};
|
|
7375
7862
|
var determineRelayChain = function determineRelayChain(node) {
|
|
7376
7863
|
return getRelayChainSymbol(node) === 'KSM' ? 'Kusama' : 'Polkadot';
|
|
7377
7864
|
};
|
|
7378
7865
|
|
|
7379
|
-
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node,
|
|
7866
|
+
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
|
|
7867
|
+
if (_typeof(currency) === 'object') {
|
|
7868
|
+
return null;
|
|
7869
|
+
}
|
|
7870
|
+
var currencyString = currency.toString();
|
|
7380
7871
|
var _getAssetsObject = getAssetsObject(node),
|
|
7381
7872
|
otherAssets = _getAssetsObject.otherAssets,
|
|
7382
7873
|
nativeAssets = _getAssetsObject.nativeAssets,
|
|
@@ -7384,7 +7875,7 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, symbolOrId) {
|
|
|
7384
7875
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (_ref) {
|
|
7385
7876
|
var symbol = _ref.symbol,
|
|
7386
7877
|
assetId = _ref.assetId;
|
|
7387
|
-
return symbol ===
|
|
7878
|
+
return symbol === currencyString || assetId === currencyString;
|
|
7388
7879
|
});
|
|
7389
7880
|
if (asset !== undefined) {
|
|
7390
7881
|
var symbol = asset.symbol,
|
|
@@ -7394,7 +7885,7 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, symbolOrId) {
|
|
|
7394
7885
|
assetId: assetId
|
|
7395
7886
|
};
|
|
7396
7887
|
}
|
|
7397
|
-
if (relayChainAssetSymbol ===
|
|
7888
|
+
if (relayChainAssetSymbol === currencyString) return {
|
|
7398
7889
|
symbol: relayChainAssetSymbol
|
|
7399
7890
|
};
|
|
7400
7891
|
return null;
|
|
@@ -7425,7 +7916,7 @@ var Litentry$1 = "100000000000";
|
|
|
7425
7916
|
var Moonbeam$1 = "0";
|
|
7426
7917
|
var Parallel$1 = "100000000000";
|
|
7427
7918
|
var AssetHubKusama$1 = "3333333";
|
|
7428
|
-
var CoretimeKusama$1 = "
|
|
7919
|
+
var CoretimeKusama$1 = "33333333";
|
|
7429
7920
|
var Encointer$1 = "33333333";
|
|
7430
7921
|
var Altair$1 = "1000000000000";
|
|
7431
7922
|
var Amplitude$1 = "1000000000";
|
|
@@ -7465,6 +7956,7 @@ var Collectives$1 = "1000000000";
|
|
|
7465
7956
|
var Khala$1 = "10000000000";
|
|
7466
7957
|
var Phala$1 = "10000000000";
|
|
7467
7958
|
var Subsocial$1 = "100000000";
|
|
7959
|
+
var KiltSpiritnet$1 = "10000000000000";
|
|
7468
7960
|
var existentialDeposits = {
|
|
7469
7961
|
AssetHubPolkadot: AssetHubPolkadot$1,
|
|
7470
7962
|
Acala: Acala$1,
|
|
@@ -7518,7 +8010,8 @@ var existentialDeposits = {
|
|
|
7518
8010
|
Collectives: Collectives$1,
|
|
7519
8011
|
Khala: Khala$1,
|
|
7520
8012
|
Phala: Phala$1,
|
|
7521
|
-
Subsocial: Subsocial$1
|
|
8013
|
+
Subsocial: Subsocial$1,
|
|
8014
|
+
KiltSpiritnet: KiltSpiritnet$1
|
|
7522
8015
|
};
|
|
7523
8016
|
|
|
7524
8017
|
var edMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -7551,6 +8044,7 @@ var edMapJson = /*#__PURE__*/Object.freeze({
|
|
|
7551
8044
|
InvArchTinker: InvArchTinker$1,
|
|
7552
8045
|
Karura: Karura$1,
|
|
7553
8046
|
Khala: Khala$1,
|
|
8047
|
+
KiltSpiritnet: KiltSpiritnet$1,
|
|
7554
8048
|
Kintsugi: Kintsugi$1,
|
|
7555
8049
|
Kusama: Kusama,
|
|
7556
8050
|
Litentry: Litentry$1,
|
|
@@ -7722,6 +8216,9 @@ var OpenChannelBuilder = /*#__PURE__*/function () {
|
|
|
7722
8216
|
}, {
|
|
7723
8217
|
key: "buildOptions",
|
|
7724
8218
|
value: function buildOptions() {
|
|
8219
|
+
if (_typeof(this.to) === 'object') {
|
|
8220
|
+
throw new Error('Channels do not support multi-location destinations');
|
|
8221
|
+
}
|
|
7725
8222
|
return {
|
|
7726
8223
|
api: this.api,
|
|
7727
8224
|
origin: this.from,
|
|
@@ -7845,6 +8342,12 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
7845
8342
|
this.paraIdTo = paraIdTo;
|
|
7846
8343
|
}
|
|
7847
8344
|
return _createClass(ParaToParaBuilder, [{
|
|
8345
|
+
key: "feeAsset",
|
|
8346
|
+
value: function feeAsset(_feeAsset) {
|
|
8347
|
+
this._feeAsset = _feeAsset;
|
|
8348
|
+
return this;
|
|
8349
|
+
}
|
|
8350
|
+
}, {
|
|
7848
8351
|
key: "amount",
|
|
7849
8352
|
value: function amount(_amount) {
|
|
7850
8353
|
this._amount = _amount;
|
|
@@ -7873,6 +8376,7 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
7873
8376
|
address: this._address,
|
|
7874
8377
|
destination: this.to,
|
|
7875
8378
|
paraIdTo: this.paraIdTo,
|
|
8379
|
+
feeAsset: this._feeAsset,
|
|
7876
8380
|
destApiForKeepAlive: this._destApi
|
|
7877
8381
|
};
|
|
7878
8382
|
}
|
|
@@ -7925,11 +8429,12 @@ var ParaToParaBuilder = /*#__PURE__*/function () {
|
|
|
7925
8429
|
}();
|
|
7926
8430
|
|
|
7927
8431
|
var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
7928
|
-
function ParaToRelayBuilder(api, from, amount) {
|
|
8432
|
+
function ParaToRelayBuilder(api, from, amount, feeAsset) {
|
|
7929
8433
|
_classCallCheck(this, ParaToRelayBuilder);
|
|
7930
8434
|
this.api = api;
|
|
7931
8435
|
this.from = from;
|
|
7932
8436
|
this.amount = amount;
|
|
8437
|
+
this.feeAsset = feeAsset;
|
|
7933
8438
|
}
|
|
7934
8439
|
return _createClass(ParaToRelayBuilder, [{
|
|
7935
8440
|
key: "address",
|
|
@@ -7953,6 +8458,7 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
|
7953
8458
|
currency: currency,
|
|
7954
8459
|
amount: this.amount,
|
|
7955
8460
|
address: this._address,
|
|
8461
|
+
feeAsset: this.feeAsset,
|
|
7956
8462
|
destApiForKeepAlive: this._destApi
|
|
7957
8463
|
};
|
|
7958
8464
|
}
|
|
@@ -7998,8 +8504,8 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
|
|
|
7998
8504
|
}
|
|
7999
8505
|
}], [{
|
|
8000
8506
|
key: "create",
|
|
8001
|
-
value: function create(api, from, amount) {
|
|
8002
|
-
return new ParaToRelayBuilder(api, from, amount);
|
|
8507
|
+
value: function create(api, from, amount, feeAsset) {
|
|
8508
|
+
return new ParaToRelayBuilder(api, from, amount, feeAsset);
|
|
8003
8509
|
}
|
|
8004
8510
|
}]);
|
|
8005
8511
|
}();
|
|
@@ -8050,10 +8556,16 @@ var FromGeneralBuilder = /*#__PURE__*/function () {
|
|
|
8050
8556
|
value: function to(node, paraIdTo) {
|
|
8051
8557
|
return new ToGeneralBuilder(this.api, this.from, node, paraIdTo);
|
|
8052
8558
|
}
|
|
8559
|
+
}, {
|
|
8560
|
+
key: "feeAsset",
|
|
8561
|
+
value: function feeAsset(_feeAsset) {
|
|
8562
|
+
this._feeAsset = _feeAsset;
|
|
8563
|
+
return this;
|
|
8564
|
+
}
|
|
8053
8565
|
}, {
|
|
8054
8566
|
key: "amount",
|
|
8055
8567
|
value: function amount(_amount) {
|
|
8056
|
-
return ParaToRelayBuilder.create(this.api, this.from, _amount);
|
|
8568
|
+
return ParaToRelayBuilder.create(this.api, this.from, _amount, this._feeAsset);
|
|
8057
8569
|
}
|
|
8058
8570
|
}, {
|
|
8059
8571
|
key: "closeChannel",
|
|
@@ -8234,71 +8746,98 @@ var checkKeepAlive = function checkKeepAlive(_ref) {
|
|
|
8234
8746
|
|
|
8235
8747
|
var sendCommon = function sendCommon(options) {
|
|
8236
8748
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8237
|
-
var _a, api, origin,
|
|
8749
|
+
var _a, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, _options$serializedAp, serializedApiCallEnabled, asset, isMultiLocationDestination, isMultiLocationCurrency, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, apiWithFallback, amountStr, currencyStr, currencyId;
|
|
8238
8750
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8239
8751
|
while (1) switch (_context.prev = _context.next) {
|
|
8240
8752
|
case 0:
|
|
8241
|
-
api = options.api, origin = options.origin,
|
|
8242
|
-
if (!(typeof
|
|
8753
|
+
api = options.api, origin = options.origin, currency = options.currency, amount = options.amount, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, feeAsset = options.feeAsset, _options$serializedAp = options.serializedApiCallEnabled, serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
|
|
8754
|
+
if (!(typeof currency === 'number' && currency > Number.MAX_SAFE_INTEGER)) {
|
|
8243
8755
|
_context.next = 3;
|
|
8244
8756
|
break;
|
|
8245
8757
|
}
|
|
8246
8758
|
throw new InvalidCurrencyError('The provided asset ID is larger than the maximum safe integer value. Please provide it as a string.');
|
|
8247
8759
|
case 3:
|
|
8248
|
-
asset = getAssetBySymbolOrId(origin,
|
|
8249
|
-
|
|
8250
|
-
|
|
8760
|
+
asset = getAssetBySymbolOrId(origin, currency);
|
|
8761
|
+
isMultiLocationDestination = _typeof(destination) === 'object';
|
|
8762
|
+
isMultiLocationCurrency = _typeof(currency) === 'object';
|
|
8763
|
+
if (!(destination !== undefined && !isMultiLocationDestination)) {
|
|
8764
|
+
_context.next = 11;
|
|
8251
8765
|
break;
|
|
8252
8766
|
}
|
|
8253
8767
|
originRelayChainSymbol = getRelayChainSymbol(origin);
|
|
8254
8768
|
destinationRelayChainSymbol = getRelayChainSymbol(destination);
|
|
8255
8769
|
if (!(originRelayChainSymbol !== destinationRelayChainSymbol)) {
|
|
8256
|
-
_context.next =
|
|
8770
|
+
_context.next = 11;
|
|
8257
8771
|
break;
|
|
8258
8772
|
}
|
|
8259
8773
|
throw new IncompatibleNodesError();
|
|
8260
|
-
case
|
|
8774
|
+
case 11:
|
|
8261
8775
|
originNode = getNode(origin);
|
|
8262
|
-
assetCheckEnabled = destination === 'AssetHubKusama' || destination === 'AssetHubPolkadot' ? false : originNode.assetCheckEnabled;
|
|
8776
|
+
assetCheckEnabled = destination === 'AssetHubKusama' || destination === 'AssetHubPolkadot' || isMultiLocationCurrency ? false : originNode.assetCheckEnabled;
|
|
8263
8777
|
if (!(asset === null && assetCheckEnabled)) {
|
|
8264
|
-
_context.next = 13;
|
|
8265
|
-
break;
|
|
8266
|
-
}
|
|
8267
|
-
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(currencySymbolOrId, "."));
|
|
8268
|
-
case 13:
|
|
8269
|
-
if (!(destination !== undefined && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !hasSupportForAsset(destination, asset.symbol))) {
|
|
8270
8778
|
_context.next = 15;
|
|
8271
8779
|
break;
|
|
8272
8780
|
}
|
|
8273
|
-
throw new InvalidCurrencyError("
|
|
8781
|
+
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
|
|
8274
8782
|
case 15:
|
|
8783
|
+
if (!(destination !== undefined && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !hasSupportForAsset(destination, asset.symbol))) {
|
|
8784
|
+
_context.next = 17;
|
|
8785
|
+
break;
|
|
8786
|
+
}
|
|
8787
|
+
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
|
|
8788
|
+
case 17:
|
|
8275
8789
|
if (!(api !== null && api !== void 0)) {
|
|
8276
|
-
_context.next =
|
|
8790
|
+
_context.next = 21;
|
|
8277
8791
|
break;
|
|
8278
8792
|
}
|
|
8279
8793
|
_context.t0 = api;
|
|
8280
|
-
_context.next =
|
|
8794
|
+
_context.next = 24;
|
|
8281
8795
|
break;
|
|
8282
|
-
case 19:
|
|
8283
|
-
_context.next = 21;
|
|
8284
|
-
return createApiInstanceForNode(origin);
|
|
8285
8796
|
case 21:
|
|
8797
|
+
_context.next = 23;
|
|
8798
|
+
return createApiInstanceForNode(origin);
|
|
8799
|
+
case 23:
|
|
8286
8800
|
_context.t0 = _context.sent;
|
|
8287
|
-
case
|
|
8801
|
+
case 24:
|
|
8288
8802
|
apiWithFallback = _context.t0;
|
|
8289
8803
|
amountStr = amount.toString();
|
|
8290
|
-
|
|
8804
|
+
if (!(_typeof(currency) === 'object')) {
|
|
8805
|
+
_context.next = 30;
|
|
8806
|
+
break;
|
|
8807
|
+
}
|
|
8808
|
+
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
8809
|
+
_context.next = 40;
|
|
8810
|
+
break;
|
|
8811
|
+
case 30:
|
|
8812
|
+
if (!(_typeof(address) === 'object')) {
|
|
8813
|
+
_context.next = 34;
|
|
8814
|
+
break;
|
|
8815
|
+
}
|
|
8816
|
+
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
8817
|
+
_context.next = 40;
|
|
8818
|
+
break;
|
|
8819
|
+
case 34:
|
|
8820
|
+
if (!(_typeof(destination) === 'object')) {
|
|
8821
|
+
_context.next = 38;
|
|
8822
|
+
break;
|
|
8823
|
+
}
|
|
8824
|
+
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
8825
|
+
_context.next = 40;
|
|
8826
|
+
break;
|
|
8827
|
+
case 38:
|
|
8828
|
+
_context.next = 40;
|
|
8291
8829
|
return checkKeepAlive({
|
|
8292
8830
|
originApi: apiWithFallback,
|
|
8293
8831
|
address: address,
|
|
8294
8832
|
amount: amountStr,
|
|
8295
8833
|
originNode: origin,
|
|
8296
8834
|
destApi: destApiForKeepAlive,
|
|
8297
|
-
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a :
|
|
8835
|
+
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : currency.toString(),
|
|
8298
8836
|
destNode: destination
|
|
8299
8837
|
});
|
|
8300
|
-
case
|
|
8301
|
-
|
|
8838
|
+
case 40:
|
|
8839
|
+
currencyStr = _typeof(currency) === 'object' ? undefined : currency.toString();
|
|
8840
|
+
currencyId = assetCheckEnabled ? asset === null || asset === void 0 ? void 0 : asset.assetId : currencyStr;
|
|
8302
8841
|
return _context.abrupt("return", originNode.transfer({
|
|
8303
8842
|
api: apiWithFallback,
|
|
8304
8843
|
currencySymbol: asset === null || asset === void 0 ? void 0 : asset.symbol,
|
|
@@ -8307,9 +8846,11 @@ var sendCommon = function sendCommon(options) {
|
|
|
8307
8846
|
address: address,
|
|
8308
8847
|
destination: destination,
|
|
8309
8848
|
paraIdTo: paraIdTo,
|
|
8849
|
+
overridedCurrencyMultiLocation: _typeof(currency) === 'object' ? currency : undefined,
|
|
8850
|
+
feeAsset: feeAsset,
|
|
8310
8851
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
8311
8852
|
}));
|
|
8312
|
-
case
|
|
8853
|
+
case 43:
|
|
8313
8854
|
case "end":
|
|
8314
8855
|
return _context.stop();
|
|
8315
8856
|
}
|
|
@@ -8352,39 +8893,61 @@ var send = function send(options) {
|
|
|
8352
8893
|
};
|
|
8353
8894
|
var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
8354
8895
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
8355
|
-
var api, destination, amount, address, paraIdTo, destApiForKeepAlive, _options$serializedAp2, serializedApiCallEnabled,
|
|
8896
|
+
var api, destination, amount, address, paraIdTo, destApiForKeepAlive, _options$serializedAp2, serializedApiCallEnabled, isMultiLocationDestination, isAddressMultiLocation, apiWithFallback, amountStr, serializedApiCall;
|
|
8356
8897
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8357
8898
|
while (1) switch (_context4.prev = _context4.next) {
|
|
8358
8899
|
case 0:
|
|
8359
8900
|
api = options.api, destination = options.destination, amount = options.amount, address = options.address, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, _options$serializedAp2 = options.serializedApiCallEnabled, serializedApiCallEnabled = _options$serializedAp2 === void 0 ? false : _options$serializedAp2;
|
|
8360
|
-
|
|
8361
|
-
|
|
8901
|
+
isMultiLocationDestination = _typeof(destination) === 'object';
|
|
8902
|
+
isAddressMultiLocation = _typeof(address) === 'object';
|
|
8903
|
+
if (!(api === undefined && isMultiLocationDestination)) {
|
|
8904
|
+
_context4.next = 5;
|
|
8905
|
+
break;
|
|
8906
|
+
}
|
|
8907
|
+
throw new Error('API is required when using MultiLocation as destination.');
|
|
8908
|
+
case 5:
|
|
8362
8909
|
if (!(api !== null && api !== void 0)) {
|
|
8363
|
-
_context4.next =
|
|
8910
|
+
_context4.next = 9;
|
|
8364
8911
|
break;
|
|
8365
8912
|
}
|
|
8366
8913
|
_context4.t0 = api;
|
|
8367
|
-
_context4.next =
|
|
8914
|
+
_context4.next = 12;
|
|
8368
8915
|
break;
|
|
8369
|
-
case 7:
|
|
8370
|
-
_context4.next = 9;
|
|
8371
|
-
return createApiInstanceForNode(relayNode);
|
|
8372
8916
|
case 9:
|
|
8917
|
+
_context4.next = 11;
|
|
8918
|
+
return createApiInstanceForNode(determineRelayChain(destination));
|
|
8919
|
+
case 11:
|
|
8373
8920
|
_context4.t0 = _context4.sent;
|
|
8374
|
-
case
|
|
8921
|
+
case 12:
|
|
8375
8922
|
apiWithFallback = _context4.t0;
|
|
8376
8923
|
amountStr = amount.toString();
|
|
8377
|
-
|
|
8924
|
+
if (!isMultiLocationDestination) {
|
|
8925
|
+
_context4.next = 18;
|
|
8926
|
+
break;
|
|
8927
|
+
}
|
|
8928
|
+
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
8929
|
+
_context4.next = 24;
|
|
8930
|
+
break;
|
|
8931
|
+
case 18:
|
|
8932
|
+
if (!isAddressMultiLocation) {
|
|
8933
|
+
_context4.next = 22;
|
|
8934
|
+
break;
|
|
8935
|
+
}
|
|
8936
|
+
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
8937
|
+
_context4.next = 24;
|
|
8938
|
+
break;
|
|
8939
|
+
case 22:
|
|
8940
|
+
_context4.next = 24;
|
|
8378
8941
|
return checkKeepAlive({
|
|
8379
8942
|
originApi: apiWithFallback,
|
|
8380
8943
|
address: address,
|
|
8381
8944
|
amount: amountStr,
|
|
8382
8945
|
destApi: destApiForKeepAlive,
|
|
8383
|
-
currencySymbol:
|
|
8946
|
+
currencySymbol: getRelayChainSymbol(destination),
|
|
8384
8947
|
destNode: destination
|
|
8385
8948
|
});
|
|
8386
|
-
case
|
|
8387
|
-
serializedApiCall = getNode(destination).transferRelayToPara({
|
|
8949
|
+
case 24:
|
|
8950
|
+
serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(destination) : destination).transferRelayToPara({
|
|
8388
8951
|
api: apiWithFallback,
|
|
8389
8952
|
destination: destination,
|
|
8390
8953
|
address: address,
|
|
@@ -8393,13 +8956,13 @@ var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
|
|
|
8393
8956
|
destApiForKeepAlive: destApiForKeepAlive
|
|
8394
8957
|
});
|
|
8395
8958
|
if (!serializedApiCallEnabled) {
|
|
8396
|
-
_context4.next =
|
|
8959
|
+
_context4.next = 27;
|
|
8397
8960
|
break;
|
|
8398
8961
|
}
|
|
8399
8962
|
return _context4.abrupt("return", serializedApiCall);
|
|
8400
|
-
case
|
|
8963
|
+
case 27:
|
|
8401
8964
|
return _context4.abrupt("return", callPolkadotJsTxFunction(apiWithFallback, serializedApiCall));
|
|
8402
|
-
case
|
|
8965
|
+
case 28:
|
|
8403
8966
|
case "end":
|
|
8404
8967
|
return _context4.stop();
|
|
8405
8968
|
}
|
|
@@ -8798,6 +9361,12 @@ var Subsocial = {
|
|
|
8798
9361
|
"PolkadotXcm"
|
|
8799
9362
|
]
|
|
8800
9363
|
};
|
|
9364
|
+
var KiltSpiritnet = {
|
|
9365
|
+
defaultPallet: "PolkadotXcm",
|
|
9366
|
+
supportedPallets: [
|
|
9367
|
+
"PolkadotXcm"
|
|
9368
|
+
]
|
|
9369
|
+
};
|
|
8801
9370
|
var pallets = {
|
|
8802
9371
|
AssetHubPolkadot: AssetHubPolkadot,
|
|
8803
9372
|
Acala: Acala,
|
|
@@ -8849,7 +9418,8 @@ var pallets = {
|
|
|
8849
9418
|
Collectives: Collectives,
|
|
8850
9419
|
Khala: Khala,
|
|
8851
9420
|
Phala: Phala,
|
|
8852
|
-
Subsocial: Subsocial
|
|
9421
|
+
Subsocial: Subsocial,
|
|
9422
|
+
KiltSpiritnet: KiltSpiritnet
|
|
8853
9423
|
};
|
|
8854
9424
|
|
|
8855
9425
|
var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
@@ -8882,6 +9452,7 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
8882
9452
|
InvArchTinker: InvArchTinker,
|
|
8883
9453
|
Karura: Karura,
|
|
8884
9454
|
Khala: Khala,
|
|
9455
|
+
KiltSpiritnet: KiltSpiritnet,
|
|
8885
9456
|
Kintsugi: Kintsugi,
|
|
8886
9457
|
Litentry: Litentry,
|
|
8887
9458
|
Litmus: Litmus,
|