MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / ethSign

Function ethSign

packages/example-project/scripts/ledger.ts:57–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57async function ethSign() {
58 const msg = ethers.toUtf8Bytes("Hello eth_sign");
59 const hexMsg = ethers.hexlify(msg);
60
61 const sig = await provider.request({
62 method: "eth_sign",
63 params: [ledgerAddress, hexMsg],
64 });
65
66 const verifiedAddress = ethers.verifyMessage("Hello eth_sign", sig);
67
68 assert.equal(verifiedAddress, ledgerAddress);
69}
70
71async function personalSign() {
72 const message = "Hello personal_sign";

Callers

nothing calls this directly

Calls 1

requestMethod · 0.65

Tested by

no test coverage detected