@paraspell/sdk-core 11.12.3 → 11.12.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 +9 -9
- package/dist/index.mjs +9 -9
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -11853,7 +11853,7 @@ var getXcmFeeEstimate = /*#__PURE__*/function () {
|
|
|
11853
11853
|
case 3:
|
|
11854
11854
|
originSufficient = _context.v;
|
|
11855
11855
|
_context.n = 4;
|
|
11856
|
-
return isSufficientDestination(destApi, destination, address,
|
|
11856
|
+
return isSufficientDestination(destApi, destination, address, amount, originAsset, fixedDestinationFee);
|
|
11857
11857
|
case 4:
|
|
11858
11858
|
_destinationSufficient = _context.v;
|
|
11859
11859
|
return _context.a(2, {
|
|
@@ -12896,17 +12896,17 @@ var createTypeAndThenCallContext = /*#__PURE__*/function () {
|
|
|
12896
12896
|
};
|
|
12897
12897
|
}();
|
|
12898
12898
|
|
|
12899
|
-
var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount) {
|
|
12899
|
+
var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount, isForFeeCalc) {
|
|
12900
12900
|
var origin = _ref.origin,
|
|
12901
12901
|
dest = _ref.dest,
|
|
12902
12902
|
reserve = _ref.reserve,
|
|
12903
12903
|
isSubBridge = _ref.isSubBridge,
|
|
12904
12904
|
assetInfo = _ref.assetInfo,
|
|
12905
12905
|
options = _ref.options;
|
|
12906
|
-
var fees = arguments.length >
|
|
12907
|
-
reserveFee:
|
|
12906
|
+
var fees = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
12907
|
+
reserveFee: 0n,
|
|
12908
12908
|
refundFee: 0n,
|
|
12909
|
-
destFee:
|
|
12909
|
+
destFee: 0n
|
|
12910
12910
|
};
|
|
12911
12911
|
var destination = options.destination,
|
|
12912
12912
|
version = options.version,
|
|
@@ -12942,8 +12942,8 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount) {
|
|
|
12942
12942
|
assetsFilter.push(createAsset(version, assetInfo.amount, localizeLocation(reserve.chain, assetInfo.location)));
|
|
12943
12943
|
if (isSubBridge || origin.chain !== reserve.chain && dest.chain !== reserve.chain) {
|
|
12944
12944
|
var buyExecutionAmount = !isDotAsset ? destFee : assetInfo.amount - reserveFee - refundFee;
|
|
12945
|
-
if (buyExecutionAmount < 0n) throw new AmountTooLowError();
|
|
12946
|
-
var filter =
|
|
12945
|
+
if (buyExecutionAmount < 0n && !isForFeeCalc) throw new AmountTooLowError();
|
|
12946
|
+
var filter = isForFeeCalc ? {
|
|
12947
12947
|
Wild: 'All'
|
|
12948
12948
|
} : {
|
|
12949
12949
|
Definite: assetsFilter
|
|
@@ -13044,7 +13044,7 @@ var createTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
13044
13044
|
return sdkCommon.deepEqual(assetInfo.location, loc);
|
|
13045
13045
|
});
|
|
13046
13046
|
assetCount = isRelayAsset ? 1 : 2;
|
|
13047
|
-
customXcm = createCustomXcm(context, isRelayAsset, assetCount);
|
|
13047
|
+
customXcm = createCustomXcm(context, isRelayAsset, assetCount, true);
|
|
13048
13048
|
refundInstruction = senderAddress ? createRefundInstruction(api, senderAddress, version, assetCount) : null;
|
|
13049
13049
|
_context.n = 2;
|
|
13050
13050
|
return computeAllFees(context, customXcm, isRelayAsset, refundInstruction);
|
|
@@ -13052,7 +13052,7 @@ var createTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
13052
13052
|
fees = _context.v;
|
|
13053
13053
|
finalCustomXcm = [];
|
|
13054
13054
|
if (refundInstruction && !isSubBridge) finalCustomXcm.push(refundInstruction);
|
|
13055
|
-
finalCustomXcm.push.apply(finalCustomXcm, _toConsumableArray(createCustomXcm(context, isRelayAsset, assetCount, fees)));
|
|
13055
|
+
finalCustomXcm.push.apply(finalCustomXcm, _toConsumableArray(createCustomXcm(context, isRelayAsset, assetCount, false, fees)));
|
|
13056
13056
|
totalFee = fees.reserveFee + fees.destFee + fees.refundFee;
|
|
13057
13057
|
assets = buildAssets(chain, assetInfo, totalFee, isRelayAsset, version);
|
|
13058
13058
|
return _context.a(2, buildTypeAndThenCall(context, isRelayAsset, finalCustomXcm, assets));
|
package/dist/index.mjs
CHANGED
|
@@ -11854,7 +11854,7 @@ var getXcmFeeEstimate = /*#__PURE__*/function () {
|
|
|
11854
11854
|
case 3:
|
|
11855
11855
|
originSufficient = _context.v;
|
|
11856
11856
|
_context.n = 4;
|
|
11857
|
-
return isSufficientDestination(destApi, destination, address,
|
|
11857
|
+
return isSufficientDestination(destApi, destination, address, amount, originAsset, fixedDestinationFee);
|
|
11858
11858
|
case 4:
|
|
11859
11859
|
_destinationSufficient = _context.v;
|
|
11860
11860
|
return _context.a(2, {
|
|
@@ -12897,17 +12897,17 @@ var createTypeAndThenCallContext = /*#__PURE__*/function () {
|
|
|
12897
12897
|
};
|
|
12898
12898
|
}();
|
|
12899
12899
|
|
|
12900
|
-
var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount) {
|
|
12900
|
+
var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount, isForFeeCalc) {
|
|
12901
12901
|
var origin = _ref.origin,
|
|
12902
12902
|
dest = _ref.dest,
|
|
12903
12903
|
reserve = _ref.reserve,
|
|
12904
12904
|
isSubBridge = _ref.isSubBridge,
|
|
12905
12905
|
assetInfo = _ref.assetInfo,
|
|
12906
12906
|
options = _ref.options;
|
|
12907
|
-
var fees = arguments.length >
|
|
12908
|
-
reserveFee:
|
|
12907
|
+
var fees = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
12908
|
+
reserveFee: 0n,
|
|
12909
12909
|
refundFee: 0n,
|
|
12910
|
-
destFee:
|
|
12910
|
+
destFee: 0n
|
|
12911
12911
|
};
|
|
12912
12912
|
var destination = options.destination,
|
|
12913
12913
|
version = options.version,
|
|
@@ -12943,8 +12943,8 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount) {
|
|
|
12943
12943
|
assetsFilter.push(createAsset(version, assetInfo.amount, localizeLocation(reserve.chain, assetInfo.location)));
|
|
12944
12944
|
if (isSubBridge || origin.chain !== reserve.chain && dest.chain !== reserve.chain) {
|
|
12945
12945
|
var buyExecutionAmount = !isDotAsset ? destFee : assetInfo.amount - reserveFee - refundFee;
|
|
12946
|
-
if (buyExecutionAmount < 0n) throw new AmountTooLowError();
|
|
12947
|
-
var filter =
|
|
12946
|
+
if (buyExecutionAmount < 0n && !isForFeeCalc) throw new AmountTooLowError();
|
|
12947
|
+
var filter = isForFeeCalc ? {
|
|
12948
12948
|
Wild: 'All'
|
|
12949
12949
|
} : {
|
|
12950
12950
|
Definite: assetsFilter
|
|
@@ -13045,7 +13045,7 @@ var createTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
13045
13045
|
return deepEqual(assetInfo.location, loc);
|
|
13046
13046
|
});
|
|
13047
13047
|
assetCount = isRelayAsset ? 1 : 2;
|
|
13048
|
-
customXcm = createCustomXcm(context, isRelayAsset, assetCount);
|
|
13048
|
+
customXcm = createCustomXcm(context, isRelayAsset, assetCount, true);
|
|
13049
13049
|
refundInstruction = senderAddress ? createRefundInstruction(api, senderAddress, version, assetCount) : null;
|
|
13050
13050
|
_context.n = 2;
|
|
13051
13051
|
return computeAllFees(context, customXcm, isRelayAsset, refundInstruction);
|
|
@@ -13053,7 +13053,7 @@ var createTypeAndThenCall = /*#__PURE__*/function () {
|
|
|
13053
13053
|
fees = _context.v;
|
|
13054
13054
|
finalCustomXcm = [];
|
|
13055
13055
|
if (refundInstruction && !isSubBridge) finalCustomXcm.push(refundInstruction);
|
|
13056
|
-
finalCustomXcm.push.apply(finalCustomXcm, _toConsumableArray(createCustomXcm(context, isRelayAsset, assetCount, fees)));
|
|
13056
|
+
finalCustomXcm.push.apply(finalCustomXcm, _toConsumableArray(createCustomXcm(context, isRelayAsset, assetCount, false, fees)));
|
|
13057
13057
|
totalFee = fees.reserveFee + fees.destFee + fees.refundFee;
|
|
13058
13058
|
assets = buildAssets(chain, assetInfo, totalFee, isRelayAsset, version);
|
|
13059
13059
|
return _context.a(2, buildTypeAndThenCall(context, isRelayAsset, finalCustomXcm, assets));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "11.12.
|
|
3
|
+
"version": "11.12.4",
|
|
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": "^2.0.0",
|
|
28
28
|
"viem": "^2.37.9",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/sdk-common": "11.12.
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/assets": "11.12.4",
|
|
30
|
+
"@paraspell/sdk-common": "11.12.4",
|
|
31
|
+
"@paraspell/pallets": "11.12.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|