Want to reward your Farcaster community with NFTs? This guide shows you how to mint NFTs directly to Farcaster users using their FID (Farcaster ID) instead of wallet addresses.

Currently Limited to Highlight

This API currently only works with NFTs deployed through Highlight on EVM networks. We’re working on expanding support to other NFT platforms, so if you have a specific request let us know.

Server wallets need to be manually set up for each user. Contact us to get your server wallet configured.

Simulate vs Execute: GET vs POST

The API provides two modes of operation:

  • GET (Simulate): Returns transaction calldata without executing - perfect for previewing costs and validating parameters
  • POST (Execute): Actually executes the mint transaction using your server wallet

Getting Transaction Calldata (Simulate)

Use the GET endpoint to preview what the mint transaction will look like:

const response = await fetch('/farcaster/nft/mint?' + new URLSearchParams({
  nft_contract_address: '0x8F01e875C816eC2C9d94E62E47771EbDB82d9A8B',
  network: 'base-sepolia',
  recipients: JSON.stringify([{ fid: 14206, quantity: 1 }])
}));

const calldata = await response.json();
console.log(calldata[0]);

Example response:

{
  "recipient": {
    "fid": 14206,
    "quantity": 1
  },
  "abi": [...],
  "function_name": "mint",
  "args": [...],
  "to": "0x8F01e875C816eC2C9d94E62E47771EbDB82d9A8B",
  "data": "0x...",
  "value": "0",
  "network": "base-sepolia"
}

Executing the Mint Transaction

To actually mint the NFT, use the POST endpoint with your server wallet:

const response = await fetch('/farcaster/nft/mint', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-wallet-id': 'your-server-wallet-id'
  },
  body: JSON.stringify({
    nft_contract_address: '0x8F01e875C816eC2C9d94E62E47771EbDB82d9A8B',
    network: 'base-sepolia',
    recipients: [{ fid: 14206, quantity: 1 }],
    async: true
  })
});

const result = await response.json();
console.log(result.transactions[0].transaction_hash);

Async vs Sync Execution

You can choose how to handle transaction execution:

Set async: false to wait for transaction confirmation and get the receipt:

{
  "transactions": [{
    "transaction_hash": "0xabc...",
    "recipient": { "fid": 14206, "quantity": 1 },
    "receipt": {
      "status": "success",
      "gas_used": "150000",
      "block_number": "12345"
    }
  }]
}

Async Mode

Set async: true to get the transaction hash immediately and check status separately, will not work with large recipient lists:

{
  "transactions": [{
    "transaction_hash": "0xabc...",
    "recipient": { "fid": 14206, "quantity": 1 }
  }]
}

Batch Minting

Mint to multiple Farcaster users in a single API call:

const recipients = [
  { fid: 14206, quantity: 1 },
  { fid: 14207, quantity: 2 },
  { fid: 14208, quantity: 1 }
];

const response = await fetch('/farcaster/nft/mint', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-wallet-id': 'your-server-wallet-id'
  },
  body: JSON.stringify({
    nft_contract_address: '0x8F01e875C816eC2C9d94E62E47771EbDB82d9A8B',
    network: 'base-sepolia',
    recipients,
    async: true
  })
});

const result = await response.json();
// Returns 3 separate transactions
console.log(`Minted to ${result.transactions.length} users`);

Server Wallets

Server wallets are managed wallets you top up with funds that execute transactions on your behalf. Benefits include:

  • No gas management: We handle gas estimation and payment
  • Reliable execution: Built-in retry logic and error handling
  • FID resolution: Automatically resolves Farcaster IDs to wallet addresses

Getting Set Up

To use this API, you’ll need:

  1. A server wallet configured by our team
  2. Your x-wallet-id header value
  3. An NFT contract deployed on Highlight
  4. Native gas tokens on the network of your choosing (top up the address we setup for you)

Contact us at to get started!

Error Handling

If you don’t include the required x-wallet-id header, you’ll get:

{
  "code": "RequiredField",
  "message": "x-wallet-id header is required"
}

If you don’t have a wallet id reach out to get one setup.

Each transaction in batch minting will either succeed with a transaction_hash or fail with an error field.

That’s it! You’re now ready to reward your Farcaster community with NFTs using just their FIDs.

Enjoy building! 🚀

For additional help, feel free to contact us.