Monitor Multi-Chain Wallets with FluxRail: A Developer's Guide
Learn how to monitor and manage wallets across multiple blockchains using FluxRail's unified API. This guide covers subscriptions, webhooks, and wallet helpers with copy-paste curl examples.
Managing wallets across multiple blockchains is a nightmare. You need to track deposits, watch for suspicious activity, and react to events in real time. With FluxRail's unified API, you can monitor and manage wallets across 31+ chains without dealing with each chain's RPC endpoints or WebSocket infrastructure.
In this guide, I'll walk you through using FluxRail's Core (blockchain monitoring) and Wallet (stateless helpers) services to build a multi-chain wallet monitoring system. You'll learn how to create subscriptions, handle webhooks, and manage wallet addresses—all with simple REST calls.
Getting Started
First, sign up at fluxrail.io to get your API keys. Use flux_test_... for sandbox testing—it's fully simulated, so you can safely experiment.
All requests go to https://api.fluxrail.io/api/v1 and require the X-API-Key header.
curl https://api.fluxrail.io/api/v1/chains \
-H "X-API-Key: flux_test_xxx"
This returns a list of supported chains. Save the slug values—you'll need them for subscriptions.
Creating Wallet Subscriptions
To monitor a wallet address, create a subscription. You can subscribe to an address or a contract. Here's how to subscribe to an Ethereum address:
curl -X POST https://api.fluxrail.io/api/v1/subscriptions \
-H "X-API-Key: flux_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"chain": "ethereum",
"address": "0x1234...",
"webhook_url": "https://your-server.com/webhook",
"event_types": ["transfer", "approval"]
}'
FluxRail will start monitoring that address for transfers and approvals. You can also subscribe to multiple addresses at once using the bulk endpoint:
curl -X POST https://api.fluxrail.io/api/v1/subscriptions/bulk \
-H "X-API-Key: flux_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"subscriptions": [
{
"chain": "ethereum",
"address": "0xaaaa...",
"webhook_url": "https://your-server.com/webhook"
},
{
"chain": "polygon",
"address": "0xbbbb...",
"webhook_url": "https://your-server.com/webhook"
}
]
}'
Managing Subscriptions
You can list, update, pause, or delete subscriptions. For example, to list all active subscriptions:
curl https://api.fluxrail.io/api/v1/subscriptions \
-H "X-API-Key: flux_test_xxx"
To get stats (counts per chain, etc.):
curl https://api.fluxrail.io/api/v1/subscriptions/stats \
-H "X-API-Key: flux_test_xxx"
To pause a subscription (useful when doing maintenance):
curl -X POST https://api.fluxrail.io/api/v1/subscriptions/{id}/toggle \
-H "X-API-Key: flux_test_xxx"
To delete a subscription:
curl -X DELETE https://api.fluxrail.io/api/v1/subscriptions/{id} \
-H "X-API-Key: flux_test_xxx"
Receiving Webhooks
When an event occurs, FluxRail sends a signed webhook to your URL. The signature is in the X-FluxRail-Signature header (HMAC SHA-256). Always verify it to avoid fake events.
Here's a sample webhook payload:
{
"id": "evt_...",
"type": "transfer",
"chain": "ethereum",
"address": "0x1234...",
"tx_hash": "0x...",
"from": "0x...",
"to": "0x...",
"value": "1000000000000000000",
"livemode": false
}
To verify the signature, use the raw body and your webhook secret (available in the dashboard). In Node.js:
const crypto = require('crypto');
function verifySignature(rawBody, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}
If verification fails, reject the request. FluxRail will retry failed deliveries—you can also manually retry via the API:
curl -X POST https://api.fluxrail.io/api/v1/events/{id}/retry \
-H "X-API-Key: flux_test_xxx"
Querying Events
If you miss a webhook or want to backfill, you can fetch events directly:
curl https://api.fluxrail.io/api/v1/events?chain=ethereum&address=0x1234... \
-H "X-API-Key: flux_test_xxx"
Get stats on events:
curl https://api.fluxrail.io/api/v1/events/stats \
-H "X-API-Key: flux_test_xxx"
Wallet Helper Services
FluxRail also provides stateless wallet utilities. For example, to generate a mnemonic:
curl -X POST https://api.fluxrail.io/api/v1/wallet/mnemonic \
-H "X-API-Key: flux_test_xxx" \
-H "Content-Type: application/json" \
-d '{}'
To derive addresses from a mnemonic:
curl -X POST https://api.fluxrail.io/api/v1/wallet/derive \
-H "X-API-Key: flux_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"mnemonic": "your twelve words here",
"path": "m/44'/60'/0'/0/0"
}'
You can also validate a mnemonic:
curl -X POST https://api.fluxrail.io/api/v1/wallet/validate \
-H "X-API-Key: flux_test_xxx" \
-H "Content-Type: application/json" \
-d '{"mnemonic": "your twelve words here"}'
These helpers let you generate wallets for your users without exposing your own infrastructure.
Putting It All Together
Here's a typical workflow for a multi-chain wallet monitoring system:
- Generate a wallet for each user using the Wallet API.
- Create subscriptions for each wallet address on the relevant chains.
- Set up a webhook endpoint to receive events.
- Verify signatures and process events (e.g., credit user balances, trigger alerts).
- Use the Dashboard or API to manage subscriptions as needed.
With FluxRail, you don't need to run your own nodes or deal with chain-specific quirks. One API handles everything.
Learn More
Check the official docs at https://fluxrail.io/docs for full endpoint reference and webhook details. For AI-assisted development, FluxRail also offers an MCP server—see the docs for integration prompts.
Happy building!