Learn about the hexValue
utils method.
Introduction
The hexValue
method is used to get the number value of a hex string, ignoring leading zeros.
Usage
This method should be used when you want to get the number value of a hex string, ignoring leading zeros. For example, you can use this method to get the number value of the hex string '0x00000000000000000000000000000000000000000000000000001234'
.
Here's a simple code example to demonstrate how to use this method:
const { Utils } = require("alchemy-sdk");
let hexString = '0x00000000000000000000000000000000000000000000000000001234';
let value = Utils.hexValue(hexString);
console.log(value); // 0x1234