You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Eip712Signer that is initialized with an Ethers v6 Ethereum wallet and can be used with Builders to sign Farcaster Messages. If you're looking for Ethers v5 support, see this troubleshooting guide.
Properties
Name
Type
Description
scheme
Uint8Array
Signature scheme used when signing messages
Constructors
static new EthersEip712Signer
Usage
import{EthersEip712Signer}from'@farcaster/hub-nodejs';import{Wallet}from'ethers';constmnemonic='ordinary long coach bounce thank quit become youth belt pretty diet caught attract melt bargain';constwallet=Wallet.fromPhrase(mnemonic);consteip712Signer=newEthersEip712Signer(wallet);
Generates a 256-bit signature for a VerificationClaim and returns the bytes.
Usage
import{FarcasterNetwork,hexStringToBytes,makeVerificationEthAddressClaim}from'@farcaster/hub-nodejs';constblockHashHex='0x1d3b0456c920eb503450c7efdcf9b5cf1f5184bf04e5d8ecbcead188a0d02018';constblockHashBytes=hexStringToBytes(blockHashHex)._unsafeUnwrap();// Safety: blockHashHex is known and can't errorconstethereumAddressResult=awaiteip712Signer.getSignerKey();if(ethereumAddressResult.isOk()){constclaimResult=makeVerificationEthAddressClaim(1,ethereumAddressResult.value,FarcasterNetwork.DEVNET,blockHashBytes);if(claimResult.isOk()){constverificationResult=awaiteip712Signer.signVerificationEthAddressClaim(claimResult.value);if(verificationResult.isOk()){console.log(verificationResult.value);}}}