@paraspell/sdk 7.1.0 → 7.1.1
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 +169 -67
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +169 -67
- package/dist/papi/index.cjs +169 -67
- package/dist/papi/index.d.ts +4 -1
- package/dist/papi/index.mjs +169 -67
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -494,8 +494,8 @@ function _superPropBase(t, o) {
|
|
|
494
494
|
return t;
|
|
495
495
|
}
|
|
496
496
|
function _superPropGet(t, o, e, r) {
|
|
497
|
-
var p = _get(_getPrototypeOf(t.prototype ), o, e);
|
|
498
|
-
return "function" == typeof p ? function (t) {
|
|
497
|
+
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
|
|
498
|
+
return 2 & r && "function" == typeof p ? function (t) {
|
|
499
499
|
return p.apply(e, t);
|
|
500
500
|
} : p;
|
|
501
501
|
}
|
|
@@ -9292,19 +9292,34 @@ var createEthereumTokenLocation = function createEthereumTokenLocation(currencyI
|
|
|
9292
9292
|
}
|
|
9293
9293
|
};
|
|
9294
9294
|
};
|
|
9295
|
-
var
|
|
9295
|
+
var createCustomXcmAh = function createCustomXcmAh(_ref, version) {
|
|
9296
9296
|
var api = _ref.api,
|
|
9297
|
-
address = _ref.address,
|
|
9298
|
-
currencyId = _ref.currencyId,
|
|
9299
9297
|
scenario = _ref.scenario,
|
|
9300
|
-
|
|
9301
|
-
return _defineProperty({},
|
|
9298
|
+
address = _ref.address;
|
|
9299
|
+
return _defineProperty({}, version, [{
|
|
9300
|
+
DepositAsset: {
|
|
9301
|
+
assets: {
|
|
9302
|
+
Wild: {
|
|
9303
|
+
AllCounted: 1
|
|
9304
|
+
}
|
|
9305
|
+
},
|
|
9306
|
+
beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', address, version, undefined))[0]
|
|
9307
|
+
}
|
|
9308
|
+
}]);
|
|
9309
|
+
};
|
|
9310
|
+
var createCustomXcmOnDest = function createCustomXcmOnDest(_ref3, version) {
|
|
9311
|
+
var api = _ref3.api,
|
|
9312
|
+
address = _ref3.address,
|
|
9313
|
+
currencyId = _ref3.currencyId,
|
|
9314
|
+
scenario = _ref3.scenario,
|
|
9315
|
+
ahAddress = _ref3.ahAddress;
|
|
9316
|
+
return _defineProperty({}, version, [{
|
|
9302
9317
|
SetAppendix: [{
|
|
9303
9318
|
DepositAsset: {
|
|
9304
9319
|
assets: {
|
|
9305
9320
|
Wild: 'All'
|
|
9306
9321
|
},
|
|
9307
|
-
beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', ahAddress !== null && ahAddress !== void 0 ? ahAddress : '',
|
|
9322
|
+
beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', ahAddress !== null && ahAddress !== void 0 ? ahAddress : '', version, undefined))[0]
|
|
9308
9323
|
}
|
|
9309
9324
|
}]
|
|
9310
9325
|
}, {
|
|
@@ -9371,11 +9386,10 @@ var Hydration$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9371
9386
|
_classCallCheck(this, Hydration);
|
|
9372
9387
|
return _callSuper(this, Hydration, ['Hydration', 'hydradx', 'polkadot', exports.Version.V3]);
|
|
9373
9388
|
}
|
|
9374
|
-
// Handles WETH Ethereum transfers
|
|
9375
9389
|
_inherits(Hydration, _ParachainNode);
|
|
9376
9390
|
return _createClass(Hydration, [{
|
|
9377
|
-
key: "
|
|
9378
|
-
value: function
|
|
9391
|
+
key: "transferToEthereum",
|
|
9392
|
+
value: function transferToEthereum(input) {
|
|
9379
9393
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9380
9394
|
var api, address, currencySymbol, scenario, version, destination, amount, currencyId, ahAddress, versionOrDefault, ethMultiAsset, fee, call;
|
|
9381
9395
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -9430,6 +9444,59 @@ var Hydration$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9430
9444
|
}, _callee2, this);
|
|
9431
9445
|
}));
|
|
9432
9446
|
}
|
|
9447
|
+
}, {
|
|
9448
|
+
key: "transferToAssetHub",
|
|
9449
|
+
value: function transferToAssetHub(input) {
|
|
9450
|
+
var api = input.api,
|
|
9451
|
+
scenario = input.scenario,
|
|
9452
|
+
version = input.version,
|
|
9453
|
+
destination = input.destination,
|
|
9454
|
+
amount = input.amount;
|
|
9455
|
+
var versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V3;
|
|
9456
|
+
var call = {
|
|
9457
|
+
module: 'PolkadotXcm',
|
|
9458
|
+
section: 'transfer_assets_using_type_and_then',
|
|
9459
|
+
parameters: {
|
|
9460
|
+
dest: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('AssetHubPolkadot')),
|
|
9461
|
+
assets: _defineProperty({}, versionOrDefault, [Object.values(this.createCurrencySpec(amount, 'ParaToRelay', versionOrDefault))[0][0]]),
|
|
9462
|
+
assets_transfer_type: 'DestinationReserve',
|
|
9463
|
+
remote_fees_id: _defineProperty({}, versionOrDefault, {
|
|
9464
|
+
Concrete: {
|
|
9465
|
+
parents: exports.Parents.ONE,
|
|
9466
|
+
interior: 'Here'
|
|
9467
|
+
}
|
|
9468
|
+
}),
|
|
9469
|
+
fees_transfer_type: 'DestinationReserve',
|
|
9470
|
+
custom_xcm_on_dest: createCustomXcmAh(input, versionOrDefault),
|
|
9471
|
+
weight_limit: 'Unlimited'
|
|
9472
|
+
}
|
|
9473
|
+
};
|
|
9474
|
+
return api.callTxMethod(call);
|
|
9475
|
+
}
|
|
9476
|
+
// Handles WETH Ethereum transfers
|
|
9477
|
+
}, {
|
|
9478
|
+
key: "transferPolkadotXCM",
|
|
9479
|
+
value: function transferPolkadotXCM(input) {
|
|
9480
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
9481
|
+
var destination;
|
|
9482
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9483
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9484
|
+
case 0:
|
|
9485
|
+
destination = input.destination;
|
|
9486
|
+
if (!(destination === 'Ethereum')) {
|
|
9487
|
+
_context3.next = 3;
|
|
9488
|
+
break;
|
|
9489
|
+
}
|
|
9490
|
+
return _context3.abrupt("return", this.transferToEthereum(input));
|
|
9491
|
+
case 3:
|
|
9492
|
+
return _context3.abrupt("return", this.transferToAssetHub(input));
|
|
9493
|
+
case 4:
|
|
9494
|
+
case "end":
|
|
9495
|
+
return _context3.stop();
|
|
9496
|
+
}
|
|
9497
|
+
}, _callee3, this);
|
|
9498
|
+
}));
|
|
9499
|
+
}
|
|
9433
9500
|
}, {
|
|
9434
9501
|
key: "transferXTokens",
|
|
9435
9502
|
value: function transferXTokens(input) {
|
|
@@ -9438,9 +9505,15 @@ var Hydration$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9438
9505
|
}
|
|
9439
9506
|
}, {
|
|
9440
9507
|
key: "canUseXTokens",
|
|
9441
|
-
value: function canUseXTokens(
|
|
9442
|
-
var destination =
|
|
9443
|
-
|
|
9508
|
+
value: function canUseXTokens(_ref5) {
|
|
9509
|
+
var destination = _ref5.destination,
|
|
9510
|
+
currencySymbol = _ref5.currencySymbol,
|
|
9511
|
+
currencyId = _ref5.currencyId;
|
|
9512
|
+
var dotAsset = getOtherAssets(this.node).find(function (_ref6) {
|
|
9513
|
+
var symbol = _ref6.symbol;
|
|
9514
|
+
return symbol === 'DOT';
|
|
9515
|
+
});
|
|
9516
|
+
return destination !== 'Ethereum' && !(destination === 'AssetHubPolkadot' && (currencySymbol === (dotAsset === null || dotAsset === void 0 ? void 0 : dotAsset.symbol) || currencyId === (dotAsset === null || dotAsset === void 0 ? void 0 : dotAsset.assetId)));
|
|
9444
9517
|
}
|
|
9445
9518
|
}]);
|
|
9446
9519
|
}(ParachainNode);
|
|
@@ -9956,41 +10029,64 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9956
10029
|
});
|
|
9957
10030
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'limited_teleport_assets', 'Unlimited');
|
|
9958
10031
|
}
|
|
10032
|
+
}, {
|
|
10033
|
+
key: "patchInput",
|
|
10034
|
+
value: function patchInput(input) {
|
|
10035
|
+
var _a;
|
|
10036
|
+
var currencySymbol = input.currencySymbol,
|
|
10037
|
+
currencyId = input.currencyId,
|
|
10038
|
+
destination = input.destination,
|
|
10039
|
+
paraIdTo = input.paraIdTo,
|
|
10040
|
+
amount = input.amount,
|
|
10041
|
+
overridedCurrency = input.overridedCurrency,
|
|
10042
|
+
scenario = input.scenario,
|
|
10043
|
+
api = input.api,
|
|
10044
|
+
version = input.version,
|
|
10045
|
+
address = input.address;
|
|
10046
|
+
if (((currencySymbol === null || currencySymbol === void 0 ? void 0 : currencySymbol.toUpperCase()) === 'USDT' || (currencySymbol === null || currencySymbol === void 0 ? void 0 : currencySymbol.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot') {
|
|
10047
|
+
var versionOrDefault = (_a = input.version) !== null && _a !== void 0 ? _a : exports.Version.V2;
|
|
10048
|
+
return Object.assign(Object.assign({}, input), {
|
|
10049
|
+
header: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, paraIdTo),
|
|
10050
|
+
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, versionOrDefault, paraIdTo),
|
|
10051
|
+
currencySelection: this.createCurrencySpec(amount, scenario, versionOrDefault, currencyId, overridedCurrency)
|
|
10052
|
+
});
|
|
10053
|
+
}
|
|
10054
|
+
var dotAsset = getOtherAssets(this.node).find(function (_ref) {
|
|
10055
|
+
var symbol = _ref.symbol;
|
|
10056
|
+
return symbol === 'DOT';
|
|
10057
|
+
});
|
|
10058
|
+
if (destination === 'Hydration' && (currencySymbol === (dotAsset === null || dotAsset === void 0 ? void 0 : dotAsset.symbol) || currencyId === (dotAsset === null || dotAsset === void 0 ? void 0 : dotAsset.assetId))) {
|
|
10059
|
+
var _versionOrDefault = version !== null && version !== void 0 ? version : this.version;
|
|
10060
|
+
return Object.assign(Object.assign({}, input), {
|
|
10061
|
+
currencySelection: _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([amount, 'ParaToRelay', _versionOrDefault, currencyId, overridedCurrency])
|
|
10062
|
+
});
|
|
10063
|
+
}
|
|
10064
|
+
return input;
|
|
10065
|
+
}
|
|
9959
10066
|
}, {
|
|
9960
10067
|
key: "transferPolkadotXCM",
|
|
9961
10068
|
value: function transferPolkadotXCM(input) {
|
|
9962
|
-
var _a;
|
|
9963
10069
|
var scenario = input.scenario,
|
|
9964
10070
|
currencySymbol = input.currencySymbol,
|
|
9965
|
-
currencyId = input.currencyId
|
|
9966
|
-
|
|
10071
|
+
currencyId = input.currencyId,
|
|
10072
|
+
destination = input.destination;
|
|
10073
|
+
if (destination === 'AssetHubKusama') {
|
|
9967
10074
|
return Promise.resolve(this.handleBridgeTransfer(input, 'Kusama'));
|
|
9968
10075
|
}
|
|
9969
|
-
if (
|
|
10076
|
+
if (destination === 'Ethereum') {
|
|
9970
10077
|
return Promise.resolve(this.handleEthBridgeTransfer(input));
|
|
9971
10078
|
}
|
|
9972
|
-
if (
|
|
10079
|
+
if (destination === 'Mythos') {
|
|
9973
10080
|
return Promise.resolve(this.handleMythosTransfer(input));
|
|
9974
10081
|
}
|
|
9975
|
-
if (scenario === 'ParaToPara' && currencySymbol === 'DOT' && currencyId === undefined) {
|
|
10082
|
+
if (scenario === 'ParaToPara' && currencySymbol === 'DOT' && currencyId === undefined && destination !== 'Hydration') {
|
|
9976
10083
|
throw new ScenarioNotSupportedError(this.node, scenario, 'Para to Para scenarios for DOT transfer from AssetHub are not supported, you have to transfer DOT to Relay chain and transfer to destination chain from Relay chain.');
|
|
9977
10084
|
}
|
|
9978
10085
|
if (scenario === 'ParaToPara' && currencySymbol === 'KSM' && currencyId === undefined) {
|
|
9979
10086
|
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>}.');
|
|
9980
10087
|
}
|
|
9981
10088
|
var section = scenario === 'ParaToPara' ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
9982
|
-
var
|
|
9983
|
-
destination = input.destination,
|
|
9984
|
-
paraIdTo = input.paraIdTo,
|
|
9985
|
-
address = input.address,
|
|
9986
|
-
amount = input.amount,
|
|
9987
|
-
overridedCurrency = input.overridedCurrency;
|
|
9988
|
-
var versionOrDefault = (_a = input.version) !== null && _a !== void 0 ? _a : exports.Version.V2;
|
|
9989
|
-
var modifiedInput = ((currencySymbol === null || currencySymbol === void 0 ? void 0 : currencySymbol.toUpperCase()) === 'USDT' || (currencySymbol === null || currencySymbol === void 0 ? void 0 : currencySymbol.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot' ? Object.assign(Object.assign({}, input), {
|
|
9990
|
-
header: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, paraIdTo),
|
|
9991
|
-
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, versionOrDefault, paraIdTo),
|
|
9992
|
-
currencySelection: this.createCurrencySpec(amount, scenario, versionOrDefault, currencyId, overridedCurrency)
|
|
9993
|
-
}) : input;
|
|
10089
|
+
var modifiedInput = this.patchInput(input);
|
|
9994
10090
|
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, section, 'Unlimited'));
|
|
9995
10091
|
}
|
|
9996
10092
|
}, {
|
|
@@ -10018,7 +10114,7 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10018
10114
|
};
|
|
10019
10115
|
return createCurrencySpec(amount, version, exports.Parents.ZERO, overridedMultiLocation, interior);
|
|
10020
10116
|
} else {
|
|
10021
|
-
return _superPropGet(AssetHubPolkadot, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
10117
|
+
return _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([amount, scenario, version, currencyId]);
|
|
10022
10118
|
}
|
|
10023
10119
|
}
|
|
10024
10120
|
}]);
|
|
@@ -10311,7 +10407,7 @@ var Darwinia$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10311
10407
|
};
|
|
10312
10408
|
return createCurrencySpec(amount, version, exports.Parents.ZERO, overridedMultiLocation, interior);
|
|
10313
10409
|
} else {
|
|
10314
|
-
return _superPropGet(Darwinia, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
10410
|
+
return _superPropGet(Darwinia, "createCurrencySpec", this, 3)([amount, scenario, version, currencyId, overridedMultiLocation]);
|
|
10315
10411
|
}
|
|
10316
10412
|
}
|
|
10317
10413
|
}, {
|
|
@@ -10546,7 +10642,7 @@ var Collectives$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
10546
10642
|
if (scenario === 'ParaToPara') {
|
|
10547
10643
|
return {};
|
|
10548
10644
|
} else {
|
|
10549
|
-
return _superPropGet(Collectives, "createCurrencySpec", this)([amount, scenario, version, currencyId]);
|
|
10645
|
+
return _superPropGet(Collectives, "createCurrencySpec", this, 3)([amount, scenario, version, currencyId]);
|
|
10550
10646
|
}
|
|
10551
10647
|
}
|
|
10552
10648
|
}]);
|
|
@@ -13765,7 +13861,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13765
13861
|
return __awaiter(void 0, [options_1].concat(args_1), void 0, function (options) {
|
|
13766
13862
|
var serializedApiCallEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
13767
13863
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
13768
|
-
var _a, _b, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, ahAddress, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, isDestAssetHub, pallet, isBifrost, asset, amountStr, currencyStr;
|
|
13864
|
+
var _a, _b, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, ahAddress, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, isDestAssetHub, pallet, isBifrost, asset, nativeAssets, amountStr, currencyStr;
|
|
13769
13865
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13770
13866
|
while (1) switch (_context.prev = _context.next) {
|
|
13771
13867
|
case 0:
|
|
@@ -13846,83 +13942,89 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13846
13942
|
pallet = getDefaultPallet(origin);
|
|
13847
13943
|
isBifrost = origin === 'BifrostPolkadot' || origin === 'BifrostKusama';
|
|
13848
13944
|
if (!(!isBridge && isDestAssetHub && pallet === 'XTokens' && !isBifrost)) {
|
|
13849
|
-
_context.next =
|
|
13945
|
+
_context.next = 44;
|
|
13850
13946
|
break;
|
|
13851
13947
|
}
|
|
13852
13948
|
asset = getAssetBySymbolOrId(destination, currency, false, destination);
|
|
13853
|
-
|
|
13949
|
+
nativeAssets = getNativeAssets(destination);
|
|
13950
|
+
if (origin === 'Hydration') {
|
|
13951
|
+
nativeAssets = nativeAssets.filter(function (nativeAsset) {
|
|
13952
|
+
return nativeAsset.symbol !== 'DOT';
|
|
13953
|
+
});
|
|
13954
|
+
}
|
|
13955
|
+
if (!('symbol' in currency && nativeAssets.some(function (nativeAsset) {
|
|
13854
13956
|
return nativeAsset.symbol.toLowerCase() === currency.symbol.toLowerCase();
|
|
13855
13957
|
}))) {
|
|
13856
|
-
_context.next =
|
|
13958
|
+
_context.next = 38;
|
|
13857
13959
|
break;
|
|
13858
13960
|
}
|
|
13859
13961
|
throw new InvalidCurrencyError("".concat(currency.symbol, " is not supported for transfers to ").concat(destination, "."));
|
|
13860
|
-
case
|
|
13962
|
+
case 38:
|
|
13861
13963
|
if (!(assetCheckEnabled && asset === null)) {
|
|
13862
|
-
_context.next =
|
|
13964
|
+
_context.next = 40;
|
|
13863
13965
|
break;
|
|
13864
13966
|
}
|
|
13865
13967
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13866
|
-
case
|
|
13968
|
+
case 40:
|
|
13867
13969
|
if (!((asset === null || asset === void 0 ? void 0 : asset.symbol) && !hasSupportForAsset(origin, asset.symbol))) {
|
|
13868
|
-
_context.next =
|
|
13970
|
+
_context.next = 42;
|
|
13869
13971
|
break;
|
|
13870
13972
|
}
|
|
13871
13973
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency ").concat(asset.symbol, "."));
|
|
13872
|
-
case 40:
|
|
13873
|
-
_context.next = 47;
|
|
13874
|
-
break;
|
|
13875
13974
|
case 42:
|
|
13975
|
+
_context.next = 49;
|
|
13976
|
+
break;
|
|
13977
|
+
case 44:
|
|
13876
13978
|
asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isTMultiLocation(destination) ? undefined : destination) : null;
|
|
13877
13979
|
if (!(!isBridge && asset === null && assetCheckEnabled)) {
|
|
13878
|
-
_context.next =
|
|
13980
|
+
_context.next = 47;
|
|
13879
13981
|
break;
|
|
13880
13982
|
}
|
|
13881
13983
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13882
|
-
case
|
|
13984
|
+
case 47:
|
|
13883
13985
|
if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol))) {
|
|
13884
|
-
_context.next =
|
|
13986
|
+
_context.next = 49;
|
|
13885
13987
|
break;
|
|
13886
13988
|
}
|
|
13887
13989
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13888
|
-
case 47:
|
|
13889
|
-
_context.next = 49;
|
|
13890
|
-
return api.init(origin);
|
|
13891
13990
|
case 49:
|
|
13991
|
+
_context.next = 51;
|
|
13992
|
+
return api.init(origin);
|
|
13993
|
+
case 51:
|
|
13892
13994
|
amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
|
|
13893
13995
|
if (!('multilocation' in currency || 'multiasset' in currency)) {
|
|
13894
|
-
_context.next =
|
|
13996
|
+
_context.next = 56;
|
|
13895
13997
|
break;
|
|
13896
13998
|
}
|
|
13897
13999
|
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
13898
|
-
_context.next =
|
|
14000
|
+
_context.next = 70;
|
|
13899
14001
|
break;
|
|
13900
|
-
case
|
|
14002
|
+
case 56:
|
|
13901
14003
|
if (!(_typeof(address) === 'object')) {
|
|
13902
|
-
_context.next =
|
|
14004
|
+
_context.next = 60;
|
|
13903
14005
|
break;
|
|
13904
14006
|
}
|
|
13905
14007
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
13906
|
-
_context.next =
|
|
14008
|
+
_context.next = 70;
|
|
13907
14009
|
break;
|
|
13908
|
-
case
|
|
14010
|
+
case 60:
|
|
13909
14011
|
if (!(_typeof(destination) === 'object')) {
|
|
13910
|
-
_context.next =
|
|
14012
|
+
_context.next = 64;
|
|
13911
14013
|
break;
|
|
13912
14014
|
}
|
|
13913
14015
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
13914
|
-
_context.next =
|
|
14016
|
+
_context.next = 70;
|
|
13915
14017
|
break;
|
|
13916
|
-
case
|
|
14018
|
+
case 64:
|
|
13917
14019
|
if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
|
|
13918
|
-
_context.next =
|
|
14020
|
+
_context.next = 68;
|
|
13919
14021
|
break;
|
|
13920
14022
|
}
|
|
13921
14023
|
console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
|
|
13922
|
-
_context.next =
|
|
14024
|
+
_context.next = 70;
|
|
13923
14025
|
break;
|
|
13924
|
-
case
|
|
13925
|
-
_context.next =
|
|
14026
|
+
case 68:
|
|
14027
|
+
_context.next = 70;
|
|
13926
14028
|
return checkKeepAlive({
|
|
13927
14029
|
originApi: api,
|
|
13928
14030
|
address: address,
|
|
@@ -13932,7 +14034,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13932
14034
|
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : 'symbol' in currency ? currency.symbol : undefined,
|
|
13933
14035
|
destNode: destination
|
|
13934
14036
|
});
|
|
13935
|
-
case
|
|
14037
|
+
case 70:
|
|
13936
14038
|
currencyStr = 'symbol' in currency ? currency.symbol : 'id' in currency ? currency.id.toString() : undefined;
|
|
13937
14039
|
return _context.abrupt("return", originNode.transfer({
|
|
13938
14040
|
api: api,
|
|
@@ -13949,7 +14051,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13949
14051
|
serializedApiCallEnabled: serializedApiCallEnabled,
|
|
13950
14052
|
ahAddress: ahAddress
|
|
13951
14053
|
}));
|
|
13952
|
-
case
|
|
14054
|
+
case 72:
|
|
13953
14055
|
case "end":
|
|
13954
14056
|
return _context.stop();
|
|
13955
14057
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -91,9 +91,11 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
|
|
|
91
91
|
|
|
92
92
|
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
93
93
|
constructor();
|
|
94
|
+
transferToEthereum<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
95
|
+
transferToAssetHub<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
94
96
|
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
95
97
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
96
|
-
protected canUseXTokens({ destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
98
|
+
protected canUseXTokens({ destination, currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -215,6 +217,7 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
215
217
|
handleBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn<TRes>;
|
|
216
218
|
handleEthBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
217
219
|
handleMythosTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
220
|
+
patchInput<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): PolkadotXCMTransferInput<TApi, TRes>;
|
|
218
221
|
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
219
222
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
220
223
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|