Skip to main content
Before using faremeter, you need a wallet with funds on the network you plan to use. This guide covers creating wallets and funding them for development.

Solana

Creating a wallet

1

Install Solana CLI

sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
2

Create a new keypair

solana-keygen new --outfile ~/.config/solana/id.json
Save the output address — you’ll need it for funding.
3

Secure your keypair

Never commit keypair files to version control. Add them to your .gitignore:
id.json
*-keypair.json
If you already have a Solana wallet (Phantom, Solflare, etc.), export your private key and convert it to the keypair JSON format.
Never share your private key or keypair file. Anyone with access can control your funds.

Funding on devnet

Devnet tokens are free. Your wallet needs SOL for transaction fees and USDC for payments.
# Airdrop SOL (free on devnet)
solana airdrop 2 --keypair ~/.config/solana/id.json --url devnet

# Verify balance
solana balance --keypair ~/.config/solana/id.json --url devnet
For devnet USDC, use the SPL Token Faucet or the Solana devnet faucet.

Funding on mainnet

For production use, your wallet needs:
  1. SOL — For transaction fees (~0.000005 SOL per transaction). Purchase from an exchange (Coinbase, Kraken, etc.) and transfer to your wallet address. Start with 0.05–0.1 SOL.
  2. USDC — For payments. Ensure you purchase Solana USDC (mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v), not Ethereum USDC.
# Verify SOL balance
solana balance --keypair ~/.config/solana/id.json

# Verify USDC balance
spl-token balance EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --owner ~/.config/solana/id.json
Start small. Begin with 1–10 USDC to test before funding larger amounts.

EVM

Creating a wallet

Generate an EVM private key using any of these methods:
# Using openssl
openssl rand -hex 32
Or use a wallet like MetaMask and export the private key. The key should be a 64-character hex string (prefix with 0x in your .env).

Funding on Base Sepolia

Base Sepolia is the recommended EVM testnet. You need:
  1. Sepolia ETH — For gas fees. Use the Base Sepolia Faucet or bridge from Sepolia ETH.
  2. Testnet USDC — For payments. Available from faucets or bridging.

EVM network identifiers

NetworkIdentifierChain ID
Basebase8453
Base Sepoliabase-sepolia84532
When configuring an EVM wallet, you pass the chain ID and name:
import { createLocalWallet } from "@faremeter/wallet-evm"

const wallet = await createLocalWallet(
  { id: 84532, name: "base-sepolia" },
  process.env.EVM_PRIVATE_KEY,
)
See Networks & Assets for the full list of supported EVM networks.

Environment variables

Create a .env file in your project root:
.env
# Solana keypair file path
PAYER_KEYPAIR_PATH=$HOME/.config/solana/id.json

# EVM private key (hex string with 0x prefix)
EVM_PRIVATE_KEY=0x...

# Merchant addresses (for server-side)
MERCHANT_ADDRESS=7xKXwxRPMo2sUAT5...
EVM_MERCHANT_ADDRESS=0x1234...
Load it in your application:
import "dotenv/config"

Security best practices

  • Never commit .env files to version control
  • Never expose keypairs in logs or error messages
  • Use different wallets for development and production
Add to your .gitignore:
.env
.env.*
client-wallet.json

Next steps