This guide walks through five common integration scenarios. Each pattern describes the goal, the API calls involved, and the sequence of operations. For full request and response schemas, see the Platform API Reference.
Goal: Monitor customer deposit addresses and react to incoming funds in real time.
When to use: Payment platforms, exchange deposit flows, and any service that needs to credit user accounts when crypto arrives.
- Import your HD wallet public key (
POST /public_keys). - Generate a unique deposit address for each customer (
POST /public_keys/{public_key_id}/addresses/next). - Create a webhook notification channel (
POST /channels). - When funds arrive, Vilna delivers a webhook event to your server.
- Your server verifies the signature, matches the address to a customer, and credits their account.
# 1. Import xPub
curl -X POST "https://api.vilna.io/v1/public_keys" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"value": "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKp...",
"label": "Customer Deposits",
"derivation_path": "m/84h/0h/0h"
}'
# 2. Generate next address for a new customer
curl -X POST "https://api.vilna.io/v1/public_keys/{pubkey_id}/addresses/next" \
-H "X-Api-Key: ${VILNA_API_KEY}"
# 3. Create webhook channel
curl -X POST "https://api.vilna.io/v1/channels" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "Deposit Webhooks",
"config": {
"kind": "webhook",
"url": "https://your-app.example.com/deposits/webhook",
"headers": {}
}
}'- Use
X-Webhook-Event-Id(or theevent_idbody field) to prevent double-crediting on retries — it is stable across retry attempts. - Store the mapping between generated addresses and customer IDs in your database.
- Verify webhook signatures before processing. See Authentication.
Goal: Show users an aggregated view of their holdings and recent activity across multiple chains.
When to use: Wallet dashboards, accounting tools, and portfolio analytics products.
- Import each user address with
POST /addresses/external. - Poll
GET /balancesfor current holdings. - Poll
GET /activityfor recent balance changes. - Use
references.tokensandreferences.blockchainsfrom the response to display token names and chain info without extra lookups.
# Add an address
curl -X POST "https://api.vilna.io/v1/addresses/external" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"value": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
"chainFamily": "evm",
"label": "Main Wallet"
}'
# Fetch balances
curl "https://api.vilna.io/v1/balances?limit=30&page=1" \
-H "X-Api-Key: ${VILNA_API_KEY}"
# Fetch recent activity
curl "https://api.vilna.io/v1/activity?limit=50&page=1" \
-H "X-Api-Key: ${VILNA_API_KEY}"- Use the
meta.total_pagesvalue to implement pagination or infinite scroll. - The
referencesobject in each response includes token and chain metadata, so you don't need extra API calls for display names. - For real-time updates, combine polling with a webhook channel.
Goal: Manage a hierarchical deterministic wallet where new addresses are derived on demand and automatically monitored.
When to use: Custody platforms, exchange hot wallets, and any system that generates addresses from a master public key.
- Import the extended public key (
POST /public_keys) with its derivation path. - Whenever you need a fresh address, call
POST /public_keys/{public_key_id}/addresses/next. - Vilna tracks the derivation index and starts monitoring the new address immediately.
- Query balances and transactions across all derived addresses using
GET /balancesandGET /transactions.
# Import the extended public key
curl -X POST "https://api.vilna.io/v1/public_keys" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"value": "xpub6BosfCnifzxRT1QKLpFfcUrgWmLqoJcGt...",
"label": "Exchange Hot Wallet",
"derivation_path": "m/44h/60h/0h"
}'
# Generate addresses as needed
curl -X POST "https://api.vilna.io/v1/public_keys/{pubkey_id}/addresses/next" \
-H "X-Api-Key: ${VILNA_API_KEY}"- Vilna supports BIP-32, BIP-44, BIP-49, BIP-84, and BIP-86 derivation paths.
- You can import xPub, yPub, or zPub keys depending on the address format you need (legacy, SegWit, native SegWit, Taproot).
- The public key never leaves Vilna unencrypted - private keys are never required.
Goal: Track addresses across several blockchains and filter activity by chain.
When to use: Multi-chain wallets, cross-chain analytics dashboards, and compliance monitoring tools.
- Check which blockchains are available (
GET /blockchains). - Register addresses with a
chainFamilyto monitor them on all chains in that family. - Query
GET /activityorGET /transactionsand filter by chain as needed. - Use
references.blockchainsto display chain metadata.
# List supported chains
curl "https://api.vilna.io/v1/blockchains" \
-H "X-Api-Key: ${VILNA_API_KEY}"
# Monitor an address on all EVM chains (Ethereum, Polygon, Arbitrum, etc.)
curl -X POST "https://api.vilna.io/v1/addresses/external" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"value": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
"chainFamily": "evm",
"label": "Multi-chain Wallet"
}'
# Get activity across all chains
curl "https://api.vilna.io/v1/activity?limit=30&page=1" \
-H "X-Api-Key: ${VILNA_API_KEY}"- EVM addresses (0x-prefixed) can be monitored on all EVM-compatible chains with a single
POST /addresses/externalcall by specifyingchainFamily: "evm". - Non-EVM chains (Bitcoin, Solana, Tron) require chain-specific address formats.
- Each chain is indexed independently, so a single address may have different balances and transaction histories on different chains.
Goal: Receive real-time notifications through multiple channels whenever blockchain activity occurs on monitored addresses.
When to use: Treasury monitoring, compliance alerts, operational dashboards, and on-call systems.
- Add the addresses you want to watch (
POST /addresses/external). - Create a webhook channel for your backend (
POST /channelswithkind: "webhook"). - Optionally create a Telegram channel for human operators (
POST /channelswithkind: "telegram"). - Test both channels (
POST /channels/{channel_id}/actions/test). - All events on monitored addresses are delivered to every active channel.
# Create a webhook channel
curl -X POST "https://api.vilna.io/v1/channels" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "Backend Alerts",
"config": {
"kind": "webhook",
"url": "https://your-app.example.com/alerts/webhook",
"headers": {}
}
}'
# Create a Telegram channel
curl -X POST "https://api.vilna.io/v1/channels" \
-H "X-Api-Key: ${VILNA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "Ops Team Telegram",
"config": {
"kind": "telegram",
"bot_token": "987654321:ABCdefGHIjklMNOpqrsTUVwxyz123456789",
"chat_id": -1001234567890,
"language": "en",
"thread_id": 0
}
}'
# Test the webhook channel
curl -X POST "https://api.vilna.io/v1/channels/{channel_id}/actions/test" \
-H "X-Api-Key: ${VILNA_API_KEY}"- All active channels receive all events. Use server-side filtering in your webhook handler to route or suppress events as needed.
- Webhook channels include HMAC-SHA256 signatures so your backend can verify each delivery. Telegram channels have no equivalent — Telegram is the endpoint, so trust is anchored in who has access to the chat and the bot.
- For high-value accounts, use both channels so that human operators get Telegram alerts while your backend processes events automatically.