@paraspell/sdk 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
@@ -749,16 +749,15 @@ var PapiApi = /*#__PURE__*/function () {
749
749
  }
750
750
  return createApiInstance;
751
751
  }()
752
- }, {
753
- key: "createAccountId",
754
- value: function createAccountId(address) {
755
- return polkadotApi.FixedSizeBinary.fromAccountId32(address).asHex();
756
- }
757
752
  }, {
758
753
  key: "accountToHex",
759
754
  value: function accountToHex(address) {
760
755
  var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
761
- var hex = this.createAccountId(address);
756
+ var isHex = function isHex(str) {
757
+ return typeof str === 'string' && /^0x[0-9a-fA-F]+$/.test(str);
758
+ };
759
+ if (isHex(address)) return address;
760
+ var hex = polkadotApi.FixedSizeBinary.fromAccountId32(address).asHex();
762
761
  return isPrefixed ? hex : hex.slice(2);
763
762
  }
764
763
  }, {
package/dist/index.mjs CHANGED
@@ -748,16 +748,15 @@ var PapiApi = /*#__PURE__*/function () {
748
748
  }
749
749
  return createApiInstance;
750
750
  }()
751
- }, {
752
- key: "createAccountId",
753
- value: function createAccountId(address) {
754
- return FixedSizeBinary.fromAccountId32(address).asHex();
755
- }
756
751
  }, {
757
752
  key: "accountToHex",
758
753
  value: function accountToHex(address) {
759
754
  var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
760
- var hex = this.createAccountId(address);
755
+ var isHex = function isHex(str) {
756
+ return typeof str === 'string' && /^0x[0-9a-fA-F]+$/.test(str);
757
+ };
758
+ if (isHex(address)) return address;
759
+ var hex = FixedSizeBinary.fromAccountId32(address).asHex();
761
760
  return isPrefixed ? hex : hex.slice(2);
762
761
  }
763
762
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "8.5.1",
3
+ "version": "8.5.2",
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
  "ethers": "^6.13.5",
27
27
  "viem": "^2.22.22",
28
- "@paraspell/sdk-core": "8.5.1"
28
+ "@paraspell/sdk-core": "8.5.2"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.8.4 < 2"