Learn about the hexConcat
utils method
Introduction
The hexConcat
method is used to concatenate multiple hex strings into a single hex string. This method is often used to join together several hex values into a single string for EVM operations.
Usage
This method should be used when concatenating multiple hex strings into a single string. For example, if you have two hex strings '0xabcd'
and '0xef01'
, you can use this method to join them into a single string '0xabcdef01'
.
Here's a simple code example to demonstrate how to use this method:
const { Utils } = require("alchemy-sdk");
let hexString1 = "0xabcd";
let hexString2 = "0xef01";
let concatenatedHex = Utils.hexConcat([hexString1, hexString2]);
console.log(concatenatedHex); // 0xabcdef01