Overview
The BlocWise Wallet API enables you to create and manage different types of blockchain wallets through RESTful endpoints. This guide will help you understand the basics and get started with wallet integration.
Quick Start
Copy # Create a new wallet
curl -X POST https://api.bloclabs.com/v1/wallets/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "mpc",
"network": "ethereum",
"label": "My First Wallet"
}'
Wallet Types
We support four types of wallets, each designed for specific use cases:
1. MPC Wallet (Recommended)
Best for applications requiring high security and institutional-grade features.
Copy POST /v1/wallets/create
Request:
Copy {
"type": "mpc",
"network": "ethereum",
"label": "Secure Trading Wallet",
"environment": "mainnet"
}
Response:
Copy {
"status": "success",
"data": {
"wallet_id": "wallet_123abc",
"address": "0x123...abc",
"type": "mpc",
"network": "ethereum",
"label": "Secure Trading Wallet",
"created_at": "2024-03-15T10:30:00Z"
}
}
Key Features:
Distributed key generation
No single point of failure
Enterprise-grade security
2. HD Wallet
Ideal for personal wallets and standard cryptocurrency applications.
Copy POST /v1/wallets/create
Request:
Copy {
"type": "hd",
"network": "polygon",
"label": "Personal Wallet",
"environment": "mainnet"
}
Response:
Copy {
"status": "success",
"data": {
"wallet_id": "wallet_456def",
"address": "0x456...def",
"type": "hd",
"network": "polygon",
"label": "Personal Wallet",
"created_at": "2024-03-15T10:35:00Z"
}
}
3. Watch Wallet
Perfect for portfolio tracking and monitoring addresses.
Copy POST /v1/wallets/watch
Request:
Copy {
"address": "0x789...ghi",
"network": "ethereum",
"label": "Portfolio Tracker",
"notifications": {
"large_transfers": true,
"incoming_transactions": true
}
}
Response:
Copy {
"status": "success",
"data": {
"wallet_id": "watch_789ghi",
"address": "0x789...ghi",
"type": "watch",
"network": "ethereum",
"label": "Portfolio Tracker"
}
}
Common Operations
Checking Wallet Balance
Copy GET /v1/wallets/{wallet_id}/balance
Response:
Copy {
"status": "success",
"data": {
"balance": "1.5",
"currency": "ETH",
"usd_value": "3000.00",
"updated_at": "2024-03-15T10:40:00Z"
}
}
Sending Transactions
Copy POST /v1/wallets/{wallet_id}/transfer
Request:
Copy {
"to": "0x789...def",
"amount": "1.5",
"asset": "ETH",
"gas_priority": "medium"
}
Response:
Copy {
"status": "success",
"data": {
"transaction_id": "tx_123abc",
"status": "pending",
"hash": "0xabc...",
"estimated_completion_time": "2024-03-15T10:45:00Z"
}
}
Get Transaction Status
Copy GET /v1/wallets/{wallet_id}/transactions/{transaction_id}
Response:
Copy {
"status": "success",
"data": {
"transaction_id": "tx_123abc",
"status": "confirmed",
"hash": "0xabc...",
"block_number": 15481234,
"confirmations": 12
}
}
Error Handling
Common error responses:
Copy {
"status": "error",
"message": "Invalid network specified",
"errors": [
{
"type": "validation_error",
"message": "Network must be one of: ethereum, polygon, binance",
"field": "network"
}
]
}
Best Practices
Security
Always verify transaction details
Implement proper error handling
Use appropriate authentication methods
Cache wallet data when appropriate
Implement proper error handling
Use webhooks for real-time updates
Next Steps
Advanced Wallet Operations
Last updated 2 months ago