Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
PRIVATE_KEY |
Yes (for tx mode) |
Wallet private key |
NEXT_PUBLIC_API_URL |
No | Custom API endpoint |
Example .env
# Required for real payments
PRIVATE_KEY=0xabc123...
# Optional: Custom API endpoint
# NEXT_PUBLIC_API_URL=https://your-custom-api.com
Custom API URL
Override the default API endpoint:
const client = new QueryFlowClient(privateKey, {
apiUrl: "https://your-custom-api.com",
});
Network Configuration
The SDK is configured for Avalanche Fuji Testnet by default.
| Setting | Value |
|---|---|
| Chain ID | 43113 |
| RPC | Default public RPC |
| Explorer | Snowtrace Testnet |
Getting Testnet AVAX
For tx mode, you need testnet AVAX:
- Go to Avalanche Faucet
- Enter your wallet address
- Request testnet AVAX
- Wait for confirmation (~2 seconds)