Wallet Management

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

# 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:

Best for applications requiring high security and institutional-grade features.

POST /v1/wallets/create

Request:

{
    "type": "mpc",
    "network": "ethereum",
    "label": "Secure Trading Wallet",
    "environment": "mainnet"
}

Response:

{
    "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

  • Multi-signature support

2. HD Wallet

Ideal for personal wallets and standard cryptocurrency applications.

POST /v1/wallets/create

Request:

{
    "type": "hd",
    "network": "polygon",
    "label": "Personal Wallet",
    "environment": "mainnet"
}

Response:

{
    "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.

POST /v1/wallets/watch

Request:

{
    "address": "0x789...ghi",
    "network": "ethereum",
    "label": "Portfolio Tracker",
    "notifications": {
        "large_transfers": true,
        "incoming_transactions": true
    }
}

Response:

{
    "status": "success",
    "data": {
        "wallet_id": "watch_789ghi",
        "address": "0x789...ghi",
        "type": "watch",
        "network": "ethereum",
        "label": "Portfolio Tracker"
    }
}

Common Operations

Checking Wallet Balance

GET /v1/wallets/{wallet_id}/balance

Response:

{
    "status": "success",
    "data": {
        "balance": "1.5",
        "currency": "ETH",
        "usd_value": "3000.00",
        "updated_at": "2024-03-15T10:40:00Z"
    }
}

Sending Transactions

POST /v1/wallets/{wallet_id}/transfer

Request:

{
    "to": "0x789...def",
    "amount": "1.5",
    "asset": "ETH",
    "gas_priority": "medium"
}

Response:

{
    "status": "success",
    "data": {
        "transaction_id": "tx_123abc",
        "status": "pending",
        "hash": "0xabc...",
        "estimated_completion_time": "2024-03-15T10:45:00Z"
    }
}

Get Transaction Status

GET /v1/wallets/{wallet_id}/transactions/{transaction_id}

Response:

{
    "status": "success",
    "data": {
        "transaction_id": "tx_123abc",
        "status": "confirmed",
        "hash": "0xabc...",
        "block_number": 15481234,
        "confirmations": 12
    }
}

Error Handling

Common error responses:

{
    "status": "error",
    "message": "Invalid network specified",
    "errors": [
        {
            "type": "validation_error",
            "message": "Network must be one of: ethereum, polygon, binance",
            "field": "network"
        }
    ]
}

Best Practices

Security

  1. Always verify transaction details

  2. Implement proper error handling

  3. Use appropriate authentication methods

  4. Regular security audits

Performance

  1. Cache wallet data when appropriate

  2. Batch balance updates

  3. Implement proper error handling

  4. Use webhooks for real-time updates

Next Steps

  • Advanced Wallet Operations

  • Transaction Management

  • Security Best Practices

  • API Reference

Last updated

Was this helpful?