@paraspell/sdk-core 13.0.1 → 13.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 +0 -3
- package/dist/index.d.ts +19 -9
- package/dist/index.mjs +963 -912
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
2
|
-
import { isChainEvm, getAssetsObject, InvalidCurrencyError, extractAssetLocation, isTAsset, findAssetInfoOrThrow,
|
|
2
|
+
import { isChainEvm, getAssetsObject, InvalidCurrencyError, extractAssetLocation, isTAsset, findAssetInfoOrThrow, findNativeAssetInfoOrThrow, findAssetInfo, findAssetOnDestOrThrow, findAssetInfoOnDest, isAssetEqual, isStableCoinAsset, isBridgedSystemAsset, isOverrideLocationSpecifier, getRelayChainSymbol, isSymbolSpecifier, normalizeLocation, getNativeAssetSymbol, getExistentialDepositOrThrow, isSymbolMatch, getEdFromAssetOrThrow, hasDryRunSupport, findNativeAssetInfo, isAssetXcEqual, normalizeSymbol, Native, hasXcmPaymentApiSupport, getOtherAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, isHex, pad, toHex, getAddress, concat, keccak256, createPublicClient, http, getContract, parseUnits as parseUnits$1, formatUnits as formatUnits$1 } from 'viem';
|
|
@@ -695,6 +695,21 @@ var RoutingResolutionError = /*#__PURE__*/function (_Error) {
|
|
|
695
695
|
return _createClass(RoutingResolutionError);
|
|
696
696
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
697
697
|
|
|
698
|
+
/**
|
|
699
|
+
* Error thrown when a runtime API call fails
|
|
700
|
+
*/
|
|
701
|
+
var RuntimeApiError = /*#__PURE__*/function (_Error) {
|
|
702
|
+
function RuntimeApiError(message) {
|
|
703
|
+
var _this;
|
|
704
|
+
_classCallCheck(this, RuntimeApiError);
|
|
705
|
+
_this = _callSuper(this, RuntimeApiError, [message]);
|
|
706
|
+
_this.name = 'RuntimeApiError';
|
|
707
|
+
return _this;
|
|
708
|
+
}
|
|
709
|
+
_inherits(RuntimeApiError, _Error);
|
|
710
|
+
return _createClass(RuntimeApiError);
|
|
711
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
712
|
+
|
|
698
713
|
/**
|
|
699
714
|
* Error thrown when a required runtime API is not available on the target chain.
|
|
700
715
|
*/
|
|
@@ -896,7 +911,7 @@ var keyFromWs = function keyFromWs(ws) {
|
|
|
896
911
|
};
|
|
897
912
|
var createClientPoolHelpers = function createClientPoolHelpers(clientPool, createClient) {
|
|
898
913
|
var leaseClient = /*#__PURE__*/function () {
|
|
899
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(ws, ttlMs
|
|
914
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(ws, ttlMs) {
|
|
900
915
|
var key, entry, client;
|
|
901
916
|
return _regenerator().w(function (_context) {
|
|
902
917
|
while (1) switch (_context.n) {
|
|
@@ -908,7 +923,7 @@ var createClientPoolHelpers = function createClientPoolHelpers(clientPool, creat
|
|
|
908
923
|
break;
|
|
909
924
|
}
|
|
910
925
|
_context.n = 1;
|
|
911
|
-
return createClient(ws
|
|
926
|
+
return createClient(ws);
|
|
912
927
|
case 1:
|
|
913
928
|
client = _context.v;
|
|
914
929
|
entry = {
|
|
@@ -925,7 +940,7 @@ var createClientPoolHelpers = function createClientPoolHelpers(clientPool, creat
|
|
|
925
940
|
}
|
|
926
941
|
}, _callee);
|
|
927
942
|
}));
|
|
928
|
-
return function leaseClient(_x, _x2
|
|
943
|
+
return function leaseClient(_x, _x2) {
|
|
929
944
|
return _ref.apply(this, arguments);
|
|
930
945
|
};
|
|
931
946
|
}();
|
|
@@ -1209,7 +1224,7 @@ var pickRouterCompatibleXcmVersion = function pickRouterCompatibleXcmVersion(ori
|
|
|
1209
1224
|
return selectXcmVersion(undefined, minWithOrigin, destVersion);
|
|
1210
1225
|
};
|
|
1211
1226
|
|
|
1212
|
-
var
|
|
1227
|
+
var createAssetId = function createAssetId(version, location) {
|
|
1213
1228
|
if (version === Version.V3) {
|
|
1214
1229
|
return {
|
|
1215
1230
|
Concrete: location
|
|
@@ -1388,967 +1403,534 @@ var claimAssets = /*#__PURE__*/function () {
|
|
|
1388
1403
|
};
|
|
1389
1404
|
}();
|
|
1390
1405
|
|
|
1391
|
-
var
|
|
1392
|
-
|
|
1406
|
+
var AssetHubPolkadot$1 = {
|
|
1407
|
+
name: "Asset Hub",
|
|
1408
|
+
info: "PolkadotAssetHub",
|
|
1409
|
+
paraId: 1000,
|
|
1410
|
+
providers: [
|
|
1411
|
+
{
|
|
1412
|
+
name: "Dwellir",
|
|
1413
|
+
endpoint: "wss://asset-hub-polkadot-rpc.n.dwellir.com"
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
name: "Dwellir Tunisia",
|
|
1417
|
+
endpoint: "wss://statemint-rpc-tn.dwellir.com"
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
name: "IBP1",
|
|
1421
|
+
endpoint: "wss://asset-hub-polkadot.ibp.network"
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
name: "IBP2",
|
|
1425
|
+
endpoint: "wss://asset-hub-polkadot.dotters.network"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
name: "LuckyFriday",
|
|
1429
|
+
endpoint: "wss://rpc-asset-hub-polkadot.luckyfriday.io"
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
name: "OnFinality",
|
|
1433
|
+
endpoint: "wss://statemint.api.onfinality.io/public-ws"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
name: "Parity",
|
|
1437
|
+
endpoint: "wss://polkadot-asset-hub-rpc.polkadot.io"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
name: "RadiumBlock",
|
|
1441
|
+
endpoint: "wss://statemint.public.curie.radiumblock.co/ws"
|
|
1442
|
+
}
|
|
1443
|
+
]
|
|
1393
1444
|
};
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1445
|
+
var Acala$1 = {
|
|
1446
|
+
name: "Acala",
|
|
1447
|
+
info: "acala",
|
|
1448
|
+
paraId: 2000,
|
|
1449
|
+
providers: [
|
|
1450
|
+
{
|
|
1451
|
+
name: "Acala Foundation 0",
|
|
1452
|
+
endpoint: "wss://acala-rpc-0.aca-api.network"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
name: "Acala Foundation 1",
|
|
1456
|
+
endpoint: "wss://acala-rpc-1.aca-api.network"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
name: "Acala Foundation 3",
|
|
1460
|
+
endpoint: "wss://acala-rpc-3.aca-api.network/ws"
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
name: "Dwellir",
|
|
1464
|
+
endpoint: "wss://acala-rpc.n.dwellir.com"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
name: "IBP1",
|
|
1468
|
+
endpoint: "wss://acala.ibp.network"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
name: "IBP2",
|
|
1472
|
+
endpoint: "wss://acala.dotters.network"
|
|
1473
|
+
}
|
|
1474
|
+
]
|
|
1405
1475
|
};
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
return findAssetOnDestOrThrow(swapConfig.exchangeChain, currentChain, swapConfig.currencyTo);
|
|
1425
|
-
}
|
|
1426
|
-
return (_findAssetInfoOnDest = findAssetInfoOnDest(originChain, currentChain, currency)) !== null && _findAssetInfoOnDest !== void 0 ? _findAssetInfoOnDest : asset;
|
|
1476
|
+
var Ajuna$1 = {
|
|
1477
|
+
name: "Ajuna Network",
|
|
1478
|
+
info: "ajuna",
|
|
1479
|
+
paraId: 2051,
|
|
1480
|
+
providers: [
|
|
1481
|
+
{
|
|
1482
|
+
name: "AjunaNetwork",
|
|
1483
|
+
endpoint: "wss://rpc-para.ajuna.network"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: "IBP1",
|
|
1487
|
+
endpoint: "wss://ajuna.ibp.network"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
name: "IBP2",
|
|
1491
|
+
endpoint: "wss://ajuna.dotters.network"
|
|
1492
|
+
}
|
|
1493
|
+
]
|
|
1427
1494
|
};
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1495
|
+
var Astar$1 = {
|
|
1496
|
+
name: "Astar",
|
|
1497
|
+
info: "astar",
|
|
1498
|
+
paraId: 2006,
|
|
1499
|
+
providers: [
|
|
1500
|
+
{
|
|
1501
|
+
name: "Astar",
|
|
1502
|
+
endpoint: "wss://rpc.astar.network"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
name: "Dwellir",
|
|
1506
|
+
endpoint: "wss://astar-rpc.n.dwellir.com"
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
name: "OnFinality",
|
|
1510
|
+
endpoint: "wss://astar.api.onfinality.io/public-ws"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
name: "RadiumBlock",
|
|
1514
|
+
endpoint: "wss://astar.public.curie.radiumblock.co/ws"
|
|
1515
|
+
}
|
|
1516
|
+
]
|
|
1441
1517
|
};
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1518
|
+
var BifrostPolkadot$1 = {
|
|
1519
|
+
name: "Bifrost",
|
|
1520
|
+
info: "bifrost",
|
|
1521
|
+
paraId: 2030,
|
|
1522
|
+
providers: [
|
|
1523
|
+
{
|
|
1524
|
+
name: "IBP1",
|
|
1525
|
+
endpoint: "wss://bifrost-polkadot.ibp.network"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
name: "IBP2",
|
|
1529
|
+
endpoint: "wss://bifrost-polkadot.dotters.network"
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: "Liebi",
|
|
1533
|
+
endpoint: "wss://hk.p.bifrost-rpc.liebi.com/ws"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: "LiebiEU",
|
|
1537
|
+
endpoint: "wss://eu.bifrost-polkadot-rpc.liebi.com/ws"
|
|
1538
|
+
}
|
|
1539
|
+
]
|
|
1453
1540
|
};
|
|
1454
|
-
var
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1541
|
+
var BridgeHubPolkadot$1 = {
|
|
1542
|
+
name: "Bridge Hub",
|
|
1543
|
+
info: "polkadotBridgeHub",
|
|
1544
|
+
paraId: 1002,
|
|
1545
|
+
providers: [
|
|
1546
|
+
{
|
|
1547
|
+
name: "Dwellir",
|
|
1548
|
+
endpoint: "wss://bridge-hub-polkadot-rpc.n.dwellir.com"
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
name: "Dwellir Tunisia",
|
|
1552
|
+
endpoint: "wss://polkadot-bridge-hub-rpc-tn.dwellir.com"
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
name: "IBP1",
|
|
1556
|
+
endpoint: "wss://bridge-hub-polkadot.ibp.network"
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
name: "IBP2",
|
|
1560
|
+
endpoint: "wss://bridge-hub-polkadot.dotters.network"
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
name: "LuckyFriday",
|
|
1564
|
+
endpoint: "wss://rpc-bridge-hub-polkadot.luckyfriday.io"
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
name: "OnFinality",
|
|
1568
|
+
endpoint: "wss://bridgehub-polkadot.api.onfinality.io/public-ws"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
name: "Parity",
|
|
1572
|
+
endpoint: "wss://polkadot-bridge-hub-rpc.polkadot.io"
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
name: "RadiumBlock",
|
|
1576
|
+
endpoint: "wss://bridgehub-polkadot.public.curie.radiumblock.co/ws"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
name: "Spectrum",
|
|
1580
|
+
endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/mgX--uWlEtmNKw/polkadotbridgehub/mainnet/"
|
|
1581
|
+
}
|
|
1582
|
+
]
|
|
1466
1583
|
};
|
|
1467
|
-
var
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
}];
|
|
1482
|
-
var isEthCompatibleAsset = asset.location.parents === Parents.TWO && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), getEthereumJunction(origin, false).GlobalConsensus) || ADDITIONAL_ALLOWED_LOCATIONS.some(function (loc) {
|
|
1483
|
-
return deepEqual(asset.location, loc);
|
|
1484
|
-
});
|
|
1485
|
-
if (!isEthCompatibleAsset) {
|
|
1486
|
-
throw new InvalidCurrencyError("Currency ".concat(JSON.stringify(asset, replaceBigInt), " is not transferable to Ethereum."));
|
|
1487
|
-
}
|
|
1584
|
+
var Centrifuge$1 = {
|
|
1585
|
+
name: "Centrifuge",
|
|
1586
|
+
info: "centrifuge",
|
|
1587
|
+
paraId: 2031,
|
|
1588
|
+
providers: [
|
|
1589
|
+
{
|
|
1590
|
+
name: "LuckyFriday",
|
|
1591
|
+
endpoint: "wss://rpc-centrifuge.luckyfriday.io"
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
name: "OnFinality",
|
|
1595
|
+
endpoint: "wss://centrifuge-parachain.api.onfinality.io/public-ws"
|
|
1596
|
+
}
|
|
1597
|
+
]
|
|
1488
1598
|
};
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1599
|
+
var Darwinia$1 = {
|
|
1600
|
+
name: "Darwinia",
|
|
1601
|
+
info: "darwinia",
|
|
1602
|
+
paraId: 2046,
|
|
1603
|
+
providers: [
|
|
1604
|
+
{
|
|
1605
|
+
name: "Darwinia",
|
|
1606
|
+
endpoint: "wss://rpc.darwinia.network"
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
name: "Subquery",
|
|
1610
|
+
endpoint: "wss://darwinia.rpc.subquery.network/public/ws"
|
|
1611
|
+
}
|
|
1612
|
+
]
|
|
1502
1613
|
};
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
if (Array.isArray(currency)) {
|
|
1514
|
-
if (!feeAsset) {
|
|
1515
|
-
throw new InvalidCurrencyError('Overridden multi assets cannot be used without specifying fee asset');
|
|
1516
|
-
}
|
|
1517
|
-
if ('location' in feeAsset && isOverrideLocationSpecifier(feeAsset.location)) {
|
|
1518
|
-
throw new InvalidCurrencyError('Fee asset cannot be an overridden location specifier');
|
|
1519
|
-
}
|
|
1520
|
-
if (currency.every(function (asset) {
|
|
1521
|
-
return isTAsset(asset);
|
|
1522
|
-
})) {
|
|
1523
|
-
if (!feeAsset) {
|
|
1524
|
-
throw new InvalidCurrencyError('Fee asset not provided');
|
|
1525
|
-
}
|
|
1526
|
-
if (!('location' in feeAsset)) {
|
|
1527
|
-
throw new InvalidCurrencyError('Fee asset must be specified by location when using raw overridden multi assets');
|
|
1528
|
-
}
|
|
1529
|
-
return currency.map(function (asset) {
|
|
1530
|
-
var ml = extractAssetLocation(asset);
|
|
1531
|
-
return _objectSpread2(_objectSpread2({}, asset), {}, {
|
|
1532
|
-
fun: {
|
|
1533
|
-
Fungible: BigInt(asset.fun.Fungible)
|
|
1534
|
-
},
|
|
1535
|
-
isFeeAsset: deepEqual(ml, feeAsset.location)
|
|
1536
|
-
});
|
|
1537
|
-
});
|
|
1538
|
-
}
|
|
1539
|
-
// MultiAsset is an array of TCurrencyCore, search for assets
|
|
1540
|
-
var assets = currency.map(function (currency) {
|
|
1541
|
-
if (currency.amount === AMOUNT_ALL) {
|
|
1542
|
-
throw new InvalidCurrencyError('Multi assets cannot use amount all. Please specify amount.');
|
|
1543
|
-
}
|
|
1544
|
-
var asset = findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null);
|
|
1545
|
-
if (!asset) {
|
|
1546
|
-
throw new InvalidCurrencyError("Origin chain ".concat(origin, " does not support currency ").concat(JSON.stringify(currency)));
|
|
1547
|
-
}
|
|
1548
|
-
if (!resolvedFeeAsset) {
|
|
1549
|
-
throw new InvalidCurrencyError('Fee asset not found');
|
|
1550
|
-
}
|
|
1551
|
-
validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
|
|
1552
|
-
var version = getChainVersion(origin);
|
|
1553
|
-
var abstractedAmount = abstractDecimals(currency.amount, asset.decimals, api);
|
|
1554
|
-
return _objectSpread2({
|
|
1555
|
-
isFeeAsset: isAssetEqual(resolvedFeeAsset, asset)
|
|
1556
|
-
}, createAsset(version, abstractedAmount, asset.location));
|
|
1557
|
-
});
|
|
1558
|
-
if (assets.filter(function (asset) {
|
|
1559
|
-
return asset.isFeeAsset;
|
|
1560
|
-
}).length > 1) {
|
|
1561
|
-
throw new InvalidCurrencyError("Fee asset matches multiple assets in multiassets");
|
|
1562
|
-
}
|
|
1563
|
-
if (assets.filter(function (asset) {
|
|
1564
|
-
return asset.isFeeAsset;
|
|
1565
|
-
}).length === 0) {
|
|
1566
|
-
throw new InvalidCurrencyError("Fee asset not found in multiassets");
|
|
1567
|
-
}
|
|
1568
|
-
return assets;
|
|
1569
|
-
}
|
|
1570
|
-
return undefined;
|
|
1614
|
+
var EnergyWebX$1 = {
|
|
1615
|
+
name: "Energy Web X",
|
|
1616
|
+
info: "ewx",
|
|
1617
|
+
paraId: 3345,
|
|
1618
|
+
providers: [
|
|
1619
|
+
{
|
|
1620
|
+
name: "Energy Web",
|
|
1621
|
+
endpoint: "wss://wnp-rpc.mainnet.energywebx.com/"
|
|
1622
|
+
}
|
|
1623
|
+
]
|
|
1571
1624
|
};
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1625
|
+
var Hydration$1 = {
|
|
1626
|
+
name: "Hydration",
|
|
1627
|
+
info: "hydradx",
|
|
1628
|
+
paraId: 2034,
|
|
1629
|
+
providers: [
|
|
1630
|
+
{
|
|
1631
|
+
name: "Helikon",
|
|
1632
|
+
endpoint: "wss://rpc.helikon.io/hydradx"
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
name: "IBP1",
|
|
1636
|
+
endpoint: "wss://hydration.ibp.network"
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
name: "IBP2",
|
|
1640
|
+
endpoint: "wss://hydration.dotters.network"
|
|
1641
|
+
}
|
|
1642
|
+
]
|
|
1578
1643
|
};
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
}
|
|
1644
|
+
var Interlay$1 = {
|
|
1645
|
+
name: "Interlay",
|
|
1646
|
+
info: "interlay",
|
|
1647
|
+
paraId: 2032,
|
|
1648
|
+
providers: [
|
|
1649
|
+
{
|
|
1650
|
+
name: "Kintsugi Labs",
|
|
1651
|
+
endpoint: "wss://api.interlay.io/parachain"
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
name: "LuckyFriday",
|
|
1655
|
+
endpoint: "wss://rpc-interlay.luckyfriday.io/"
|
|
1656
|
+
}
|
|
1657
|
+
]
|
|
1594
1658
|
};
|
|
1595
|
-
var
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
if (!isBridgeTransfer && originRelayChainSymbol !== destinationRelayChainSymbol) {
|
|
1610
|
-
throw new ScenarioNotSupportedError('Origin and destination must share the same relay chain unless using a bridge.');
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
if (isRelayChain(origin) && typeof destination === 'string' && !isExternalChain(destination)) {
|
|
1614
|
-
var chain = getChain(destination);
|
|
1615
|
-
if (!chain.isRelayToParaEnabled()) {
|
|
1616
|
-
throw new ScenarioNotSupportedError({
|
|
1617
|
-
chain: destination,
|
|
1618
|
-
scenario: 'RelayToPara'
|
|
1619
|
-
});
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1659
|
+
var Heima$1 = {
|
|
1660
|
+
name: "Heima",
|
|
1661
|
+
info: "heima",
|
|
1662
|
+
paraId: 2013,
|
|
1663
|
+
providers: [
|
|
1664
|
+
{
|
|
1665
|
+
name: "Dwellir",
|
|
1666
|
+
endpoint: "wss://heima-rpc.n.dwellir.com"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
name: "Heima",
|
|
1670
|
+
endpoint: "wss://rpc.heima-parachain.heima.network"
|
|
1671
|
+
}
|
|
1672
|
+
]
|
|
1622
1673
|
};
|
|
1623
|
-
var
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1674
|
+
var Jamton$1 = {
|
|
1675
|
+
name: "JAMTON",
|
|
1676
|
+
info: "jamton",
|
|
1677
|
+
paraId: 3397,
|
|
1678
|
+
providers: [
|
|
1679
|
+
{
|
|
1680
|
+
name: "Jamton",
|
|
1681
|
+
endpoint: "wss://rpc.jamton.network"
|
|
1682
|
+
}
|
|
1683
|
+
]
|
|
1630
1684
|
};
|
|
1631
|
-
var
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
sender = _ref.sender,
|
|
1636
|
-
address = _ref.recipient,
|
|
1637
|
-
transactOptions = _ref.transactOptions;
|
|
1638
|
-
var call = transactOptions === null || transactOptions === void 0 ? void 0 : transactOptions.call;
|
|
1639
|
-
if (!call) return;
|
|
1640
|
-
if (from === to) {
|
|
1641
|
-
throw new UnsupportedOperationError('Cannot use transact options with local transfers.');
|
|
1642
|
-
}
|
|
1643
|
-
if (typeof call === 'string' && !isHex(call)) {
|
|
1644
|
-
throw new ValidationError('Transact call hex must be a valid hex string.');
|
|
1645
|
-
}
|
|
1646
|
-
if (isChainEvm(from) || typeof to === 'string' && isChainEvm(to)) {
|
|
1647
|
-
throw new UnsupportedOperationError('Transact option is only supported for Substrate to Substrate scenarios.');
|
|
1648
|
-
}
|
|
1649
|
-
if (typeof address === 'string' && sender && !compareAddresses(api, address, sender)) {
|
|
1650
|
-
return new ValidationError('Sender address must match the destination address for transact to work.');
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
var resolveTransferParams = function resolveTransferParams(options) {
|
|
1655
|
-
var api = options.api,
|
|
1656
|
-
origin = options.from,
|
|
1657
|
-
currency = options.currency,
|
|
1658
|
-
feeAsset = options.feeAsset,
|
|
1659
|
-
address = options.recipient,
|
|
1660
|
-
destination = options.to,
|
|
1661
|
-
version = options.version,
|
|
1662
|
-
sender = options.sender;
|
|
1663
|
-
validateCurrency(currency, feeAsset);
|
|
1664
|
-
validateDestination(origin, destination);
|
|
1665
|
-
validateTransact(options);
|
|
1666
|
-
validateDestinationAddress(address, destination, api);
|
|
1667
|
-
if (sender) validateAddress(api, sender, origin, false);
|
|
1668
|
-
var isBridge = !isTLocation(destination) && isSubstrateBridge(origin, destination);
|
|
1669
|
-
var assetCheckEnabled = shouldPerformAssetCheck(origin, currency);
|
|
1670
|
-
validateAssetSpecifiers(assetCheckEnabled, currency);
|
|
1671
|
-
var asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
|
|
1672
|
-
var resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
1673
|
-
validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
|
|
1674
|
-
var amount = Array.isArray(currency) ? 0n : abstractDecimals(currency.amount, asset === null || asset === void 0 ? void 0 : asset.decimals, api);
|
|
1675
|
-
// Ensure amount is at least 2 to avoid Rust panic (only for non-array currencies)
|
|
1676
|
-
var finalAmount = !Array.isArray(currency) && amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
|
|
1677
|
-
var resolvedVersion = pickCompatibleXcmVersion(origin, destination, version);
|
|
1678
|
-
var overriddenAsset = resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset);
|
|
1679
|
-
// In case asset check is disabled, we create asset object from currency symbol
|
|
1680
|
-
var resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
1681
|
-
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
1682
|
-
};
|
|
1683
|
-
var finalAsset = Array.isArray(currency) ? // TODO: Refactor this
|
|
1684
|
-
// We use a dummy values when overriding with multi-assets
|
|
1685
|
-
// since these values won't be used but need to pass checks
|
|
1686
|
-
_objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
1687
|
-
amount: 0n,
|
|
1688
|
-
assetId: '1',
|
|
1689
|
-
location: {
|
|
1690
|
-
parents: Parents.ZERO,
|
|
1691
|
-
interior: {
|
|
1692
|
-
Here: null
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
}) : _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
1696
|
-
amount: finalAmount
|
|
1697
|
-
});
|
|
1698
|
-
var normalizedAsset = finalAsset.location ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
|
|
1699
|
-
location: normalizeLocation(finalAsset.location, resolvedVersion)
|
|
1700
|
-
}) : finalAsset;
|
|
1701
|
-
return {
|
|
1702
|
-
resolvedFeeAsset: resolvedFeeAsset,
|
|
1703
|
-
resolvedVersion: resolvedVersion,
|
|
1704
|
-
overriddenAsset: overriddenAsset,
|
|
1705
|
-
normalizedAsset: normalizedAsset
|
|
1706
|
-
};
|
|
1707
|
-
};
|
|
1708
|
-
var createTransfer = /*#__PURE__*/function () {
|
|
1709
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
|
|
1710
|
-
var api, origin, currency, feeAsset, recipient, destination, paraIdTo, sender, ahAddress, pallet, method, transactOptions, isAmountAll, keepAlive, _resolveTransferParam, resolvedFeeAsset, resolvedVersion, overriddenAsset, normalizedAsset;
|
|
1711
|
-
return _regenerator().w(function (_context) {
|
|
1712
|
-
while (1) switch (_context.n) {
|
|
1713
|
-
case 0:
|
|
1714
|
-
api = options.api, origin = options.from, currency = options.currency, feeAsset = options.feeAsset, recipient = options.recipient, destination = options.to, paraIdTo = options.paraIdTo, sender = options.sender, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method, transactOptions = options.transactOptions, isAmountAll = options.isAmountAll, keepAlive = options.keepAlive;
|
|
1715
|
-
_resolveTransferParam = resolveTransferParams(options), resolvedFeeAsset = _resolveTransferParam.resolvedFeeAsset, resolvedVersion = _resolveTransferParam.resolvedVersion, overriddenAsset = _resolveTransferParam.overriddenAsset, normalizedAsset = _resolveTransferParam.normalizedAsset;
|
|
1716
|
-
_context.n = 1;
|
|
1717
|
-
return api.init(origin, TX_CLIENT_TIMEOUT_MS);
|
|
1718
|
-
case 1:
|
|
1719
|
-
return _context.a(2, getChain(origin).transfer({
|
|
1720
|
-
api: api,
|
|
1721
|
-
assetInfo: normalizedAsset,
|
|
1722
|
-
currency: currency,
|
|
1723
|
-
feeAsset: resolvedFeeAsset,
|
|
1724
|
-
feeCurrency: feeAsset,
|
|
1725
|
-
recipient: recipient,
|
|
1726
|
-
to: destination,
|
|
1727
|
-
paraIdTo: paraIdTo,
|
|
1728
|
-
overriddenAsset: overriddenAsset,
|
|
1729
|
-
version: resolvedVersion,
|
|
1730
|
-
sender: sender,
|
|
1731
|
-
ahAddress: ahAddress,
|
|
1732
|
-
pallet: pallet,
|
|
1733
|
-
method: method,
|
|
1734
|
-
transactOptions: transactOptions,
|
|
1735
|
-
isAmountAll: isAmountAll,
|
|
1736
|
-
keepAlive: keepAlive
|
|
1737
|
-
}));
|
|
1738
|
-
}
|
|
1739
|
-
}, _callee);
|
|
1740
|
-
}));
|
|
1741
|
-
return function createTransfer(_x) {
|
|
1742
|
-
return _ref.apply(this, arguments);
|
|
1743
|
-
};
|
|
1744
|
-
}();
|
|
1745
|
-
|
|
1746
|
-
var isAssetHub = function isAssetHub(chain) {
|
|
1747
|
-
return chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama';
|
|
1748
|
-
};
|
|
1749
|
-
var isBridgeHub = function isBridgeHub(chain) {
|
|
1750
|
-
return chain === 'BridgeHubPolkadot' || chain === 'BridgeHubKusama';
|
|
1751
|
-
};
|
|
1752
|
-
var isPeople = function isPeople(chain) {
|
|
1753
|
-
return chain === 'PeoplePolkadot' || chain === 'PeopleKusama';
|
|
1754
|
-
};
|
|
1755
|
-
var isSystemPara = function isSystemPara(chain) {
|
|
1756
|
-
return isAssetHub(chain) || isBridgeHub(chain) || isPeople(chain);
|
|
1757
|
-
};
|
|
1758
|
-
var mul = function mul(v, num) {
|
|
1759
|
-
var den = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1n;
|
|
1760
|
-
return v * num / den;
|
|
1761
|
-
};
|
|
1762
|
-
var padFee = function padFee(raw, origin, dest, side) {
|
|
1763
|
-
var relayOrigin = isRelayChain(origin);
|
|
1764
|
-
var relayDest = isRelayChain(dest);
|
|
1765
|
-
var sysParaOrigin = isSystemPara(origin);
|
|
1766
|
-
var sysParaDest = isSystemPara(dest);
|
|
1767
|
-
var relayToPara = relayOrigin && !relayDest;
|
|
1768
|
-
var sysParaToPara = sysParaOrigin && !sysParaDest;
|
|
1769
|
-
var paraToPara = !relayOrigin && !sysParaOrigin;
|
|
1770
|
-
if (sysParaToPara) return raw * 40n;
|
|
1771
|
-
if (relayToPara) return side === 'origin' ? mul(raw, 320n, 100n) : mul(raw, 3000n, 100n);
|
|
1772
|
-
if (paraToPara && side == 'origin' && origin === 'Mythos' && dest !== 'Ethereum') {
|
|
1773
|
-
return 150000000000000000n;
|
|
1774
|
-
}
|
|
1775
|
-
if (paraToPara) return mul(raw, 130n, 100n);
|
|
1776
|
-
// apply default 30% padding
|
|
1777
|
-
return mul(raw, 130n, 100n);
|
|
1778
|
-
};
|
|
1779
|
-
var padValueBy = function padValueBy(amount, percent) {
|
|
1780
|
-
var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
|
|
1781
|
-
return amount * (BigInt(10000) + scaled) / BigInt(10000);
|
|
1782
|
-
};
|
|
1783
|
-
|
|
1784
|
-
var getMythosOriginFee = /*#__PURE__*/function () {
|
|
1785
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api) {
|
|
1786
|
-
var ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, ahExecutionFee, nativeAsset, feeConverted;
|
|
1787
|
-
return _regenerator().w(function (_context) {
|
|
1788
|
-
while (1) switch (_context.n) {
|
|
1789
|
-
case 0:
|
|
1790
|
-
ahApi = api.clone();
|
|
1791
|
-
_context.n = 1;
|
|
1792
|
-
return ahApi.init('AssetHubPolkadot');
|
|
1793
|
-
case 1:
|
|
1794
|
-
_context.n = 2;
|
|
1795
|
-
return getParaEthTransferFees(ahApi, false);
|
|
1796
|
-
case 2:
|
|
1797
|
-
_yield$getParaEthTran = _context.v;
|
|
1798
|
-
_yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
|
|
1799
|
-
bridgeFee = _yield$getParaEthTran2[0];
|
|
1800
|
-
ahExecutionFee = _yield$getParaEthTran2[1];
|
|
1801
|
-
nativeAsset = findNativeAssetInfoOrThrow('Mythos');
|
|
1802
|
-
_context.n = 3;
|
|
1803
|
-
return ahApi.quoteAhPrice(DOT_LOCATION, nativeAsset.location, bridgeFee + ahExecutionFee);
|
|
1804
|
-
case 3:
|
|
1805
|
-
feeConverted = _context.v;
|
|
1806
|
-
_context.n = 4;
|
|
1807
|
-
return ahApi.disconnect();
|
|
1808
|
-
case 4:
|
|
1809
|
-
if (feeConverted) {
|
|
1810
|
-
_context.n = 5;
|
|
1811
|
-
break;
|
|
1812
|
-
}
|
|
1813
|
-
throw new UnableToComputeError("Pool DOT -> ".concat(nativeAsset.symbol, " not found."));
|
|
1814
|
-
case 5:
|
|
1815
|
-
return _context.a(2, padValueBy(feeConverted, 10));
|
|
1816
|
-
}
|
|
1817
|
-
}, _callee);
|
|
1818
|
-
}));
|
|
1819
|
-
return function getMythosOriginFee(_x) {
|
|
1820
|
-
return _ref.apply(this, arguments);
|
|
1821
|
-
};
|
|
1822
|
-
}();
|
|
1823
|
-
|
|
1824
|
-
var AssetHubPolkadot$1 = {
|
|
1825
|
-
name: "Asset Hub",
|
|
1826
|
-
info: "PolkadotAssetHub",
|
|
1827
|
-
paraId: 1000,
|
|
1685
|
+
var Moonbeam$1 = {
|
|
1686
|
+
name: "Moonbeam",
|
|
1687
|
+
info: "moonbeam",
|
|
1688
|
+
paraId: 2004,
|
|
1828
1689
|
providers: [
|
|
1829
1690
|
{
|
|
1830
|
-
name: "
|
|
1831
|
-
endpoint: "wss://
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
name: "Dwellir Tunisia",
|
|
1835
|
-
endpoint: "wss://statemint-rpc-tn.dwellir.com"
|
|
1691
|
+
name: "Allnodes",
|
|
1692
|
+
endpoint: "wss://moonbeam-rpc.publicnode.com"
|
|
1836
1693
|
},
|
|
1837
1694
|
{
|
|
1838
1695
|
name: "IBP1",
|
|
1839
|
-
endpoint: "wss://
|
|
1696
|
+
endpoint: "wss://moonbeam.ibp.network"
|
|
1840
1697
|
},
|
|
1841
1698
|
{
|
|
1842
1699
|
name: "IBP2",
|
|
1843
|
-
endpoint: "wss://
|
|
1700
|
+
endpoint: "wss://moonbeam.dotters.network"
|
|
1844
1701
|
},
|
|
1845
1702
|
{
|
|
1846
|
-
name: "
|
|
1847
|
-
endpoint: "wss://
|
|
1703
|
+
name: "Moonbeam Foundation",
|
|
1704
|
+
endpoint: "wss://wss.api.moonbeam.network"
|
|
1848
1705
|
},
|
|
1849
1706
|
{
|
|
1850
1707
|
name: "OnFinality",
|
|
1851
|
-
endpoint: "wss://
|
|
1708
|
+
endpoint: "wss://moonbeam.api.onfinality.io/public-ws"
|
|
1852
1709
|
},
|
|
1853
1710
|
{
|
|
1854
|
-
name: "
|
|
1855
|
-
endpoint: "wss://
|
|
1711
|
+
name: "RadiumBlock",
|
|
1712
|
+
endpoint: "wss://moonbeam.public.curie.radiumblock.co/ws"
|
|
1856
1713
|
},
|
|
1857
1714
|
{
|
|
1858
|
-
name: "
|
|
1859
|
-
endpoint: "wss://
|
|
1715
|
+
name: "UnitedBloc",
|
|
1716
|
+
endpoint: "wss://moonbeam.unitedbloc.com"
|
|
1860
1717
|
}
|
|
1861
1718
|
]
|
|
1862
1719
|
};
|
|
1863
|
-
var
|
|
1864
|
-
name: "
|
|
1865
|
-
info: "
|
|
1866
|
-
paraId:
|
|
1720
|
+
var CoretimePolkadot$1 = {
|
|
1721
|
+
name: "Coretime",
|
|
1722
|
+
info: "polkadotCoretime",
|
|
1723
|
+
paraId: 1005,
|
|
1867
1724
|
providers: [
|
|
1868
1725
|
{
|
|
1869
|
-
name: "
|
|
1870
|
-
endpoint: "wss://
|
|
1726
|
+
name: "Dwellir",
|
|
1727
|
+
endpoint: "wss://coretime-polkadot-rpc.n.dwellir.com"
|
|
1871
1728
|
},
|
|
1872
1729
|
{
|
|
1873
|
-
name: "
|
|
1874
|
-
endpoint: "wss://
|
|
1730
|
+
name: "IBP1",
|
|
1731
|
+
endpoint: "wss://coretime-polkadot.ibp.network"
|
|
1875
1732
|
},
|
|
1876
1733
|
{
|
|
1877
|
-
name: "
|
|
1878
|
-
endpoint: "wss://
|
|
1734
|
+
name: "IBP2",
|
|
1735
|
+
endpoint: "wss://coretime-polkadot.dotters.network"
|
|
1879
1736
|
},
|
|
1880
1737
|
{
|
|
1881
|
-
name: "
|
|
1882
|
-
endpoint: "wss://
|
|
1738
|
+
name: "LuckyFriday",
|
|
1739
|
+
endpoint: "wss://rpc-coretime-polkadot.luckyfriday.io"
|
|
1883
1740
|
},
|
|
1884
1741
|
{
|
|
1885
|
-
name: "
|
|
1886
|
-
endpoint: "wss://
|
|
1742
|
+
name: "OnFinality",
|
|
1743
|
+
endpoint: "wss://coretime-polkadot.api.onfinality.io/public-ws"
|
|
1887
1744
|
},
|
|
1888
1745
|
{
|
|
1889
|
-
name: "
|
|
1890
|
-
endpoint: "wss://
|
|
1746
|
+
name: "Parity",
|
|
1747
|
+
endpoint: "wss://polkadot-coretime-rpc.polkadot.io"
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
name: "RadiumBlock",
|
|
1751
|
+
endpoint: "wss://coretime-polkadot.public.curie.radiumblock.co/ws"
|
|
1891
1752
|
}
|
|
1892
1753
|
]
|
|
1893
1754
|
};
|
|
1894
|
-
var
|
|
1895
|
-
name: "
|
|
1896
|
-
info: "
|
|
1897
|
-
paraId:
|
|
1898
|
-
providers: [
|
|
1899
|
-
{
|
|
1900
|
-
name: "AjunaNetwork",
|
|
1901
|
-
endpoint: "wss://rpc-para.ajuna.network"
|
|
1902
|
-
},
|
|
1903
|
-
{
|
|
1904
|
-
name: "IBP1",
|
|
1905
|
-
endpoint: "wss://ajuna.ibp.network"
|
|
1906
|
-
},
|
|
1907
|
-
{
|
|
1908
|
-
name: "IBP2",
|
|
1909
|
-
endpoint: "wss://ajuna.dotters.network"
|
|
1910
|
-
}
|
|
1911
|
-
]
|
|
1912
|
-
};
|
|
1913
|
-
var Astar$1 = {
|
|
1914
|
-
name: "Astar",
|
|
1915
|
-
info: "astar",
|
|
1916
|
-
paraId: 2006,
|
|
1917
|
-
providers: [
|
|
1918
|
-
{
|
|
1919
|
-
name: "Astar",
|
|
1920
|
-
endpoint: "wss://rpc.astar.network"
|
|
1921
|
-
},
|
|
1922
|
-
{
|
|
1923
|
-
name: "Dwellir",
|
|
1924
|
-
endpoint: "wss://astar-rpc.n.dwellir.com"
|
|
1925
|
-
},
|
|
1926
|
-
{
|
|
1927
|
-
name: "OnFinality",
|
|
1928
|
-
endpoint: "wss://astar.api.onfinality.io/public-ws"
|
|
1929
|
-
},
|
|
1930
|
-
{
|
|
1931
|
-
name: "RadiumBlock",
|
|
1932
|
-
endpoint: "wss://astar.public.curie.radiumblock.co/ws"
|
|
1933
|
-
}
|
|
1934
|
-
]
|
|
1935
|
-
};
|
|
1936
|
-
var BifrostPolkadot$1 = {
|
|
1937
|
-
name: "Bifrost",
|
|
1938
|
-
info: "bifrost",
|
|
1939
|
-
paraId: 2030,
|
|
1940
|
-
providers: [
|
|
1941
|
-
{
|
|
1942
|
-
name: "IBP1",
|
|
1943
|
-
endpoint: "wss://bifrost-polkadot.ibp.network"
|
|
1944
|
-
},
|
|
1945
|
-
{
|
|
1946
|
-
name: "IBP2",
|
|
1947
|
-
endpoint: "wss://bifrost-polkadot.dotters.network"
|
|
1948
|
-
},
|
|
1949
|
-
{
|
|
1950
|
-
name: "Liebi",
|
|
1951
|
-
endpoint: "wss://hk.p.bifrost-rpc.liebi.com/ws"
|
|
1952
|
-
},
|
|
1953
|
-
{
|
|
1954
|
-
name: "LiebiEU",
|
|
1955
|
-
endpoint: "wss://eu.bifrost-polkadot-rpc.liebi.com/ws"
|
|
1956
|
-
}
|
|
1957
|
-
]
|
|
1958
|
-
};
|
|
1959
|
-
var BridgeHubPolkadot$1 = {
|
|
1960
|
-
name: "Bridge Hub",
|
|
1961
|
-
info: "polkadotBridgeHub",
|
|
1962
|
-
paraId: 1002,
|
|
1755
|
+
var Collectives$1 = {
|
|
1756
|
+
name: "Collectives",
|
|
1757
|
+
info: "polkadotCollectives",
|
|
1758
|
+
paraId: 1001,
|
|
1963
1759
|
providers: [
|
|
1964
1760
|
{
|
|
1965
1761
|
name: "Dwellir",
|
|
1966
|
-
endpoint: "wss://
|
|
1762
|
+
endpoint: "wss://collectives-polkadot-rpc.n.dwellir.com"
|
|
1967
1763
|
},
|
|
1968
1764
|
{
|
|
1969
1765
|
name: "Dwellir Tunisia",
|
|
1970
|
-
endpoint: "wss://polkadot-
|
|
1766
|
+
endpoint: "wss://polkadot-collectives-rpc-tn.dwellir.com"
|
|
1971
1767
|
},
|
|
1972
1768
|
{
|
|
1973
1769
|
name: "IBP1",
|
|
1974
|
-
endpoint: "wss://
|
|
1770
|
+
endpoint: "wss://collectives-polkadot.ibp.network"
|
|
1975
1771
|
},
|
|
1976
1772
|
{
|
|
1977
1773
|
name: "IBP2",
|
|
1978
|
-
endpoint: "wss://
|
|
1774
|
+
endpoint: "wss://collectives-polkadot.dotters.network"
|
|
1979
1775
|
},
|
|
1980
1776
|
{
|
|
1981
1777
|
name: "LuckyFriday",
|
|
1982
|
-
endpoint: "wss://rpc-
|
|
1778
|
+
endpoint: "wss://rpc-collectives-polkadot.luckyfriday.io"
|
|
1983
1779
|
},
|
|
1984
1780
|
{
|
|
1985
1781
|
name: "OnFinality",
|
|
1986
|
-
endpoint: "wss://
|
|
1782
|
+
endpoint: "wss://collectives.api.onfinality.io/public-ws"
|
|
1987
1783
|
},
|
|
1988
1784
|
{
|
|
1989
1785
|
name: "Parity",
|
|
1990
|
-
endpoint: "wss://polkadot-
|
|
1786
|
+
endpoint: "wss://polkadot-collectives-rpc.polkadot.io"
|
|
1991
1787
|
},
|
|
1992
1788
|
{
|
|
1993
1789
|
name: "RadiumBlock",
|
|
1994
|
-
endpoint: "wss://
|
|
1995
|
-
},
|
|
1996
|
-
{
|
|
1997
|
-
name: "Spectrum",
|
|
1998
|
-
endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/mgX--uWlEtmNKw/polkadotbridgehub/mainnet/"
|
|
1790
|
+
endpoint: "wss://collectives.public.curie.radiumblock.co/ws"
|
|
1999
1791
|
}
|
|
2000
1792
|
]
|
|
2001
1793
|
};
|
|
2002
|
-
var
|
|
2003
|
-
name: "
|
|
2004
|
-
info: "
|
|
2005
|
-
paraId:
|
|
1794
|
+
var Crust$1 = {
|
|
1795
|
+
name: "Crust",
|
|
1796
|
+
info: "crustParachain",
|
|
1797
|
+
paraId: 2008,
|
|
2006
1798
|
providers: [
|
|
2007
1799
|
{
|
|
2008
|
-
name: "
|
|
2009
|
-
endpoint: "wss://
|
|
1800
|
+
name: "Crust",
|
|
1801
|
+
endpoint: "wss://crust-parachain.crustapps.net"
|
|
2010
1802
|
},
|
|
2011
1803
|
{
|
|
2012
|
-
name: "
|
|
2013
|
-
endpoint: "wss://
|
|
2014
|
-
}
|
|
2015
|
-
]
|
|
2016
|
-
};
|
|
2017
|
-
var Darwinia$1 = {
|
|
2018
|
-
name: "Darwinia",
|
|
2019
|
-
info: "darwinia",
|
|
2020
|
-
paraId: 2046,
|
|
2021
|
-
providers: [
|
|
1804
|
+
name: "Crust APP",
|
|
1805
|
+
endpoint: "wss://crust-parachain.crustnetwork.app"
|
|
1806
|
+
},
|
|
2022
1807
|
{
|
|
2023
|
-
name: "
|
|
2024
|
-
endpoint: "wss://
|
|
1808
|
+
name: "Crust CC",
|
|
1809
|
+
endpoint: "wss://crust-parachain.crustnetwork.cc"
|
|
2025
1810
|
},
|
|
2026
1811
|
{
|
|
2027
|
-
name: "
|
|
2028
|
-
endpoint: "wss://
|
|
1812
|
+
name: "Crust XYZ",
|
|
1813
|
+
endpoint: "wss://crust-parachain.crustnetwork.xyz"
|
|
2029
1814
|
}
|
|
2030
1815
|
]
|
|
2031
1816
|
};
|
|
2032
|
-
var
|
|
2033
|
-
name: "
|
|
2034
|
-
info: "
|
|
2035
|
-
paraId:
|
|
1817
|
+
var Manta$1 = {
|
|
1818
|
+
name: "Manta",
|
|
1819
|
+
info: "manta",
|
|
1820
|
+
paraId: 2104,
|
|
2036
1821
|
providers: [
|
|
2037
1822
|
{
|
|
2038
|
-
name: "
|
|
2039
|
-
endpoint: "wss://
|
|
1823
|
+
name: "Manta Network",
|
|
1824
|
+
endpoint: "wss://ws.manta.systems"
|
|
2040
1825
|
}
|
|
2041
1826
|
]
|
|
2042
1827
|
};
|
|
2043
|
-
var
|
|
2044
|
-
name: "
|
|
2045
|
-
info: "
|
|
2046
|
-
paraId:
|
|
1828
|
+
var NeuroWeb$1 = {
|
|
1829
|
+
name: "NeuroWeb",
|
|
1830
|
+
info: "neuroweb",
|
|
1831
|
+
paraId: 2043,
|
|
2047
1832
|
providers: [
|
|
2048
1833
|
{
|
|
2049
|
-
name: "
|
|
2050
|
-
endpoint: "wss://rpc.
|
|
2051
|
-
},
|
|
2052
|
-
{
|
|
2053
|
-
name: "IBP1",
|
|
2054
|
-
endpoint: "wss://hydration.ibp.network"
|
|
2055
|
-
},
|
|
2056
|
-
{
|
|
2057
|
-
name: "IBP2",
|
|
2058
|
-
endpoint: "wss://hydration.dotters.network"
|
|
1834
|
+
name: "TraceLabs",
|
|
1835
|
+
endpoint: "wss://parachain-rpc.origin-trail.network"
|
|
2059
1836
|
}
|
|
2060
1837
|
]
|
|
2061
1838
|
};
|
|
2062
|
-
var
|
|
2063
|
-
name: "
|
|
2064
|
-
info: "
|
|
2065
|
-
paraId:
|
|
1839
|
+
var Pendulum$1 = {
|
|
1840
|
+
name: "Pendulum",
|
|
1841
|
+
info: "pendulum",
|
|
1842
|
+
paraId: 2094,
|
|
2066
1843
|
providers: [
|
|
2067
1844
|
{
|
|
2068
|
-
name: "
|
|
2069
|
-
endpoint: "wss://
|
|
2070
|
-
},
|
|
2071
|
-
{
|
|
2072
|
-
name: "LuckyFriday",
|
|
2073
|
-
endpoint: "wss://rpc-interlay.luckyfriday.io/"
|
|
1845
|
+
name: "PendulumChain",
|
|
1846
|
+
endpoint: "wss://rpc-pendulum.prd.pendulumchain.tech"
|
|
2074
1847
|
}
|
|
2075
1848
|
]
|
|
2076
1849
|
};
|
|
2077
|
-
var
|
|
2078
|
-
name: "
|
|
2079
|
-
info: "
|
|
2080
|
-
paraId:
|
|
1850
|
+
var Mythos$1 = {
|
|
1851
|
+
name: "Mythos",
|
|
1852
|
+
info: "mythos",
|
|
1853
|
+
paraId: 3369,
|
|
2081
1854
|
providers: [
|
|
2082
1855
|
{
|
|
2083
|
-
name: "
|
|
2084
|
-
endpoint: "wss://
|
|
2085
|
-
},
|
|
2086
|
-
{
|
|
2087
|
-
name: "Heima",
|
|
2088
|
-
endpoint: "wss://rpc.heima-parachain.heima.network"
|
|
1856
|
+
name: "parity",
|
|
1857
|
+
endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
|
|
2089
1858
|
}
|
|
2090
1859
|
]
|
|
2091
1860
|
};
|
|
2092
|
-
var
|
|
2093
|
-
name: "
|
|
2094
|
-
info: "
|
|
2095
|
-
paraId:
|
|
1861
|
+
var Peaq$1 = {
|
|
1862
|
+
name: "peaq",
|
|
1863
|
+
info: "peaq",
|
|
1864
|
+
paraId: 3338,
|
|
2096
1865
|
providers: [
|
|
2097
1866
|
{
|
|
2098
|
-
name: "
|
|
2099
|
-
endpoint: "wss://
|
|
1867
|
+
name: "OnFinality",
|
|
1868
|
+
endpoint: "wss://peaq.api.onfinality.io/public-ws"
|
|
2100
1869
|
}
|
|
2101
1870
|
]
|
|
2102
1871
|
};
|
|
2103
|
-
var
|
|
2104
|
-
name: "
|
|
2105
|
-
info: "
|
|
2106
|
-
paraId:
|
|
1872
|
+
var PeoplePolkadot$1 = {
|
|
1873
|
+
name: "People",
|
|
1874
|
+
info: "polkadotPeople",
|
|
1875
|
+
paraId: 1004,
|
|
2107
1876
|
providers: [
|
|
2108
1877
|
{
|
|
2109
|
-
name: "
|
|
2110
|
-
endpoint: "wss://
|
|
1878
|
+
name: "Dwellir",
|
|
1879
|
+
endpoint: "wss://people-polkadot-rpc.n.dwellir.com"
|
|
2111
1880
|
},
|
|
2112
1881
|
{
|
|
2113
1882
|
name: "IBP1",
|
|
2114
|
-
endpoint: "wss://
|
|
1883
|
+
endpoint: "wss://people-polkadot.ibp.network"
|
|
2115
1884
|
},
|
|
2116
1885
|
{
|
|
2117
1886
|
name: "IBP2",
|
|
2118
|
-
endpoint: "wss://
|
|
1887
|
+
endpoint: "wss://people-polkadot.dotters.network"
|
|
2119
1888
|
},
|
|
2120
1889
|
{
|
|
2121
|
-
name: "
|
|
2122
|
-
endpoint: "wss://
|
|
1890
|
+
name: "LuckyFriday",
|
|
1891
|
+
endpoint: "wss://rpc-people-polkadot.luckyfriday.io"
|
|
2123
1892
|
},
|
|
2124
1893
|
{
|
|
2125
1894
|
name: "OnFinality",
|
|
2126
|
-
endpoint: "wss://
|
|
1895
|
+
endpoint: "wss://people-polkadot.api.onfinality.io/public-ws"
|
|
2127
1896
|
},
|
|
2128
1897
|
{
|
|
2129
|
-
name: "
|
|
2130
|
-
endpoint: "wss://
|
|
1898
|
+
name: "Parity",
|
|
1899
|
+
endpoint: "wss://polkadot-people-rpc.polkadot.io"
|
|
2131
1900
|
},
|
|
2132
1901
|
{
|
|
2133
|
-
name: "
|
|
2134
|
-
endpoint: "wss://
|
|
1902
|
+
name: "RadiumBlock",
|
|
1903
|
+
endpoint: "wss://people-polkadot.public.curie.radiumblock.co/ws"
|
|
2135
1904
|
}
|
|
2136
1905
|
]
|
|
2137
1906
|
};
|
|
2138
|
-
var
|
|
2139
|
-
name: "
|
|
2140
|
-
info: "
|
|
2141
|
-
paraId:
|
|
1907
|
+
var Unique$1 = {
|
|
1908
|
+
name: "Unique Network",
|
|
1909
|
+
info: "unique",
|
|
1910
|
+
paraId: 2037,
|
|
2142
1911
|
providers: [
|
|
2143
1912
|
{
|
|
2144
|
-
name: "
|
|
2145
|
-
endpoint: "wss://
|
|
1913
|
+
name: "Geo Load Balancer",
|
|
1914
|
+
endpoint: "wss://ws.unique.network"
|
|
2146
1915
|
},
|
|
2147
1916
|
{
|
|
2148
1917
|
name: "IBP1",
|
|
2149
|
-
endpoint: "wss://
|
|
1918
|
+
endpoint: "wss://unique.ibp.network"
|
|
2150
1919
|
},
|
|
2151
1920
|
{
|
|
2152
1921
|
name: "IBP2",
|
|
2153
|
-
endpoint: "wss://
|
|
2154
|
-
}
|
|
1922
|
+
endpoint: "wss://unique.dotters.network"
|
|
1923
|
+
}
|
|
1924
|
+
]
|
|
1925
|
+
};
|
|
1926
|
+
var Xode$1 = {
|
|
1927
|
+
name: "Xode",
|
|
1928
|
+
info: "xode",
|
|
1929
|
+
paraId: 3417,
|
|
1930
|
+
providers: [
|
|
2155
1931
|
{
|
|
2156
|
-
name: "
|
|
2157
|
-
endpoint: "wss://
|
|
2158
|
-
},
|
|
2159
|
-
{
|
|
2160
|
-
name: "OnFinality",
|
|
2161
|
-
endpoint: "wss://coretime-polkadot.api.onfinality.io/public-ws"
|
|
2162
|
-
},
|
|
2163
|
-
{
|
|
2164
|
-
name: "Parity",
|
|
2165
|
-
endpoint: "wss://polkadot-coretime-rpc.polkadot.io"
|
|
2166
|
-
},
|
|
2167
|
-
{
|
|
2168
|
-
name: "RadiumBlock",
|
|
2169
|
-
endpoint: "wss://coretime-polkadot.public.curie.radiumblock.co/ws"
|
|
2170
|
-
}
|
|
2171
|
-
]
|
|
2172
|
-
};
|
|
2173
|
-
var Collectives$1 = {
|
|
2174
|
-
name: "Collectives",
|
|
2175
|
-
info: "polkadotCollectives",
|
|
2176
|
-
paraId: 1001,
|
|
2177
|
-
providers: [
|
|
2178
|
-
{
|
|
2179
|
-
name: "Dwellir",
|
|
2180
|
-
endpoint: "wss://collectives-polkadot-rpc.n.dwellir.com"
|
|
2181
|
-
},
|
|
2182
|
-
{
|
|
2183
|
-
name: "Dwellir Tunisia",
|
|
2184
|
-
endpoint: "wss://polkadot-collectives-rpc-tn.dwellir.com"
|
|
2185
|
-
},
|
|
2186
|
-
{
|
|
2187
|
-
name: "IBP1",
|
|
2188
|
-
endpoint: "wss://collectives-polkadot.ibp.network"
|
|
2189
|
-
},
|
|
2190
|
-
{
|
|
2191
|
-
name: "IBP2",
|
|
2192
|
-
endpoint: "wss://collectives-polkadot.dotters.network"
|
|
2193
|
-
},
|
|
2194
|
-
{
|
|
2195
|
-
name: "LuckyFriday",
|
|
2196
|
-
endpoint: "wss://rpc-collectives-polkadot.luckyfriday.io"
|
|
2197
|
-
},
|
|
2198
|
-
{
|
|
2199
|
-
name: "OnFinality",
|
|
2200
|
-
endpoint: "wss://collectives.api.onfinality.io/public-ws"
|
|
2201
|
-
},
|
|
2202
|
-
{
|
|
2203
|
-
name: "Parity",
|
|
2204
|
-
endpoint: "wss://polkadot-collectives-rpc.polkadot.io"
|
|
2205
|
-
},
|
|
2206
|
-
{
|
|
2207
|
-
name: "RadiumBlock",
|
|
2208
|
-
endpoint: "wss://collectives.public.curie.radiumblock.co/ws"
|
|
2209
|
-
}
|
|
2210
|
-
]
|
|
2211
|
-
};
|
|
2212
|
-
var Crust$1 = {
|
|
2213
|
-
name: "Crust",
|
|
2214
|
-
info: "crustParachain",
|
|
2215
|
-
paraId: 2008,
|
|
2216
|
-
providers: [
|
|
2217
|
-
{
|
|
2218
|
-
name: "Crust",
|
|
2219
|
-
endpoint: "wss://crust-parachain.crustapps.net"
|
|
2220
|
-
},
|
|
2221
|
-
{
|
|
2222
|
-
name: "Crust APP",
|
|
2223
|
-
endpoint: "wss://crust-parachain.crustnetwork.app"
|
|
2224
|
-
},
|
|
2225
|
-
{
|
|
2226
|
-
name: "Crust CC",
|
|
2227
|
-
endpoint: "wss://crust-parachain.crustnetwork.cc"
|
|
2228
|
-
},
|
|
2229
|
-
{
|
|
2230
|
-
name: "Crust XYZ",
|
|
2231
|
-
endpoint: "wss://crust-parachain.crustnetwork.xyz"
|
|
2232
|
-
}
|
|
2233
|
-
]
|
|
2234
|
-
};
|
|
2235
|
-
var Manta$1 = {
|
|
2236
|
-
name: "Manta",
|
|
2237
|
-
info: "manta",
|
|
2238
|
-
paraId: 2104,
|
|
2239
|
-
providers: [
|
|
2240
|
-
{
|
|
2241
|
-
name: "Manta Network",
|
|
2242
|
-
endpoint: "wss://ws.manta.systems"
|
|
2243
|
-
}
|
|
2244
|
-
]
|
|
2245
|
-
};
|
|
2246
|
-
var NeuroWeb$1 = {
|
|
2247
|
-
name: "NeuroWeb",
|
|
2248
|
-
info: "neuroweb",
|
|
2249
|
-
paraId: 2043,
|
|
2250
|
-
providers: [
|
|
2251
|
-
{
|
|
2252
|
-
name: "TraceLabs",
|
|
2253
|
-
endpoint: "wss://parachain-rpc.origin-trail.network"
|
|
2254
|
-
}
|
|
2255
|
-
]
|
|
2256
|
-
};
|
|
2257
|
-
var Pendulum$1 = {
|
|
2258
|
-
name: "Pendulum",
|
|
2259
|
-
info: "pendulum",
|
|
2260
|
-
paraId: 2094,
|
|
2261
|
-
providers: [
|
|
2262
|
-
{
|
|
2263
|
-
name: "PendulumChain",
|
|
2264
|
-
endpoint: "wss://rpc-pendulum.prd.pendulumchain.tech"
|
|
2265
|
-
}
|
|
2266
|
-
]
|
|
2267
|
-
};
|
|
2268
|
-
var Mythos$1 = {
|
|
2269
|
-
name: "Mythos",
|
|
2270
|
-
info: "mythos",
|
|
2271
|
-
paraId: 3369,
|
|
2272
|
-
providers: [
|
|
2273
|
-
{
|
|
2274
|
-
name: "parity",
|
|
2275
|
-
endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
|
|
2276
|
-
}
|
|
2277
|
-
]
|
|
2278
|
-
};
|
|
2279
|
-
var Peaq$1 = {
|
|
2280
|
-
name: "peaq",
|
|
2281
|
-
info: "peaq",
|
|
2282
|
-
paraId: 3338,
|
|
2283
|
-
providers: [
|
|
2284
|
-
{
|
|
2285
|
-
name: "OnFinality",
|
|
2286
|
-
endpoint: "wss://peaq.api.onfinality.io/public-ws"
|
|
2287
|
-
}
|
|
2288
|
-
]
|
|
2289
|
-
};
|
|
2290
|
-
var PeoplePolkadot$1 = {
|
|
2291
|
-
name: "People",
|
|
2292
|
-
info: "polkadotPeople",
|
|
2293
|
-
paraId: 1004,
|
|
2294
|
-
providers: [
|
|
2295
|
-
{
|
|
2296
|
-
name: "Dwellir",
|
|
2297
|
-
endpoint: "wss://people-polkadot-rpc.n.dwellir.com"
|
|
2298
|
-
},
|
|
2299
|
-
{
|
|
2300
|
-
name: "IBP1",
|
|
2301
|
-
endpoint: "wss://people-polkadot.ibp.network"
|
|
2302
|
-
},
|
|
2303
|
-
{
|
|
2304
|
-
name: "IBP2",
|
|
2305
|
-
endpoint: "wss://people-polkadot.dotters.network"
|
|
2306
|
-
},
|
|
2307
|
-
{
|
|
2308
|
-
name: "LuckyFriday",
|
|
2309
|
-
endpoint: "wss://rpc-people-polkadot.luckyfriday.io"
|
|
2310
|
-
},
|
|
2311
|
-
{
|
|
2312
|
-
name: "OnFinality",
|
|
2313
|
-
endpoint: "wss://people-polkadot.api.onfinality.io/public-ws"
|
|
2314
|
-
},
|
|
2315
|
-
{
|
|
2316
|
-
name: "Parity",
|
|
2317
|
-
endpoint: "wss://polkadot-people-rpc.polkadot.io"
|
|
2318
|
-
},
|
|
2319
|
-
{
|
|
2320
|
-
name: "RadiumBlock",
|
|
2321
|
-
endpoint: "wss://people-polkadot.public.curie.radiumblock.co/ws"
|
|
2322
|
-
}
|
|
2323
|
-
]
|
|
2324
|
-
};
|
|
2325
|
-
var Unique$1 = {
|
|
2326
|
-
name: "Unique Network",
|
|
2327
|
-
info: "unique",
|
|
2328
|
-
paraId: 2037,
|
|
2329
|
-
providers: [
|
|
2330
|
-
{
|
|
2331
|
-
name: "Geo Load Balancer",
|
|
2332
|
-
endpoint: "wss://ws.unique.network"
|
|
2333
|
-
},
|
|
2334
|
-
{
|
|
2335
|
-
name: "IBP1",
|
|
2336
|
-
endpoint: "wss://unique.ibp.network"
|
|
2337
|
-
},
|
|
2338
|
-
{
|
|
2339
|
-
name: "IBP2",
|
|
2340
|
-
endpoint: "wss://unique.dotters.network"
|
|
2341
|
-
}
|
|
2342
|
-
]
|
|
2343
|
-
};
|
|
2344
|
-
var Xode$1 = {
|
|
2345
|
-
name: "Xode",
|
|
2346
|
-
info: "xode",
|
|
2347
|
-
paraId: 3417,
|
|
2348
|
-
providers: [
|
|
2349
|
-
{
|
|
2350
|
-
name: "RakSonCebu",
|
|
2351
|
-
endpoint: "wss://rakson-ceb-rpc.xode.net"
|
|
1932
|
+
name: "RakSonCebu",
|
|
1933
|
+
endpoint: "wss://rakson-ceb-rpc.xode.net"
|
|
2352
1934
|
},
|
|
2353
1935
|
{
|
|
2354
1936
|
name: "RakSonKorea",
|
|
@@ -3229,36 +2811,479 @@ var getChainConfig = function getChainConfig(chain) {
|
|
|
3229
2811
|
return configsMap[chain];
|
|
3230
2812
|
};
|
|
3231
2813
|
|
|
3232
|
-
var getChainProviders = function getChainProviders(chain) {
|
|
3233
|
-
var _getChainConfig = getChainConfig(chain),
|
|
3234
|
-
providers = _getChainConfig.providers;
|
|
3235
|
-
if (providers.length === 0) {
|
|
3236
|
-
throw new ProviderUnavailableError("No providers found for chain ".concat(chain));
|
|
3237
|
-
}
|
|
3238
|
-
// Prefer Dwellir provider
|
|
3239
|
-
providers.sort(function (a, b) {
|
|
3240
|
-
return (a.name === 'Dwellir' ? 0 : 1) - (b.name === 'Dwellir' ? 0 : 1);
|
|
3241
|
-
});
|
|
3242
|
-
return providers.map(function (p) {
|
|
3243
|
-
return p.endpoint;
|
|
2814
|
+
var getChainProviders = function getChainProviders(chain) {
|
|
2815
|
+
var _getChainConfig = getChainConfig(chain),
|
|
2816
|
+
providers = _getChainConfig.providers;
|
|
2817
|
+
if (providers.length === 0) {
|
|
2818
|
+
throw new ProviderUnavailableError("No providers found for chain ".concat(chain));
|
|
2819
|
+
}
|
|
2820
|
+
// Prefer Dwellir provider
|
|
2821
|
+
providers.sort(function (a, b) {
|
|
2822
|
+
return (a.name === 'Dwellir' ? 0 : 1) - (b.name === 'Dwellir' ? 0 : 1);
|
|
2823
|
+
});
|
|
2824
|
+
return providers.map(function (p) {
|
|
2825
|
+
return p.endpoint;
|
|
2826
|
+
});
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
/**
|
|
2830
|
+
* Retrieves the parachain ID for a specified chain.
|
|
2831
|
+
*
|
|
2832
|
+
* @param chain - The chain for which to get the paraId.
|
|
2833
|
+
* @returns The parachain ID of the chain.
|
|
2834
|
+
*/
|
|
2835
|
+
var getParaId = function getParaId(chain) {
|
|
2836
|
+
if (chain === 'Ethereum') {
|
|
2837
|
+
return ETH_MAINNET_PARA_ID;
|
|
2838
|
+
} else if (chain === 'EthereumTestnet') {
|
|
2839
|
+
return ETH_TESTNET_PARA_ID;
|
|
2840
|
+
}
|
|
2841
|
+
return getChainConfig(chain).paraId;
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2844
|
+
var isMoonbeamWhAsset = function isMoonbeamWhAsset(location) {
|
|
2845
|
+
return !!location && hasJunction(location, 'Parachain', getParaId('Moonbeam')) && hasJunction(location, 'PalletInstance', 110);
|
|
2846
|
+
};
|
|
2847
|
+
var inferFeeAsset = function inferFeeAsset(origin, destination, asset) {
|
|
2848
|
+
if (origin === 'Hydration' && destination === 'Moonbeam' && isMoonbeamWhAsset(asset.location)) {
|
|
2849
|
+
return findNativeAssetInfoOrThrow(destination);
|
|
2850
|
+
}
|
|
2851
|
+
return undefined;
|
|
2852
|
+
};
|
|
2853
|
+
|
|
2854
|
+
var resolveAsset = function resolveAsset(currency, origin, destination, assetCheckEnabled) {
|
|
2855
|
+
return assetCheckEnabled ? findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null) : null;
|
|
2856
|
+
};
|
|
2857
|
+
|
|
2858
|
+
var resolveFeeAsset = function resolveFeeAsset(feeAsset, origin, destination, currency) {
|
|
2859
|
+
if (!origin.startsWith('Hydration') && origin !== 'AssetHubPolkadot') {
|
|
2860
|
+
throw new ScenarioNotSupportedError("Fee asset is not supported on ".concat(origin));
|
|
2861
|
+
}
|
|
2862
|
+
var asset = findAssetInfo(origin, feeAsset, !isTLocation(destination) ? destination : null);
|
|
2863
|
+
var usesRawOverriddenMultiAssets = Array.isArray(currency) && currency.every(isTAsset);
|
|
2864
|
+
if (!asset && !usesRawOverriddenMultiAssets) {
|
|
2865
|
+
throwUnsupportedCurrency(feeAsset, origin);
|
|
2866
|
+
}
|
|
2867
|
+
return asset !== null && asset !== void 0 ? asset : undefined;
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2870
|
+
var resolveHopAsset = function resolveHopAsset(_ref) {
|
|
2871
|
+
var _findAssetInfoOnDest;
|
|
2872
|
+
var api = _ref.api,
|
|
2873
|
+
tx = _ref.tx,
|
|
2874
|
+
originChain = _ref.originChain,
|
|
2875
|
+
currentChain = _ref.currentChain,
|
|
2876
|
+
destination = _ref.destination,
|
|
2877
|
+
swapConfig = _ref.swapConfig,
|
|
2878
|
+
asset = _ref.asset,
|
|
2879
|
+
hasPassedExchange = _ref.hasPassedExchange,
|
|
2880
|
+
currency = _ref.currency;
|
|
2881
|
+
var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
|
|
2882
|
+
var useRelayAssetAsFee = typeof destination === 'string' && isExternalChain(destination) || isRelayAssetIncluded;
|
|
2883
|
+
if (useRelayAssetAsFee) {
|
|
2884
|
+
return findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
|
|
2885
|
+
}
|
|
2886
|
+
if (hasPassedExchange && swapConfig && currentChain !== swapConfig.exchangeChain) {
|
|
2887
|
+
return findAssetOnDestOrThrow(swapConfig.exchangeChain, currentChain, swapConfig.currencyTo);
|
|
2888
|
+
}
|
|
2889
|
+
return (_findAssetInfoOnDest = findAssetInfoOnDest(originChain, currentChain, currency)) !== null && _findAssetInfoOnDest !== void 0 ? _findAssetInfoOnDest : asset;
|
|
2890
|
+
};
|
|
2891
|
+
|
|
2892
|
+
var getEthereumJunction = function getEthereumJunction(chain) {
|
|
2893
|
+
var useBigInt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2894
|
+
var relayChain = getRelayChainOf(chain);
|
|
2895
|
+
var isTestnet = relayChain === 'Westend' || relayChain === 'Paseo';
|
|
2896
|
+
var chainId = isTestnet ? ETH_TESTNET_PARA_ID : ETH_MAINNET_PARA_ID;
|
|
2897
|
+
return {
|
|
2898
|
+
GlobalConsensus: {
|
|
2899
|
+
Ethereum: {
|
|
2900
|
+
chainId: useBigInt ? BigInt(chainId) : chainId
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
};
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2906
|
+
var validateBridgeAsset = function validateBridgeAsset(origin, destination, asset, currency, isBridge) {
|
|
2907
|
+
if (!asset || isTLocation(destination) || isExternalChain(destination) || !isBridge) {
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
var nativeAsset = findNativeAssetInfoOrThrow(origin);
|
|
2911
|
+
var isNativeAsset = isAssetEqual(asset, nativeAsset);
|
|
2912
|
+
var isBridgedStablecoin = isStableCoinAsset(asset);
|
|
2913
|
+
if (!(isNativeAsset || isBridgedSystemAsset(asset, [getRelayChainOf(destination)]) || isBridgedStablecoin)) {
|
|
2914
|
+
throw new InvalidCurrencyError("Substrate bridge does not support currency ".concat(JSON.stringify(currency, replaceBigInt), "."));
|
|
2915
|
+
}
|
|
2916
|
+
};
|
|
2917
|
+
var validateEcosystems = function validateEcosystems(origin, destination) {
|
|
2918
|
+
if (isTLocation(destination)) return;
|
|
2919
|
+
var relayChain = getRelayChainOf(origin);
|
|
2920
|
+
var destinationToRelayChains = {
|
|
2921
|
+
Ethereum: ['Polkadot'],
|
|
2922
|
+
EthereumTestnet: ['Westend', 'Paseo']
|
|
2923
|
+
};
|
|
2924
|
+
var allowedRelayChains = destinationToRelayChains[destination];
|
|
2925
|
+
if (!allowedRelayChains) return;
|
|
2926
|
+
if (!allowedRelayChains.includes(relayChain)) {
|
|
2927
|
+
throw new InvalidCurrencyError("Destination ".concat(destination, " is only supported from following ecosystems: ").concat(allowedRelayChains.join(', '), "."));
|
|
2928
|
+
}
|
|
2929
|
+
};
|
|
2930
|
+
var validateEthereumAsset = function validateEthereumAsset(origin, destination, asset) {
|
|
2931
|
+
if (!asset || !isTLocation(destination) && !isSnowbridge(origin, destination) || origin === 'Mythos') {
|
|
2932
|
+
return;
|
|
2933
|
+
}
|
|
2934
|
+
validateEcosystems(origin, destination);
|
|
2935
|
+
var ADDITIONAL_ALLOWED_LOCATIONS = [RELAY_LOCATION, {
|
|
2936
|
+
parents: 2,
|
|
2937
|
+
interior: {
|
|
2938
|
+
X1: [{
|
|
2939
|
+
GlobalConsensus: {
|
|
2940
|
+
Kusama: null
|
|
2941
|
+
}
|
|
2942
|
+
}]
|
|
2943
|
+
}
|
|
2944
|
+
}];
|
|
2945
|
+
var isEthCompatibleAsset = asset.location.parents === Parents.TWO && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), getEthereumJunction(origin, false).GlobalConsensus) || ADDITIONAL_ALLOWED_LOCATIONS.some(function (loc) {
|
|
2946
|
+
return deepEqual(asset.location, loc);
|
|
2947
|
+
});
|
|
2948
|
+
if (!isEthCompatibleAsset) {
|
|
2949
|
+
throw new InvalidCurrencyError("Currency ".concat(JSON.stringify(asset, replaceBigInt), " is not transferable to Ethereum."));
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled, isBridge, asset) {
|
|
2953
|
+
var origin = _ref.from,
|
|
2954
|
+
destination = _ref.to,
|
|
2955
|
+
currency = _ref.currency;
|
|
2956
|
+
var isLocationDestination = _typeof(destination) === 'object';
|
|
2957
|
+
if (asset === null && assetCheckEnabled) {
|
|
2958
|
+
throwUnsupportedCurrency(currency, origin);
|
|
2959
|
+
}
|
|
2960
|
+
if (!isLocationDestination && assetCheckEnabled && !findAssetInfoOnDest(origin, destination, currency, asset)) {
|
|
2961
|
+
throw new InvalidCurrencyError("Destination chain ".concat(destination, " does not support currency ").concat(JSON.stringify(currency, replaceBigInt), "."));
|
|
2962
|
+
}
|
|
2963
|
+
validateBridgeAsset(origin, destination, asset, currency, isBridge);
|
|
2964
|
+
validateEthereumAsset(origin, destination, asset);
|
|
2965
|
+
};
|
|
2966
|
+
|
|
2967
|
+
var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset) {
|
|
2968
|
+
var api = options.api,
|
|
2969
|
+
currency = options.currency,
|
|
2970
|
+
feeAsset = options.feeAsset,
|
|
2971
|
+
origin = options.from,
|
|
2972
|
+
destination = options.to;
|
|
2973
|
+
if ('location' in currency && isOverrideLocationSpecifier(currency.location)) {
|
|
2974
|
+
return currency.location.value;
|
|
2975
|
+
}
|
|
2976
|
+
if (Array.isArray(currency)) {
|
|
2977
|
+
if (!feeAsset) {
|
|
2978
|
+
throw new InvalidCurrencyError('Overridden multi assets cannot be used without specifying fee asset');
|
|
2979
|
+
}
|
|
2980
|
+
if ('location' in feeAsset && isOverrideLocationSpecifier(feeAsset.location)) {
|
|
2981
|
+
throw new InvalidCurrencyError('Fee asset cannot be an overridden location specifier');
|
|
2982
|
+
}
|
|
2983
|
+
if (currency.every(function (asset) {
|
|
2984
|
+
return isTAsset(asset);
|
|
2985
|
+
})) {
|
|
2986
|
+
if (!feeAsset) {
|
|
2987
|
+
throw new InvalidCurrencyError('Fee asset not provided');
|
|
2988
|
+
}
|
|
2989
|
+
if (!('location' in feeAsset)) {
|
|
2990
|
+
throw new InvalidCurrencyError('Fee asset must be specified by location when using raw overridden multi assets');
|
|
2991
|
+
}
|
|
2992
|
+
return currency.map(function (asset) {
|
|
2993
|
+
var ml = extractAssetLocation(asset);
|
|
2994
|
+
return _objectSpread2(_objectSpread2({}, asset), {}, {
|
|
2995
|
+
fun: {
|
|
2996
|
+
Fungible: BigInt(asset.fun.Fungible)
|
|
2997
|
+
},
|
|
2998
|
+
isFeeAsset: deepEqual(ml, feeAsset.location)
|
|
2999
|
+
});
|
|
3000
|
+
});
|
|
3001
|
+
}
|
|
3002
|
+
// MultiAsset is an array of TCurrencyCore, search for assets
|
|
3003
|
+
var assets = currency.map(function (currency) {
|
|
3004
|
+
if (currency.amount === AMOUNT_ALL) {
|
|
3005
|
+
throw new InvalidCurrencyError('Multi assets cannot use amount all. Please specify amount.');
|
|
3006
|
+
}
|
|
3007
|
+
var asset = findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null);
|
|
3008
|
+
if (!asset) {
|
|
3009
|
+
throw new InvalidCurrencyError("Origin chain ".concat(origin, " does not support currency ").concat(JSON.stringify(currency)));
|
|
3010
|
+
}
|
|
3011
|
+
if (!resolvedFeeAsset) {
|
|
3012
|
+
throw new InvalidCurrencyError('Fee asset not found');
|
|
3013
|
+
}
|
|
3014
|
+
validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
|
|
3015
|
+
var version = getChainVersion(origin);
|
|
3016
|
+
var abstractedAmount = abstractDecimals(currency.amount, asset.decimals, api);
|
|
3017
|
+
return _objectSpread2({
|
|
3018
|
+
isFeeAsset: isAssetEqual(resolvedFeeAsset, asset)
|
|
3019
|
+
}, createAsset(version, abstractedAmount, asset.location));
|
|
3020
|
+
});
|
|
3021
|
+
if (assets.filter(function (asset) {
|
|
3022
|
+
return asset.isFeeAsset;
|
|
3023
|
+
}).length > 1) {
|
|
3024
|
+
throw new InvalidCurrencyError("Fee asset matches multiple assets in multiassets");
|
|
3025
|
+
}
|
|
3026
|
+
if (assets.filter(function (asset) {
|
|
3027
|
+
return asset.isFeeAsset;
|
|
3028
|
+
}).length === 0) {
|
|
3029
|
+
throw new InvalidCurrencyError("Fee asset not found in multiassets");
|
|
3030
|
+
}
|
|
3031
|
+
return assets;
|
|
3032
|
+
}
|
|
3033
|
+
return undefined;
|
|
3034
|
+
};
|
|
3035
|
+
|
|
3036
|
+
var shouldPerformAssetCheck = function shouldPerformAssetCheck(origin, currency) {
|
|
3037
|
+
if (isRelayChain(origin)) return true;
|
|
3038
|
+
var isMultipleAssets = Array.isArray(currency);
|
|
3039
|
+
var hasOverriddenLocation = 'location' in currency && isOverrideLocationSpecifier(currency.location);
|
|
3040
|
+
return !(isMultipleAssets || hasOverriddenLocation);
|
|
3041
|
+
};
|
|
3042
|
+
|
|
3043
|
+
var validateCurrency = function validateCurrency(currency, feeAsset) {
|
|
3044
|
+
if (Array.isArray(currency)) {
|
|
3045
|
+
if (currency.length === 0) {
|
|
3046
|
+
throw new InvalidCurrencyError('Overridden assets cannot be empty');
|
|
3047
|
+
}
|
|
3048
|
+
if (currency.length === 1) {
|
|
3049
|
+
throw new InvalidCurrencyError('Please provide more than one asset');
|
|
3050
|
+
}
|
|
3051
|
+
if (currency.length > 1 && !currency.every(function (asset) {
|
|
3052
|
+
return isTAsset(asset);
|
|
3053
|
+
}) && !feeAsset) {
|
|
3054
|
+
throw new InvalidCurrencyError('Overridden assets cannot be used without specifying fee asset');
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
};
|
|
3058
|
+
var validateDestination = function validateDestination(origin, destination) {
|
|
3059
|
+
if (isRelayChain(origin) && !isTLocation(destination) && isRelayChain(destination) && origin !== destination) {
|
|
3060
|
+
throw new ScenarioNotSupportedError('Direct relay chain to relay chain transfers are not supported. Please use Polkadot <-> Kusama bridge through AssetHub.');
|
|
3061
|
+
}
|
|
3062
|
+
var allowedChainsToEthereum = ['AssetHubPolkadot', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'BifrostPolkadot', 'Moonbeam', 'Mythos'];
|
|
3063
|
+
if (typeof destination === 'string' && isExternalChain(destination) && !allowedChainsToEthereum.includes(origin)) {
|
|
3064
|
+
throw new ScenarioNotSupportedError("Transfers to Ethereum are only supported from: ".concat(allowedChainsToEthereum.join(', ')));
|
|
3065
|
+
}
|
|
3066
|
+
var isLocationDestination = _typeof(destination) === 'object';
|
|
3067
|
+
var isBridgeTransfer = !isTLocation(destination) && isBridge(origin, destination);
|
|
3068
|
+
var isRelayDestination = !isTLocation(destination) && isRelayChain(destination);
|
|
3069
|
+
if (!isRelayDestination && !isLocationDestination) {
|
|
3070
|
+
var originRelayChainSymbol = getRelayChainSymbol(origin);
|
|
3071
|
+
var destinationRelayChainSymbol = getRelayChainSymbol(destination);
|
|
3072
|
+
if (!isBridgeTransfer && originRelayChainSymbol !== destinationRelayChainSymbol) {
|
|
3073
|
+
throw new ScenarioNotSupportedError('Origin and destination must share the same relay chain unless using a bridge.');
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
if (isRelayChain(origin) && typeof destination === 'string' && !isExternalChain(destination)) {
|
|
3077
|
+
var chain = getChain(destination);
|
|
3078
|
+
if (!chain.isRelayToParaEnabled()) {
|
|
3079
|
+
throw new ScenarioNotSupportedError({
|
|
3080
|
+
chain: destination,
|
|
3081
|
+
scenario: 'RelayToPara'
|
|
3082
|
+
});
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
};
|
|
3086
|
+
var validateAssetSpecifiers = function validateAssetSpecifiers(assetCheckEnabled, currency) {
|
|
3087
|
+
if (!assetCheckEnabled && 'symbol' in currency && isSymbolSpecifier(currency.symbol)) {
|
|
3088
|
+
throw new InvalidCurrencyError('Symbol specifier is not supported when asset check is disabled. Please use normal symbol instead.');
|
|
3089
|
+
}
|
|
3090
|
+
if (!assetCheckEnabled && 'id' in currency) {
|
|
3091
|
+
throw new InvalidCurrencyError('Asset ID is not supported when asset check is disabled. Please use normal symbol instead');
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
var validateTransact = function validateTransact(_ref) {
|
|
3095
|
+
var api = _ref.api,
|
|
3096
|
+
from = _ref.from,
|
|
3097
|
+
to = _ref.to,
|
|
3098
|
+
sender = _ref.sender,
|
|
3099
|
+
address = _ref.recipient,
|
|
3100
|
+
transactOptions = _ref.transactOptions;
|
|
3101
|
+
var call = transactOptions === null || transactOptions === void 0 ? void 0 : transactOptions.call;
|
|
3102
|
+
if (!call) return;
|
|
3103
|
+
if (from === to) {
|
|
3104
|
+
throw new UnsupportedOperationError('Cannot use transact options with local transfers.');
|
|
3105
|
+
}
|
|
3106
|
+
if (typeof call === 'string' && !isHex(call)) {
|
|
3107
|
+
throw new ValidationError('Transact call hex must be a valid hex string.');
|
|
3108
|
+
}
|
|
3109
|
+
if (isChainEvm(from) || typeof to === 'string' && isChainEvm(to)) {
|
|
3110
|
+
throw new UnsupportedOperationError('Transact option is only supported for Substrate to Substrate scenarios.');
|
|
3111
|
+
}
|
|
3112
|
+
if (typeof address === 'string' && sender && !compareAddresses(api, address, sender)) {
|
|
3113
|
+
return new ValidationError('Sender address must match the destination address for transact to work.');
|
|
3114
|
+
}
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3117
|
+
var resolveTransferParams = function resolveTransferParams(options) {
|
|
3118
|
+
var api = options.api,
|
|
3119
|
+
origin = options.from,
|
|
3120
|
+
currency = options.currency,
|
|
3121
|
+
feeAsset = options.feeAsset,
|
|
3122
|
+
address = options.recipient,
|
|
3123
|
+
destination = options.to,
|
|
3124
|
+
version = options.version,
|
|
3125
|
+
sender = options.sender;
|
|
3126
|
+
validateCurrency(currency, feeAsset);
|
|
3127
|
+
validateDestination(origin, destination);
|
|
3128
|
+
validateTransact(options);
|
|
3129
|
+
validateDestinationAddress(address, destination, api);
|
|
3130
|
+
if (sender) validateAddress(api, sender, origin, false);
|
|
3131
|
+
var isBridge = !isTLocation(destination) && isSubstrateBridge(origin, destination);
|
|
3132
|
+
var assetCheckEnabled = shouldPerformAssetCheck(origin, currency);
|
|
3133
|
+
validateAssetSpecifiers(assetCheckEnabled, currency);
|
|
3134
|
+
var asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
|
|
3135
|
+
var resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
3136
|
+
validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
|
|
3137
|
+
var amount = Array.isArray(currency) ? 0n : abstractDecimals(currency.amount, asset === null || asset === void 0 ? void 0 : asset.decimals, api);
|
|
3138
|
+
// Ensure amount is at least 2 to avoid Rust panic (only for non-array currencies)
|
|
3139
|
+
var finalAmount = !Array.isArray(currency) && amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
|
|
3140
|
+
var resolvedVersion = pickCompatibleXcmVersion(origin, destination, version);
|
|
3141
|
+
var overriddenAsset = resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset);
|
|
3142
|
+
// In case asset check is disabled, we create asset object from currency symbol
|
|
3143
|
+
var resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
3144
|
+
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
3145
|
+
};
|
|
3146
|
+
var finalAsset = Array.isArray(currency) ? // TODO: Refactor this
|
|
3147
|
+
// We use a dummy values when overriding with multi-assets
|
|
3148
|
+
// since these values won't be used but need to pass checks
|
|
3149
|
+
_objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
3150
|
+
amount: 0n,
|
|
3151
|
+
assetId: '1',
|
|
3152
|
+
location: {
|
|
3153
|
+
parents: Parents.ZERO,
|
|
3154
|
+
interior: {
|
|
3155
|
+
Here: null
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
}) : _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
3159
|
+
amount: finalAmount
|
|
3244
3160
|
});
|
|
3161
|
+
var normalizedAsset = finalAsset.location ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
|
|
3162
|
+
location: normalizeLocation(finalAsset.location, resolvedVersion)
|
|
3163
|
+
}) : finalAsset;
|
|
3164
|
+
return {
|
|
3165
|
+
resolvedFeeAsset: resolvedFeeAsset,
|
|
3166
|
+
resolvedVersion: resolvedVersion,
|
|
3167
|
+
overriddenAsset: overriddenAsset,
|
|
3168
|
+
normalizedAsset: normalizedAsset
|
|
3169
|
+
};
|
|
3245
3170
|
};
|
|
3171
|
+
var createTransfer = /*#__PURE__*/function () {
|
|
3172
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
|
|
3173
|
+
var api, origin, currency, feeAsset, recipient, destination, paraIdTo, sender, ahAddress, pallet, method, transactOptions, isAmountAll, keepAlive, _resolveTransferParam, resolvedFeeAsset, resolvedVersion, overriddenAsset, normalizedAsset;
|
|
3174
|
+
return _regenerator().w(function (_context) {
|
|
3175
|
+
while (1) switch (_context.n) {
|
|
3176
|
+
case 0:
|
|
3177
|
+
api = options.api, origin = options.from, currency = options.currency, feeAsset = options.feeAsset, recipient = options.recipient, destination = options.to, paraIdTo = options.paraIdTo, sender = options.sender, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method, transactOptions = options.transactOptions, isAmountAll = options.isAmountAll, keepAlive = options.keepAlive;
|
|
3178
|
+
_resolveTransferParam = resolveTransferParams(options), resolvedFeeAsset = _resolveTransferParam.resolvedFeeAsset, resolvedVersion = _resolveTransferParam.resolvedVersion, overriddenAsset = _resolveTransferParam.overriddenAsset, normalizedAsset = _resolveTransferParam.normalizedAsset;
|
|
3179
|
+
_context.n = 1;
|
|
3180
|
+
return api.init(origin, TX_CLIENT_TIMEOUT_MS);
|
|
3181
|
+
case 1:
|
|
3182
|
+
return _context.a(2, getChain(origin).transfer({
|
|
3183
|
+
api: api,
|
|
3184
|
+
assetInfo: normalizedAsset,
|
|
3185
|
+
currency: currency,
|
|
3186
|
+
feeAsset: resolvedFeeAsset,
|
|
3187
|
+
feeCurrency: feeAsset,
|
|
3188
|
+
recipient: recipient,
|
|
3189
|
+
to: destination,
|
|
3190
|
+
paraIdTo: paraIdTo,
|
|
3191
|
+
overriddenAsset: overriddenAsset,
|
|
3192
|
+
version: resolvedVersion,
|
|
3193
|
+
sender: sender,
|
|
3194
|
+
ahAddress: ahAddress,
|
|
3195
|
+
pallet: pallet,
|
|
3196
|
+
method: method,
|
|
3197
|
+
transactOptions: transactOptions,
|
|
3198
|
+
isAmountAll: isAmountAll,
|
|
3199
|
+
keepAlive: keepAlive
|
|
3200
|
+
}));
|
|
3201
|
+
}
|
|
3202
|
+
}, _callee);
|
|
3203
|
+
}));
|
|
3204
|
+
return function createTransfer(_x) {
|
|
3205
|
+
return _ref.apply(this, arguments);
|
|
3206
|
+
};
|
|
3207
|
+
}();
|
|
3246
3208
|
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
var
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3209
|
+
var isAssetHub = function isAssetHub(chain) {
|
|
3210
|
+
return chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama';
|
|
3211
|
+
};
|
|
3212
|
+
var isBridgeHub = function isBridgeHub(chain) {
|
|
3213
|
+
return chain === 'BridgeHubPolkadot' || chain === 'BridgeHubKusama';
|
|
3214
|
+
};
|
|
3215
|
+
var isPeople = function isPeople(chain) {
|
|
3216
|
+
return chain === 'PeoplePolkadot' || chain === 'PeopleKusama';
|
|
3217
|
+
};
|
|
3218
|
+
var isSystemPara = function isSystemPara(chain) {
|
|
3219
|
+
return isAssetHub(chain) || isBridgeHub(chain) || isPeople(chain);
|
|
3220
|
+
};
|
|
3221
|
+
var mul = function mul(v, num) {
|
|
3222
|
+
var den = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1n;
|
|
3223
|
+
return v * num / den;
|
|
3224
|
+
};
|
|
3225
|
+
var padFee = function padFee(raw, origin, dest, side) {
|
|
3226
|
+
var relayOrigin = isRelayChain(origin);
|
|
3227
|
+
var relayDest = isRelayChain(dest);
|
|
3228
|
+
var sysParaOrigin = isSystemPara(origin);
|
|
3229
|
+
var sysParaDest = isSystemPara(dest);
|
|
3230
|
+
var relayToPara = relayOrigin && !relayDest;
|
|
3231
|
+
var sysParaToPara = sysParaOrigin && !sysParaDest;
|
|
3232
|
+
var paraToPara = !relayOrigin && !sysParaOrigin;
|
|
3233
|
+
if (sysParaToPara) return raw * 40n;
|
|
3234
|
+
if (relayToPara) return side === 'origin' ? mul(raw, 320n, 100n) : mul(raw, 3000n, 100n);
|
|
3235
|
+
if (paraToPara && side == 'origin' && origin === 'Mythos' && dest !== 'Ethereum') {
|
|
3236
|
+
return 150000000000000000n;
|
|
3258
3237
|
}
|
|
3259
|
-
return
|
|
3238
|
+
if (paraToPara) return mul(raw, 130n, 100n);
|
|
3239
|
+
// apply default 30% padding
|
|
3240
|
+
return mul(raw, 130n, 100n);
|
|
3241
|
+
};
|
|
3242
|
+
var padValueBy = function padValueBy(amount, percent) {
|
|
3243
|
+
var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
|
|
3244
|
+
return amount * (BigInt(10000) + scaled) / BigInt(10000);
|
|
3260
3245
|
};
|
|
3261
3246
|
|
|
3247
|
+
var getMythosOriginFee = /*#__PURE__*/function () {
|
|
3248
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api) {
|
|
3249
|
+
var ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, ahExecutionFee, nativeAsset, feeConverted;
|
|
3250
|
+
return _regenerator().w(function (_context) {
|
|
3251
|
+
while (1) switch (_context.n) {
|
|
3252
|
+
case 0:
|
|
3253
|
+
ahApi = api.clone();
|
|
3254
|
+
_context.n = 1;
|
|
3255
|
+
return ahApi.init('AssetHubPolkadot');
|
|
3256
|
+
case 1:
|
|
3257
|
+
_context.n = 2;
|
|
3258
|
+
return getParaEthTransferFees(ahApi, false);
|
|
3259
|
+
case 2:
|
|
3260
|
+
_yield$getParaEthTran = _context.v;
|
|
3261
|
+
_yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
|
|
3262
|
+
bridgeFee = _yield$getParaEthTran2[0];
|
|
3263
|
+
ahExecutionFee = _yield$getParaEthTran2[1];
|
|
3264
|
+
nativeAsset = findNativeAssetInfoOrThrow('Mythos');
|
|
3265
|
+
_context.n = 3;
|
|
3266
|
+
return ahApi.quoteAhPrice(DOT_LOCATION, nativeAsset.location, bridgeFee + ahExecutionFee);
|
|
3267
|
+
case 3:
|
|
3268
|
+
feeConverted = _context.v;
|
|
3269
|
+
_context.n = 4;
|
|
3270
|
+
return ahApi.disconnect();
|
|
3271
|
+
case 4:
|
|
3272
|
+
if (feeConverted) {
|
|
3273
|
+
_context.n = 5;
|
|
3274
|
+
break;
|
|
3275
|
+
}
|
|
3276
|
+
throw new UnableToComputeError("Pool DOT -> ".concat(nativeAsset.symbol, " not found."));
|
|
3277
|
+
case 5:
|
|
3278
|
+
return _context.a(2, padValueBy(feeConverted, 10));
|
|
3279
|
+
}
|
|
3280
|
+
}, _callee);
|
|
3281
|
+
}));
|
|
3282
|
+
return function getMythosOriginFee(_x) {
|
|
3283
|
+
return _ref.apply(this, arguments);
|
|
3284
|
+
};
|
|
3285
|
+
}();
|
|
3286
|
+
|
|
3262
3287
|
/**
|
|
3263
3288
|
* Builder class for constructing asset claim transactions.
|
|
3264
3289
|
*
|
|
@@ -3843,7 +3868,8 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
3843
3868
|
/**
|
|
3844
3869
|
* Sets a custom pallet for the transaction.
|
|
3845
3870
|
*
|
|
3846
|
-
* @param
|
|
3871
|
+
* @param pallet - The name of the custom pallet to be used.
|
|
3872
|
+
* @param method - The name of the method to be used.
|
|
3847
3873
|
* @returns An instance of the Builder.
|
|
3848
3874
|
*/
|
|
3849
3875
|
}, {
|
|
@@ -4799,8 +4825,8 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
4799
4825
|
assertHasId(asset);
|
|
4800
4826
|
var assetId = asset.assetId,
|
|
4801
4827
|
amount = asset.amount;
|
|
4802
|
-
var bigintIdChains = ['Astar', 'Shiden', 'Moonbeam', 'NeuroWeb'];
|
|
4803
|
-
var notUseAddressIdChains = ['NeuroWeb'];
|
|
4828
|
+
var bigintIdChains = ['Astar', 'Shiden', 'Moonbeam', 'NeuroWeb', 'Darwinia'];
|
|
4829
|
+
var notUseAddressIdChains = ['NeuroWeb', 'Darwinia'];
|
|
4804
4830
|
var useBigInt = bigintIdChains.some(function (prefix) {
|
|
4805
4831
|
return chain.startsWith(prefix);
|
|
4806
4832
|
});
|
|
@@ -4902,7 +4928,7 @@ var BalancesPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
4902
4928
|
key: "mint",
|
|
4903
4929
|
value: function mint(address, assetInfo, balance, chain) {
|
|
4904
4930
|
var amount = assetInfo.amount;
|
|
4905
|
-
var noIdPrefixes = ['Hydration', 'NeuroWeb', 'Basilisk'];
|
|
4931
|
+
var noIdPrefixes = ['Hydration', 'NeuroWeb', 'Basilisk', 'Darwinia'];
|
|
4906
4932
|
var notUseId = noIdPrefixes.some(function (prefix) {
|
|
4907
4933
|
return chain.startsWith(prefix);
|
|
4908
4934
|
}) || isChainEvm(chain);
|
|
@@ -4992,27 +5018,25 @@ var ForeignAssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
4992
5018
|
_inherits(ForeignAssetsPallet, _BaseAssetsPallet);
|
|
4993
5019
|
return _createClass(ForeignAssetsPallet, [{
|
|
4994
5020
|
key: "mint",
|
|
4995
|
-
value: function mint(address, asset) {
|
|
5021
|
+
value: function mint(address, asset, _balance, chain) {
|
|
4996
5022
|
var location = asset.location,
|
|
4997
5023
|
amount = asset.amount;
|
|
5024
|
+
var notUseId = ['NeuroWeb'];
|
|
5025
|
+
var addr = notUseId.some(function (prefix) {
|
|
5026
|
+
return chain.startsWith(prefix);
|
|
5027
|
+
}) ? address : {
|
|
5028
|
+
Id: address
|
|
5029
|
+
};
|
|
4998
5030
|
return Promise.resolve({
|
|
4999
5031
|
assetStatusTx: {
|
|
5000
5032
|
module: this.palletName,
|
|
5001
5033
|
method: 'force_asset_status',
|
|
5002
5034
|
params: {
|
|
5003
5035
|
id: location,
|
|
5004
|
-
owner:
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
Id: address
|
|
5009
|
-
},
|
|
5010
|
-
admin: {
|
|
5011
|
-
Id: address
|
|
5012
|
-
},
|
|
5013
|
-
freezer: {
|
|
5014
|
-
Id: address
|
|
5015
|
-
},
|
|
5036
|
+
owner: addr,
|
|
5037
|
+
issuer: addr,
|
|
5038
|
+
admin: addr,
|
|
5039
|
+
freezer: addr,
|
|
5016
5040
|
min_balance: 0n,
|
|
5017
5041
|
is_sufficient: true,
|
|
5018
5042
|
is_frozen: false
|
|
@@ -5023,9 +5047,7 @@ var ForeignAssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
5023
5047
|
method: 'mint',
|
|
5024
5048
|
params: {
|
|
5025
5049
|
id: location,
|
|
5026
|
-
beneficiary:
|
|
5027
|
-
Id: address
|
|
5028
|
-
},
|
|
5050
|
+
beneficiary: addr,
|
|
5029
5051
|
amount: amount
|
|
5030
5052
|
}
|
|
5031
5053
|
}
|
|
@@ -5534,15 +5556,13 @@ var isSufficientDestination = /*#__PURE__*/function () {
|
|
|
5534
5556
|
};
|
|
5535
5557
|
}();
|
|
5536
5558
|
|
|
5537
|
-
var createOriginLocation = function createOriginLocation(origin, destination) {
|
|
5559
|
+
var createOriginLocation = function createOriginLocation(origin, destination, version) {
|
|
5538
5560
|
if (isRelayChain(origin)) return DOT_LOCATION;
|
|
5539
5561
|
return {
|
|
5540
5562
|
parents: isRelayChain(destination) ? Parents.ZERO : Parents.ONE,
|
|
5541
|
-
interior: {
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
}]
|
|
5545
|
-
}
|
|
5563
|
+
interior: createX1Payload(version, {
|
|
5564
|
+
Parachain: getParaId(origin)
|
|
5565
|
+
})
|
|
5546
5566
|
};
|
|
5547
5567
|
};
|
|
5548
5568
|
var getDestXcmFee = /*#__PURE__*/function () {
|
|
@@ -5655,7 +5675,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
5655
5675
|
case 3:
|
|
5656
5676
|
_context3.n = 4;
|
|
5657
5677
|
return api.getDryRunXcm({
|
|
5658
|
-
originLocation: addXcmVersionHeader(createOriginLocation(hopChain, destination),
|
|
5678
|
+
originLocation: addXcmVersionHeader(createOriginLocation(hopChain, destination, version), version),
|
|
5659
5679
|
tx: tx,
|
|
5660
5680
|
xcm: forwardedXcms[1][0],
|
|
5661
5681
|
chain: destination,
|
|
@@ -6837,13 +6857,13 @@ var addEthereumBridgeFees = /*#__PURE__*/function () {
|
|
|
6837
6857
|
|
|
6838
6858
|
var dryRunInternal = /*#__PURE__*/function () {
|
|
6839
6859
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
6840
|
-
var api, origin, destination, currency, tx, sender, feeAsset, swapConfig, version, bypassOptions, _options$useRootOrigi, useRootOrigin,
|
|
6860
|
+
var api, origin, destination, currency, tx, sender, feeAsset, swapConfig, version, bypassOptions, _options$useRootOrigi, useRootOrigin, asset, resolvedFeeAsset, amount, resolvedVersion, originDryRun, isMythosToEthereum, originDryModified, initialForwardedXcms, initialDestParaId, processHop, traversalResult, bridgeHubChain, assetHubChain, bridgeHubHop, processedBridgeHub, bridgeHubHopIndex, result, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9;
|
|
6841
6861
|
return _regenerator().w(function (_context2) {
|
|
6842
6862
|
while (1) switch (_context2.n) {
|
|
6843
6863
|
case 0:
|
|
6844
6864
|
api = options.api, origin = options.origin, destination = options.destination, currency = options.currency, tx = options.tx, sender = options.sender, feeAsset = options.feeAsset, swapConfig = options.swapConfig, version = options.version, bypassOptions = options.bypassOptions, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi;
|
|
6845
|
-
resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
6846
6865
|
asset = findAssetInfoOrThrow(origin, currency, destination);
|
|
6866
|
+
resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
6847
6867
|
amount = abstractDecimals(currency.amount, asset.decimals, api);
|
|
6848
6868
|
resolvedVersion = pickCompatibleXcmVersion(origin, destination, version);
|
|
6849
6869
|
_context2.n = 1;
|
|
@@ -6900,12 +6920,13 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
6900
6920
|
initialForwardedXcms = originDryModified.forwardedXcms, initialDestParaId = originDryModified.destParaId;
|
|
6901
6921
|
processHop = /*#__PURE__*/function () {
|
|
6902
6922
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
|
|
6903
|
-
var
|
|
6923
|
+
var _inferFeeAsset;
|
|
6924
|
+
var hopApi, currentChain, currentOrigin, currentAsset, forwardedXcms, hasPassedExchange, isDestination, resolvedHopAsset, hopAsset, hopDryRun;
|
|
6904
6925
|
return _regenerator().w(function (_context) {
|
|
6905
6926
|
while (1) switch (_context.n) {
|
|
6906
6927
|
case 0:
|
|
6907
|
-
hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
|
|
6908
|
-
|
|
6928
|
+
hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange, isDestination = params.isDestination;
|
|
6929
|
+
resolvedHopAsset = resolveHopAsset({
|
|
6909
6930
|
api: api,
|
|
6910
6931
|
tx: tx,
|
|
6911
6932
|
originChain: origin,
|
|
@@ -6916,6 +6937,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
6916
6937
|
swapConfig: swapConfig,
|
|
6917
6938
|
hasPassedExchange: hasPassedExchange
|
|
6918
6939
|
});
|
|
6940
|
+
hopAsset = isDestination ? (_inferFeeAsset = inferFeeAsset(origin, destination, asset)) !== null && _inferFeeAsset !== void 0 ? _inferFeeAsset : resolvedHopAsset : resolvedHopAsset;
|
|
6919
6941
|
if (hasDryRunSupport(currentChain)) {
|
|
6920
6942
|
_context.n = 1;
|
|
6921
6943
|
break;
|
|
@@ -6928,7 +6950,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
6928
6950
|
case 1:
|
|
6929
6951
|
_context.n = 2;
|
|
6930
6952
|
return hopApi.getDryRunXcm({
|
|
6931
|
-
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, currentChain), resolvedVersion),
|
|
6953
|
+
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, currentChain, resolvedVersion), resolvedVersion),
|
|
6932
6954
|
tx: tx,
|
|
6933
6955
|
xcm: forwardedXcms[1][0],
|
|
6934
6956
|
chain: currentChain,
|
|
@@ -7329,7 +7351,7 @@ var getBypassResultWithRetries = /*#__PURE__*/function () {
|
|
|
7329
7351
|
return 'failureReason' in res ? res.failureReason : 'dryRunError' in res ? res.dryRunError : undefined;
|
|
7330
7352
|
};
|
|
7331
7353
|
isFailedToTransact = function isFailedToTransact(res) {
|
|
7332
|
-
return 'failureReason' in res && res.failureReason === FAILED_TO_TRANSACT_ASSET;
|
|
7354
|
+
return 'failureReason' in res && res.failureReason === FAILED_TO_TRANSACT_ASSET || 'failureSubReason' in res && res.failureSubReason === FAILED_TO_TRANSACT_ASSET;
|
|
7333
7355
|
};
|
|
7334
7356
|
isAmountTooLow = function isAmountTooLow(e) {
|
|
7335
7357
|
return e instanceof AmountTooLowError;
|
|
@@ -7695,7 +7717,7 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
7695
7717
|
};
|
|
7696
7718
|
var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
7697
7719
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
7698
|
-
var api, tx, origin, destination, sender, recipient, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation, asset, amount, resolvedVersion, _yield$getOriginXcmFe, originFeeRaw, originAsset, originFeeType, originDryRunError, originDryRunSubError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destAsset, destFeeType, destDryRunError, destDryRunSubError, destSufficient, destResult, _destApi, destFallback, bridgeHubChain, assetHubChain, bridgeHubHop, processedBridgeHub, _bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, _t, _t2, _t3, _t4;
|
|
7720
|
+
var api, tx, origin, destination, sender, recipient, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation, asset, amount, resolvedVersion, _yield$getOriginXcmFe, originFeeRaw, originAsset, originFeeType, originDryRunError, originDryRunSubError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, _failureSubReason, processHop, traversalResult, destFee, destAsset, destFeeType, destDryRunError, destDryRunSubError, destSufficient, destResult, _inferFeeAsset2, _destApi, destFallback, bridgeHubChain, assetHubChain, bridgeHubHop, processedBridgeHub, _bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, failureSubReason, _t, _t2, _t3, _t4;
|
|
7699
7721
|
return _regenerator().w(function (_context2) {
|
|
7700
7722
|
while (1) switch (_context2.p = _context2.n) {
|
|
7701
7723
|
case 0:
|
|
@@ -7806,10 +7828,11 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
7806
7828
|
_getFailureInfo = getFailureInfo({
|
|
7807
7829
|
origin: _result.origin,
|
|
7808
7830
|
destination: _result.destination
|
|
7809
|
-
}, []), _failureChain = _getFailureInfo.failureChain, _failureReason = _getFailureInfo.failureReason;
|
|
7831
|
+
}, []), _failureChain = _getFailureInfo.failureChain, _failureReason = _getFailureInfo.failureReason, _failureSubReason = _getFailureInfo.failureSubReason;
|
|
7810
7832
|
return _context2.a(2, _objectSpread2(_objectSpread2({}, _result), {}, {
|
|
7811
7833
|
failureChain: _failureChain,
|
|
7812
|
-
failureReason: _failureReason
|
|
7834
|
+
failureReason: _failureReason,
|
|
7835
|
+
failureSubReason: _failureSubReason
|
|
7813
7836
|
}));
|
|
7814
7837
|
case 8:
|
|
7815
7838
|
_context2.p = 8;
|
|
@@ -7821,12 +7844,13 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
7821
7844
|
case 10:
|
|
7822
7845
|
processHop = /*#__PURE__*/function () {
|
|
7823
7846
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
|
|
7824
|
-
var
|
|
7847
|
+
var _inferFeeAsset;
|
|
7848
|
+
var hopApi, currentChain, currentOrigin, currentAsset, forwardedXcms, hasPassedExchange, isDestination, resolvedHopAsset, hopAsset, hopResult;
|
|
7825
7849
|
return _regenerator().w(function (_context) {
|
|
7826
7850
|
while (1) switch (_context.n) {
|
|
7827
7851
|
case 0:
|
|
7828
|
-
hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
|
|
7829
|
-
|
|
7852
|
+
hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange, isDestination = params.isDestination;
|
|
7853
|
+
resolvedHopAsset = resolveHopAsset({
|
|
7830
7854
|
api: api,
|
|
7831
7855
|
tx: tx,
|
|
7832
7856
|
originChain: origin,
|
|
@@ -7837,6 +7861,7 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
7837
7861
|
swapConfig: swapConfig,
|
|
7838
7862
|
hasPassedExchange: hasPassedExchange
|
|
7839
7863
|
});
|
|
7864
|
+
hopAsset = isDestination ? (_inferFeeAsset = inferFeeAsset(origin, destination, asset)) !== null && _inferFeeAsset !== void 0 ? _inferFeeAsset : resolvedHopAsset : resolvedHopAsset;
|
|
7840
7865
|
_context.n = 1;
|
|
7841
7866
|
return getDestXcmFee({
|
|
7842
7867
|
api: hopApi,
|
|
@@ -7926,7 +7951,7 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
7926
7951
|
}),
|
|
7927
7952
|
sender: sender,
|
|
7928
7953
|
recipient: recipient,
|
|
7929
|
-
asset: asset,
|
|
7954
|
+
asset: (_inferFeeAsset2 = inferFeeAsset(origin, destination, asset)) !== null && _inferFeeAsset2 !== void 0 ? _inferFeeAsset2 : asset,
|
|
7930
7955
|
version: resolvedVersion,
|
|
7931
7956
|
tx: tx,
|
|
7932
7957
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
@@ -8022,10 +8047,11 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
8022
8047
|
_getFailureInfo2 = getFailureInfo({
|
|
8023
8048
|
origin: result.origin,
|
|
8024
8049
|
destination: result.destination
|
|
8025
|
-
}, result.hops), failureChain = _getFailureInfo2.failureChain, failureReason = _getFailureInfo2.failureReason;
|
|
8050
|
+
}, result.hops), failureChain = _getFailureInfo2.failureChain, failureReason = _getFailureInfo2.failureReason, failureSubReason = _getFailureInfo2.failureSubReason;
|
|
8026
8051
|
return _context2.a(2, _objectSpread2(_objectSpread2({}, result), {}, {
|
|
8027
8052
|
failureChain: failureChain,
|
|
8028
|
-
failureReason: failureReason
|
|
8053
|
+
failureReason: failureReason,
|
|
8054
|
+
failureSubReason: failureSubReason
|
|
8029
8055
|
}));
|
|
8030
8056
|
}
|
|
8031
8057
|
}, _callee2, null, [[5,, 8, 10]]);
|
|
@@ -8802,7 +8828,7 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(context, isDotAsset, cu
|
|
|
8802
8828
|
var feeAsset = Array.isArray(overriddenAsset) ? overriddenAsset.find(function (a) {
|
|
8803
8829
|
return a.isFeeAsset;
|
|
8804
8830
|
}) : null;
|
|
8805
|
-
var feeMultiAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : createAsset(version, assetInfo.amount, localizeLocation(origin.chain, feeAssetLocation));
|
|
8831
|
+
var feeMultiAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : createAsset(version, assetInfo.amount, normalizeLocation(localizeLocation(origin.chain, feeAssetLocation), version));
|
|
8806
8832
|
var module = pallet !== null && pallet !== void 0 ? pallet : getXcmPallet(origin.chain);
|
|
8807
8833
|
var methodName = method !== null && method !== void 0 ? method : 'transfer_assets_using_type_and_then';
|
|
8808
8834
|
return {
|
|
@@ -8994,7 +9020,7 @@ var createCustomXcm = /*#__PURE__*/function () {
|
|
|
8994
9020
|
};
|
|
8995
9021
|
assetsFilter = [];
|
|
8996
9022
|
if (!isRelayAsset) assetsFilter.push(createAsset(version, hopFees + destFee, localizeLocation(reserve.chain, RELAY_LOCATION)));
|
|
8997
|
-
assetsFilter.push(createAsset(version, assetInfo.amount, localizeLocation(reserve.chain, assetInfo.location)));
|
|
9023
|
+
assetsFilter.push(createAsset(version, assetInfo.amount, normalizeLocation(localizeLocation(reserve.chain, assetInfo.location), version)));
|
|
8998
9024
|
if (!(isSubBridge || origin.chain !== reserve.chain && dest.chain !== reserve.chain)) {
|
|
8999
9025
|
_context.n = 4;
|
|
9000
9026
|
break;
|
|
@@ -9099,9 +9125,15 @@ var buildAssets = function buildAssets(chain, asset, feeAmount, isRelayAsset, _r
|
|
|
9099
9125
|
if (!isRelayAsset) {
|
|
9100
9126
|
assets.push(createAsset(version, feeAmount, RELAY_LOCATION));
|
|
9101
9127
|
}
|
|
9102
|
-
assets.push(createAsset(version, asset.amount, localizeLocation(chain, asset.location)));
|
|
9128
|
+
assets.push(createAsset(version, asset.amount, normalizeLocation(localizeLocation(chain, asset.location), version)));
|
|
9103
9129
|
return sortAssets(assets);
|
|
9104
9130
|
};
|
|
9131
|
+
var resolveAssetCount = function resolveAssetCount(overriddenAsset, isRelayAsset) {
|
|
9132
|
+
if (overriddenAsset) {
|
|
9133
|
+
return Array.isArray(overriddenAsset) ? overriddenAsset.length : 1;
|
|
9134
|
+
}
|
|
9135
|
+
return isRelayAsset ? 1 : 2;
|
|
9136
|
+
};
|
|
9105
9137
|
var DEFAULT_SYSTEM_ASSET_AMOUNT = '1';
|
|
9106
9138
|
var resolveSystemAssetAmount = function resolveSystemAssetAmount(_ref2, isForFeeCalc, fees) {
|
|
9107
9139
|
var systemAsset = _ref2.systemAsset;
|
|
@@ -9120,6 +9152,7 @@ var constructTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
9120
9152
|
options,
|
|
9121
9153
|
sender,
|
|
9122
9154
|
version,
|
|
9155
|
+
overriddenAsset,
|
|
9123
9156
|
assetCount,
|
|
9124
9157
|
refundInstruction,
|
|
9125
9158
|
resolvedFees,
|
|
@@ -9133,8 +9166,8 @@ var constructTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
9133
9166
|
case 0:
|
|
9134
9167
|
fees = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
|
|
9135
9168
|
origin = context.origin, assetInfo = context.assetInfo, isSubBridge = context.isSubBridge, isRelayAsset = context.isRelayAsset, options = context.options;
|
|
9136
|
-
sender = options.sender, version = options.version;
|
|
9137
|
-
assetCount = isRelayAsset
|
|
9169
|
+
sender = options.sender, version = options.version, overriddenAsset = options.overriddenAsset;
|
|
9170
|
+
assetCount = resolveAssetCount(overriddenAsset, isRelayAsset);
|
|
9138
9171
|
refundInstruction = sender && !isSubBridge ? createRefundInstruction(origin.api, sender, version, assetCount) : null;
|
|
9139
9172
|
resolvedFees = fees !== null && fees !== void 0 ? fees : {
|
|
9140
9173
|
hopFees: 0n,
|
|
@@ -9797,7 +9830,7 @@ var applyDecimalAbstraction = function applyDecimalAbstraction(amount, decimals,
|
|
|
9797
9830
|
|
|
9798
9831
|
var createAssetsFilter = function createAssetsFilter(asset, version) {
|
|
9799
9832
|
var location = extractAssetLocation(asset);
|
|
9800
|
-
var id =
|
|
9833
|
+
var id = createAssetId(version, location);
|
|
9801
9834
|
return {
|
|
9802
9835
|
Wild: {
|
|
9803
9836
|
AllOf: {
|
|
@@ -12152,7 +12185,7 @@ var Hydration = /*#__PURE__*/function (_Chain) {
|
|
|
12152
12185
|
key: "transferPolkadotXCM",
|
|
12153
12186
|
value: function () {
|
|
12154
12187
|
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
12155
|
-
var destination, asset, feeAsset, overriddenAsset, api, isNativeAsset, isNativeFeeAsset,
|
|
12188
|
+
var destination, asset, feeAsset, overriddenAsset, api, isNativeAsset, isNativeFeeAsset, _t;
|
|
12156
12189
|
return _regenerator().w(function (_context) {
|
|
12157
12190
|
while (1) switch (_context.n) {
|
|
12158
12191
|
case 0:
|
|
@@ -12185,8 +12218,7 @@ var Hydration = /*#__PURE__*/function (_Chain) {
|
|
|
12185
12218
|
case 3:
|
|
12186
12219
|
return _context.a(2, _t.deserializeExtrinsics.call(_t, _context.v));
|
|
12187
12220
|
case 4:
|
|
12188
|
-
|
|
12189
|
-
if (!(isMoonbeamWhAsset && destination === 'Moonbeam')) {
|
|
12221
|
+
if (!(isMoonbeamWhAsset(asset.location) && destination === 'Moonbeam')) {
|
|
12190
12222
|
_context.n = 5;
|
|
12191
12223
|
break;
|
|
12192
12224
|
}
|
|
@@ -12208,8 +12240,8 @@ var Hydration = /*#__PURE__*/function (_Chain) {
|
|
|
12208
12240
|
version = input.version;
|
|
12209
12241
|
var glmr = findAssetInfoOrThrow(this.chain, {
|
|
12210
12242
|
symbol: getNativeAssetSymbol('Moonbeam')
|
|
12211
|
-
}
|
|
12212
|
-
var FEE_AMOUNT =
|
|
12243
|
+
});
|
|
12244
|
+
var FEE_AMOUNT = 150000000000000000n; // 0.15 GLMR
|
|
12213
12245
|
return transferPolkadotXcm(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
12214
12246
|
overriddenAsset: [_objectSpread2(_objectSpread2({}, createAsset(version, FEE_AMOUNT, glmr.location)), {}, {
|
|
12215
12247
|
isFeeAsset: true
|
|
@@ -12970,7 +13002,7 @@ var Interlay = /*#__PURE__*/function (_Chain) {
|
|
|
12970
13002
|
params: {
|
|
12971
13003
|
dest: recipient,
|
|
12972
13004
|
currency_id: currencyId,
|
|
12973
|
-
|
|
13005
|
+
amount: asset.amount
|
|
12974
13006
|
}
|
|
12975
13007
|
});
|
|
12976
13008
|
}
|
|
@@ -13087,7 +13119,7 @@ var Kintsugi = /*#__PURE__*/function (_Chain) {
|
|
|
13087
13119
|
params: {
|
|
13088
13120
|
dest: recipient,
|
|
13089
13121
|
currency_id: currencyId,
|
|
13090
|
-
|
|
13122
|
+
amount: asset.amount
|
|
13091
13123
|
}
|
|
13092
13124
|
});
|
|
13093
13125
|
}
|
|
@@ -13572,6 +13604,25 @@ var Pendulum = /*#__PURE__*/function (_Chain) {
|
|
|
13572
13604
|
useMultiAssetTransfer: asset.symbol === 'DOT'
|
|
13573
13605
|
}), currencySelection);
|
|
13574
13606
|
}
|
|
13607
|
+
}, {
|
|
13608
|
+
key: "transferLocalNonNativeAsset",
|
|
13609
|
+
value: function transferLocalNonNativeAsset(options) {
|
|
13610
|
+
var api = options.api,
|
|
13611
|
+
asset = options.assetInfo,
|
|
13612
|
+
recipient = options.recipient;
|
|
13613
|
+
var amount = getLocalTransferAmount(options);
|
|
13614
|
+
return api.deserializeExtrinsics({
|
|
13615
|
+
module: 'Currencies',
|
|
13616
|
+
method: 'transfer',
|
|
13617
|
+
params: {
|
|
13618
|
+
dest: {
|
|
13619
|
+
Id: recipient
|
|
13620
|
+
},
|
|
13621
|
+
currency_id: this.getCustomCurrencyId(asset),
|
|
13622
|
+
amount: amount
|
|
13623
|
+
}
|
|
13624
|
+
});
|
|
13625
|
+
}
|
|
13575
13626
|
}]);
|
|
13576
13627
|
}(Chain);
|
|
13577
13628
|
|
|
@@ -13747,7 +13798,7 @@ var Unique = /*#__PURE__*/function (_Chain) {
|
|
|
13747
13798
|
key: "getBalanceForeign",
|
|
13748
13799
|
value: function () {
|
|
13749
13800
|
var _getBalanceForeign = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset) {
|
|
13750
|
-
var _balance$value;
|
|
13801
|
+
var _ref, _balance$value;
|
|
13751
13802
|
var collectionId, balance;
|
|
13752
13803
|
return _regenerator().w(function (_context) {
|
|
13753
13804
|
while (1) switch (_context.n) {
|
|
@@ -13771,7 +13822,7 @@ var Unique = /*#__PURE__*/function (_Chain) {
|
|
|
13771
13822
|
});
|
|
13772
13823
|
case 2:
|
|
13773
13824
|
balance = _context.v;
|
|
13774
|
-
return _context.a(2, (_balance$value = balance === null || balance === void 0 ? void 0 : balance.value) !== null && _balance$value !== void 0 ? _balance$value : 0n);
|
|
13825
|
+
return _context.a(2, (_ref = (_balance$value = balance === null || balance === void 0 ? void 0 : balance.value) !== null && _balance$value !== void 0 ? _balance$value : (balance === null || balance === void 0 ? void 0 : balance.ok) != undefined ? BigInt(balance.ok) : undefined) !== null && _ref !== void 0 ? _ref : 0n);
|
|
13775
13826
|
}
|
|
13776
13827
|
}, _callee);
|
|
13777
13828
|
}));
|
|
@@ -14038,10 +14089,10 @@ var resolveChainApi = function resolveChainApi(config, chain, createApiInstance)
|
|
|
14038
14089
|
throw new MissingChainApiError(chain);
|
|
14039
14090
|
}
|
|
14040
14091
|
if (!apiConfig) {
|
|
14041
|
-
return createApiInstance(getChainProviders(chain)
|
|
14092
|
+
return createApiInstance(getChainProviders(chain));
|
|
14042
14093
|
}
|
|
14043
14094
|
if (typeof apiConfig === 'string' || apiConfig instanceof Array) {
|
|
14044
|
-
return createApiInstance(apiConfig
|
|
14095
|
+
return createApiInstance(apiConfig);
|
|
14045
14096
|
}
|
|
14046
14097
|
return Promise.resolve(apiConfig);
|
|
14047
14098
|
};
|
|
@@ -14214,4 +14265,4 @@ var createClientCache = function createClientCache(maxSize, pingClient, onEvicti
|
|
|
14214
14265
|
};
|
|
14215
14266
|
};
|
|
14216
14267
|
|
|
14217
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm,
|
|
14268
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo$1 as getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveAssetCount, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|