Skip to main content

Prerequisites

1

Node.js Installed

Ensure you have Nodejs installed on your system. You can download it from Node.js’ official website.
2

API Key and Mnemonic

Obtain an API key from the dev portal Ensure you have a valid Ethereum mnemonic phrase of the account with a signer associated with the above API key.
3

Dependencies Installed

Install the required packages:

Code Breakdown and Steps

1

Import Required Libraries

The code begins by importing the necessary libraries:
2

Define Your Mnemonic

Replace "YOUR_MNEMONIC_HERE" with your Ethereum mnemonic phrase:
3

Convert Mnemonic to Account

The mnemonicToAccount function converts your mnemonic into an account object:
4

Configure Neynar API Client

Replace "YOUR_API_KEY_HERE" with your API key and set the correct base path for the Neynar API:
5

Create the SIWE Message

The createSiweMessage function generates a SIWE message with details such as domain, address, and nonce:
6

Sign and Verify the Message

The fetchSigners function handles the signing process and fetches signers:Note: The address should be the custody_address of the farcaster account (Check custody_address in User API)
7

Execute the Function

Call the fetchSigners function and handle success or errors:

Expected Output

For additional help, feel free to contact us.