I tried to use ethers' keccak256 function like this:
import { keccak256 } from "@ethersproject/keccak256";
const signature = keccak256("balanceOf(address)");
But the script failed with this error:
Error: invalid arrayify value (argument="value", value="balanceOf(address)", code=INVALID_ARGUMENT, version=bytes/5.5.0)
How can I make it work?