@paraspell/sdk-pjs 8.15.2 → 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-pjs";
382
382
  const ed = getExistentialDeposit(node, currency?)
383
383
  ```
384
384
 
385
+ ### Convert SS58 address
386
+ ```ts
387
+ import { convertSs58 } from "@paraspell/sdk-pjs";
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-pjs";
package/dist/index.cjs CHANGED
@@ -529,6 +529,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
529
529
  var uint8Array = utilCrypto.decodeAddress(address);
530
530
  return util.u8aToHex(uint8Array, -1, isPrefixed);
531
531
  }
532
+ }, {
533
+ key: "accountToUint8a",
534
+ value: function accountToUint8a(address) {
535
+ return utilCrypto.decodeAddress(address);
536
+ }
532
537
  }, {
533
538
  key: "callTxMethod",
534
539
  value: function callTxMethod(_ref) {
@@ -1257,6 +1262,11 @@ var assets = /*#__PURE__*/Object.freeze({
1257
1262
  verifyEdOnDestination: verifyEdOnDestination
1258
1263
  });
1259
1264
 
1265
+ var convertSs58 = function convertSs58(address, node) {
1266
+ var papiApi = new PolkadotJsApi();
1267
+ return sdkCore.convertSs58(papiApi, address, node);
1268
+ };
1269
+
1260
1270
  var approveToken = /*#__PURE__*/function () {
1261
1271
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(signer, amount, symbol) {
1262
1272
  var env, contract, weth9, result, receipt;
@@ -1834,6 +1844,7 @@ exports.EvmBuilder = EvmBuilder;
1834
1844
  exports.approveToken = approveToken;
1835
1845
  exports.assets = assets;
1836
1846
  exports.claimAssets = claimAssets;
1847
+ exports.convertSs58 = convertSs58;
1837
1848
  exports.createApiInstanceForNode = createApiInstanceForNode;
1838
1849
  exports.depositToken = depositToken;
1839
1850
  exports.dryRun = dryRun;
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 * as _polkadot_api from '@polkadot/api';
5
5
  import { ApiPromise } from '@polkadot/api';
@@ -133,6 +133,8 @@ declare namespace assets {
133
133
  };
134
134
  }
135
135
 
136
+ declare const convertSs58: (address: string, node: TNodeDotKsmWithRelayChains) => string;
137
+
136
138
  /**
137
139
  * Builder class for constructing transfers from Ethereum to Polkadot.
138
140
  */
@@ -269,5 +271,5 @@ declare namespace transfer {
269
271
 
270
272
  declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
271
273
 
272
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
274
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
273
275
  export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, 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, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, 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, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, 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 { WsProvider, ApiPromise } from '@polkadot/api';
4
4
  import { u32 } from '@polkadot/types';
@@ -528,6 +528,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
528
528
  var uint8Array = decodeAddress(address);
529
529
  return u8aToHex(uint8Array, -1, isPrefixed);
530
530
  }
531
+ }, {
532
+ key: "accountToUint8a",
533
+ value: function accountToUint8a(address) {
534
+ return decodeAddress(address);
535
+ }
531
536
  }, {
532
537
  key: "callTxMethod",
533
538
  value: function callTxMethod(_ref) {
@@ -1256,6 +1261,11 @@ var assets = /*#__PURE__*/Object.freeze({
1256
1261
  verifyEdOnDestination: verifyEdOnDestination
1257
1262
  });
1258
1263
 
1264
+ var convertSs58 = function convertSs58(address, node) {
1265
+ var papiApi = new PolkadotJsApi();
1266
+ return convertSs58$1(papiApi, address, node);
1267
+ };
1268
+
1259
1269
  var approveToken = /*#__PURE__*/function () {
1260
1270
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(signer, amount, symbol) {
1261
1271
  var env, contract, weth9, result, receipt;
@@ -1828,4 +1838,4 @@ var transfer = /*#__PURE__*/Object.freeze({
1828
1838
  transferEthToPolkadot: transferEthToPolkadot
1829
1839
  });
1830
1840
 
1831
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
1841
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "8.15.2",
3
+ "version": "8.16.0",
4
4
  "description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@snowbridge/contract-types": "0.1.50",
28
28
  "ethers": "^6.13.7",
29
29
  "viem": "^2.28.1",
30
- "@paraspell/sdk-core": "8.15.2"
30
+ "@paraspell/sdk-core": "8.16.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 15.0 < 16",