encodeAbiParameters

Encodes the given ABI parameters and values into a hexadecimal string.

Example

import { encodeAbiParameters } from "viem";
const params = [
{ name: "param1", type: "uint256" },
{ name: "param2", type: "string" },
];
const values = [123, "hello"];
const data = encodeAbiParameters(params, values);
console.log(data);

Parameters

Returns

  • The encoded ABI parameters as a hexadecimal string.