@paraspell/sdk-pjs 8.5.1 → 8.5.2

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 CHANGED
@@ -896,15 +896,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
896
896
  }
897
897
  return createApiInstance;
898
898
  }()
899
- }, {
900
- key: "createAccountId",
901
- value: function createAccountId(address) {
902
- return this.api.createType('AccountId32', address).toHex();
903
- }
904
899
  }, {
905
900
  key: "accountToHex",
906
901
  value: function accountToHex(address) {
907
902
  var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
903
+ if (util.isHex(address)) return address;
908
904
  var uint8Array = utilCrypto.decodeAddress(address);
909
905
  return util.u8aToHex(uint8Array, -1, isPrefixed);
910
906
  }
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { WETH9__factory } from '@snowbridge/contract-types';
5
5
  import { WsProvider, ApiPromise } from '@polkadot/api';
6
6
  import { u32 } from '@polkadot/types';
7
7
  import { decodeAddress, blake2AsHex } from '@polkadot/util-crypto';
8
- import { u8aToHex, numberToHex } from '@polkadot/util';
8
+ import { isHex, u8aToHex, numberToHex } from '@polkadot/util';
9
9
  import { Contract } from 'ethers';
10
10
  import { getContract, createPublicClient, http } from 'viem';
11
11
 
@@ -895,15 +895,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
895
895
  }
896
896
  return createApiInstance;
897
897
  }()
898
- }, {
899
- key: "createAccountId",
900
- value: function createAccountId(address) {
901
- return this.api.createType('AccountId32', address).toHex();
902
- }
903
898
  }, {
904
899
  key: "accountToHex",
905
900
  value: function accountToHex(address) {
906
901
  var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
902
+ if (isHex(address)) return address;
907
903
  var uint8Array = decodeAddress(address);
908
904
  return u8aToHex(uint8Array, -1, isPrefixed);
909
905
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "8.5.1",
3
+ "version": "8.5.2",
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.32",
28
28
  "ethers": "^6.13.5",
29
29
  "viem": "^2.22.22",
30
- "@paraspell/sdk-core": "8.5.1"
30
+ "@paraspell/sdk-core": "8.5.2"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 15.0 < 16",