@paraspell/sdk 10.11.6 → 10.11.7
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 +14 -13
- package/dist/index.mjs +15 -14
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1487,28 +1487,29 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1487
1487
|
key: "getXcmPaymentApiFee",
|
|
1488
1488
|
value: function () {
|
|
1489
1489
|
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(node, xcm, asset) {
|
|
1490
|
-
var
|
|
1490
|
+
var transformXcm,
|
|
1491
|
+
weight,
|
|
1492
|
+
localizedLocation,
|
|
1493
|
+
transformedLocation,
|
|
1494
|
+
feeResult,
|
|
1495
|
+
_args21 = arguments;
|
|
1491
1496
|
return _regenerator().w(function (_context21) {
|
|
1492
1497
|
while (1) switch (_context21.n) {
|
|
1493
1498
|
case 0:
|
|
1499
|
+
transformXcm = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : false;
|
|
1494
1500
|
_context21.n = 1;
|
|
1495
|
-
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(xcm);
|
|
1501
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(transformXcm ? _transform(xcm) : xcm);
|
|
1496
1502
|
case 1:
|
|
1497
1503
|
weight = _context21.v;
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
throw new sdkCore.InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1503
|
-
case 2:
|
|
1504
|
-
transformedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || sdkCore.isRelayChain(node) ? sdkCore.localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1505
|
-
transformedPapiLocation = _transform(transformedLocation);
|
|
1506
|
-
_context21.n = 3;
|
|
1504
|
+
sdkCore.assertHasLocation(asset);
|
|
1505
|
+
localizedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || sdkCore.isRelayChain(node) ? sdkCore.localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1506
|
+
transformedLocation = _transform(localizedLocation);
|
|
1507
|
+
_context21.n = 2;
|
|
1507
1508
|
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight.value, {
|
|
1508
1509
|
type: sdkCore.Version.V4,
|
|
1509
|
-
value:
|
|
1510
|
+
value: transformedLocation
|
|
1510
1511
|
});
|
|
1511
|
-
case
|
|
1512
|
+
case 2:
|
|
1512
1513
|
feeResult = _context21.v;
|
|
1513
1514
|
return _context21.a(2, feeResult.value);
|
|
1514
1515
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidParameterError, isConfig, BatchMode, getNodeProviders, MissingChainApiError, NodeNotSupportedError, createApiInstanceForNode as createApiInstanceForNode$1, Parents, Version, getNode, isForeignAsset, assertHasId, computeFeeFromDryRun, findAsset, Native, getNativeAssetSymbol, hasXcmPaymentApiSupport, getAssetsObject, localizeLocation, isRelayChain,
|
|
1
|
+
import { InvalidParameterError, isConfig, BatchMode, getNodeProviders, MissingChainApiError, NodeNotSupportedError, createApiInstanceForNode as createApiInstanceForNode$1, Parents, Version, getNode, isForeignAsset, assertHasId, computeFeeFromDryRun, findAsset, Native, getNativeAssetSymbol, hasXcmPaymentApiSupport, getAssetsObject, assertHasLocation, localizeLocation, isRelayChain, padFeeBy, isAssetEqual, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Override, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, getXcmFee as getXcmFee$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { blake2b } from '@noble/hashes/blake2';
|
|
4
4
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
@@ -1486,28 +1486,29 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1486
1486
|
key: "getXcmPaymentApiFee",
|
|
1487
1487
|
value: function () {
|
|
1488
1488
|
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(node, xcm, asset) {
|
|
1489
|
-
var
|
|
1489
|
+
var transformXcm,
|
|
1490
|
+
weight,
|
|
1491
|
+
localizedLocation,
|
|
1492
|
+
transformedLocation,
|
|
1493
|
+
feeResult,
|
|
1494
|
+
_args21 = arguments;
|
|
1490
1495
|
return _regenerator().w(function (_context21) {
|
|
1491
1496
|
while (1) switch (_context21.n) {
|
|
1492
1497
|
case 0:
|
|
1498
|
+
transformXcm = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : false;
|
|
1493
1499
|
_context21.n = 1;
|
|
1494
|
-
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(xcm);
|
|
1500
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(transformXcm ? _transform(xcm) : xcm);
|
|
1495
1501
|
case 1:
|
|
1496
1502
|
weight = _context21.v;
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
throw new InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1502
|
-
case 2:
|
|
1503
|
-
transformedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || isRelayChain(node) ? localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1504
|
-
transformedPapiLocation = _transform(transformedLocation);
|
|
1505
|
-
_context21.n = 3;
|
|
1503
|
+
assertHasLocation(asset);
|
|
1504
|
+
localizedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || isRelayChain(node) ? localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1505
|
+
transformedLocation = _transform(localizedLocation);
|
|
1506
|
+
_context21.n = 2;
|
|
1506
1507
|
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight.value, {
|
|
1507
1508
|
type: Version.V4,
|
|
1508
|
-
value:
|
|
1509
|
+
value: transformedLocation
|
|
1509
1510
|
});
|
|
1510
|
-
case
|
|
1511
|
+
case 2:
|
|
1511
1512
|
feeResult = _context21.v;
|
|
1512
1513
|
return _context21.a(2, feeResult.value);
|
|
1513
1514
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "10.11.
|
|
3
|
+
"version": "10.11.7",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"viem": "^2.33.2",
|
|
28
|
-
"@paraspell/sdk-core": "10.11.
|
|
28
|
+
"@paraspell/sdk-core": "10.11.7"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.15.2 < 2"
|