@alephium/web3 0.18.0 → 0.18.1

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.
@@ -233,6 +233,9 @@ function stringToHex(str) {
233
233
  }
234
234
  exports.stringToHex = stringToHex;
235
235
  function hexToString(str) {
236
+ if (!isHexString(str)) {
237
+ throw new Error(`Invalid hex string: ${str}`);
238
+ }
236
239
  return buffer_1.Buffer.from(str, 'hex').toString();
237
240
  }
238
241
  exports.hexToString = hexToString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
@@ -242,6 +242,9 @@ export function stringToHex(str: string): string {
242
242
  }
243
243
 
244
244
  export function hexToString(str: string): string {
245
+ if (!isHexString(str)) {
246
+ throw new Error(`Invalid hex string: ${str}`)
247
+ }
245
248
  return Buffer.from(str, 'hex').toString()
246
249
  }
247
250