@paraspell/sdk-core 10.4.2 → 10.4.4
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/dist/index.cjs +398 -347
- package/dist/index.d.ts +12 -24
- package/dist/index.mjs +383 -331
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -2016,83 +2016,6 @@ var getParaId = function getParaId(node) {
|
|
|
2016
2016
|
return getNodeConfig(node).paraId;
|
|
2017
2017
|
};
|
|
2018
2018
|
|
|
2019
|
-
/**
|
|
2020
|
-
* The options for the batch builder.
|
|
2021
|
-
*/
|
|
2022
|
-
exports.BatchMode = void 0;
|
|
2023
|
-
(function (BatchMode) {
|
|
2024
|
-
/**
|
|
2025
|
-
* Does not commit if one of the calls in the batch fails.
|
|
2026
|
-
*/
|
|
2027
|
-
BatchMode["BATCH_ALL"] = "BATCH_ALL";
|
|
2028
|
-
/**
|
|
2029
|
-
* Commits each successful call regardless if a call fails.
|
|
2030
|
-
*/
|
|
2031
|
-
BatchMode["BATCH"] = "BATCH";
|
|
2032
|
-
})(exports.BatchMode || (exports.BatchMode = {}));
|
|
2033
|
-
|
|
2034
|
-
exports.XTokensError = void 0;
|
|
2035
|
-
(function (XTokensError) {
|
|
2036
|
-
XTokensError["AssetHasNoReserve"] = "AssetHasNoReserve";
|
|
2037
|
-
XTokensError["NotCrossChainTransfer"] = "NotCrossChainTransfer";
|
|
2038
|
-
XTokensError["InvalidDest"] = "InvalidDest";
|
|
2039
|
-
XTokensError["NotCrossChainTransferableCurrency"] = "NotCrossChainTransferableCurrency";
|
|
2040
|
-
XTokensError["UnweighableMessage"] = "UnweighableMessage";
|
|
2041
|
-
XTokensError["XcmExecutionFailed"] = "XcmExecutionFailed";
|
|
2042
|
-
XTokensError["CannotReanchor"] = "CannotReanchor";
|
|
2043
|
-
XTokensError["InvalidAncestry"] = "InvalidAncestry";
|
|
2044
|
-
XTokensError["InvalidAsset"] = "InvalidAsset";
|
|
2045
|
-
XTokensError["DestinationNotInvertible"] = "DestinationNotInvertible";
|
|
2046
|
-
XTokensError["BadVersion"] = "BadVersion";
|
|
2047
|
-
XTokensError["DistinctReserveForAssetAndFee"] = "DistinctReserveForAssetAndFee";
|
|
2048
|
-
XTokensError["ZeroFee"] = "ZeroFee";
|
|
2049
|
-
XTokensError["ZeroAmount"] = "ZeroAmount";
|
|
2050
|
-
XTokensError["TooManyAssetsBeingSent"] = "TooManyAssetsBeingSent";
|
|
2051
|
-
XTokensError["AssetIndexNonExistent"] = "AssetIndexNonExistent";
|
|
2052
|
-
XTokensError["FeeNotEnough"] = "FeeNotEnough";
|
|
2053
|
-
XTokensError["NotSupportedLocation"] = "NotSupportedLocation";
|
|
2054
|
-
XTokensError["MinXcmFeeNotDefined"] = "MinXcmFeeNotDefined";
|
|
2055
|
-
XTokensError["RateLimited"] = "RateLimited";
|
|
2056
|
-
})(exports.XTokensError || (exports.XTokensError = {}));
|
|
2057
|
-
exports.PolkadotXcmError = void 0;
|
|
2058
|
-
(function (PolkadotXcmError) {
|
|
2059
|
-
PolkadotXcmError["Unreachable"] = "Unreachable";
|
|
2060
|
-
PolkadotXcmError["SendFailure"] = "SendFailure";
|
|
2061
|
-
PolkadotXcmError["Filtered"] = "Filtered";
|
|
2062
|
-
PolkadotXcmError["UnweighableMessage"] = "UnweighableMessage";
|
|
2063
|
-
PolkadotXcmError["DestinationNotInvertible"] = "DestinationNotInvertible";
|
|
2064
|
-
PolkadotXcmError["Empty"] = "Empty";
|
|
2065
|
-
PolkadotXcmError["CannotReanchor"] = "CannotReanchor";
|
|
2066
|
-
PolkadotXcmError["TooManyAssets"] = "TooManyAssets";
|
|
2067
|
-
PolkadotXcmError["InvalidOrigin"] = "InvalidOrigin";
|
|
2068
|
-
PolkadotXcmError["BadVersion"] = "BadVersion";
|
|
2069
|
-
PolkadotXcmError["BadLocation"] = "BadLocation";
|
|
2070
|
-
PolkadotXcmError["NoSubscription"] = "NoSubscription";
|
|
2071
|
-
PolkadotXcmError["AlreadySubscribed"] = "AlreadySubscribed";
|
|
2072
|
-
PolkadotXcmError["CannotCheckOutTeleport"] = "CannotCheckOutTeleport";
|
|
2073
|
-
PolkadotXcmError["LowBalance"] = "LowBalance";
|
|
2074
|
-
PolkadotXcmError["TooManyLocks"] = "TooManyLocks";
|
|
2075
|
-
PolkadotXcmError["AccountNotSovereign"] = "AccountNotSovereign";
|
|
2076
|
-
PolkadotXcmError["FeesNotMet"] = "FeesNotMet";
|
|
2077
|
-
PolkadotXcmError["LockNotFound"] = "LockNotFound";
|
|
2078
|
-
PolkadotXcmError["InUse"] = "InUse";
|
|
2079
|
-
PolkadotXcmError["REMOVED"] = "REMOVED";
|
|
2080
|
-
PolkadotXcmError["InvalidAssetUnknownReserve"] = "InvalidAssetUnknownReserve";
|
|
2081
|
-
PolkadotXcmError["InvalidAssetUnsupportedReserve"] = "InvalidAssetUnsupportedReserve";
|
|
2082
|
-
PolkadotXcmError["TooManyReserves"] = "TooManyReserves";
|
|
2083
|
-
PolkadotXcmError["LocalExecutionIncomplete"] = "LocalExecutionIncomplete";
|
|
2084
|
-
})(exports.PolkadotXcmError || (exports.PolkadotXcmError = {}));
|
|
2085
|
-
|
|
2086
|
-
/**
|
|
2087
|
-
* The XCM version.
|
|
2088
|
-
*/
|
|
2089
|
-
exports.Version = void 0;
|
|
2090
|
-
(function (Version) {
|
|
2091
|
-
Version["V3"] = "V3";
|
|
2092
|
-
Version["V4"] = "V4";
|
|
2093
|
-
Version["V5"] = "V5";
|
|
2094
|
-
})(exports.Version || (exports.Version = {}));
|
|
2095
|
-
|
|
2096
2019
|
var createApiInstanceForNode = /*#__PURE__*/function () {
|
|
2097
2020
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, node) {
|
|
2098
2021
|
var wsUrl;
|
|
@@ -2110,10 +2033,10 @@ var createApiInstanceForNode = /*#__PURE__*/function () {
|
|
|
2110
2033
|
}();
|
|
2111
2034
|
|
|
2112
2035
|
var createX1Payload = function createX1Payload(version, junction) {
|
|
2113
|
-
return version ===
|
|
2114
|
-
X1: [junction]
|
|
2115
|
-
} : {
|
|
2036
|
+
return version === sdkCommon.Version.V3 ? {
|
|
2116
2037
|
X1: junction
|
|
2038
|
+
} : {
|
|
2039
|
+
X1: [junction]
|
|
2117
2040
|
};
|
|
2118
2041
|
};
|
|
2119
2042
|
|
|
@@ -2369,6 +2292,73 @@ var computeFeeFromDryRunPjs = function computeFeeFromDryRunPjs(dryRun, node, exe
|
|
|
2369
2292
|
return totalDeliveryFees + executionFee;
|
|
2370
2293
|
};
|
|
2371
2294
|
|
|
2295
|
+
/**
|
|
2296
|
+
* The options for the batch builder.
|
|
2297
|
+
*/
|
|
2298
|
+
exports.BatchMode = void 0;
|
|
2299
|
+
(function (BatchMode) {
|
|
2300
|
+
/**
|
|
2301
|
+
* Does not commit if one of the calls in the batch fails.
|
|
2302
|
+
*/
|
|
2303
|
+
BatchMode["BATCH_ALL"] = "BATCH_ALL";
|
|
2304
|
+
/**
|
|
2305
|
+
* Commits each successful call regardless if a call fails.
|
|
2306
|
+
*/
|
|
2307
|
+
BatchMode["BATCH"] = "BATCH";
|
|
2308
|
+
})(exports.BatchMode || (exports.BatchMode = {}));
|
|
2309
|
+
|
|
2310
|
+
exports.XTokensError = void 0;
|
|
2311
|
+
(function (XTokensError) {
|
|
2312
|
+
XTokensError["AssetHasNoReserve"] = "AssetHasNoReserve";
|
|
2313
|
+
XTokensError["NotCrossChainTransfer"] = "NotCrossChainTransfer";
|
|
2314
|
+
XTokensError["InvalidDest"] = "InvalidDest";
|
|
2315
|
+
XTokensError["NotCrossChainTransferableCurrency"] = "NotCrossChainTransferableCurrency";
|
|
2316
|
+
XTokensError["UnweighableMessage"] = "UnweighableMessage";
|
|
2317
|
+
XTokensError["XcmExecutionFailed"] = "XcmExecutionFailed";
|
|
2318
|
+
XTokensError["CannotReanchor"] = "CannotReanchor";
|
|
2319
|
+
XTokensError["InvalidAncestry"] = "InvalidAncestry";
|
|
2320
|
+
XTokensError["InvalidAsset"] = "InvalidAsset";
|
|
2321
|
+
XTokensError["DestinationNotInvertible"] = "DestinationNotInvertible";
|
|
2322
|
+
XTokensError["BadVersion"] = "BadVersion";
|
|
2323
|
+
XTokensError["DistinctReserveForAssetAndFee"] = "DistinctReserveForAssetAndFee";
|
|
2324
|
+
XTokensError["ZeroFee"] = "ZeroFee";
|
|
2325
|
+
XTokensError["ZeroAmount"] = "ZeroAmount";
|
|
2326
|
+
XTokensError["TooManyAssetsBeingSent"] = "TooManyAssetsBeingSent";
|
|
2327
|
+
XTokensError["AssetIndexNonExistent"] = "AssetIndexNonExistent";
|
|
2328
|
+
XTokensError["FeeNotEnough"] = "FeeNotEnough";
|
|
2329
|
+
XTokensError["NotSupportedLocation"] = "NotSupportedLocation";
|
|
2330
|
+
XTokensError["MinXcmFeeNotDefined"] = "MinXcmFeeNotDefined";
|
|
2331
|
+
XTokensError["RateLimited"] = "RateLimited";
|
|
2332
|
+
})(exports.XTokensError || (exports.XTokensError = {}));
|
|
2333
|
+
exports.PolkadotXcmError = void 0;
|
|
2334
|
+
(function (PolkadotXcmError) {
|
|
2335
|
+
PolkadotXcmError["Unreachable"] = "Unreachable";
|
|
2336
|
+
PolkadotXcmError["SendFailure"] = "SendFailure";
|
|
2337
|
+
PolkadotXcmError["Filtered"] = "Filtered";
|
|
2338
|
+
PolkadotXcmError["UnweighableMessage"] = "UnweighableMessage";
|
|
2339
|
+
PolkadotXcmError["DestinationNotInvertible"] = "DestinationNotInvertible";
|
|
2340
|
+
PolkadotXcmError["Empty"] = "Empty";
|
|
2341
|
+
PolkadotXcmError["CannotReanchor"] = "CannotReanchor";
|
|
2342
|
+
PolkadotXcmError["TooManyAssets"] = "TooManyAssets";
|
|
2343
|
+
PolkadotXcmError["InvalidOrigin"] = "InvalidOrigin";
|
|
2344
|
+
PolkadotXcmError["BadVersion"] = "BadVersion";
|
|
2345
|
+
PolkadotXcmError["BadLocation"] = "BadLocation";
|
|
2346
|
+
PolkadotXcmError["NoSubscription"] = "NoSubscription";
|
|
2347
|
+
PolkadotXcmError["AlreadySubscribed"] = "AlreadySubscribed";
|
|
2348
|
+
PolkadotXcmError["CannotCheckOutTeleport"] = "CannotCheckOutTeleport";
|
|
2349
|
+
PolkadotXcmError["LowBalance"] = "LowBalance";
|
|
2350
|
+
PolkadotXcmError["TooManyLocks"] = "TooManyLocks";
|
|
2351
|
+
PolkadotXcmError["AccountNotSovereign"] = "AccountNotSovereign";
|
|
2352
|
+
PolkadotXcmError["FeesNotMet"] = "FeesNotMet";
|
|
2353
|
+
PolkadotXcmError["LockNotFound"] = "LockNotFound";
|
|
2354
|
+
PolkadotXcmError["InUse"] = "InUse";
|
|
2355
|
+
PolkadotXcmError["REMOVED"] = "REMOVED";
|
|
2356
|
+
PolkadotXcmError["InvalidAssetUnknownReserve"] = "InvalidAssetUnknownReserve";
|
|
2357
|
+
PolkadotXcmError["InvalidAssetUnsupportedReserve"] = "InvalidAssetUnsupportedReserve";
|
|
2358
|
+
PolkadotXcmError["TooManyReserves"] = "TooManyReserves";
|
|
2359
|
+
PolkadotXcmError["LocalExecutionIncomplete"] = "LocalExecutionIncomplete";
|
|
2360
|
+
})(exports.PolkadotXcmError || (exports.PolkadotXcmError = {}));
|
|
2361
|
+
|
|
2372
2362
|
var resolveModuleError = function resolveModuleError(node, error) {
|
|
2373
2363
|
var palletDetails = pallets.getSupportedPalletsDetails(node).find(function (p) {
|
|
2374
2364
|
return p.index === Number(error.index);
|
|
@@ -2389,29 +2379,6 @@ var resolveModuleError = function resolveModuleError(node, error) {
|
|
|
2389
2379
|
return failureReason;
|
|
2390
2380
|
};
|
|
2391
2381
|
|
|
2392
|
-
var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api, address) {
|
|
2393
|
-
var isMultiLocation = _typeof(address) === 'object';
|
|
2394
|
-
if (isMultiLocation) {
|
|
2395
|
-
return _defineProperty({}, exports.Version.V4, address);
|
|
2396
|
-
}
|
|
2397
|
-
var isEthAddress = viem.isAddress(address);
|
|
2398
|
-
return addXcmVersionHeader({
|
|
2399
|
-
parents: sdkCommon.Parents.ZERO,
|
|
2400
|
-
interior: {
|
|
2401
|
-
X1: [isEthAddress ? {
|
|
2402
|
-
AccountKey20: {
|
|
2403
|
-
key: address
|
|
2404
|
-
}
|
|
2405
|
-
} : {
|
|
2406
|
-
AccountId32: {
|
|
2407
|
-
id: api.accountToHex(address),
|
|
2408
|
-
network: null
|
|
2409
|
-
}
|
|
2410
|
-
}]
|
|
2411
|
-
}
|
|
2412
|
-
}, exports.Version.V4);
|
|
2413
|
-
};
|
|
2414
|
-
|
|
2415
2382
|
var getFees = function getFees(scenario) {
|
|
2416
2383
|
if (scenario === 'ParaToRelay') {
|
|
2417
2384
|
return 4600000000;
|
|
@@ -2531,7 +2498,7 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
2531
2498
|
};
|
|
2532
2499
|
|
|
2533
2500
|
var createMultiAsset = function createMultiAsset(version, amount, multiLocation) {
|
|
2534
|
-
if (version ===
|
|
2501
|
+
if (version === sdkCommon.Version.V4 || version === sdkCommon.Version.V5) {
|
|
2535
2502
|
return {
|
|
2536
2503
|
id: multiLocation,
|
|
2537
2504
|
fun: {
|
|
@@ -3468,13 +3435,14 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
|
|
|
3468
3435
|
};
|
|
3469
3436
|
}();
|
|
3470
3437
|
|
|
3471
|
-
var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin,
|
|
3438
|
+
var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, messageId) {
|
|
3472
3439
|
var api = _ref.api,
|
|
3473
3440
|
address = _ref.address,
|
|
3474
3441
|
asset = _ref.asset,
|
|
3475
3442
|
scenario = _ref.scenario,
|
|
3476
3443
|
senderAddress = _ref.senderAddress,
|
|
3477
|
-
ahAddress = _ref.ahAddress
|
|
3444
|
+
ahAddress = _ref.ahAddress,
|
|
3445
|
+
version = _ref.version;
|
|
3478
3446
|
if (!assets.isForeignAsset(asset)) {
|
|
3479
3447
|
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
|
|
3480
3448
|
}
|
|
@@ -3781,7 +3749,9 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
|
|
|
3781
3749
|
ahAddress: ahAddress,
|
|
3782
3750
|
asset: _objectSpread2(_objectSpread2({}, foundAsset), {}, {
|
|
3783
3751
|
amount: currency.amount
|
|
3784
|
-
})
|
|
3752
|
+
}),
|
|
3753
|
+
version: sdkCommon.Version.V4
|
|
3754
|
+
}, from, messageId);
|
|
3785
3755
|
_context.n = 12;
|
|
3786
3756
|
return api.objectToHex(customXcm, 'XcmVersionedXcm');
|
|
3787
3757
|
case 12:
|
|
@@ -4767,7 +4737,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4767
4737
|
case 3:
|
|
4768
4738
|
_context2.n = 4;
|
|
4769
4739
|
return api.getDryRunXcm({
|
|
4770
|
-
originLocation: addXcmVersionHeader(createOriginLocation(hopNode, destination),
|
|
4740
|
+
originLocation: addXcmVersionHeader(createOriginLocation(hopNode, destination), sdkCommon.Version.V4),
|
|
4771
4741
|
xcm: forwardedXcms[1][0],
|
|
4772
4742
|
node: destination,
|
|
4773
4743
|
origin: origin,
|
|
@@ -4902,7 +4872,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
4902
4872
|
case 7:
|
|
4903
4873
|
_context.n = 8;
|
|
4904
4874
|
return hopApi.getDryRunXcm({
|
|
4905
|
-
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, nextChain),
|
|
4875
|
+
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, nextChain), sdkCommon.Version.V4),
|
|
4906
4876
|
xcm: forwardedXcms[1][0],
|
|
4907
4877
|
node: nextChain,
|
|
4908
4878
|
origin: currentOrigin,
|
|
@@ -5630,7 +5600,7 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
|
|
|
5630
5600
|
destination = _ref.to,
|
|
5631
5601
|
currency = _ref.currency;
|
|
5632
5602
|
var isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
|
|
5633
|
-
var allowedChainsToAh = ['BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec'];
|
|
5603
|
+
var allowedChainsToAh = ['AssetHubPolkadot', 'BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec'];
|
|
5634
5604
|
if (!sdkCommon.isRelayChain(origin) && !isBridge && isDestAssetHub && !allowedChainsToAh.includes(origin) && (asset === null || asset === void 0 ? void 0 : asset.symbol) === 'DOT') {
|
|
5635
5605
|
throw new TransferToAhNotSupported("Node ".concat(origin, " does not support DOT transfer to AssetHub"));
|
|
5636
5606
|
}
|
|
@@ -5709,6 +5679,17 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
|
|
|
5709
5679
|
return undefined;
|
|
5710
5680
|
};
|
|
5711
5681
|
|
|
5682
|
+
var selectXcmVersion = function selectXcmVersion(forcedVersion, originVersion, destMaxVersion) {
|
|
5683
|
+
if (forcedVersion) {
|
|
5684
|
+
return forcedVersion;
|
|
5685
|
+
}
|
|
5686
|
+
var destVersion = destMaxVersion !== null && destMaxVersion !== void 0 ? destMaxVersion : originVersion;
|
|
5687
|
+
if (originVersion === sdkCommon.Version.V4 && destVersion === sdkCommon.Version.V3) {
|
|
5688
|
+
return sdkCommon.Version.V3;
|
|
5689
|
+
}
|
|
5690
|
+
return originVersion;
|
|
5691
|
+
};
|
|
5692
|
+
|
|
5712
5693
|
var shouldPerformAssetCheck = function shouldPerformAssetCheck(origin, currency) {
|
|
5713
5694
|
if (sdkCommon.isRelayChain(origin)) return true;
|
|
5714
5695
|
var hasMultiAsset = 'multiasset' in currency;
|
|
@@ -5767,7 +5748,7 @@ var validateAssetSpecifiers = function validateAssetSpecifiers(assetCheckEnabled
|
|
|
5767
5748
|
|
|
5768
5749
|
var send = /*#__PURE__*/function () {
|
|
5769
5750
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
|
|
5770
|
-
var api, origin, currency, feeAsset, address, destination, paraIdTo, version, senderAddress, ahAddress, pallet, method, isBridge, assetCheckEnabled, asset, resolvedFeeAsset, isLocalTransfer, overriddenAsset, resolvedAsset,
|
|
5751
|
+
var api, origin, currency, feeAsset, address, destination, paraIdTo, version, senderAddress, ahAddress, pallet, method, isBridge, assetCheckEnabled, asset, resolvedFeeAsset, originVersion, destVersion, resolvedVersion, isLocalTransfer, overriddenAsset, resolvedAsset, finalAsset, finalVersion, normalizedAsset;
|
|
5771
5752
|
return _regenerator().w(function (_context) {
|
|
5772
5753
|
while (1) switch (_context.n) {
|
|
5773
5754
|
case 0:
|
|
@@ -5782,6 +5763,9 @@ var send = /*#__PURE__*/function () {
|
|
|
5782
5763
|
asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
|
|
5783
5764
|
resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
5784
5765
|
validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
|
|
5766
|
+
originVersion = sdkCommon.isRelayChain(origin) ? sdkCommon.Version.V4 : getNode(origin).version;
|
|
5767
|
+
destVersion = !sdkCommon.isTMultiLocation(destination) && !sdkCommon.isRelayChain(destination) && destination !== 'Ethereum' ? getNode(destination).version : undefined;
|
|
5768
|
+
resolvedVersion = selectXcmVersion(version, originVersion, destVersion);
|
|
5785
5769
|
if (!sdkCommon.isRelayChain(origin)) {
|
|
5786
5770
|
_context.n = 6;
|
|
5787
5771
|
break;
|
|
@@ -5832,7 +5816,7 @@ var send = /*#__PURE__*/function () {
|
|
|
5832
5816
|
amount: 'multiasset' in currency ? 0 : currency.amount
|
|
5833
5817
|
}),
|
|
5834
5818
|
paraIdTo: paraIdTo,
|
|
5835
|
-
version:
|
|
5819
|
+
version: resolvedVersion,
|
|
5836
5820
|
pallet: pallet,
|
|
5837
5821
|
method: method
|
|
5838
5822
|
}));
|
|
@@ -5845,7 +5829,6 @@ var send = /*#__PURE__*/function () {
|
|
|
5845
5829
|
resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
5846
5830
|
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
5847
5831
|
};
|
|
5848
|
-
originNode = getNode(origin);
|
|
5849
5832
|
finalAsset = 'multiasset' in currency ? _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
5850
5833
|
amount: 0,
|
|
5851
5834
|
assetId: '1'
|
|
@@ -5853,16 +5836,20 @@ var send = /*#__PURE__*/function () {
|
|
|
5853
5836
|
_objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
5854
5837
|
amount: BigInt(currency.amount) < 1n ? 1n : currency.amount
|
|
5855
5838
|
});
|
|
5856
|
-
|
|
5839
|
+
finalVersion = selectXcmVersion(version, originVersion, destVersion);
|
|
5840
|
+
normalizedAsset = finalAsset.multiLocation ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
|
|
5841
|
+
multilocation: assets.normalizeMultiLocation(finalAsset.multiLocation, finalVersion)
|
|
5842
|
+
}) : finalAsset;
|
|
5843
|
+
return _context.a(2, getNode(origin).transfer({
|
|
5857
5844
|
api: api,
|
|
5858
|
-
asset:
|
|
5845
|
+
asset: normalizedAsset,
|
|
5859
5846
|
currency: currency,
|
|
5860
5847
|
feeAsset: resolvedFeeAsset,
|
|
5861
5848
|
address: address,
|
|
5862
5849
|
to: destination,
|
|
5863
5850
|
paraIdTo: paraIdTo,
|
|
5864
5851
|
overriddenAsset: overriddenAsset,
|
|
5865
|
-
version:
|
|
5852
|
+
version: finalVersion,
|
|
5866
5853
|
senderAddress: senderAddress,
|
|
5867
5854
|
ahAddress: ahAddress,
|
|
5868
5855
|
pallet: pallet,
|
|
@@ -5924,7 +5911,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5924
5911
|
key: "transfer",
|
|
5925
5912
|
value: function () {
|
|
5926
5913
|
var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
|
|
5927
|
-
var api, asset, currency, feeAsset, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, isRelayDestination, scenario, paraId,
|
|
5914
|
+
var api, asset, currency, feeAsset, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, isRelayDestination, scenario, paraId, isLocalTransfer, isBifrostOrigin, isAssetHubDest, shouldUseMultiasset, input, _options, isEthAsset, isAHPOrigin, isAHPDest, isEthDest;
|
|
5928
5915
|
return _regenerator().w(function (_context) {
|
|
5929
5916
|
while (1) switch (_context.n) {
|
|
5930
5917
|
case 0:
|
|
@@ -5938,7 +5925,6 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5938
5925
|
}
|
|
5939
5926
|
throw new InvalidParameterError('Sending assets to Polimec is supported only from AssetHubPolkadot and Hydration');
|
|
5940
5927
|
case 1:
|
|
5941
|
-
versionOrDefault = version !== null && version !== void 0 ? version : this.version;
|
|
5942
5928
|
isLocalTransfer = this.node === destination;
|
|
5943
5929
|
if (!isLocalTransfer) {
|
|
5944
5930
|
_context.n = 2;
|
|
@@ -5961,14 +5947,14 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
5961
5947
|
scenario: scenario,
|
|
5962
5948
|
pallet: 'XTokens',
|
|
5963
5949
|
recipientAddress: address,
|
|
5964
|
-
version:
|
|
5950
|
+
version: version,
|
|
5965
5951
|
paraId: paraId
|
|
5966
5952
|
}),
|
|
5967
5953
|
fees: getFees(scenario),
|
|
5968
5954
|
origin: this.node,
|
|
5969
5955
|
scenario: scenario,
|
|
5970
5956
|
paraIdTo: paraId,
|
|
5971
|
-
version:
|
|
5957
|
+
version: version,
|
|
5972
5958
|
destination: destination,
|
|
5973
5959
|
overriddenAsset: overriddenAsset,
|
|
5974
5960
|
pallet: pallet,
|
|
@@ -6004,17 +5990,17 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6004
5990
|
}
|
|
6005
5991
|
_options = {
|
|
6006
5992
|
api: api,
|
|
6007
|
-
header: this.createVersionedDestination(scenario,
|
|
5993
|
+
header: this.createVersionedDestination(scenario, version, destination, paraId),
|
|
6008
5994
|
addressSelection: createVersionedBeneficiary({
|
|
6009
5995
|
api: api,
|
|
6010
5996
|
scenario: scenario,
|
|
6011
5997
|
pallet: 'PolkadotXcm',
|
|
6012
5998
|
recipientAddress: address,
|
|
6013
|
-
version:
|
|
5999
|
+
version: version,
|
|
6014
6000
|
paraId: paraId
|
|
6015
6001
|
}),
|
|
6016
6002
|
address: address,
|
|
6017
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario,
|
|
6003
|
+
currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== undefined),
|
|
6018
6004
|
overriddenAsset: overriddenAsset,
|
|
6019
6005
|
asset: asset,
|
|
6020
6006
|
currency: currency,
|
|
@@ -6068,8 +6054,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6068
6054
|
}, {
|
|
6069
6055
|
key: "transferRelayToPara",
|
|
6070
6056
|
value: function transferRelayToPara(options) {
|
|
6071
|
-
var
|
|
6072
|
-
version = _options$version === void 0 ? exports.Version.V3 : _options$version,
|
|
6057
|
+
var version = options.version,
|
|
6073
6058
|
pallet = options.pallet,
|
|
6074
6059
|
methodOverride = options.method;
|
|
6075
6060
|
var _this$getRelayToParaO = this.getRelayToParaOverrides(),
|
|
@@ -6165,11 +6150,11 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6165
6150
|
value: function () {
|
|
6166
6151
|
var _transferEthAssetViaAH = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
|
|
6167
6152
|
var _feeAsset$multiLocati;
|
|
6168
|
-
var api, asset, scenario,
|
|
6153
|
+
var api, asset, scenario, version, destination, address, senderAddress, feeAsset, paraIdTo, ethMultiAsset, PARA_TO_PARA_FEE_DOT, AH_EXECUTION_FEE_PADDED, dryRunResult, dryRunFeePadded, dest, call;
|
|
6169
6154
|
return _regenerator().w(function (_context2) {
|
|
6170
6155
|
while (1) switch (_context2.n) {
|
|
6171
6156
|
case 0:
|
|
6172
|
-
api = input.api, asset = input.asset, scenario = input.scenario,
|
|
6157
|
+
api = input.api, asset = input.asset, scenario = input.scenario, version = input.version, destination = input.destination, address = input.address, senderAddress = input.senderAddress, feeAsset = input.feeAsset, paraIdTo = input.paraIdTo;
|
|
6173
6158
|
if (asset.multiLocation) {
|
|
6174
6159
|
_context2.n = 1;
|
|
6175
6160
|
break;
|
|
@@ -6285,7 +6270,6 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6285
6270
|
api,
|
|
6286
6271
|
asset,
|
|
6287
6272
|
scenario,
|
|
6288
|
-
_input$version2,
|
|
6289
6273
|
version,
|
|
6290
6274
|
destination,
|
|
6291
6275
|
address,
|
|
@@ -6309,7 +6293,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6309
6293
|
while (1) switch (_context3.n) {
|
|
6310
6294
|
case 0:
|
|
6311
6295
|
useOnlyDepositInstruction = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
|
|
6312
|
-
api = input.api, asset = input.asset, scenario = input.scenario,
|
|
6296
|
+
api = input.api, asset = input.asset, scenario = input.scenario, version = input.version, destination = input.destination, address = input.address, senderAddress = input.senderAddress, feeAsset = input.feeAsset;
|
|
6313
6297
|
_context3.n = 1;
|
|
6314
6298
|
return getBridgeStatus(api.clone());
|
|
6315
6299
|
case 1:
|
|
@@ -6392,7 +6376,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6392
6376
|
return generateMessageId(api, senderAddress, getParaId(this.node), ethAsset.assetId, address, asset.amount);
|
|
6393
6377
|
case 11:
|
|
6394
6378
|
messageId = _context3.v;
|
|
6395
|
-
customXcmOnDest = createCustomXcmOnDest(input, this.node,
|
|
6379
|
+
customXcmOnDest = createCustomXcmOnDest(input, this.node, messageId);
|
|
6396
6380
|
case 12:
|
|
6397
6381
|
call = {
|
|
6398
6382
|
module: 'PolkadotXcm',
|
|
@@ -6422,7 +6406,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
6422
6406
|
var Acala = /*#__PURE__*/function (_ParachainNode) {
|
|
6423
6407
|
function Acala() {
|
|
6424
6408
|
_classCallCheck(this, Acala);
|
|
6425
|
-
return _callSuper(this, Acala, ['Acala', 'acala', 'polkadot',
|
|
6409
|
+
return _callSuper(this, Acala, ['Acala', 'acala', 'polkadot', sdkCommon.Version.V4]);
|
|
6426
6410
|
}
|
|
6427
6411
|
_inherits(Acala, _ParachainNode);
|
|
6428
6412
|
return _createClass(Acala, [{
|
|
@@ -6527,7 +6511,7 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
|
6527
6511
|
var Ajuna = /*#__PURE__*/function (_ParachainNode) {
|
|
6528
6512
|
function Ajuna() {
|
|
6529
6513
|
_classCallCheck(this, Ajuna);
|
|
6530
|
-
return _callSuper(this, Ajuna, ['Ajuna', 'ajuna', 'polkadot',
|
|
6514
|
+
return _callSuper(this, Ajuna, ['Ajuna', 'ajuna', 'polkadot', sdkCommon.Version.V4]);
|
|
6531
6515
|
}
|
|
6532
6516
|
_inherits(Ajuna, _ParachainNode);
|
|
6533
6517
|
return _createClass(Ajuna, [{
|
|
@@ -6590,7 +6574,7 @@ var Ajuna = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6590
6574
|
var Altair = /*#__PURE__*/function (_ParachainNode) {
|
|
6591
6575
|
function Altair() {
|
|
6592
6576
|
_classCallCheck(this, Altair);
|
|
6593
|
-
return _callSuper(this, Altair, ['Altair', 'altair', 'kusama',
|
|
6577
|
+
return _callSuper(this, Altair, ['Altair', 'altair', 'kusama', sdkCommon.Version.V4]);
|
|
6594
6578
|
}
|
|
6595
6579
|
_inherits(Altair, _ParachainNode);
|
|
6596
6580
|
return _createClass(Altair, [{
|
|
@@ -6641,7 +6625,7 @@ var Altair = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6641
6625
|
var Amplitude = /*#__PURE__*/function (_ParachainNode) {
|
|
6642
6626
|
function Amplitude() {
|
|
6643
6627
|
_classCallCheck(this, Amplitude);
|
|
6644
|
-
return _callSuper(this, Amplitude, ['Amplitude', 'amplitude', 'kusama',
|
|
6628
|
+
return _callSuper(this, Amplitude, ['Amplitude', 'amplitude', 'kusama', sdkCommon.Version.V3]);
|
|
6645
6629
|
}
|
|
6646
6630
|
_inherits(Amplitude, _ParachainNode);
|
|
6647
6631
|
return _createClass(Amplitude, [{
|
|
@@ -6662,7 +6646,7 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6662
6646
|
var AssetHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
6663
6647
|
function AssetHubKusama() {
|
|
6664
6648
|
_classCallCheck(this, AssetHubKusama);
|
|
6665
|
-
return _callSuper(this, AssetHubKusama, ['AssetHubKusama', 'KusamaAssetHub', 'kusama',
|
|
6649
|
+
return _callSuper(this, AssetHubKusama, ['AssetHubKusama', 'KusamaAssetHub', 'kusama', sdkCommon.Version.V4]);
|
|
6666
6650
|
}
|
|
6667
6651
|
_inherits(AssetHubKusama, _ParachainNode);
|
|
6668
6652
|
return _createClass(AssetHubKusama, [{
|
|
@@ -6707,10 +6691,25 @@ var AssetHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6707
6691
|
}]);
|
|
6708
6692
|
}(ParachainNode);
|
|
6709
6693
|
|
|
6694
|
+
var createExecuteCall = function createExecuteCall(
|
|
6695
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6696
|
+
xcm, maxWeight) {
|
|
6697
|
+
return {
|
|
6698
|
+
module: 'PolkadotXcm',
|
|
6699
|
+
method: 'execute',
|
|
6700
|
+
parameters: {
|
|
6701
|
+
message: xcm,
|
|
6702
|
+
max_weight: {
|
|
6703
|
+
ref_time: maxWeight.refTime,
|
|
6704
|
+
proof_size: maxWeight.proofSize
|
|
6705
|
+
}
|
|
6706
|
+
}
|
|
6707
|
+
};
|
|
6708
|
+
};
|
|
6709
|
+
|
|
6710
6710
|
var createExecuteExchangeXcm = function createExecuteExchangeXcm(input, weight, originExecutionFee, destExecutionFee) {
|
|
6711
6711
|
var api = input.api,
|
|
6712
|
-
|
|
6713
|
-
version = _input$version === void 0 ? exports.Version.V4 : _input$version,
|
|
6712
|
+
version = input.version,
|
|
6714
6713
|
asset = input.asset,
|
|
6715
6714
|
scenario = input.scenario,
|
|
6716
6715
|
destination = input.destination,
|
|
@@ -6804,15 +6803,15 @@ var createExecuteExchangeXcm = function createExecuteExchangeXcm(input, weight,
|
|
|
6804
6803
|
return api.callTxMethod(call);
|
|
6805
6804
|
};
|
|
6806
6805
|
|
|
6807
|
-
var createExecuteXcm = function createExecuteXcm(input,
|
|
6806
|
+
var createExecuteXcm = function createExecuteXcm(input, executionFee, version) {
|
|
6807
|
+
var _feeAsset$multiLocati;
|
|
6808
6808
|
var api = input.api,
|
|
6809
|
-
_input$version = input.version,
|
|
6810
|
-
version = _input$version === void 0 ? exports.Version.V4 : _input$version,
|
|
6811
6809
|
asset = input.asset,
|
|
6812
6810
|
scenario = input.scenario,
|
|
6813
6811
|
destination = input.destination,
|
|
6814
6812
|
paraIdTo = input.paraIdTo,
|
|
6815
|
-
address = input.address
|
|
6813
|
+
address = input.address,
|
|
6814
|
+
feeAsset = input.feeAsset;
|
|
6816
6815
|
var dest = createDestination(scenario, version, destination, paraIdTo);
|
|
6817
6816
|
var beneficiary = createBeneficiary({
|
|
6818
6817
|
api: api,
|
|
@@ -6822,77 +6821,93 @@ var createExecuteXcm = function createExecuteXcm(input, weight, executionFee) {
|
|
|
6822
6821
|
version: version,
|
|
6823
6822
|
paraId: paraIdTo
|
|
6824
6823
|
});
|
|
6825
|
-
if (!asset.multiLocation) {
|
|
6826
|
-
throw new
|
|
6824
|
+
if (!assets.isForeignAsset(asset) || !asset.multiLocation || !asset.assetId) {
|
|
6825
|
+
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is missing multiLocation or assetId"));
|
|
6827
6826
|
}
|
|
6828
|
-
|
|
6827
|
+
if (feeAsset && (!assets.isForeignAsset(feeAsset) || !feeAsset.multiLocation || !feeAsset.assetId)) {
|
|
6828
|
+
throw new assets.InvalidCurrencyError("Fee asset ".concat(JSON.stringify(feeAsset), " is missing multiLocation or assetId"));
|
|
6829
|
+
}
|
|
6830
|
+
var assetML = transformMultiLocation(asset.multiLocation);
|
|
6831
|
+
var feeML = transformMultiLocation((_feeAsset$multiLocati = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.multiLocation) !== null && _feeAsset$multiLocati !== void 0 ? _feeAsset$multiLocati : asset.multiLocation);
|
|
6832
|
+
var sameFeeAsset = feeAsset && assets.isAssetEqual(asset, feeAsset);
|
|
6829
6833
|
var amountWithoutFee = BigInt(asset.amount) - executionFee;
|
|
6830
|
-
var
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6834
|
+
var assetsToWithdraw = [{
|
|
6835
|
+
assetId: asset.assetId,
|
|
6836
|
+
multiasset: {
|
|
6837
|
+
id: assetML,
|
|
6838
|
+
fun: {
|
|
6839
|
+
Fungible: BigInt(asset.amount)
|
|
6840
|
+
}
|
|
6841
|
+
}
|
|
6842
|
+
}];
|
|
6843
|
+
if (!sameFeeAsset && feeAsset !== null && feeAsset !== void 0 && feeAsset.multiLocation) {
|
|
6844
|
+
assetsToWithdraw.push({
|
|
6845
|
+
assetId: feeAsset.assetId,
|
|
6846
|
+
multiasset: {
|
|
6847
|
+
id: feeML,
|
|
6848
|
+
fun: {
|
|
6849
|
+
Fungible: executionFee
|
|
6850
|
+
}
|
|
6851
|
+
}
|
|
6852
|
+
});
|
|
6853
|
+
}
|
|
6854
|
+
assetsToWithdraw.sort(function (a, b) {
|
|
6855
|
+
return a.assetId > b.assetId ? 1 : -1;
|
|
6856
|
+
});
|
|
6857
|
+
var xcm = [{
|
|
6858
|
+
WithdrawAsset: assetsToWithdraw.map(function (_ref) {
|
|
6859
|
+
var multiasset = _ref.multiasset;
|
|
6860
|
+
return multiasset;
|
|
6861
|
+
})
|
|
6862
|
+
}, {
|
|
6863
|
+
BuyExecution: {
|
|
6864
|
+
fees: {
|
|
6865
|
+
id: feeML,
|
|
6866
|
+
fun: {
|
|
6867
|
+
Fungible: executionFee
|
|
6868
|
+
}
|
|
6869
|
+
},
|
|
6870
|
+
weight_limit: {
|
|
6871
|
+
Limited: {
|
|
6872
|
+
ref_time: 150n,
|
|
6873
|
+
proof_size: 0n
|
|
6874
|
+
}
|
|
6875
|
+
}
|
|
6876
|
+
}
|
|
6877
|
+
}, {
|
|
6878
|
+
DepositReserveAsset: {
|
|
6879
|
+
assets: {
|
|
6880
|
+
Definite: [{
|
|
6881
|
+
id: assetML,
|
|
6837
6882
|
fun: {
|
|
6838
|
-
Fungible: BigInt(asset.amount)
|
|
6883
|
+
Fungible: sameFeeAsset ? amountWithoutFee : BigInt(asset.amount)
|
|
6839
6884
|
}
|
|
6840
6885
|
}]
|
|
6841
|
-
},
|
|
6886
|
+
},
|
|
6887
|
+
dest: dest,
|
|
6888
|
+
xcm: [{
|
|
6842
6889
|
BuyExecution: {
|
|
6843
6890
|
fees: {
|
|
6844
|
-
id:
|
|
6891
|
+
id: asset.multiLocation,
|
|
6845
6892
|
fun: {
|
|
6846
|
-
Fungible: executionFee
|
|
6893
|
+
Fungible: sameFeeAsset ? amountWithoutFee - executionFee : BigInt(asset.amount)
|
|
6847
6894
|
}
|
|
6848
6895
|
},
|
|
6849
|
-
weight_limit:
|
|
6850
|
-
Limited: {
|
|
6851
|
-
ref_time: 150n,
|
|
6852
|
-
proof_size: 0n
|
|
6853
|
-
}
|
|
6854
|
-
}
|
|
6896
|
+
weight_limit: 'Unlimited'
|
|
6855
6897
|
}
|
|
6856
6898
|
}, {
|
|
6857
|
-
|
|
6899
|
+
DepositAsset: {
|
|
6858
6900
|
assets: {
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
fun: {
|
|
6862
|
-
Fungible: amountWithoutFee
|
|
6863
|
-
}
|
|
6864
|
-
}]
|
|
6865
|
-
},
|
|
6866
|
-
dest: dest,
|
|
6867
|
-
xcm: [{
|
|
6868
|
-
BuyExecution: {
|
|
6869
|
-
fees: {
|
|
6870
|
-
id: asset.multiLocation,
|
|
6871
|
-
fun: {
|
|
6872
|
-
Fungible: amountWithoutFee - executionFee
|
|
6873
|
-
}
|
|
6874
|
-
},
|
|
6875
|
-
weight_limit: 'Unlimited'
|
|
6876
|
-
}
|
|
6877
|
-
}, {
|
|
6878
|
-
DepositAsset: {
|
|
6879
|
-
assets: {
|
|
6880
|
-
Wild: {
|
|
6881
|
-
AllCounted: 1
|
|
6882
|
-
}
|
|
6883
|
-
},
|
|
6884
|
-
beneficiary: beneficiary
|
|
6901
|
+
Wild: {
|
|
6902
|
+
AllCounted: 1
|
|
6885
6903
|
}
|
|
6886
|
-
}
|
|
6904
|
+
},
|
|
6905
|
+
beneficiary: beneficiary
|
|
6887
6906
|
}
|
|
6888
|
-
}]
|
|
6889
|
-
max_weight: {
|
|
6890
|
-
ref_time: weight.refTime,
|
|
6891
|
-
proof_size: weight.proofSize
|
|
6892
|
-
}
|
|
6907
|
+
}]
|
|
6893
6908
|
}
|
|
6894
|
-
};
|
|
6895
|
-
return
|
|
6909
|
+
}];
|
|
6910
|
+
return addXcmVersionHeader(xcm, version);
|
|
6896
6911
|
};
|
|
6897
6912
|
|
|
6898
6913
|
var handleToAhTeleport = /*#__PURE__*/function () {
|
|
@@ -6986,13 +7001,12 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6986
7001
|
function AssetHubPolkadot() {
|
|
6987
7002
|
var _this;
|
|
6988
7003
|
_classCallCheck(this, AssetHubPolkadot);
|
|
6989
|
-
_this = _callSuper(this, AssetHubPolkadot, ['AssetHubPolkadot', 'PolkadotAssetHub', 'polkadot',
|
|
7004
|
+
_this = _callSuper(this, AssetHubPolkadot, ['AssetHubPolkadot', 'PolkadotAssetHub', 'polkadot', sdkCommon.Version.V4]);
|
|
6990
7005
|
_this.handleLocalReserveTransfer = function (input) {
|
|
6991
7006
|
var useDOTAsFeeAsset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6992
7007
|
var api = input.api,
|
|
6993
7008
|
scenario = input.scenario,
|
|
6994
|
-
|
|
6995
|
-
version = _input$version === void 0 ? exports.Version.V4 : _input$version,
|
|
7009
|
+
version = input.version,
|
|
6996
7010
|
destination = input.destination,
|
|
6997
7011
|
asset = input.asset,
|
|
6998
7012
|
paraIdTo = input.paraIdTo;
|
|
@@ -7024,42 +7038,46 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7024
7038
|
return _createClass(AssetHubPolkadot, [{
|
|
7025
7039
|
key: "handleBridgeTransfer",
|
|
7026
7040
|
value: function handleBridgeTransfer(input, targetChain) {
|
|
7027
|
-
var
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
}
|
|
7037
|
-
};
|
|
7041
|
+
var _asset$symbol, _asset$symbol2, _asset$symbol3, _asset$symbol4;
|
|
7042
|
+
var api = input.api,
|
|
7043
|
+
asset = input.asset,
|
|
7044
|
+
destination = input.destination,
|
|
7045
|
+
scenario = input.scenario,
|
|
7046
|
+
address = input.address,
|
|
7047
|
+
version = input.version,
|
|
7048
|
+
paraIdTo = input.paraIdTo;
|
|
7049
|
+
if (targetChain === 'Kusama' && ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toUpperCase()) === 'KSM' || targetChain === 'Polkadot' && ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toUpperCase()) === 'DOT') {
|
|
7038
7050
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7039
|
-
header: createBridgePolkadotXcmDest(
|
|
7040
|
-
addressSelection:
|
|
7041
|
-
|
|
7051
|
+
header: createBridgePolkadotXcmDest(version, targetChain, destination, paraIdTo),
|
|
7052
|
+
addressSelection: createVersionedBeneficiary({
|
|
7053
|
+
api: api,
|
|
7054
|
+
scenario: scenario,
|
|
7055
|
+
pallet: 'PolkadotXcm',
|
|
7056
|
+
recipientAddress: address,
|
|
7057
|
+
version: version,
|
|
7058
|
+
paraId: paraIdTo
|
|
7059
|
+
}),
|
|
7060
|
+
currencySelection: createVersionedMultiAssets(version, asset.amount, asset.multiLocation)
|
|
7042
7061
|
});
|
|
7043
7062
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited');
|
|
7044
|
-
} else if (targetChain === 'Polkadot' && ((
|
|
7045
|
-
var _overriddenVersion = exports.Version.V3;
|
|
7063
|
+
} else if (targetChain === 'Polkadot' && ((_asset$symbol3 = asset.symbol) === null || _asset$symbol3 === void 0 ? void 0 : _asset$symbol3.toUpperCase()) === 'KSM' || targetChain === 'Kusama' && ((_asset$symbol4 = asset.symbol) === null || _asset$symbol4 === void 0 ? void 0 : _asset$symbol4.toUpperCase()) === 'DOT') {
|
|
7046
7064
|
var _modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7047
|
-
header: createBridgePolkadotXcmDest(
|
|
7048
|
-
currencySelection: createVersionedMultiAssets(
|
|
7065
|
+
header: createBridgePolkadotXcmDest(version, targetChain, destination, paraIdTo),
|
|
7066
|
+
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
7049
7067
|
});
|
|
7050
7068
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(_modifiedInput, 'limited_reserve_transfer_assets', 'Unlimited');
|
|
7051
7069
|
}
|
|
7052
|
-
throw new assets.InvalidCurrencyError("Polkadot <-> Kusama bridge does not support currency ".concat(
|
|
7070
|
+
throw new assets.InvalidCurrencyError("Polkadot <-> Kusama bridge does not support currency ".concat(asset.symbol));
|
|
7053
7071
|
}
|
|
7054
7072
|
}, {
|
|
7055
7073
|
key: "handleEthBridgeNativeTransfer",
|
|
7056
7074
|
value: function () {
|
|
7057
7075
|
var _handleEthBridgeNativeTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
7058
|
-
var api,
|
|
7076
|
+
var api, version, scenario, destination, senderAddress, address, paraIdTo, asset, bridgeStatus, messageId, multiLocation, call;
|
|
7059
7077
|
return _regenerator().w(function (_context) {
|
|
7060
7078
|
while (1) switch (_context.n) {
|
|
7061
7079
|
case 0:
|
|
7062
|
-
api = input.api,
|
|
7080
|
+
api = input.api, version = input.version, scenario = input.scenario, destination = input.destination, senderAddress = input.senderAddress, address = input.address, paraIdTo = input.paraIdTo, asset = input.asset;
|
|
7063
7081
|
_context.n = 1;
|
|
7064
7082
|
return getBridgeStatus(api.clone());
|
|
7065
7083
|
case 1:
|
|
@@ -7142,11 +7160,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7142
7160
|
key: "handleEthBridgeTransfer",
|
|
7143
7161
|
value: function () {
|
|
7144
7162
|
var _handleEthBridgeTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
|
|
7145
|
-
var api, scenario, destination, paraIdTo, address, asset, bridgeStatus, modifiedInput;
|
|
7163
|
+
var api, scenario, destination, paraIdTo, address, asset, version, bridgeStatus, modifiedInput;
|
|
7146
7164
|
return _regenerator().w(function (_context2) {
|
|
7147
7165
|
while (1) switch (_context2.n) {
|
|
7148
7166
|
case 0:
|
|
7149
|
-
api = input.api, scenario = input.scenario, destination = input.destination, paraIdTo = input.paraIdTo, address = input.address, asset = input.asset;
|
|
7167
|
+
api = input.api, scenario = input.scenario, destination = input.destination, paraIdTo = input.paraIdTo, address = input.address, asset = input.asset, version = input.version;
|
|
7150
7168
|
_context2.n = 1;
|
|
7151
7169
|
return getBridgeStatus(api.clone());
|
|
7152
7170
|
case 1:
|
|
@@ -7185,7 +7203,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7185
7203
|
version: this.version,
|
|
7186
7204
|
paraId: paraIdTo
|
|
7187
7205
|
}),
|
|
7188
|
-
currencySelection: createVersionedMultiAssets(
|
|
7206
|
+
currencySelection: createVersionedMultiAssets(version, asset.amount, asset.multiLocation)
|
|
7189
7207
|
});
|
|
7190
7208
|
return _context2.a(2, PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited'));
|
|
7191
7209
|
}
|
|
@@ -7204,8 +7222,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7204
7222
|
asset = input.asset,
|
|
7205
7223
|
scenario = input.scenario,
|
|
7206
7224
|
destination = input.destination,
|
|
7207
|
-
paraIdTo = input.paraIdTo
|
|
7208
|
-
|
|
7225
|
+
paraIdTo = input.paraIdTo,
|
|
7226
|
+
version = input.version;
|
|
7209
7227
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
7210
7228
|
var customMultiLocation = {
|
|
7211
7229
|
parents: sdkCommon.Parents.ONE,
|
|
@@ -7234,8 +7252,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7234
7252
|
value: function patchInput(input) {
|
|
7235
7253
|
var asset = input.asset,
|
|
7236
7254
|
destination = input.destination,
|
|
7237
|
-
_input$
|
|
7238
|
-
version = _input$
|
|
7255
|
+
_input$version = input.version,
|
|
7256
|
+
version = _input$version === void 0 ? this.version : _input$version;
|
|
7239
7257
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
7240
7258
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7241
7259
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -7254,11 +7272,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7254
7272
|
key: "handleExecuteTransfer",
|
|
7255
7273
|
value: function () {
|
|
7256
7274
|
var _handleExecuteTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(input) {
|
|
7257
|
-
var api, senderAddress, asset, feeAsset, decimals, multiplier, base, scaledMultiplier, MIN_FEE,
|
|
7275
|
+
var api, senderAddress, asset, feeAsset, version, decimals, multiplier, base, scaledMultiplier, MIN_FEE, call, dryRunResult, paddedFee, xcm, weight;
|
|
7258
7276
|
return _regenerator().w(function (_context3) {
|
|
7259
7277
|
while (1) switch (_context3.n) {
|
|
7260
7278
|
case 0:
|
|
7261
|
-
api = input.api, senderAddress = input.senderAddress, asset = input.asset, feeAsset = input.feeAsset;
|
|
7279
|
+
api = input.api, senderAddress = input.senderAddress, asset = input.asset, feeAsset = input.feeAsset, version = input.version;
|
|
7262
7280
|
if (senderAddress) {
|
|
7263
7281
|
_context3.n = 1;
|
|
7264
7282
|
break;
|
|
@@ -7271,11 +7289,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7271
7289
|
base = BigInt(Math.pow(10, decimals));
|
|
7272
7290
|
scaledMultiplier = BigInt(Math.floor(multiplier * Math.pow(10, decimals)));
|
|
7273
7291
|
MIN_FEE = base * scaledMultiplier / BigInt(Math.pow(10, decimals));
|
|
7274
|
-
|
|
7292
|
+
call = createExecuteCall(createExecuteXcm(input, MIN_FEE, version), MAX_WEIGHT);
|
|
7275
7293
|
_context3.n = 2;
|
|
7276
7294
|
return api.getDryRunCall({
|
|
7277
7295
|
node: this.node,
|
|
7278
|
-
tx:
|
|
7296
|
+
tx: api.callTxMethod(call),
|
|
7279
7297
|
address: senderAddress,
|
|
7280
7298
|
isFeeAsset: !!feeAsset
|
|
7281
7299
|
});
|
|
@@ -7287,14 +7305,13 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7287
7305
|
}
|
|
7288
7306
|
throw new DryRunFailedError(dryRunResult.failureReason);
|
|
7289
7307
|
case 3:
|
|
7290
|
-
if (dryRunResult.weight) {
|
|
7291
|
-
_context3.n = 4;
|
|
7292
|
-
break;
|
|
7293
|
-
}
|
|
7294
|
-
throw new DryRunFailedError('weight not found');
|
|
7295
|
-
case 4:
|
|
7296
7308
|
paddedFee = dryRunResult.fee * 120n / 100n;
|
|
7297
|
-
|
|
7309
|
+
xcm = createExecuteXcm(input, paddedFee, version);
|
|
7310
|
+
_context3.n = 4;
|
|
7311
|
+
return api.getXcmWeight(xcm);
|
|
7312
|
+
case 4:
|
|
7313
|
+
weight = _context3.v;
|
|
7314
|
+
return _context3.a(2, createExecuteCall(createExecuteXcm(input, paddedFee, version), weight));
|
|
7298
7315
|
}
|
|
7299
7316
|
}, _callee3, this);
|
|
7300
7317
|
}));
|
|
@@ -7305,54 +7322,96 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7305
7322
|
}()
|
|
7306
7323
|
}, {
|
|
7307
7324
|
key: "transferPolkadotXCM",
|
|
7308
|
-
value: function
|
|
7309
|
-
var
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7325
|
+
value: function () {
|
|
7326
|
+
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(input) {
|
|
7327
|
+
var api, scenario, asset, destination, feeAsset, overriddenAsset, isNativeAsset, isEthereumAsset, isSystemNode, method, modifiedInput, _t, _t2;
|
|
7328
|
+
return _regenerator().w(function (_context4) {
|
|
7329
|
+
while (1) switch (_context4.n) {
|
|
7330
|
+
case 0:
|
|
7331
|
+
api = input.api, scenario = input.scenario, asset = input.asset, destination = input.destination, feeAsset = input.feeAsset, overriddenAsset = input.overriddenAsset;
|
|
7332
|
+
if (!feeAsset) {
|
|
7333
|
+
_context4.n = 4;
|
|
7334
|
+
break;
|
|
7335
|
+
}
|
|
7336
|
+
if (!overriddenAsset) {
|
|
7337
|
+
_context4.n = 1;
|
|
7338
|
+
break;
|
|
7339
|
+
}
|
|
7340
|
+
throw new assets.InvalidCurrencyError('Cannot use overridden multi-assets with XCM execute');
|
|
7341
|
+
case 1:
|
|
7342
|
+
if (!(assets.normalizeSymbol(asset.symbol) === assets.normalizeSymbol('KSM'))) {
|
|
7343
|
+
_context4.n = 2;
|
|
7344
|
+
break;
|
|
7345
|
+
}
|
|
7346
|
+
return _context4.a(2, this.handleLocalReserveTransfer(input));
|
|
7347
|
+
case 2:
|
|
7348
|
+
isNativeAsset = asset.symbol === this.getNativeAssetSymbol();
|
|
7349
|
+
if (isNativeAsset) {
|
|
7350
|
+
_context4.n = 4;
|
|
7351
|
+
break;
|
|
7352
|
+
}
|
|
7353
|
+
_t = api;
|
|
7354
|
+
_context4.n = 3;
|
|
7355
|
+
return this.handleExecuteTransfer(input);
|
|
7356
|
+
case 3:
|
|
7357
|
+
_t2 = _context4.v;
|
|
7358
|
+
return _context4.a(2, _t.callTxMethod.call(_t, _t2));
|
|
7359
|
+
case 4:
|
|
7360
|
+
if (!(destination === 'AssetHubKusama')) {
|
|
7361
|
+
_context4.n = 5;
|
|
7362
|
+
break;
|
|
7363
|
+
}
|
|
7364
|
+
return _context4.a(2, this.handleBridgeTransfer(input, 'Kusama'));
|
|
7365
|
+
case 5:
|
|
7366
|
+
if (!(destination === 'Ethereum')) {
|
|
7367
|
+
_context4.n = 6;
|
|
7368
|
+
break;
|
|
7369
|
+
}
|
|
7370
|
+
return _context4.a(2, this.handleEthBridgeTransfer(input));
|
|
7371
|
+
case 6:
|
|
7372
|
+
if (!(destination === 'Mythos')) {
|
|
7373
|
+
_context4.n = 7;
|
|
7374
|
+
break;
|
|
7375
|
+
}
|
|
7376
|
+
return _context4.a(2, this.handleMythosTransfer(input));
|
|
7377
|
+
case 7:
|
|
7378
|
+
isEthereumAsset = asset.multiLocation && assets.findAssetByMultiLocation(assets.getOtherAssets('Ethereum'), asset.multiLocation);
|
|
7379
|
+
if (!(destination === 'BifrostPolkadot' && isEthereumAsset)) {
|
|
7380
|
+
_context4.n = 8;
|
|
7381
|
+
break;
|
|
7382
|
+
}
|
|
7383
|
+
return _context4.a(2, this.handleLocalReserveTransfer(input));
|
|
7384
|
+
case 8:
|
|
7385
|
+
if (!isEthereumAsset) {
|
|
7386
|
+
_context4.n = 9;
|
|
7387
|
+
break;
|
|
7388
|
+
}
|
|
7389
|
+
return _context4.a(2, this.handleLocalReserveTransfer(input, true));
|
|
7390
|
+
case 9:
|
|
7391
|
+
isSystemNode = !sdkCommon.isTMultiLocation(destination) && SYSTEM_NODES_POLKADOT.includes(destination);
|
|
7392
|
+
if (!(scenario === 'ParaToPara' && asset.symbol === 'DOT' && !assets.isForeignAsset(asset) && destination !== 'Hydration' && destination !== 'Polimec' && destination !== 'Moonbeam' && destination !== 'BifrostPolkadot' && destination !== 'PeoplePolkadot' && destination !== 'Ajuna' && !isSystemNode)) {
|
|
7393
|
+
_context4.n = 10;
|
|
7394
|
+
break;
|
|
7395
|
+
}
|
|
7396
|
+
throw new ScenarioNotSupportedError(this.node, scenario, 'Some Parachains do not have a reserve for DOT on AssetHub. This can also include multihop transfers that have AssetHub as a hop chain and the call contains DOT. Chains that do not have a DOT reserve on AssetHub are not allowed to transfer DOT to it or through it because this transfer will result in asset loss.');
|
|
7397
|
+
case 10:
|
|
7398
|
+
if (!(scenario === 'ParaToPara' && asset.symbol === 'KSM' && !assets.isForeignAsset(asset))) {
|
|
7399
|
+
_context4.n = 11;
|
|
7400
|
+
break;
|
|
7401
|
+
}
|
|
7402
|
+
throw new ScenarioNotSupportedError(this.node, scenario, 'Bridged KSM cannot currently be transfered from AssetHubPolkadot, if you are sending different KSM asset, please specify {id: <KSMID>}.');
|
|
7403
|
+
case 11:
|
|
7404
|
+
method = this.getMethod(scenario, destination);
|
|
7405
|
+
modifiedInput = this.patchInput(input);
|
|
7406
|
+
return _context4.a(2, PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, method, 'Unlimited'));
|
|
7407
|
+
}
|
|
7408
|
+
}, _callee4, this);
|
|
7409
|
+
}));
|
|
7410
|
+
function transferPolkadotXCM(_x4) {
|
|
7411
|
+
return _transferPolkadotXCM.apply(this, arguments);
|
|
7351
7412
|
}
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, method, 'Unlimited'));
|
|
7355
|
-
}
|
|
7413
|
+
return transferPolkadotXCM;
|
|
7414
|
+
}()
|
|
7356
7415
|
}, {
|
|
7357
7416
|
key: "getRelayToParaOverrides",
|
|
7358
7417
|
value: function getRelayToParaOverrides() {
|
|
@@ -7420,7 +7479,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7420
7479
|
var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
7421
7480
|
function Astar() {
|
|
7422
7481
|
_classCallCheck(this, Astar);
|
|
7423
|
-
return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot',
|
|
7482
|
+
return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot', sdkCommon.Version.V4]);
|
|
7424
7483
|
}
|
|
7425
7484
|
_inherits(Astar, _ParachainNode);
|
|
7426
7485
|
return _createClass(Astar, [{
|
|
@@ -7473,7 +7532,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7473
7532
|
var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
7474
7533
|
function Basilisk() {
|
|
7475
7534
|
_classCallCheck(this, Basilisk);
|
|
7476
|
-
return _callSuper(this, Basilisk, ['Basilisk', 'basilisk', 'kusama',
|
|
7535
|
+
return _callSuper(this, Basilisk, ['Basilisk', 'basilisk', 'kusama', sdkCommon.Version.V4]);
|
|
7477
7536
|
}
|
|
7478
7537
|
_inherits(Basilisk, _ParachainNode);
|
|
7479
7538
|
return _createClass(Basilisk, [{
|
|
@@ -7501,7 +7560,7 @@ var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7501
7560
|
var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7502
7561
|
function BifrostKusama() {
|
|
7503
7562
|
_classCallCheck(this, BifrostKusama);
|
|
7504
|
-
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama',
|
|
7563
|
+
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama', sdkCommon.Version.V4]);
|
|
7505
7564
|
}
|
|
7506
7565
|
_inherits(BifrostKusama, _ParachainNode);
|
|
7507
7566
|
return _createClass(BifrostKusama, [{
|
|
@@ -7520,7 +7579,7 @@ var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7520
7579
|
var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7521
7580
|
function BifrostPolkadot() {
|
|
7522
7581
|
_classCallCheck(this, BifrostPolkadot);
|
|
7523
|
-
return _callSuper(this, BifrostPolkadot, ['BifrostPolkadot', 'bifrost', 'polkadot',
|
|
7582
|
+
return _callSuper(this, BifrostPolkadot, ['BifrostPolkadot', 'bifrost', 'polkadot', sdkCommon.Version.V4]);
|
|
7524
7583
|
}
|
|
7525
7584
|
_inherits(BifrostPolkadot, _ParachainNode);
|
|
7526
7585
|
return _createClass(BifrostPolkadot, [{
|
|
@@ -7622,7 +7681,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7622
7681
|
var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7623
7682
|
function BridgeHubKusama() {
|
|
7624
7683
|
_classCallCheck(this, BridgeHubKusama);
|
|
7625
|
-
return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama',
|
|
7684
|
+
return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama', sdkCommon.Version.V4]);
|
|
7626
7685
|
}
|
|
7627
7686
|
_inherits(BridgeHubKusama, _ParachainNode);
|
|
7628
7687
|
return _createClass(BridgeHubKusama, [{
|
|
@@ -7649,7 +7708,7 @@ var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7649
7708
|
var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7650
7709
|
function BridgeHubPolkadot() {
|
|
7651
7710
|
_classCallCheck(this, BridgeHubPolkadot);
|
|
7652
|
-
return _callSuper(this, BridgeHubPolkadot, ['BridgeHubPolkadot', 'polkadotBridgeHub', 'polkadot',
|
|
7711
|
+
return _callSuper(this, BridgeHubPolkadot, ['BridgeHubPolkadot', 'polkadotBridgeHub', 'polkadot', sdkCommon.Version.V4]);
|
|
7653
7712
|
}
|
|
7654
7713
|
_inherits(BridgeHubPolkadot, _ParachainNode);
|
|
7655
7714
|
return _createClass(BridgeHubPolkadot, [{
|
|
@@ -7676,7 +7735,7 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7676
7735
|
var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
|
|
7677
7736
|
function Centrifuge() {
|
|
7678
7737
|
_classCallCheck(this, Centrifuge);
|
|
7679
|
-
return _callSuper(this, Centrifuge, ['Centrifuge', 'centrifuge', 'polkadot',
|
|
7738
|
+
return _callSuper(this, Centrifuge, ['Centrifuge', 'centrifuge', 'polkadot', sdkCommon.Version.V4]);
|
|
7680
7739
|
}
|
|
7681
7740
|
_inherits(Centrifuge, _ParachainNode);
|
|
7682
7741
|
return _createClass(Centrifuge, [{
|
|
@@ -7727,7 +7786,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7727
7786
|
var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
7728
7787
|
function Collectives() {
|
|
7729
7788
|
_classCallCheck(this, Collectives);
|
|
7730
|
-
return _callSuper(this, Collectives, ['Collectives', 'polkadotCollectives', 'polkadot',
|
|
7789
|
+
return _callSuper(this, Collectives, ['Collectives', 'polkadotCollectives', 'polkadot', sdkCommon.Version.V4]);
|
|
7731
7790
|
}
|
|
7732
7791
|
_inherits(Collectives, _ParachainNode);
|
|
7733
7792
|
return _createClass(Collectives, [{
|
|
@@ -7758,7 +7817,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7758
7817
|
var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
|
|
7759
7818
|
function ComposableFinance() {
|
|
7760
7819
|
_classCallCheck(this, ComposableFinance);
|
|
7761
|
-
return _callSuper(this, ComposableFinance, ['ComposableFinance', 'composable', 'polkadot',
|
|
7820
|
+
return _callSuper(this, ComposableFinance, ['ComposableFinance', 'composable', 'polkadot', sdkCommon.Version.V3]);
|
|
7762
7821
|
}
|
|
7763
7822
|
_inherits(ComposableFinance, _ParachainNode);
|
|
7764
7823
|
return _createClass(ComposableFinance, [{
|
|
@@ -7776,7 +7835,7 @@ var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7776
7835
|
var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7777
7836
|
function CoretimeKusama() {
|
|
7778
7837
|
_classCallCheck(this, CoretimeKusama);
|
|
7779
|
-
return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama',
|
|
7838
|
+
return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama', sdkCommon.Version.V4]);
|
|
7780
7839
|
}
|
|
7781
7840
|
_inherits(CoretimeKusama, _ParachainNode);
|
|
7782
7841
|
return _createClass(CoretimeKusama, [{
|
|
@@ -7801,7 +7860,7 @@ var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7801
7860
|
var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7802
7861
|
function CoretimePolkadot() {
|
|
7803
7862
|
_classCallCheck(this, CoretimePolkadot);
|
|
7804
|
-
return _callSuper(this, CoretimePolkadot, ['CoretimePolkadot', 'polkadotCoretime', 'polkadot',
|
|
7863
|
+
return _callSuper(this, CoretimePolkadot, ['CoretimePolkadot', 'polkadotCoretime', 'polkadot', sdkCommon.Version.V4]);
|
|
7805
7864
|
}
|
|
7806
7865
|
_inherits(CoretimePolkadot, _ParachainNode);
|
|
7807
7866
|
return _createClass(CoretimePolkadot, [{
|
|
@@ -7825,7 +7884,7 @@ var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7825
7884
|
var Crab = /*#__PURE__*/function (_ParachainNode) {
|
|
7826
7885
|
function Crab() {
|
|
7827
7886
|
_classCallCheck(this, Crab);
|
|
7828
|
-
return _callSuper(this, Crab, ['Crab', 'crab', 'kusama',
|
|
7887
|
+
return _callSuper(this, Crab, ['Crab', 'crab', 'kusama', sdkCommon.Version.V4]);
|
|
7829
7888
|
}
|
|
7830
7889
|
_inherits(Crab, _ParachainNode);
|
|
7831
7890
|
return _createClass(Crab, [{
|
|
@@ -7869,7 +7928,7 @@ var Crab = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7869
7928
|
var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
7870
7929
|
function Crust() {
|
|
7871
7930
|
_classCallCheck(this, Crust);
|
|
7872
|
-
return _callSuper(this, Crust, ['Crust', 'crustParachain', 'polkadot',
|
|
7931
|
+
return _callSuper(this, Crust, ['Crust', 'crustParachain', 'polkadot', sdkCommon.Version.V3]);
|
|
7873
7932
|
}
|
|
7874
7933
|
_inherits(Crust, _ParachainNode);
|
|
7875
7934
|
return _createClass(Crust, [{
|
|
@@ -7922,7 +7981,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7922
7981
|
var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
|
|
7923
7982
|
function CrustShadow() {
|
|
7924
7983
|
_classCallCheck(this, CrustShadow);
|
|
7925
|
-
return _callSuper(this, CrustShadow, ['CrustShadow', 'shadow', 'kusama',
|
|
7984
|
+
return _callSuper(this, CrustShadow, ['CrustShadow', 'shadow', 'kusama', sdkCommon.Version.V3]);
|
|
7926
7985
|
}
|
|
7927
7986
|
_inherits(CrustShadow, _ParachainNode);
|
|
7928
7987
|
return _createClass(CrustShadow, [{
|
|
@@ -7956,7 +8015,7 @@ var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7956
8015
|
var Curio = /*#__PURE__*/function (_ParachainNode) {
|
|
7957
8016
|
function Curio() {
|
|
7958
8017
|
_classCallCheck(this, Curio);
|
|
7959
|
-
return _callSuper(this, Curio, ['Curio', 'curio', 'kusama',
|
|
8018
|
+
return _callSuper(this, Curio, ['Curio', 'curio', 'kusama', sdkCommon.Version.V3]);
|
|
7960
8019
|
}
|
|
7961
8020
|
_inherits(Curio, _ParachainNode);
|
|
7962
8021
|
return _createClass(Curio, [{
|
|
@@ -7976,7 +8035,7 @@ var Curio = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7976
8035
|
var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
7977
8036
|
function Darwinia() {
|
|
7978
8037
|
_classCallCheck(this, Darwinia);
|
|
7979
|
-
return _callSuper(this, Darwinia, ['Darwinia', 'darwinia', 'polkadot',
|
|
8038
|
+
return _callSuper(this, Darwinia, ['Darwinia', 'darwinia', 'polkadot', sdkCommon.Version.V4]);
|
|
7980
8039
|
}
|
|
7981
8040
|
_inherits(Darwinia, _ParachainNode);
|
|
7982
8041
|
return _createClass(Darwinia, [{
|
|
@@ -8033,7 +8092,7 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8033
8092
|
var Encointer = /*#__PURE__*/function (_ParachainNode) {
|
|
8034
8093
|
function Encointer() {
|
|
8035
8094
|
_classCallCheck(this, Encointer);
|
|
8036
|
-
return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama',
|
|
8095
|
+
return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama', sdkCommon.Version.V4]);
|
|
8037
8096
|
}
|
|
8038
8097
|
_inherits(Encointer, _ParachainNode);
|
|
8039
8098
|
return _createClass(Encointer, [{
|
|
@@ -8060,7 +8119,7 @@ var Encointer = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8060
8119
|
var Heima = /*#__PURE__*/function (_ParachainNode) {
|
|
8061
8120
|
function Heima() {
|
|
8062
8121
|
_classCallCheck(this, Heima);
|
|
8063
|
-
return _callSuper(this, Heima, ['Heima', 'litentry', 'polkadot',
|
|
8122
|
+
return _callSuper(this, Heima, ['Heima', 'litentry', 'polkadot', sdkCommon.Version.V4]);
|
|
8064
8123
|
}
|
|
8065
8124
|
_inherits(Heima, _ParachainNode);
|
|
8066
8125
|
return _createClass(Heima, [{
|
|
@@ -8126,10 +8185,8 @@ var createTypeAndThenTransfer = function createTypeAndThenTransfer(_ref, version
|
|
|
8126
8185
|
})]),
|
|
8127
8186
|
assets_transfer_type: transferType,
|
|
8128
8187
|
remote_fees_id: _defineProperty({}, version, {
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
interior: 'Here'
|
|
8132
|
-
}
|
|
8188
|
+
parents: scenario === 'ParaToPara' ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO,
|
|
8189
|
+
interior: 'Here'
|
|
8133
8190
|
}),
|
|
8134
8191
|
fees_transfer_type: transferType,
|
|
8135
8192
|
custom_xcm_on_dest: createCustomXcmPolimec(api, address, scenario, destination, paraIdTo, version),
|
|
@@ -8151,10 +8208,8 @@ var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scena
|
|
|
8151
8208
|
BuyExecution: {
|
|
8152
8209
|
fees: {
|
|
8153
8210
|
id: {
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
interior: 'Here'
|
|
8157
|
-
}
|
|
8211
|
+
parents: sdkCommon.Parents.ONE,
|
|
8212
|
+
interior: 'Here'
|
|
8158
8213
|
},
|
|
8159
8214
|
fun: {
|
|
8160
8215
|
Fungible: GAS_LIMIT
|
|
@@ -8184,7 +8239,7 @@ var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scena
|
|
|
8184
8239
|
var Polimec = /*#__PURE__*/function (_ParachainNode) {
|
|
8185
8240
|
function Polimec() {
|
|
8186
8241
|
_classCallCheck(this, Polimec);
|
|
8187
|
-
return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot',
|
|
8242
|
+
return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', sdkCommon.Version.V4]);
|
|
8188
8243
|
}
|
|
8189
8244
|
_inherits(Polimec, _ParachainNode);
|
|
8190
8245
|
return _createClass(Polimec, [{
|
|
@@ -8286,7 +8341,7 @@ var createCustomXcmAh = function createCustomXcmAh(_ref, version) {
|
|
|
8286
8341
|
var Hydration = /*#__PURE__*/function (_ParachainNode) {
|
|
8287
8342
|
function Hydration() {
|
|
8288
8343
|
_classCallCheck(this, Hydration);
|
|
8289
|
-
return _callSuper(this, Hydration, ['Hydration', 'hydradx', 'polkadot',
|
|
8344
|
+
return _callSuper(this, Hydration, ['Hydration', 'hydradx', 'polkadot', sdkCommon.Version.V4]);
|
|
8290
8345
|
}
|
|
8291
8346
|
_inherits(Hydration, _ParachainNode);
|
|
8292
8347
|
return _createClass(Hydration, [{
|
|
@@ -8297,22 +8352,19 @@ var Hydration = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8297
8352
|
scenario = input.scenario,
|
|
8298
8353
|
version = input.version,
|
|
8299
8354
|
destination = input.destination;
|
|
8300
|
-
var versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V3;
|
|
8301
8355
|
var call = {
|
|
8302
8356
|
module: 'PolkadotXcm',
|
|
8303
8357
|
method: 'transfer_assets_using_type_and_then',
|
|
8304
8358
|
parameters: {
|
|
8305
|
-
dest: this.createVersionedDestination(scenario,
|
|
8306
|
-
assets: _defineProperty({},
|
|
8359
|
+
dest: this.createVersionedDestination(scenario, version, destination, getParaId('AssetHubPolkadot')),
|
|
8360
|
+
assets: _defineProperty({}, version, [createMultiAsset(version, asset.amount, DOT_MULTILOCATION)]),
|
|
8307
8361
|
assets_transfer_type: 'DestinationReserve',
|
|
8308
|
-
remote_fees_id: _defineProperty({},
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
interior: 'Here'
|
|
8312
|
-
}
|
|
8362
|
+
remote_fees_id: _defineProperty({}, version, {
|
|
8363
|
+
parents: sdkCommon.Parents.ONE,
|
|
8364
|
+
interior: 'Here'
|
|
8313
8365
|
}),
|
|
8314
8366
|
fees_transfer_type: 'DestinationReserve',
|
|
8315
|
-
custom_xcm_on_dest: createCustomXcmAh(input,
|
|
8367
|
+
custom_xcm_on_dest: createCustomXcmAh(input, version),
|
|
8316
8368
|
weight_limit: 'Unlimited'
|
|
8317
8369
|
}
|
|
8318
8370
|
};
|
|
@@ -8429,7 +8481,7 @@ Hydration.NATIVE_ASSET_ID = 0;
|
|
|
8429
8481
|
var Interlay = /*#__PURE__*/function (_ParachainNode) {
|
|
8430
8482
|
function Interlay() {
|
|
8431
8483
|
_classCallCheck(this, Interlay);
|
|
8432
|
-
return _callSuper(this, Interlay, ['Interlay', 'interlay', 'polkadot',
|
|
8484
|
+
return _callSuper(this, Interlay, ['Interlay', 'interlay', 'polkadot', sdkCommon.Version.V3]);
|
|
8433
8485
|
}
|
|
8434
8486
|
_inherits(Interlay, _ParachainNode);
|
|
8435
8487
|
return _createClass(Interlay, [{
|
|
@@ -8475,7 +8527,7 @@ var Interlay = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8475
8527
|
var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
8476
8528
|
function Karura() {
|
|
8477
8529
|
_classCallCheck(this, Karura);
|
|
8478
|
-
return _callSuper(this, Karura, ['Karura', 'karura', 'kusama',
|
|
8530
|
+
return _callSuper(this, Karura, ['Karura', 'karura', 'kusama', sdkCommon.Version.V4]);
|
|
8479
8531
|
}
|
|
8480
8532
|
_inherits(Karura, _ParachainNode);
|
|
8481
8533
|
return _createClass(Karura, [{
|
|
@@ -8499,7 +8551,7 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8499
8551
|
var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
8500
8552
|
function KiltSpiritnet() {
|
|
8501
8553
|
_classCallCheck(this, KiltSpiritnet);
|
|
8502
|
-
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot',
|
|
8554
|
+
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', sdkCommon.Version.V4]);
|
|
8503
8555
|
}
|
|
8504
8556
|
_inherits(KiltSpiritnet, _ParachainNode);
|
|
8505
8557
|
return _createClass(KiltSpiritnet, [{
|
|
@@ -8523,7 +8575,7 @@ var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8523
8575
|
var Kintsugi = /*#__PURE__*/function (_ParachainNode) {
|
|
8524
8576
|
function Kintsugi() {
|
|
8525
8577
|
_classCallCheck(this, Kintsugi);
|
|
8526
|
-
return _callSuper(this, Kintsugi, ['Kintsugi', 'kintsugi', 'kusama',
|
|
8578
|
+
return _callSuper(this, Kintsugi, ['Kintsugi', 'kintsugi', 'kusama', sdkCommon.Version.V3]);
|
|
8527
8579
|
}
|
|
8528
8580
|
_inherits(Kintsugi, _ParachainNode);
|
|
8529
8581
|
return _createClass(Kintsugi, [{
|
|
@@ -8569,7 +8621,7 @@ var Kintsugi = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8569
8621
|
var Manta = /*#__PURE__*/function (_ParachainNode) {
|
|
8570
8622
|
function Manta() {
|
|
8571
8623
|
_classCallCheck(this, Manta);
|
|
8572
|
-
return _callSuper(this, Manta, ['Manta', 'manta', 'polkadot',
|
|
8624
|
+
return _callSuper(this, Manta, ['Manta', 'manta', 'polkadot', sdkCommon.Version.V3]);
|
|
8573
8625
|
}
|
|
8574
8626
|
_inherits(Manta, _ParachainNode);
|
|
8575
8627
|
return _createClass(Manta, [{
|
|
@@ -8621,7 +8673,7 @@ Manta.NATIVE_ASSET_ID = 1n;
|
|
|
8621
8673
|
var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
|
|
8622
8674
|
function Moonbeam() {
|
|
8623
8675
|
_classCallCheck(this, Moonbeam);
|
|
8624
|
-
return _callSuper(this, Moonbeam, ['Moonbeam', 'moonbeam', 'polkadot',
|
|
8676
|
+
return _callSuper(this, Moonbeam, ['Moonbeam', 'moonbeam', 'polkadot', sdkCommon.Version.V4]);
|
|
8625
8677
|
}
|
|
8626
8678
|
_inherits(Moonbeam, _ParachainNode);
|
|
8627
8679
|
return _createClass(Moonbeam, [{
|
|
@@ -8693,7 +8745,7 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8693
8745
|
var Moonriver = /*#__PURE__*/function (_ParachainNode) {
|
|
8694
8746
|
function Moonriver() {
|
|
8695
8747
|
_classCallCheck(this, Moonriver);
|
|
8696
|
-
return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama',
|
|
8748
|
+
return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama', sdkCommon.Version.V4]);
|
|
8697
8749
|
}
|
|
8698
8750
|
_inherits(Moonriver, _ParachainNode);
|
|
8699
8751
|
return _createClass(Moonriver, [{
|
|
@@ -8744,7 +8796,7 @@ var Moonriver = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8744
8796
|
var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
8745
8797
|
function Mythos() {
|
|
8746
8798
|
_classCallCheck(this, Mythos);
|
|
8747
|
-
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot',
|
|
8799
|
+
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', sdkCommon.Version.V4]);
|
|
8748
8800
|
}
|
|
8749
8801
|
_inherits(Mythos, _ParachainNode);
|
|
8750
8802
|
return _createClass(Mythos, [{
|
|
@@ -8801,7 +8853,7 @@ var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8801
8853
|
var NeuroWeb = /*#__PURE__*/function (_ParachainNode) {
|
|
8802
8854
|
function NeuroWeb() {
|
|
8803
8855
|
_classCallCheck(this, NeuroWeb);
|
|
8804
|
-
return _callSuper(this, NeuroWeb, ['NeuroWeb', 'neuroweb', 'polkadot',
|
|
8856
|
+
return _callSuper(this, NeuroWeb, ['NeuroWeb', 'neuroweb', 'polkadot', sdkCommon.Version.V4]);
|
|
8805
8857
|
}
|
|
8806
8858
|
_inherits(NeuroWeb, _ParachainNode);
|
|
8807
8859
|
return _createClass(NeuroWeb, [{
|
|
@@ -8815,7 +8867,7 @@ var NeuroWeb = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8815
8867
|
var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
8816
8868
|
function Nodle() {
|
|
8817
8869
|
_classCallCheck(this, Nodle);
|
|
8818
|
-
return _callSuper(this, Nodle, ['Nodle', 'nodle', 'polkadot',
|
|
8870
|
+
return _callSuper(this, Nodle, ['Nodle', 'nodle', 'polkadot', sdkCommon.Version.V4]);
|
|
8819
8871
|
}
|
|
8820
8872
|
_inherits(Nodle, _ParachainNode);
|
|
8821
8873
|
return _createClass(Nodle, [{
|
|
@@ -8842,7 +8894,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8842
8894
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
8843
8895
|
function Peaq() {
|
|
8844
8896
|
_classCallCheck(this, Peaq);
|
|
8845
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot',
|
|
8897
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', sdkCommon.Version.V4]);
|
|
8846
8898
|
}
|
|
8847
8899
|
_inherits(Peaq, _ParachainNode);
|
|
8848
8900
|
return _createClass(Peaq, [{
|
|
@@ -8893,7 +8945,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8893
8945
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
8894
8946
|
function Pendulum() {
|
|
8895
8947
|
_classCallCheck(this, Pendulum);
|
|
8896
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot',
|
|
8948
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', sdkCommon.Version.V3]);
|
|
8897
8949
|
}
|
|
8898
8950
|
_inherits(Pendulum, _ParachainNode);
|
|
8899
8951
|
return _createClass(Pendulum, [{
|
|
@@ -8926,7 +8978,7 @@ var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8926
8978
|
var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
8927
8979
|
function PeopleKusama() {
|
|
8928
8980
|
_classCallCheck(this, PeopleKusama);
|
|
8929
|
-
return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama',
|
|
8981
|
+
return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama', sdkCommon.Version.V4]);
|
|
8930
8982
|
}
|
|
8931
8983
|
_inherits(PeopleKusama, _ParachainNode);
|
|
8932
8984
|
return _createClass(PeopleKusama, [{
|
|
@@ -8953,7 +9005,7 @@ var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8953
9005
|
var PeoplePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
8954
9006
|
function PeoplePolkadot() {
|
|
8955
9007
|
_classCallCheck(this, PeoplePolkadot);
|
|
8956
|
-
return _callSuper(this, PeoplePolkadot, ['PeoplePolkadot', 'polkadotPeople', 'polkadot',
|
|
9008
|
+
return _callSuper(this, PeoplePolkadot, ['PeoplePolkadot', 'polkadotPeople', 'polkadot', sdkCommon.Version.V4]);
|
|
8957
9009
|
}
|
|
8958
9010
|
_inherits(PeoplePolkadot, _ParachainNode);
|
|
8959
9011
|
return _createClass(PeoplePolkadot, [{
|
|
@@ -9038,7 +9090,7 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
9038
9090
|
if (isMultiLocationDestination) {
|
|
9039
9091
|
throw new InvalidParameterError('Multilocation destinations are not supported for specific transfer you are trying to create. In special cases such as xTokens or xTransfer pallet try using address multilocation instead (for both destination and address in same multilocation set (eg. X2 - Parachain, Address). For further assistance please open issue in our repository.');
|
|
9040
9092
|
}
|
|
9041
|
-
var version =
|
|
9093
|
+
var version = sdkCommon.Version.V3;
|
|
9042
9094
|
var multiAssets = [createMultiAsset(version, asset.amount, {
|
|
9043
9095
|
parents: sdkCommon.Parents.ZERO,
|
|
9044
9096
|
interior: 'Here'
|
|
@@ -9064,7 +9116,7 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
9064
9116
|
var Phala = /*#__PURE__*/function (_ParachainNode) {
|
|
9065
9117
|
function Phala() {
|
|
9066
9118
|
_classCallCheck(this, Phala);
|
|
9067
|
-
return _callSuper(this, Phala, ['Phala', 'phala', 'polkadot',
|
|
9119
|
+
return _callSuper(this, Phala, ['Phala', 'phala', 'polkadot', sdkCommon.Version.V3]);
|
|
9068
9120
|
}
|
|
9069
9121
|
_inherits(Phala, _ParachainNode);
|
|
9070
9122
|
return _createClass(Phala, [{
|
|
@@ -9106,7 +9158,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9106
9158
|
var Quartz = /*#__PURE__*/function (_ParachainNode) {
|
|
9107
9159
|
function Quartz() {
|
|
9108
9160
|
_classCallCheck(this, Quartz);
|
|
9109
|
-
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama',
|
|
9161
|
+
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', sdkCommon.Version.V4]);
|
|
9110
9162
|
}
|
|
9111
9163
|
_inherits(Quartz, _ParachainNode);
|
|
9112
9164
|
return _createClass(Quartz, [{
|
|
@@ -9128,7 +9180,7 @@ Quartz.NATIVE_ASSET_ID = 0;
|
|
|
9128
9180
|
var RobonomicsKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
9129
9181
|
function RobonomicsKusama() {
|
|
9130
9182
|
_classCallCheck(this, RobonomicsKusama);
|
|
9131
|
-
return _callSuper(this, RobonomicsKusama, ['RobonomicsKusama', 'robonomics', 'kusama',
|
|
9183
|
+
return _callSuper(this, RobonomicsKusama, ['RobonomicsKusama', 'robonomics', 'kusama', sdkCommon.Version.V3]);
|
|
9132
9184
|
}
|
|
9133
9185
|
_inherits(RobonomicsKusama, _ParachainNode);
|
|
9134
9186
|
return _createClass(RobonomicsKusama, [{
|
|
@@ -9147,7 +9199,7 @@ var RobonomicsKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9147
9199
|
var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
9148
9200
|
function RobonomicsPolkadot() {
|
|
9149
9201
|
_classCallCheck(this, RobonomicsPolkadot);
|
|
9150
|
-
return _callSuper(this, RobonomicsPolkadot, ['RobonomicsPolkadot', 'robonomics', 'polkadot',
|
|
9202
|
+
return _callSuper(this, RobonomicsPolkadot, ['RobonomicsPolkadot', 'robonomics', 'polkadot', sdkCommon.Version.V3]);
|
|
9151
9203
|
}
|
|
9152
9204
|
_inherits(RobonomicsPolkadot, _ParachainNode);
|
|
9153
9205
|
return _createClass(RobonomicsPolkadot, [{
|
|
@@ -9185,7 +9237,7 @@ var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9185
9237
|
var Shiden = /*#__PURE__*/function (_ParachainNode) {
|
|
9186
9238
|
function Shiden() {
|
|
9187
9239
|
_classCallCheck(this, Shiden);
|
|
9188
|
-
return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama',
|
|
9240
|
+
return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama', sdkCommon.Version.V4]);
|
|
9189
9241
|
}
|
|
9190
9242
|
_inherits(Shiden, _ParachainNode);
|
|
9191
9243
|
return _createClass(Shiden, [{
|
|
@@ -9217,7 +9269,7 @@ var Shiden = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9217
9269
|
var Subsocial = /*#__PURE__*/function (_ParachainNode) {
|
|
9218
9270
|
function Subsocial() {
|
|
9219
9271
|
_classCallCheck(this, Subsocial);
|
|
9220
|
-
return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot',
|
|
9272
|
+
return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot', sdkCommon.Version.V3]);
|
|
9221
9273
|
}
|
|
9222
9274
|
_inherits(Subsocial, _ParachainNode);
|
|
9223
9275
|
return _createClass(Subsocial, [{
|
|
@@ -9239,7 +9291,7 @@ var Subsocial = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9239
9291
|
var Unique = /*#__PURE__*/function (_ParachainNode) {
|
|
9240
9292
|
function Unique() {
|
|
9241
9293
|
_classCallCheck(this, Unique);
|
|
9242
|
-
return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot',
|
|
9294
|
+
return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot', sdkCommon.Version.V4]);
|
|
9243
9295
|
}
|
|
9244
9296
|
_inherits(Unique, _ParachainNode);
|
|
9245
9297
|
return _createClass(Unique, [{
|
|
@@ -9266,7 +9318,7 @@ Unique.NATIVE_ASSET_ID = 0;
|
|
|
9266
9318
|
var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
|
|
9267
9319
|
function Zeitgeist() {
|
|
9268
9320
|
_classCallCheck(this, Zeitgeist);
|
|
9269
|
-
return _callSuper(this, Zeitgeist, ['Zeitgeist', 'zeitgeist', 'polkadot',
|
|
9321
|
+
return _callSuper(this, Zeitgeist, ['Zeitgeist', 'zeitgeist', 'polkadot', sdkCommon.Version.V3]);
|
|
9270
9322
|
}
|
|
9271
9323
|
_inherits(Zeitgeist, _ParachainNode);
|
|
9272
9324
|
return _createClass(Zeitgeist, [{
|
|
@@ -9393,7 +9445,7 @@ var buildClaimAssetsInput = function buildClaimAssetsInput(_ref) {
|
|
|
9393
9445
|
multiAssets = _ref.multiAssets,
|
|
9394
9446
|
address = _ref.address,
|
|
9395
9447
|
_ref$version = _ref.version,
|
|
9396
|
-
version = _ref$version === void 0 ?
|
|
9448
|
+
version = _ref$version === void 0 ? sdkCommon.Version.V4 : _ref$version;
|
|
9397
9449
|
return {
|
|
9398
9450
|
assets: _defineProperty({}, version, multiAssets),
|
|
9399
9451
|
beneficiary: _defineProperty({}, version, buildBeneficiaryInput(api, address))
|
|
@@ -10261,7 +10313,6 @@ exports.determineRelayChain = determineRelayChain;
|
|
|
10261
10313
|
exports.dryRun = dryRun;
|
|
10262
10314
|
exports.dryRunOrigin = dryRunOrigin;
|
|
10263
10315
|
exports.encodeSs58 = encodeSs58;
|
|
10264
|
-
exports.generateAddressMultiLocationV4 = generateAddressMultiLocationV4;
|
|
10265
10316
|
exports.getAssetBalance = getAssetBalance;
|
|
10266
10317
|
exports.getAssetBalanceInternal = getAssetBalanceInternal;
|
|
10267
10318
|
exports.getBalanceForeign = getBalanceForeign;
|