@paraspell/sdk 8.15.1 → 8.16.0

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/README.md CHANGED
@@ -382,6 +382,13 @@ import { getExistentialDeposit } from "@paraspell/sdk";
382
382
  const ed = getExistentialDeposit(node, currency?)
383
383
  ```
384
384
 
385
+ ### Convert SS58 address
386
+ ```ts
387
+ import { convertSs58 } from "@paraspell/sdk";
388
+
389
+ let result = convertSs58(address, node) // returns converted address in string
390
+ ```
391
+
385
392
  ### XCM Transfer info
386
393
  ```ts
387
394
  import { getAssetBalance, getTransferInfo, getOriginFeeDetails, getTransferableAmount, getParaEthTransferFees, verifyEdOnDestination } from "@paraspell/sdk";
package/dist/index.cjs CHANGED
@@ -1007,6 +1007,15 @@ var PapiApi = /*#__PURE__*/function () {
1007
1007
  var hex = polkadotApi.FixedSizeBinary.fromAccountId32(address).asHex();
1008
1008
  return isPrefixed ? hex : hex.slice(2);
1009
1009
  }
1010
+ }, {
1011
+ key: "accountToUint8a",
1012
+ value: function accountToUint8a(address) {
1013
+ var result = polkadotApi.getSs58AddressInfo(address);
1014
+ if (!result.isValid) {
1015
+ throw new sdkCore.InvalidParameterError("Invalid address: ".concat(address));
1016
+ }
1017
+ return result.publicKey;
1018
+ }
1010
1019
  }, {
1011
1020
  key: "callTxMethod",
1012
1021
  value: function callTxMethod(_ref4) {
@@ -1734,6 +1743,11 @@ var assets = /*#__PURE__*/Object.freeze({
1734
1743
  verifyEdOnDestination: verifyEdOnDestination
1735
1744
  });
1736
1745
 
1746
+ var convertSs58 = function convertSs58(address, node) {
1747
+ var papiApi = new PapiApi();
1748
+ return sdkCore.convertSs58(papiApi, address, node);
1749
+ };
1750
+
1737
1751
  /**
1738
1752
  * Builder class for constructing transfers from Ethereum to Polkadot.
1739
1753
  */
@@ -1943,6 +1957,7 @@ exports.Builder = Builder;
1943
1957
  exports.EvmBuilder = EvmBuilder;
1944
1958
  exports.assets = assets;
1945
1959
  exports.claimAssets = claimAssets;
1960
+ exports.convertSs58 = convertSs58;
1946
1961
  exports.createApiInstanceForNode = createApiInstanceForNode;
1947
1962
  exports.dryRun = dryRun;
1948
1963
  exports.dryRunOrigin = dryRunOrigin;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _paraspell_sdk_core from '@paraspell/sdk-core';
2
- import { TApiOrUrl, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, TEvmBuilderOptions, TNodeWithRelayChains, TCurrencyInputWithAmount, GeneralBuilder as GeneralBuilder$1, TSendBaseOptions, TNodeDotKsmWithRelayChains } from '@paraspell/sdk-core';
2
+ import { TApiOrUrl, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, TNodeDotKsmWithRelayChains, TEvmBuilderOptions, TNodeWithRelayChains, TCurrencyInputWithAmount, GeneralBuilder as GeneralBuilder$1, TSendBaseOptions } from '@paraspell/sdk-core';
3
3
  export * from '@paraspell/sdk-core';
4
4
  import { TEvmNodeFrom } from '@paraspell/sdk-core/src';
5
5
  import * as polkadot_api from 'polkadot-api';
@@ -131,6 +131,8 @@ declare namespace assets {
131
131
  };
132
132
  }
133
133
 
134
+ declare const convertSs58: (address: string, node: TNodeDotKsmWithRelayChains) => string;
135
+
134
136
  /**
135
137
  * Builder class for constructing transfers from Ethereum to Polkadot.
136
138
  */
@@ -242,5 +244,5 @@ declare namespace transfer {
242
244
 
243
245
  declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
244
246
 
245
- export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
247
+ export { Builder, EvmBuilder, assets, claimAssets, convertSs58, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
246
248
  export type { GeneralBuilder, TEvmNodeFromPapi, TPapiApi, TPapiApiOrUrl, TPapiTransaction };
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { InvalidParameterError, BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, 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, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$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';
5
5
  import { ethers } from 'ethers';
6
- import { FixedSizeBinary, Binary, AccountId, createClient } from 'polkadot-api';
6
+ import { FixedSizeBinary, getSs58AddressInfo, Binary, AccountId, createClient } from 'polkadot-api';
7
7
  import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
8
8
 
9
9
  function _arrayLikeToArray(r, a) {
@@ -1006,6 +1006,15 @@ var PapiApi = /*#__PURE__*/function () {
1006
1006
  var hex = FixedSizeBinary.fromAccountId32(address).asHex();
1007
1007
  return isPrefixed ? hex : hex.slice(2);
1008
1008
  }
1009
+ }, {
1010
+ key: "accountToUint8a",
1011
+ value: function accountToUint8a(address) {
1012
+ var result = getSs58AddressInfo(address);
1013
+ if (!result.isValid) {
1014
+ throw new InvalidParameterError("Invalid address: ".concat(address));
1015
+ }
1016
+ return result.publicKey;
1017
+ }
1009
1018
  }, {
1010
1019
  key: "callTxMethod",
1011
1020
  value: function callTxMethod(_ref4) {
@@ -1733,6 +1742,11 @@ var assets = /*#__PURE__*/Object.freeze({
1733
1742
  verifyEdOnDestination: verifyEdOnDestination
1734
1743
  });
1735
1744
 
1745
+ var convertSs58 = function convertSs58(address, node) {
1746
+ var papiApi = new PapiApi();
1747
+ return convertSs58$1(papiApi, address, node);
1748
+ };
1749
+
1736
1750
  /**
1737
1751
  * Builder class for constructing transfers from Ethereum to Polkadot.
1738
1752
  */
@@ -1938,4 +1952,4 @@ var transfer = /*#__PURE__*/Object.freeze({
1938
1952
  send: send
1939
1953
  });
1940
1954
 
1941
- export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
1955
+ export { Builder, EvmBuilder, assets, claimAssets, convertSs58, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "8.15.1",
3
+ "version": "8.16.0",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "ethers": "^6.13.7",
28
28
  "quick-lru": "^7.0.1",
29
29
  "viem": "^2.28.1",
30
- "@paraspell/sdk-core": "8.15.1"
30
+ "@paraspell/sdk-core": "8.16.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "polkadot-api": ">= 1.10.2 < 2"