A little help migrating from Ethers #627
Replies: 4 comments 6 replies
-
I know that signer would be defined like this so Im really just looking for matching the hashes and generating the signature.
|
Beta Was this translation helpful? Give feedback.
-
I figured out that these are generating equivalent hashes. Do you see any issues with this viem method of generating a hash?
|
Beta Was this translation helpful? Give feedback.
-
will keep an eye that pr for the message signature 👍 |
Beta Was this translation helpful? Give feedback.
-
I had some trouble getting this figured out, so in case anyone hits a similar issue and comes across this, this is the key aspect that helped me migrate from ethers:
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
I'm working on the server side looking to rewrite the following function using viem instead of ethers. It seems simple enough and I've kinda made some progress but the hashes continue to not match and the sign message gives me an error of "personal_sign" is not supported.
Any help would be appreciated thanks!
const provider = new ethers.providers.AlchemyProvider(
"homestead",
"<ALCHEMY_API_KEY"
);
const signer = new Wallet(
"<SIGNER_ADDRESS>",
provider
);
const hash = ethers.utils.solidityKeccak256(
["bytes"],
[
ethers.utils.defaultAbiCoder.encode(
["address", "uint256"],
[minter, salt]
),
]
);
const signature = await signer.signMessage(ethers.utils.arrayify(hash));
return signature
Beta Was this translation helpful? Give feedback.
All reactions