This guide demonstrates how to get a list of signers for an account if the developer can’t access the user’s mnemonic. (If the developer has access to the mnemonic, check: Backend)
fetchNonce
and fetchSigners
) should ideally be performed on the backend to protect your API key and maintain security.
Ethereum-Enabled Browser
API Key
Dependencies Installed
Import Required Libraries
Configure Neynar API Client
Create the Wallet Client
createWalletClient
function initializes a wallet client using the viem
library. It uses window.ethereum
to connect to the browser’s wallet:Create the SIWE Message
createSiweMessage
function generates a SIWE message with details such as domain, address, and nonce:Sign and Verify the Message
fetchSigners
function retrieves the user’s Ethereum address, generates a SIWE message, signs it, and verifies the signature using the Neynar API.Note:address
should be the custody_address
of the farcaster account (Check custody_address in User API)Execute the Function
fetchSigners
function and handle the response or errors: