@paraspell/sdk-core 10.4.3 → 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 +238 -241
- package/dist/index.d.ts +11 -24
- package/dist/index.mjs +223 -225
- 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, [{
|
|
@@ -6725,8 +6709,7 @@ xcm, maxWeight) {
|
|
|
6725
6709
|
|
|
6726
6710
|
var createExecuteExchangeXcm = function createExecuteExchangeXcm(input, weight, originExecutionFee, destExecutionFee) {
|
|
6727
6711
|
var api = input.api,
|
|
6728
|
-
|
|
6729
|
-
version = _input$version === void 0 ? exports.Version.V4 : _input$version,
|
|
6712
|
+
version = input.version,
|
|
6730
6713
|
asset = input.asset,
|
|
6731
6714
|
scenario = input.scenario,
|
|
6732
6715
|
destination = input.destination,
|
|
@@ -6838,25 +6821,44 @@ var createExecuteXcm = function createExecuteXcm(input, executionFee, version) {
|
|
|
6838
6821
|
version: version,
|
|
6839
6822
|
paraId: paraIdTo
|
|
6840
6823
|
});
|
|
6841
|
-
if (!asset.multiLocation ||
|
|
6842
|
-
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), "
|
|
6824
|
+
if (!assets.isForeignAsset(asset) || !asset.multiLocation || !asset.assetId) {
|
|
6825
|
+
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is missing multiLocation or assetId"));
|
|
6826
|
+
}
|
|
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"));
|
|
6843
6829
|
}
|
|
6844
6830
|
var assetML = transformMultiLocation(asset.multiLocation);
|
|
6845
6831
|
var feeML = transformMultiLocation((_feeAsset$multiLocati = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.multiLocation) !== null && _feeAsset$multiLocati !== void 0 ? _feeAsset$multiLocati : asset.multiLocation);
|
|
6846
6832
|
var sameFeeAsset = feeAsset && assets.isAssetEqual(asset, feeAsset);
|
|
6847
6833
|
var amountWithoutFee = BigInt(asset.amount) - executionFee;
|
|
6848
|
-
var
|
|
6849
|
-
|
|
6834
|
+
var assetsToWithdraw = [{
|
|
6835
|
+
assetId: asset.assetId,
|
|
6836
|
+
multiasset: {
|
|
6850
6837
|
id: assetML,
|
|
6851
6838
|
fun: {
|
|
6852
6839
|
Fungible: BigInt(asset.amount)
|
|
6853
6840
|
}
|
|
6854
|
-
}
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
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
|
+
}
|
|
6858
6851
|
}
|
|
6859
|
-
}
|
|
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
|
+
})
|
|
6860
6862
|
}, {
|
|
6861
6863
|
BuyExecution: {
|
|
6862
6864
|
fees: {
|
|
@@ -6999,13 +7001,12 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6999
7001
|
function AssetHubPolkadot() {
|
|
7000
7002
|
var _this;
|
|
7001
7003
|
_classCallCheck(this, AssetHubPolkadot);
|
|
7002
|
-
_this = _callSuper(this, AssetHubPolkadot, ['AssetHubPolkadot', 'PolkadotAssetHub', 'polkadot',
|
|
7004
|
+
_this = _callSuper(this, AssetHubPolkadot, ['AssetHubPolkadot', 'PolkadotAssetHub', 'polkadot', sdkCommon.Version.V4]);
|
|
7003
7005
|
_this.handleLocalReserveTransfer = function (input) {
|
|
7004
7006
|
var useDOTAsFeeAsset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7005
7007
|
var api = input.api,
|
|
7006
7008
|
scenario = input.scenario,
|
|
7007
|
-
|
|
7008
|
-
version = _input$version === void 0 ? exports.Version.V4 : _input$version,
|
|
7009
|
+
version = input.version,
|
|
7009
7010
|
destination = input.destination,
|
|
7010
7011
|
asset = input.asset,
|
|
7011
7012
|
paraIdTo = input.paraIdTo;
|
|
@@ -7037,42 +7038,46 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7037
7038
|
return _createClass(AssetHubPolkadot, [{
|
|
7038
7039
|
key: "handleBridgeTransfer",
|
|
7039
7040
|
value: function handleBridgeTransfer(input, targetChain) {
|
|
7040
|
-
var
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
}
|
|
7050
|
-
};
|
|
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') {
|
|
7051
7050
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7052
|
-
header: createBridgePolkadotXcmDest(
|
|
7053
|
-
addressSelection:
|
|
7054
|
-
|
|
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)
|
|
7055
7061
|
});
|
|
7056
7062
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited');
|
|
7057
|
-
} else if (targetChain === 'Polkadot' && ((
|
|
7058
|
-
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') {
|
|
7059
7064
|
var _modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7060
|
-
header: createBridgePolkadotXcmDest(
|
|
7061
|
-
currencySelection: createVersionedMultiAssets(
|
|
7065
|
+
header: createBridgePolkadotXcmDest(version, targetChain, destination, paraIdTo),
|
|
7066
|
+
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
7062
7067
|
});
|
|
7063
7068
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(_modifiedInput, 'limited_reserve_transfer_assets', 'Unlimited');
|
|
7064
7069
|
}
|
|
7065
|
-
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));
|
|
7066
7071
|
}
|
|
7067
7072
|
}, {
|
|
7068
7073
|
key: "handleEthBridgeNativeTransfer",
|
|
7069
7074
|
value: function () {
|
|
7070
7075
|
var _handleEthBridgeNativeTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
7071
|
-
var api,
|
|
7076
|
+
var api, version, scenario, destination, senderAddress, address, paraIdTo, asset, bridgeStatus, messageId, multiLocation, call;
|
|
7072
7077
|
return _regenerator().w(function (_context) {
|
|
7073
7078
|
while (1) switch (_context.n) {
|
|
7074
7079
|
case 0:
|
|
7075
|
-
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;
|
|
7076
7081
|
_context.n = 1;
|
|
7077
7082
|
return getBridgeStatus(api.clone());
|
|
7078
7083
|
case 1:
|
|
@@ -7155,11 +7160,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7155
7160
|
key: "handleEthBridgeTransfer",
|
|
7156
7161
|
value: function () {
|
|
7157
7162
|
var _handleEthBridgeTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
|
|
7158
|
-
var api, scenario, destination, paraIdTo, address, asset, bridgeStatus, modifiedInput;
|
|
7163
|
+
var api, scenario, destination, paraIdTo, address, asset, version, bridgeStatus, modifiedInput;
|
|
7159
7164
|
return _regenerator().w(function (_context2) {
|
|
7160
7165
|
while (1) switch (_context2.n) {
|
|
7161
7166
|
case 0:
|
|
7162
|
-
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;
|
|
7163
7168
|
_context2.n = 1;
|
|
7164
7169
|
return getBridgeStatus(api.clone());
|
|
7165
7170
|
case 1:
|
|
@@ -7198,7 +7203,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7198
7203
|
version: this.version,
|
|
7199
7204
|
paraId: paraIdTo
|
|
7200
7205
|
}),
|
|
7201
|
-
currencySelection: createVersionedMultiAssets(
|
|
7206
|
+
currencySelection: createVersionedMultiAssets(version, asset.amount, asset.multiLocation)
|
|
7202
7207
|
});
|
|
7203
7208
|
return _context2.a(2, PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited'));
|
|
7204
7209
|
}
|
|
@@ -7217,8 +7222,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7217
7222
|
asset = input.asset,
|
|
7218
7223
|
scenario = input.scenario,
|
|
7219
7224
|
destination = input.destination,
|
|
7220
|
-
paraIdTo = input.paraIdTo
|
|
7221
|
-
|
|
7225
|
+
paraIdTo = input.paraIdTo,
|
|
7226
|
+
version = input.version;
|
|
7222
7227
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
7223
7228
|
var customMultiLocation = {
|
|
7224
7229
|
parents: sdkCommon.Parents.ONE,
|
|
@@ -7247,8 +7252,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7247
7252
|
value: function patchInput(input) {
|
|
7248
7253
|
var asset = input.asset,
|
|
7249
7254
|
destination = input.destination,
|
|
7250
|
-
_input$
|
|
7251
|
-
version = _input$
|
|
7255
|
+
_input$version = input.version,
|
|
7256
|
+
version = _input$version === void 0 ? this.version : _input$version;
|
|
7252
7257
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
7253
7258
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7254
7259
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -7267,11 +7272,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7267
7272
|
key: "handleExecuteTransfer",
|
|
7268
7273
|
value: function () {
|
|
7269
7274
|
var _handleExecuteTransfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(input) {
|
|
7270
|
-
var api, senderAddress, asset, feeAsset,
|
|
7275
|
+
var api, senderAddress, asset, feeAsset, version, decimals, multiplier, base, scaledMultiplier, MIN_FEE, call, dryRunResult, paddedFee, xcm, weight;
|
|
7271
7276
|
return _regenerator().w(function (_context3) {
|
|
7272
7277
|
while (1) switch (_context3.n) {
|
|
7273
7278
|
case 0:
|
|
7274
|
-
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;
|
|
7275
7280
|
if (senderAddress) {
|
|
7276
7281
|
_context3.n = 1;
|
|
7277
7282
|
break;
|
|
@@ -7474,7 +7479,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7474
7479
|
var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
7475
7480
|
function Astar() {
|
|
7476
7481
|
_classCallCheck(this, Astar);
|
|
7477
|
-
return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot',
|
|
7482
|
+
return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot', sdkCommon.Version.V4]);
|
|
7478
7483
|
}
|
|
7479
7484
|
_inherits(Astar, _ParachainNode);
|
|
7480
7485
|
return _createClass(Astar, [{
|
|
@@ -7527,7 +7532,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7527
7532
|
var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
7528
7533
|
function Basilisk() {
|
|
7529
7534
|
_classCallCheck(this, Basilisk);
|
|
7530
|
-
return _callSuper(this, Basilisk, ['Basilisk', 'basilisk', 'kusama',
|
|
7535
|
+
return _callSuper(this, Basilisk, ['Basilisk', 'basilisk', 'kusama', sdkCommon.Version.V4]);
|
|
7531
7536
|
}
|
|
7532
7537
|
_inherits(Basilisk, _ParachainNode);
|
|
7533
7538
|
return _createClass(Basilisk, [{
|
|
@@ -7555,7 +7560,7 @@ var Basilisk = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7555
7560
|
var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7556
7561
|
function BifrostKusama() {
|
|
7557
7562
|
_classCallCheck(this, BifrostKusama);
|
|
7558
|
-
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama',
|
|
7563
|
+
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama', sdkCommon.Version.V4]);
|
|
7559
7564
|
}
|
|
7560
7565
|
_inherits(BifrostKusama, _ParachainNode);
|
|
7561
7566
|
return _createClass(BifrostKusama, [{
|
|
@@ -7574,7 +7579,7 @@ var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7574
7579
|
var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7575
7580
|
function BifrostPolkadot() {
|
|
7576
7581
|
_classCallCheck(this, BifrostPolkadot);
|
|
7577
|
-
return _callSuper(this, BifrostPolkadot, ['BifrostPolkadot', 'bifrost', 'polkadot',
|
|
7582
|
+
return _callSuper(this, BifrostPolkadot, ['BifrostPolkadot', 'bifrost', 'polkadot', sdkCommon.Version.V4]);
|
|
7578
7583
|
}
|
|
7579
7584
|
_inherits(BifrostPolkadot, _ParachainNode);
|
|
7580
7585
|
return _createClass(BifrostPolkadot, [{
|
|
@@ -7676,7 +7681,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7676
7681
|
var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7677
7682
|
function BridgeHubKusama() {
|
|
7678
7683
|
_classCallCheck(this, BridgeHubKusama);
|
|
7679
|
-
return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama',
|
|
7684
|
+
return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama', sdkCommon.Version.V4]);
|
|
7680
7685
|
}
|
|
7681
7686
|
_inherits(BridgeHubKusama, _ParachainNode);
|
|
7682
7687
|
return _createClass(BridgeHubKusama, [{
|
|
@@ -7703,7 +7708,7 @@ var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7703
7708
|
var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7704
7709
|
function BridgeHubPolkadot() {
|
|
7705
7710
|
_classCallCheck(this, BridgeHubPolkadot);
|
|
7706
|
-
return _callSuper(this, BridgeHubPolkadot, ['BridgeHubPolkadot', 'polkadotBridgeHub', 'polkadot',
|
|
7711
|
+
return _callSuper(this, BridgeHubPolkadot, ['BridgeHubPolkadot', 'polkadotBridgeHub', 'polkadot', sdkCommon.Version.V4]);
|
|
7707
7712
|
}
|
|
7708
7713
|
_inherits(BridgeHubPolkadot, _ParachainNode);
|
|
7709
7714
|
return _createClass(BridgeHubPolkadot, [{
|
|
@@ -7730,7 +7735,7 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7730
7735
|
var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
|
|
7731
7736
|
function Centrifuge() {
|
|
7732
7737
|
_classCallCheck(this, Centrifuge);
|
|
7733
|
-
return _callSuper(this, Centrifuge, ['Centrifuge', 'centrifuge', 'polkadot',
|
|
7738
|
+
return _callSuper(this, Centrifuge, ['Centrifuge', 'centrifuge', 'polkadot', sdkCommon.Version.V4]);
|
|
7734
7739
|
}
|
|
7735
7740
|
_inherits(Centrifuge, _ParachainNode);
|
|
7736
7741
|
return _createClass(Centrifuge, [{
|
|
@@ -7781,7 +7786,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7781
7786
|
var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
7782
7787
|
function Collectives() {
|
|
7783
7788
|
_classCallCheck(this, Collectives);
|
|
7784
|
-
return _callSuper(this, Collectives, ['Collectives', 'polkadotCollectives', 'polkadot',
|
|
7789
|
+
return _callSuper(this, Collectives, ['Collectives', 'polkadotCollectives', 'polkadot', sdkCommon.Version.V4]);
|
|
7785
7790
|
}
|
|
7786
7791
|
_inherits(Collectives, _ParachainNode);
|
|
7787
7792
|
return _createClass(Collectives, [{
|
|
@@ -7812,7 +7817,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7812
7817
|
var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
|
|
7813
7818
|
function ComposableFinance() {
|
|
7814
7819
|
_classCallCheck(this, ComposableFinance);
|
|
7815
|
-
return _callSuper(this, ComposableFinance, ['ComposableFinance', 'composable', 'polkadot',
|
|
7820
|
+
return _callSuper(this, ComposableFinance, ['ComposableFinance', 'composable', 'polkadot', sdkCommon.Version.V3]);
|
|
7816
7821
|
}
|
|
7817
7822
|
_inherits(ComposableFinance, _ParachainNode);
|
|
7818
7823
|
return _createClass(ComposableFinance, [{
|
|
@@ -7830,7 +7835,7 @@ var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7830
7835
|
var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
7831
7836
|
function CoretimeKusama() {
|
|
7832
7837
|
_classCallCheck(this, CoretimeKusama);
|
|
7833
|
-
return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama',
|
|
7838
|
+
return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama', sdkCommon.Version.V4]);
|
|
7834
7839
|
}
|
|
7835
7840
|
_inherits(CoretimeKusama, _ParachainNode);
|
|
7836
7841
|
return _createClass(CoretimeKusama, [{
|
|
@@ -7855,7 +7860,7 @@ var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7855
7860
|
var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
7856
7861
|
function CoretimePolkadot() {
|
|
7857
7862
|
_classCallCheck(this, CoretimePolkadot);
|
|
7858
|
-
return _callSuper(this, CoretimePolkadot, ['CoretimePolkadot', 'polkadotCoretime', 'polkadot',
|
|
7863
|
+
return _callSuper(this, CoretimePolkadot, ['CoretimePolkadot', 'polkadotCoretime', 'polkadot', sdkCommon.Version.V4]);
|
|
7859
7864
|
}
|
|
7860
7865
|
_inherits(CoretimePolkadot, _ParachainNode);
|
|
7861
7866
|
return _createClass(CoretimePolkadot, [{
|
|
@@ -7879,7 +7884,7 @@ var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7879
7884
|
var Crab = /*#__PURE__*/function (_ParachainNode) {
|
|
7880
7885
|
function Crab() {
|
|
7881
7886
|
_classCallCheck(this, Crab);
|
|
7882
|
-
return _callSuper(this, Crab, ['Crab', 'crab', 'kusama',
|
|
7887
|
+
return _callSuper(this, Crab, ['Crab', 'crab', 'kusama', sdkCommon.Version.V4]);
|
|
7883
7888
|
}
|
|
7884
7889
|
_inherits(Crab, _ParachainNode);
|
|
7885
7890
|
return _createClass(Crab, [{
|
|
@@ -7923,7 +7928,7 @@ var Crab = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7923
7928
|
var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
7924
7929
|
function Crust() {
|
|
7925
7930
|
_classCallCheck(this, Crust);
|
|
7926
|
-
return _callSuper(this, Crust, ['Crust', 'crustParachain', 'polkadot',
|
|
7931
|
+
return _callSuper(this, Crust, ['Crust', 'crustParachain', 'polkadot', sdkCommon.Version.V3]);
|
|
7927
7932
|
}
|
|
7928
7933
|
_inherits(Crust, _ParachainNode);
|
|
7929
7934
|
return _createClass(Crust, [{
|
|
@@ -7976,7 +7981,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7976
7981
|
var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
|
|
7977
7982
|
function CrustShadow() {
|
|
7978
7983
|
_classCallCheck(this, CrustShadow);
|
|
7979
|
-
return _callSuper(this, CrustShadow, ['CrustShadow', 'shadow', 'kusama',
|
|
7984
|
+
return _callSuper(this, CrustShadow, ['CrustShadow', 'shadow', 'kusama', sdkCommon.Version.V3]);
|
|
7980
7985
|
}
|
|
7981
7986
|
_inherits(CrustShadow, _ParachainNode);
|
|
7982
7987
|
return _createClass(CrustShadow, [{
|
|
@@ -8010,7 +8015,7 @@ var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8010
8015
|
var Curio = /*#__PURE__*/function (_ParachainNode) {
|
|
8011
8016
|
function Curio() {
|
|
8012
8017
|
_classCallCheck(this, Curio);
|
|
8013
|
-
return _callSuper(this, Curio, ['Curio', 'curio', 'kusama',
|
|
8018
|
+
return _callSuper(this, Curio, ['Curio', 'curio', 'kusama', sdkCommon.Version.V3]);
|
|
8014
8019
|
}
|
|
8015
8020
|
_inherits(Curio, _ParachainNode);
|
|
8016
8021
|
return _createClass(Curio, [{
|
|
@@ -8030,7 +8035,7 @@ var Curio = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8030
8035
|
var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
8031
8036
|
function Darwinia() {
|
|
8032
8037
|
_classCallCheck(this, Darwinia);
|
|
8033
|
-
return _callSuper(this, Darwinia, ['Darwinia', 'darwinia', 'polkadot',
|
|
8038
|
+
return _callSuper(this, Darwinia, ['Darwinia', 'darwinia', 'polkadot', sdkCommon.Version.V4]);
|
|
8034
8039
|
}
|
|
8035
8040
|
_inherits(Darwinia, _ParachainNode);
|
|
8036
8041
|
return _createClass(Darwinia, [{
|
|
@@ -8087,7 +8092,7 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8087
8092
|
var Encointer = /*#__PURE__*/function (_ParachainNode) {
|
|
8088
8093
|
function Encointer() {
|
|
8089
8094
|
_classCallCheck(this, Encointer);
|
|
8090
|
-
return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama',
|
|
8095
|
+
return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama', sdkCommon.Version.V4]);
|
|
8091
8096
|
}
|
|
8092
8097
|
_inherits(Encointer, _ParachainNode);
|
|
8093
8098
|
return _createClass(Encointer, [{
|
|
@@ -8114,7 +8119,7 @@ var Encointer = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8114
8119
|
var Heima = /*#__PURE__*/function (_ParachainNode) {
|
|
8115
8120
|
function Heima() {
|
|
8116
8121
|
_classCallCheck(this, Heima);
|
|
8117
|
-
return _callSuper(this, Heima, ['Heima', 'litentry', 'polkadot',
|
|
8122
|
+
return _callSuper(this, Heima, ['Heima', 'litentry', 'polkadot', sdkCommon.Version.V4]);
|
|
8118
8123
|
}
|
|
8119
8124
|
_inherits(Heima, _ParachainNode);
|
|
8120
8125
|
return _createClass(Heima, [{
|
|
@@ -8180,10 +8185,8 @@ var createTypeAndThenTransfer = function createTypeAndThenTransfer(_ref, version
|
|
|
8180
8185
|
})]),
|
|
8181
8186
|
assets_transfer_type: transferType,
|
|
8182
8187
|
remote_fees_id: _defineProperty({}, version, {
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
interior: 'Here'
|
|
8186
|
-
}
|
|
8188
|
+
parents: scenario === 'ParaToPara' ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO,
|
|
8189
|
+
interior: 'Here'
|
|
8187
8190
|
}),
|
|
8188
8191
|
fees_transfer_type: transferType,
|
|
8189
8192
|
custom_xcm_on_dest: createCustomXcmPolimec(api, address, scenario, destination, paraIdTo, version),
|
|
@@ -8205,10 +8208,8 @@ var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scena
|
|
|
8205
8208
|
BuyExecution: {
|
|
8206
8209
|
fees: {
|
|
8207
8210
|
id: {
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
interior: 'Here'
|
|
8211
|
-
}
|
|
8211
|
+
parents: sdkCommon.Parents.ONE,
|
|
8212
|
+
interior: 'Here'
|
|
8212
8213
|
},
|
|
8213
8214
|
fun: {
|
|
8214
8215
|
Fungible: GAS_LIMIT
|
|
@@ -8238,7 +8239,7 @@ var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scena
|
|
|
8238
8239
|
var Polimec = /*#__PURE__*/function (_ParachainNode) {
|
|
8239
8240
|
function Polimec() {
|
|
8240
8241
|
_classCallCheck(this, Polimec);
|
|
8241
|
-
return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot',
|
|
8242
|
+
return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', sdkCommon.Version.V4]);
|
|
8242
8243
|
}
|
|
8243
8244
|
_inherits(Polimec, _ParachainNode);
|
|
8244
8245
|
return _createClass(Polimec, [{
|
|
@@ -8340,7 +8341,7 @@ var createCustomXcmAh = function createCustomXcmAh(_ref, version) {
|
|
|
8340
8341
|
var Hydration = /*#__PURE__*/function (_ParachainNode) {
|
|
8341
8342
|
function Hydration() {
|
|
8342
8343
|
_classCallCheck(this, Hydration);
|
|
8343
|
-
return _callSuper(this, Hydration, ['Hydration', 'hydradx', 'polkadot',
|
|
8344
|
+
return _callSuper(this, Hydration, ['Hydration', 'hydradx', 'polkadot', sdkCommon.Version.V4]);
|
|
8344
8345
|
}
|
|
8345
8346
|
_inherits(Hydration, _ParachainNode);
|
|
8346
8347
|
return _createClass(Hydration, [{
|
|
@@ -8351,22 +8352,19 @@ var Hydration = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8351
8352
|
scenario = input.scenario,
|
|
8352
8353
|
version = input.version,
|
|
8353
8354
|
destination = input.destination;
|
|
8354
|
-
var versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V3;
|
|
8355
8355
|
var call = {
|
|
8356
8356
|
module: 'PolkadotXcm',
|
|
8357
8357
|
method: 'transfer_assets_using_type_and_then',
|
|
8358
8358
|
parameters: {
|
|
8359
|
-
dest: this.createVersionedDestination(scenario,
|
|
8360
|
-
assets: _defineProperty({},
|
|
8359
|
+
dest: this.createVersionedDestination(scenario, version, destination, getParaId('AssetHubPolkadot')),
|
|
8360
|
+
assets: _defineProperty({}, version, [createMultiAsset(version, asset.amount, DOT_MULTILOCATION)]),
|
|
8361
8361
|
assets_transfer_type: 'DestinationReserve',
|
|
8362
|
-
remote_fees_id: _defineProperty({},
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
interior: 'Here'
|
|
8366
|
-
}
|
|
8362
|
+
remote_fees_id: _defineProperty({}, version, {
|
|
8363
|
+
parents: sdkCommon.Parents.ONE,
|
|
8364
|
+
interior: 'Here'
|
|
8367
8365
|
}),
|
|
8368
8366
|
fees_transfer_type: 'DestinationReserve',
|
|
8369
|
-
custom_xcm_on_dest: createCustomXcmAh(input,
|
|
8367
|
+
custom_xcm_on_dest: createCustomXcmAh(input, version),
|
|
8370
8368
|
weight_limit: 'Unlimited'
|
|
8371
8369
|
}
|
|
8372
8370
|
};
|
|
@@ -8483,7 +8481,7 @@ Hydration.NATIVE_ASSET_ID = 0;
|
|
|
8483
8481
|
var Interlay = /*#__PURE__*/function (_ParachainNode) {
|
|
8484
8482
|
function Interlay() {
|
|
8485
8483
|
_classCallCheck(this, Interlay);
|
|
8486
|
-
return _callSuper(this, Interlay, ['Interlay', 'interlay', 'polkadot',
|
|
8484
|
+
return _callSuper(this, Interlay, ['Interlay', 'interlay', 'polkadot', sdkCommon.Version.V3]);
|
|
8487
8485
|
}
|
|
8488
8486
|
_inherits(Interlay, _ParachainNode);
|
|
8489
8487
|
return _createClass(Interlay, [{
|
|
@@ -8529,7 +8527,7 @@ var Interlay = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8529
8527
|
var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
8530
8528
|
function Karura() {
|
|
8531
8529
|
_classCallCheck(this, Karura);
|
|
8532
|
-
return _callSuper(this, Karura, ['Karura', 'karura', 'kusama',
|
|
8530
|
+
return _callSuper(this, Karura, ['Karura', 'karura', 'kusama', sdkCommon.Version.V4]);
|
|
8533
8531
|
}
|
|
8534
8532
|
_inherits(Karura, _ParachainNode);
|
|
8535
8533
|
return _createClass(Karura, [{
|
|
@@ -8553,7 +8551,7 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8553
8551
|
var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
8554
8552
|
function KiltSpiritnet() {
|
|
8555
8553
|
_classCallCheck(this, KiltSpiritnet);
|
|
8556
|
-
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot',
|
|
8554
|
+
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', sdkCommon.Version.V4]);
|
|
8557
8555
|
}
|
|
8558
8556
|
_inherits(KiltSpiritnet, _ParachainNode);
|
|
8559
8557
|
return _createClass(KiltSpiritnet, [{
|
|
@@ -8577,7 +8575,7 @@ var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8577
8575
|
var Kintsugi = /*#__PURE__*/function (_ParachainNode) {
|
|
8578
8576
|
function Kintsugi() {
|
|
8579
8577
|
_classCallCheck(this, Kintsugi);
|
|
8580
|
-
return _callSuper(this, Kintsugi, ['Kintsugi', 'kintsugi', 'kusama',
|
|
8578
|
+
return _callSuper(this, Kintsugi, ['Kintsugi', 'kintsugi', 'kusama', sdkCommon.Version.V3]);
|
|
8581
8579
|
}
|
|
8582
8580
|
_inherits(Kintsugi, _ParachainNode);
|
|
8583
8581
|
return _createClass(Kintsugi, [{
|
|
@@ -8623,7 +8621,7 @@ var Kintsugi = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8623
8621
|
var Manta = /*#__PURE__*/function (_ParachainNode) {
|
|
8624
8622
|
function Manta() {
|
|
8625
8623
|
_classCallCheck(this, Manta);
|
|
8626
|
-
return _callSuper(this, Manta, ['Manta', 'manta', 'polkadot',
|
|
8624
|
+
return _callSuper(this, Manta, ['Manta', 'manta', 'polkadot', sdkCommon.Version.V3]);
|
|
8627
8625
|
}
|
|
8628
8626
|
_inherits(Manta, _ParachainNode);
|
|
8629
8627
|
return _createClass(Manta, [{
|
|
@@ -8675,7 +8673,7 @@ Manta.NATIVE_ASSET_ID = 1n;
|
|
|
8675
8673
|
var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
|
|
8676
8674
|
function Moonbeam() {
|
|
8677
8675
|
_classCallCheck(this, Moonbeam);
|
|
8678
|
-
return _callSuper(this, Moonbeam, ['Moonbeam', 'moonbeam', 'polkadot',
|
|
8676
|
+
return _callSuper(this, Moonbeam, ['Moonbeam', 'moonbeam', 'polkadot', sdkCommon.Version.V4]);
|
|
8679
8677
|
}
|
|
8680
8678
|
_inherits(Moonbeam, _ParachainNode);
|
|
8681
8679
|
return _createClass(Moonbeam, [{
|
|
@@ -8747,7 +8745,7 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8747
8745
|
var Moonriver = /*#__PURE__*/function (_ParachainNode) {
|
|
8748
8746
|
function Moonriver() {
|
|
8749
8747
|
_classCallCheck(this, Moonriver);
|
|
8750
|
-
return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama',
|
|
8748
|
+
return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama', sdkCommon.Version.V4]);
|
|
8751
8749
|
}
|
|
8752
8750
|
_inherits(Moonriver, _ParachainNode);
|
|
8753
8751
|
return _createClass(Moonriver, [{
|
|
@@ -8798,7 +8796,7 @@ var Moonriver = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8798
8796
|
var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
8799
8797
|
function Mythos() {
|
|
8800
8798
|
_classCallCheck(this, Mythos);
|
|
8801
|
-
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot',
|
|
8799
|
+
return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', sdkCommon.Version.V4]);
|
|
8802
8800
|
}
|
|
8803
8801
|
_inherits(Mythos, _ParachainNode);
|
|
8804
8802
|
return _createClass(Mythos, [{
|
|
@@ -8855,7 +8853,7 @@ var Mythos = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8855
8853
|
var NeuroWeb = /*#__PURE__*/function (_ParachainNode) {
|
|
8856
8854
|
function NeuroWeb() {
|
|
8857
8855
|
_classCallCheck(this, NeuroWeb);
|
|
8858
|
-
return _callSuper(this, NeuroWeb, ['NeuroWeb', 'neuroweb', 'polkadot',
|
|
8856
|
+
return _callSuper(this, NeuroWeb, ['NeuroWeb', 'neuroweb', 'polkadot', sdkCommon.Version.V4]);
|
|
8859
8857
|
}
|
|
8860
8858
|
_inherits(NeuroWeb, _ParachainNode);
|
|
8861
8859
|
return _createClass(NeuroWeb, [{
|
|
@@ -8869,7 +8867,7 @@ var NeuroWeb = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8869
8867
|
var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
8870
8868
|
function Nodle() {
|
|
8871
8869
|
_classCallCheck(this, Nodle);
|
|
8872
|
-
return _callSuper(this, Nodle, ['Nodle', 'nodle', 'polkadot',
|
|
8870
|
+
return _callSuper(this, Nodle, ['Nodle', 'nodle', 'polkadot', sdkCommon.Version.V4]);
|
|
8873
8871
|
}
|
|
8874
8872
|
_inherits(Nodle, _ParachainNode);
|
|
8875
8873
|
return _createClass(Nodle, [{
|
|
@@ -8896,7 +8894,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8896
8894
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
8897
8895
|
function Peaq() {
|
|
8898
8896
|
_classCallCheck(this, Peaq);
|
|
8899
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot',
|
|
8897
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', sdkCommon.Version.V4]);
|
|
8900
8898
|
}
|
|
8901
8899
|
_inherits(Peaq, _ParachainNode);
|
|
8902
8900
|
return _createClass(Peaq, [{
|
|
@@ -8947,7 +8945,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8947
8945
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
8948
8946
|
function Pendulum() {
|
|
8949
8947
|
_classCallCheck(this, Pendulum);
|
|
8950
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot',
|
|
8948
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', sdkCommon.Version.V3]);
|
|
8951
8949
|
}
|
|
8952
8950
|
_inherits(Pendulum, _ParachainNode);
|
|
8953
8951
|
return _createClass(Pendulum, [{
|
|
@@ -8980,7 +8978,7 @@ var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8980
8978
|
var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
8981
8979
|
function PeopleKusama() {
|
|
8982
8980
|
_classCallCheck(this, PeopleKusama);
|
|
8983
|
-
return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama',
|
|
8981
|
+
return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama', sdkCommon.Version.V4]);
|
|
8984
8982
|
}
|
|
8985
8983
|
_inherits(PeopleKusama, _ParachainNode);
|
|
8986
8984
|
return _createClass(PeopleKusama, [{
|
|
@@ -9007,7 +9005,7 @@ var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9007
9005
|
var PeoplePolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
9008
9006
|
function PeoplePolkadot() {
|
|
9009
9007
|
_classCallCheck(this, PeoplePolkadot);
|
|
9010
|
-
return _callSuper(this, PeoplePolkadot, ['PeoplePolkadot', 'polkadotPeople', 'polkadot',
|
|
9008
|
+
return _callSuper(this, PeoplePolkadot, ['PeoplePolkadot', 'polkadotPeople', 'polkadot', sdkCommon.Version.V4]);
|
|
9011
9009
|
}
|
|
9012
9010
|
_inherits(PeoplePolkadot, _ParachainNode);
|
|
9013
9011
|
return _createClass(PeoplePolkadot, [{
|
|
@@ -9092,7 +9090,7 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
9092
9090
|
if (isMultiLocationDestination) {
|
|
9093
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.');
|
|
9094
9092
|
}
|
|
9095
|
-
var version =
|
|
9093
|
+
var version = sdkCommon.Version.V3;
|
|
9096
9094
|
var multiAssets = [createMultiAsset(version, asset.amount, {
|
|
9097
9095
|
parents: sdkCommon.Parents.ZERO,
|
|
9098
9096
|
interior: 'Here'
|
|
@@ -9118,7 +9116,7 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
9118
9116
|
var Phala = /*#__PURE__*/function (_ParachainNode) {
|
|
9119
9117
|
function Phala() {
|
|
9120
9118
|
_classCallCheck(this, Phala);
|
|
9121
|
-
return _callSuper(this, Phala, ['Phala', 'phala', 'polkadot',
|
|
9119
|
+
return _callSuper(this, Phala, ['Phala', 'phala', 'polkadot', sdkCommon.Version.V3]);
|
|
9122
9120
|
}
|
|
9123
9121
|
_inherits(Phala, _ParachainNode);
|
|
9124
9122
|
return _createClass(Phala, [{
|
|
@@ -9160,7 +9158,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9160
9158
|
var Quartz = /*#__PURE__*/function (_ParachainNode) {
|
|
9161
9159
|
function Quartz() {
|
|
9162
9160
|
_classCallCheck(this, Quartz);
|
|
9163
|
-
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama',
|
|
9161
|
+
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', sdkCommon.Version.V4]);
|
|
9164
9162
|
}
|
|
9165
9163
|
_inherits(Quartz, _ParachainNode);
|
|
9166
9164
|
return _createClass(Quartz, [{
|
|
@@ -9182,7 +9180,7 @@ Quartz.NATIVE_ASSET_ID = 0;
|
|
|
9182
9180
|
var RobonomicsKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
9183
9181
|
function RobonomicsKusama() {
|
|
9184
9182
|
_classCallCheck(this, RobonomicsKusama);
|
|
9185
|
-
return _callSuper(this, RobonomicsKusama, ['RobonomicsKusama', 'robonomics', 'kusama',
|
|
9183
|
+
return _callSuper(this, RobonomicsKusama, ['RobonomicsKusama', 'robonomics', 'kusama', sdkCommon.Version.V3]);
|
|
9186
9184
|
}
|
|
9187
9185
|
_inherits(RobonomicsKusama, _ParachainNode);
|
|
9188
9186
|
return _createClass(RobonomicsKusama, [{
|
|
@@ -9201,7 +9199,7 @@ var RobonomicsKusama = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9201
9199
|
var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
9202
9200
|
function RobonomicsPolkadot() {
|
|
9203
9201
|
_classCallCheck(this, RobonomicsPolkadot);
|
|
9204
|
-
return _callSuper(this, RobonomicsPolkadot, ['RobonomicsPolkadot', 'robonomics', 'polkadot',
|
|
9202
|
+
return _callSuper(this, RobonomicsPolkadot, ['RobonomicsPolkadot', 'robonomics', 'polkadot', sdkCommon.Version.V3]);
|
|
9205
9203
|
}
|
|
9206
9204
|
_inherits(RobonomicsPolkadot, _ParachainNode);
|
|
9207
9205
|
return _createClass(RobonomicsPolkadot, [{
|
|
@@ -9239,7 +9237,7 @@ var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9239
9237
|
var Shiden = /*#__PURE__*/function (_ParachainNode) {
|
|
9240
9238
|
function Shiden() {
|
|
9241
9239
|
_classCallCheck(this, Shiden);
|
|
9242
|
-
return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama',
|
|
9240
|
+
return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama', sdkCommon.Version.V4]);
|
|
9243
9241
|
}
|
|
9244
9242
|
_inherits(Shiden, _ParachainNode);
|
|
9245
9243
|
return _createClass(Shiden, [{
|
|
@@ -9271,7 +9269,7 @@ var Shiden = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9271
9269
|
var Subsocial = /*#__PURE__*/function (_ParachainNode) {
|
|
9272
9270
|
function Subsocial() {
|
|
9273
9271
|
_classCallCheck(this, Subsocial);
|
|
9274
|
-
return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot',
|
|
9272
|
+
return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot', sdkCommon.Version.V3]);
|
|
9275
9273
|
}
|
|
9276
9274
|
_inherits(Subsocial, _ParachainNode);
|
|
9277
9275
|
return _createClass(Subsocial, [{
|
|
@@ -9293,7 +9291,7 @@ var Subsocial = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9293
9291
|
var Unique = /*#__PURE__*/function (_ParachainNode) {
|
|
9294
9292
|
function Unique() {
|
|
9295
9293
|
_classCallCheck(this, Unique);
|
|
9296
|
-
return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot',
|
|
9294
|
+
return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot', sdkCommon.Version.V4]);
|
|
9297
9295
|
}
|
|
9298
9296
|
_inherits(Unique, _ParachainNode);
|
|
9299
9297
|
return _createClass(Unique, [{
|
|
@@ -9320,7 +9318,7 @@ Unique.NATIVE_ASSET_ID = 0;
|
|
|
9320
9318
|
var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
|
|
9321
9319
|
function Zeitgeist() {
|
|
9322
9320
|
_classCallCheck(this, Zeitgeist);
|
|
9323
|
-
return _callSuper(this, Zeitgeist, ['Zeitgeist', 'zeitgeist', 'polkadot',
|
|
9321
|
+
return _callSuper(this, Zeitgeist, ['Zeitgeist', 'zeitgeist', 'polkadot', sdkCommon.Version.V3]);
|
|
9324
9322
|
}
|
|
9325
9323
|
_inherits(Zeitgeist, _ParachainNode);
|
|
9326
9324
|
return _createClass(Zeitgeist, [{
|
|
@@ -9447,7 +9445,7 @@ var buildClaimAssetsInput = function buildClaimAssetsInput(_ref) {
|
|
|
9447
9445
|
multiAssets = _ref.multiAssets,
|
|
9448
9446
|
address = _ref.address,
|
|
9449
9447
|
_ref$version = _ref.version,
|
|
9450
|
-
version = _ref$version === void 0 ?
|
|
9448
|
+
version = _ref$version === void 0 ? sdkCommon.Version.V4 : _ref$version;
|
|
9451
9449
|
return {
|
|
9452
9450
|
assets: _defineProperty({}, version, multiAssets),
|
|
9453
9451
|
beneficiary: _defineProperty({}, version, buildBeneficiaryInput(api, address))
|
|
@@ -10315,7 +10313,6 @@ exports.determineRelayChain = determineRelayChain;
|
|
|
10315
10313
|
exports.dryRun = dryRun;
|
|
10316
10314
|
exports.dryRunOrigin = dryRunOrigin;
|
|
10317
10315
|
exports.encodeSs58 = encodeSs58;
|
|
10318
|
-
exports.generateAddressMultiLocationV4 = generateAddressMultiLocationV4;
|
|
10319
10316
|
exports.getAssetBalance = getAssetBalance;
|
|
10320
10317
|
exports.getAssetBalanceInternal = getAssetBalanceInternal;
|
|
10321
10318
|
exports.getBalanceForeign = getBalanceForeign;
|