@paraspell/sdk-core 10.10.0 → 10.10.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 +8 -6
- package/dist/index.mjs +9 -7
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -695,7 +695,7 @@ var DOT_MULTILOCATION = {
|
|
|
695
695
|
parents: sdkCommon.Parents.ONE,
|
|
696
696
|
interior: 'Here'
|
|
697
697
|
};
|
|
698
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['
|
|
698
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
699
699
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
700
700
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
701
701
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -5474,7 +5474,8 @@ var getFailureInfo = function getFailureInfo(nodes, hops) {
|
|
|
5474
5474
|
};
|
|
5475
5475
|
var getXcmFee = /*#__PURE__*/function () {
|
|
5476
5476
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
5477
|
-
var
|
|
5477
|
+
var _findAssetOnDest2;
|
|
5478
|
+
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, asset, _yield$getOriginXcmFe, originFee, originCurrency, originFeeType, originDryRunError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, hops, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, assetHubNode, bridgeHubNode, currentOrigin, forwardedXcms, nextParaId, intermediateFees, destinationFee, destinationFeeType, destinationDryRunError, destinationSufficient, nextChain, hopApi, _findAssetOnDest, hopResult, hopCurrency, hopDetail, failingRecord, hopIsDestination, _destApi, destFallback, processedBridgeHubData, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, bridgeHubHopIndex, destCurrency, result, _getFailureInfo2, failureChain, failureReason;
|
|
5478
5479
|
return _regenerator().w(function (_context) {
|
|
5479
5480
|
while (1) switch (_context.n) {
|
|
5480
5481
|
case 0:
|
|
@@ -5618,7 +5619,7 @@ var getXcmFee = /*#__PURE__*/function () {
|
|
|
5618
5619
|
});
|
|
5619
5620
|
case 13:
|
|
5620
5621
|
hopResult = _context.v;
|
|
5621
|
-
hopCurrency = hopResult.feeType === 'dryRun' ? destination === nextChain ? assets.
|
|
5622
|
+
hopCurrency = hopResult.feeType === 'dryRun' ? destination === nextChain ? ((_findAssetOnDest = assets.findAssetOnDest(origin, nextChain, currency)) !== null && _findAssetOnDest !== void 0 ? _findAssetOnDest : asset).symbol : asset.symbol : assets.getNativeAssetSymbol(nextChain);
|
|
5622
5623
|
hopDetail = hopResult.dryRunError ? {
|
|
5623
5624
|
fee: hopResult.fee,
|
|
5624
5625
|
feeType: hopResult.feeType,
|
|
@@ -5738,7 +5739,7 @@ var getXcmFee = /*#__PURE__*/function () {
|
|
|
5738
5739
|
}
|
|
5739
5740
|
case 24:
|
|
5740
5741
|
intermediateFees.bridgeHub = processedBridgeHubData;
|
|
5741
|
-
destCurrency = destinationFeeType === 'dryRun' ? assets.
|
|
5742
|
+
destCurrency = destinationFeeType === 'dryRun' ? ((_findAssetOnDest2 = assets.findAssetOnDest(origin, destination, currency)) !== null && _findAssetOnDest2 !== void 0 ? _findAssetOnDest2 : asset).symbol : assets.getNativeAssetSymbol(destination);
|
|
5742
5743
|
result = _objectSpread2(_objectSpread2({
|
|
5743
5744
|
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
5744
5745
|
weight: originWeight
|
|
@@ -8504,7 +8505,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8504
8505
|
key: "transferPolkadotXCM",
|
|
8505
8506
|
value: function () {
|
|
8506
8507
|
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(input) {
|
|
8507
|
-
var api, scenario, asset, destination, feeAsset, overriddenAsset, isNativeAsset, isNativeFeeAsset, isEthereumAsset, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
|
|
8508
|
+
var api, scenario, asset, destination, feeAsset, overriddenAsset, isNativeAsset, isNativeFeeAsset, isEthereumAsset, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
|
|
8508
8509
|
return _regenerator().w(function (_context3) {
|
|
8509
8510
|
while (1) switch (_context3.n) {
|
|
8510
8511
|
case 0:
|
|
@@ -8569,8 +8570,9 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8569
8570
|
}
|
|
8570
8571
|
return _context3.a(2, this.handleLocalReserveTransfer(input, true));
|
|
8571
8572
|
case 9:
|
|
8573
|
+
CHAINS_SUPPORT_DOT_TRANSFER = new Set(['Hydration', 'Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
8572
8574
|
isTrusted = !sdkCommon.isTMultiLocation(destination) && sdkCommon.isSystemChain(destination);
|
|
8573
|
-
isDotReserveAh = !sdkCommon.isTMultiLocation(destination) &&
|
|
8575
|
+
isDotReserveAh = !sdkCommon.isTMultiLocation(destination) && CHAINS_SUPPORT_DOT_TRANSFER.has(destination);
|
|
8574
8576
|
if (!(scenario === 'ParaToPara' && asset.symbol === this.getNativeAssetSymbol() && !assets.isForeignAsset(asset) && !isDotReserveAh && !isTrusted)) {
|
|
8575
8577
|
_context3.n = 10;
|
|
8576
8578
|
break;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2';
|
|
2
|
-
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier,
|
|
2
|
+
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier, findAssetOnDest, normalizeMultiLocation, findAssetOnDestOrThrow, normalizeSymbol, getAssetId, getNativeAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, createPublicClient, http, getContract } from 'viem';
|
|
@@ -696,7 +696,7 @@ var DOT_MULTILOCATION = {
|
|
|
696
696
|
parents: Parents.ONE,
|
|
697
697
|
interior: 'Here'
|
|
698
698
|
};
|
|
699
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['
|
|
699
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
700
700
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
701
701
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
702
702
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -5475,7 +5475,8 @@ var getFailureInfo = function getFailureInfo(nodes, hops) {
|
|
|
5475
5475
|
};
|
|
5476
5476
|
var getXcmFee = /*#__PURE__*/function () {
|
|
5477
5477
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
5478
|
-
var
|
|
5478
|
+
var _findAssetOnDest2;
|
|
5479
|
+
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, asset, _yield$getOriginXcmFe, originFee, originCurrency, originFeeType, originDryRunError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, hops, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, assetHubNode, bridgeHubNode, currentOrigin, forwardedXcms, nextParaId, intermediateFees, destinationFee, destinationFeeType, destinationDryRunError, destinationSufficient, nextChain, hopApi, _findAssetOnDest, hopResult, hopCurrency, hopDetail, failingRecord, hopIsDestination, _destApi, destFallback, processedBridgeHubData, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, bridgeHubHopIndex, destCurrency, result, _getFailureInfo2, failureChain, failureReason;
|
|
5479
5480
|
return _regenerator().w(function (_context) {
|
|
5480
5481
|
while (1) switch (_context.n) {
|
|
5481
5482
|
case 0:
|
|
@@ -5619,7 +5620,7 @@ var getXcmFee = /*#__PURE__*/function () {
|
|
|
5619
5620
|
});
|
|
5620
5621
|
case 13:
|
|
5621
5622
|
hopResult = _context.v;
|
|
5622
|
-
hopCurrency = hopResult.feeType === 'dryRun' ? destination === nextChain ?
|
|
5623
|
+
hopCurrency = hopResult.feeType === 'dryRun' ? destination === nextChain ? ((_findAssetOnDest = findAssetOnDest(origin, nextChain, currency)) !== null && _findAssetOnDest !== void 0 ? _findAssetOnDest : asset).symbol : asset.symbol : getNativeAssetSymbol(nextChain);
|
|
5623
5624
|
hopDetail = hopResult.dryRunError ? {
|
|
5624
5625
|
fee: hopResult.fee,
|
|
5625
5626
|
feeType: hopResult.feeType,
|
|
@@ -5739,7 +5740,7 @@ var getXcmFee = /*#__PURE__*/function () {
|
|
|
5739
5740
|
}
|
|
5740
5741
|
case 24:
|
|
5741
5742
|
intermediateFees.bridgeHub = processedBridgeHubData;
|
|
5742
|
-
destCurrency = destinationFeeType === 'dryRun' ?
|
|
5743
|
+
destCurrency = destinationFeeType === 'dryRun' ? ((_findAssetOnDest2 = findAssetOnDest(origin, destination, currency)) !== null && _findAssetOnDest2 !== void 0 ? _findAssetOnDest2 : asset).symbol : getNativeAssetSymbol(destination);
|
|
5743
5744
|
result = _objectSpread2(_objectSpread2({
|
|
5744
5745
|
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
5745
5746
|
weight: originWeight
|
|
@@ -8505,7 +8506,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8505
8506
|
key: "transferPolkadotXCM",
|
|
8506
8507
|
value: function () {
|
|
8507
8508
|
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(input) {
|
|
8508
|
-
var api, scenario, asset, destination, feeAsset, overriddenAsset, isNativeAsset, isNativeFeeAsset, isEthereumAsset, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
|
|
8509
|
+
var api, scenario, asset, destination, feeAsset, overriddenAsset, isNativeAsset, isNativeFeeAsset, isEthereumAsset, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
|
|
8509
8510
|
return _regenerator().w(function (_context3) {
|
|
8510
8511
|
while (1) switch (_context3.n) {
|
|
8511
8512
|
case 0:
|
|
@@ -8570,8 +8571,9 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8570
8571
|
}
|
|
8571
8572
|
return _context3.a(2, this.handleLocalReserveTransfer(input, true));
|
|
8572
8573
|
case 9:
|
|
8574
|
+
CHAINS_SUPPORT_DOT_TRANSFER = new Set(['Hydration', 'Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
8573
8575
|
isTrusted = !isTMultiLocation(destination) && isSystemChain(destination);
|
|
8574
|
-
isDotReserveAh = !isTMultiLocation(destination) &&
|
|
8576
|
+
isDotReserveAh = !isTMultiLocation(destination) && CHAINS_SUPPORT_DOT_TRANSFER.has(destination);
|
|
8575
8577
|
if (!(scenario === 'ParaToPara' && asset.symbol === this.getNativeAssetSymbol() && !isForeignAsset(asset) && !isDotReserveAh && !isTrusted)) {
|
|
8576
8578
|
_context3.n = 10;
|
|
8577
8579
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "10.10.
|
|
3
|
+
"version": "10.10.1",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"@scure/base": "^1.2.6",
|
|
28
28
|
"viem": "^2.31.6",
|
|
29
|
-
"@paraspell/assets": "10.10.
|
|
30
|
-
"@paraspell/sdk-common": "10.10.
|
|
31
|
-
"@paraspell/pallets": "10.10.
|
|
29
|
+
"@paraspell/assets": "10.10.1",
|
|
30
|
+
"@paraspell/sdk-common": "10.10.1",
|
|
31
|
+
"@paraspell/pallets": "10.10.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|