Skip to main content

What is a Wallet ID?

A wallet_id is a unique identifier for an app wallet that Neynar operates on your behalf. When you use a wallet_id, Neynar executes onchain transactions for you, handling gas estimation, transaction submission, and retry logic automatically. Think of it as a server-side wallet that you fund with gas tokens, and Neynar manages the technical complexity of blockchain interactions.

When Do You Need a Wallet ID?

You need a wallet_id for all onchain operations on Neynar:
OperationEndpointWallet ID Status
Mint NFTsPOST /v2/farcaster/nft/mintREQUIRED
Send FungiblesPOST /v2/farcaster/fungible/sendREQUIRED
Buy StoragePOST /v2/farcaster/storage/buyREQUIRED
Fetch FIDGET /v2/farcaster/user/fidREQUIRED
Register AccountPOST /v2/farcaster/user/REQUIRED
All onchain operations require a wallet_id. This ensures consistent billing and gives you full control over your onchain spending.

Getting Your Wallet Set Up

App wallets are self-service - you can create them directly in the developer portal!

Setup Process

  1. Go to the Neynar Developer Portal
  2. Select your app from the dashboard
  3. Navigate to the “App Wallet” tab in your app settings
  4. Copy your wallet_id - You’ll see a field displaying your wallet ID once created
  5. Copy your wallet address(es) - You’ll receive wallet addresses for each supported network
  6. Fund your wallet with gas tokens (see below)
  7. Start using the wallet_id in your API calls immediately!
Need Help? If you encounter any issues during setup, message our developer Slack.

What You’ll Get

When you create an app wallet, you’ll receive:
  1. Wallet ID - A unique identifier to use in API headers (e.g., wlt_abc123...)
  2. Wallet Addresses - Ethereum addresses for each network where you can send gas tokens (e.g., 0x1234...)

Finding Your Wallet ID

Your wallet_id is available anytime in the developer portal:
  1. Go to dev.neynar.com
  2. Select your app
  3. Navigate to the “App Wallet” tab
  4. Copy your wallet_id value
Keep this information secure - treat your wallet_id like an API key.

Funding Your Wallet

Your wallet needs native gas tokens on the networks where you’ll operate:

Supported Networks

NetworkGas TokenUse Case
BaseETHProduction NFT minting, mainnet operations
OptimismETHAccount registration, storage purchases
Base SepoliaETH (testnet)Testing and development

How to Fund

  1. Get your wallet address from setup email or portal
  2. Send gas tokens to that address using any wallet (MetaMask, Coinbase Wallet, etc.)
  3. Recommended amounts:
    • Testing: 0.01 ETH
    • Low volume (<100 ops/day): 0.1 ETH
    • High volume (>1000 ops/day): 1+ ETH

Funding Example

# Using MetaMask or any wallet:
# 1. Switch to the appropriate network (Base, Optimism, etc.)
# 2. Send ETH to your wallet address
# 3. Wait for confirmation

# Example wallet address (yours will be different):
# 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
Gas Costs: Typical operations cost:
  • NFT mint: ~$0.01-0.05 in gas
  • Account registration: ~$0.10-0.50 in gas
  • Storage purchase: ~$0.05-0.20 in gas

Monitoring Balance

Check Balance Manually

You can view your wallet balance on any block explorer: Base:
https://basescan.org/address/YOUR_WALLET_ADDRESS
Optimism:
https://optimistic.etherscan.io/address/YOUR_WALLET_ADDRESS
Base Sepolia:
https://sepolia.basescan.org/address/YOUR_WALLET_ADDRESS

Developer Portal

The developer portal shows:
  • Current balance per network
  • Recent transactions
  • Wallet addresses for each network
  • Transaction history

Using Your Wallet ID

Add the x-wallet-id header to your API requests:

Example: Minting NFTs

const response = await fetch('https://api.neynar.com/v2/farcaster/nft/mint', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_NEYNAR_API_KEY',
    'x-wallet-id': 'your-wallet-id',  // ← Your wallet ID here
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    nft_contract_address: '0x...',
    network: 'base',
    recipients: [{ fid: 12345, quantity: 1 }]
  })
});

const result = await response.json();
console.log('Minted:', result);

Example: Buying Storage

const response = await fetch('https://api.neynar.com/v2/farcaster/storage/buy', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_NEYNAR_API_KEY',
    'x-wallet-id': 'your-wallet-id',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    fid: 12345,
    units: 1
  })
});

Error Handling

Missing Wallet ID

If you don’t provide a wallet_id when required:
{
  "code": "Unauthorized",
  "message": "Your app is not authorized for this operation. Please provide x-wallet-id header or contact support for allowlist access."
}
Solution: Add the x-wallet-id header or request allowlist access.

Invalid Wallet ID

If your wallet_id is incorrect:
{
  "code": "InvalidWalletId",
  "message": "The provided wallet_id is invalid or not found."
}
Solution: Verify your wallet_id in the developer portal or contact support.

Insufficient Balance

If your wallet runs out of gas:
{
  "code": "InsufficientFunds",
  "message": "Wallet does not have enough balance to complete this transaction."
}
Solution: Fund your wallet with more gas tokens.

Best Practices

Security

  • Store wallet_id securely - Treat it like an API key
  • Use environment variables - Never commit wallet_id to code
  • Rotate if compromised - Contact support for new wallet_id
  • Don’t share publicly - Keep wallet_id private

Operations

  • Monitor balance regularly - Set up alerts for low balance
  • Fund adequately - Ensure sufficient gas for your volume
  • Test on testnet first - Use Base Sepolia before mainnet
  • Handle errors gracefully - Implement retry logic

Cost Optimization

  • Batch operations when possible
  • Monitor gas prices - Some operations can wait for lower gas
  • Choose right network - Base often has lower gas costs than Optimism, some transactions can only be done on certain networks.

FAQ

Can I use one wallet_id for multiple apps?

No, each app should have its own wallet_id for security and accounting purposes.

What happens if my wallet runs out of funds?

Operations will fail with an insufficient balance error. Fund your wallet to resume operations.

Can I withdraw funds from my wallet?

Not currently. App wallets are managed by Neynar for security. Contact support if you need to adjust your setup.

Can I see transaction history?

Yes, use a block explorer with your wallet address, or check the developer portal (coming soon).

Need Help?