@paraspell/sdk 11.14.2 → 11.14.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 +12 -6
- package/dist/index.mjs +13 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -883,10 +883,16 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
883
883
|
value: function accountToUint8a(address) {
|
|
884
884
|
var result = polkadotApi.getSs58AddressInfo(address);
|
|
885
885
|
if (!result.isValid) {
|
|
886
|
-
throw new sdkCore.
|
|
886
|
+
throw new sdkCore.InvalidAddressError("Invalid address: ".concat(address));
|
|
887
887
|
}
|
|
888
888
|
return result.publicKey;
|
|
889
889
|
}
|
|
890
|
+
}, {
|
|
891
|
+
key: "validateSubstrateAddress",
|
|
892
|
+
value: function validateSubstrateAddress(address) {
|
|
893
|
+
var result = polkadotApi.getSs58AddressInfo(address);
|
|
894
|
+
return result.isValid;
|
|
895
|
+
}
|
|
890
896
|
}, {
|
|
891
897
|
key: "callTxMethod",
|
|
892
898
|
value: function callTxMethod(_ref5) {
|
|
@@ -1292,12 +1298,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1292
1298
|
case 8:
|
|
1293
1299
|
response = _context12.v;
|
|
1294
1300
|
entry = response.find(function (_ref6) {
|
|
1295
|
-
var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$assetId2;
|
|
1301
|
+
var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$symbol3, _asset$assetId2;
|
|
1296
1302
|
var keyArgs = _ref6.keyArgs;
|
|
1297
1303
|
var _keyArgs = _slicedToArray(keyArgs, 2);
|
|
1298
1304
|
_keyArgs[0];
|
|
1299
1305
|
var assetItem = _keyArgs[1];
|
|
1300
|
-
return assetItem.toString().toLowerCase() === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase()) || sdkCore.isForeignAsset(asset) && assetItem.toString().toLowerCase() === ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.toString().toLowerCase() === ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && sdkCore.isForeignAsset(asset) && assetItem.value.toString().toLowerCase() === ((_asset$assetId2 = asset.assetId) === null || _asset$assetId2 === void 0 ? void 0 : _asset$assetId2.toLowerCase());
|
|
1306
|
+
return assetItem.toString().toLowerCase() === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase()) || sdkCore.isForeignAsset(asset) && assetItem.toString().toLowerCase() === ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.toString().toLowerCase() === ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.type && assetItem.value.type.toString().toLowerCase() === ((_asset$symbol3 = asset.symbol) === null || _asset$symbol3 === void 0 ? void 0 : _asset$symbol3.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && sdkCore.isForeignAsset(asset) && assetItem.value.toString().toLowerCase() === ((_asset$assetId2 = asset.assetId) === null || _asset$assetId2 === void 0 ? void 0 : _asset$assetId2.toLowerCase());
|
|
1301
1307
|
});
|
|
1302
1308
|
return _context12.a(2, entry !== null && entry !== void 0 && entry.value ? BigInt(entry.value.free.toString()) : 0n);
|
|
1303
1309
|
}
|
|
@@ -2099,12 +2105,12 @@ var EvmBuilderCore = /*#__PURE__*/function () {
|
|
|
2099
2105
|
key: "build",
|
|
2100
2106
|
value: (function () {
|
|
2101
2107
|
var _build = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2102
|
-
var _this$_options, from, to, address;
|
|
2108
|
+
var _this$_options, from, to, address, api;
|
|
2103
2109
|
return _regenerator().w(function (_context) {
|
|
2104
2110
|
while (1) switch (_context.n) {
|
|
2105
2111
|
case 0:
|
|
2106
|
-
_this$_options = this._options, from = _this$_options.from, to = _this$_options.to, address = _this$_options.address;
|
|
2107
|
-
sdkCore.validateAddress(address, to);
|
|
2112
|
+
_this$_options = this._options, from = _this$_options.from, to = _this$_options.to, address = _this$_options.address, api = _this$_options.api;
|
|
2113
|
+
sdkCore.validateAddress(api, address, to);
|
|
2108
2114
|
if (!(from === 'Moonbeam' && to === 'Ethereum')) {
|
|
2109
2115
|
_context.n = 1;
|
|
2110
2116
|
break;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidParameterError, isConfig, BatchMode, getChainProviders, MissingChainApiError, Parents, Version, assertHasId, assertHasLocation, getChain, isForeignAsset, computeFeeFromDryRun, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, replaceBigInt, getAssetsObject, ChainNotSupportedError, wrapTxBypass, localizeLocation, isAssetXcEqual, padValueBy, isRelayChain, isAssetEqual, createChainClient as createChainClient$1, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$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 } from '@paraspell/sdk-core';
|
|
1
|
+
import { InvalidParameterError, isConfig, InvalidAddressError, BatchMode, getChainProviders, MissingChainApiError, Parents, Version, assertHasId, assertHasLocation, getChain, isForeignAsset, computeFeeFromDryRun, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, replaceBigInt, getAssetsObject, ChainNotSupportedError, wrapTxBypass, localizeLocation, isAssetXcEqual, padValueBy, isRelayChain, isAssetEqual, createChainClient as createChainClient$1, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$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 } 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';
|
|
@@ -882,10 +882,16 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
882
882
|
value: function accountToUint8a(address) {
|
|
883
883
|
var result = getSs58AddressInfo(address);
|
|
884
884
|
if (!result.isValid) {
|
|
885
|
-
throw new
|
|
885
|
+
throw new InvalidAddressError("Invalid address: ".concat(address));
|
|
886
886
|
}
|
|
887
887
|
return result.publicKey;
|
|
888
888
|
}
|
|
889
|
+
}, {
|
|
890
|
+
key: "validateSubstrateAddress",
|
|
891
|
+
value: function validateSubstrateAddress(address) {
|
|
892
|
+
var result = getSs58AddressInfo(address);
|
|
893
|
+
return result.isValid;
|
|
894
|
+
}
|
|
889
895
|
}, {
|
|
890
896
|
key: "callTxMethod",
|
|
891
897
|
value: function callTxMethod(_ref5) {
|
|
@@ -1291,12 +1297,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1291
1297
|
case 8:
|
|
1292
1298
|
response = _context12.v;
|
|
1293
1299
|
entry = response.find(function (_ref6) {
|
|
1294
|
-
var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$assetId2;
|
|
1300
|
+
var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$symbol3, _asset$assetId2;
|
|
1295
1301
|
var keyArgs = _ref6.keyArgs;
|
|
1296
1302
|
var _keyArgs = _slicedToArray(keyArgs, 2);
|
|
1297
1303
|
_keyArgs[0];
|
|
1298
1304
|
var assetItem = _keyArgs[1];
|
|
1299
|
-
return assetItem.toString().toLowerCase() === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase()) || isForeignAsset(asset) && assetItem.toString().toLowerCase() === ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.toString().toLowerCase() === ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && isForeignAsset(asset) && assetItem.value.toString().toLowerCase() === ((_asset$assetId2 = asset.assetId) === null || _asset$assetId2 === void 0 ? void 0 : _asset$assetId2.toLowerCase());
|
|
1305
|
+
return assetItem.toString().toLowerCase() === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase()) || isForeignAsset(asset) && assetItem.toString().toLowerCase() === ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.toString().toLowerCase() === ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && assetItem.value.type && assetItem.value.type.toString().toLowerCase() === ((_asset$symbol3 = asset.symbol) === null || _asset$symbol3 === void 0 ? void 0 : _asset$symbol3.toLowerCase()) || _typeof(assetItem) === 'object' && 'value' in assetItem && isForeignAsset(asset) && assetItem.value.toString().toLowerCase() === ((_asset$assetId2 = asset.assetId) === null || _asset$assetId2 === void 0 ? void 0 : _asset$assetId2.toLowerCase());
|
|
1300
1306
|
});
|
|
1301
1307
|
return _context12.a(2, entry !== null && entry !== void 0 && entry.value ? BigInt(entry.value.free.toString()) : 0n);
|
|
1302
1308
|
}
|
|
@@ -2098,12 +2104,12 @@ var EvmBuilderCore = /*#__PURE__*/function () {
|
|
|
2098
2104
|
key: "build",
|
|
2099
2105
|
value: (function () {
|
|
2100
2106
|
var _build = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2101
|
-
var _this$_options, from, to, address;
|
|
2107
|
+
var _this$_options, from, to, address, api;
|
|
2102
2108
|
return _regenerator().w(function (_context) {
|
|
2103
2109
|
while (1) switch (_context.n) {
|
|
2104
2110
|
case 0:
|
|
2105
|
-
_this$_options = this._options, from = _this$_options.from, to = _this$_options.to, address = _this$_options.address;
|
|
2106
|
-
validateAddress(address, to);
|
|
2111
|
+
_this$_options = this._options, from = _this$_options.from, to = _this$_options.to, address = _this$_options.address, api = _this$_options.api;
|
|
2112
|
+
validateAddress(api, address, to);
|
|
2107
2113
|
if (!(from === 'Moonbeam' && to === 'Ethereum')) {
|
|
2108
2114
|
_context.n = 1;
|
|
2109
2115
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "11.14.
|
|
3
|
+
"version": "11.14.4",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"@polkadot-api/legacy-provider": "^0.3.3",
|
|
28
28
|
"viem": "^2.38.5",
|
|
29
|
-
"@paraspell/sdk-core": "11.14.
|
|
29
|
+
"@paraspell/sdk-core": "11.14.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"polkadot-api": ">= 1.20.5 < 2"
|