Skip to content

На этой странице

Addresses API

The addresses API provides functionality for managing cryptocurrency addresses, service wallets, and grey lists for various blockchain networks.

Interactive Testing

On this page you can test the API in real time! Enter your API key in the field below and click the "Test" buttons to send requests to the server https://cp-merch-dev.wsdemo.online/api.

If you encounter CORS errors:

  • Use the "📋 Copy curl" buttons to get ready-to-use commands
  • Execute commands in terminal or use Postman
  • Install a browser extension to disable CORS (e.g., "CORS Unblock")

Overview

The addresses API allows you to:

  • Create new addresses for specific networks and coins
  • Retrieve address information and balances
  • Manage service wallets (hot, cold, token collector)
  • Handle grey list addresses for security
  • Get balances for different wallet types

Authentication

Different endpoints require different levels of authentication:

  • CLIENT_API_KEY: For basic operations like creating addresses and checking balances
  • ADMIN_API_KEY: For administrative operations like managing service wallets
  • Bearer token: Alternative authentication method for all operations
POST

Create Address

POST /v1/addresses

Creates a new address for a certain network and coin (optional). If coin is not provided then address will be generated for all coins of provided network.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug (e.g., bitcoin, ethereum, tron)
coinstringНетCoin slug (optional, if not provided - generates for all network coins)
modestringНетAddress mode: single, common, cross
typestringНетAddress type: user, hot, cold, collector

Ответы

201 Created

Address successfully created

400 Bad Request

Invalid request parameters

GET

Get Address

GET /v1/addresses/{address}

Returns specified address with balance information.

Параметры

ПараметрТипОбязательныйОписание
addressstringДаThe cryptocurrency address to retrieve

Ответы

200 OK

Address information retrieved

400 Bad Request

Invalid address format

404 Not Found

Address not found

GET

Get Hot Wallet Balance

GET /v1/addresses/hot-wallet/{network}

Returns the balance of the withdrawal (hot) wallet for specified network.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug (e.g., bitcoin, ethereum, tron)

Ответы

200 OK

Hot wallet balance retrieved

400 Bad Request

Invalid network

GET

Get Service Wallet Balance

GET /v1/addresses/service-wallet/{network}

Returns the balance of the service (token collector) wallet for specified network.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug (e.g., bitcoin, ethereum, tron)

Ответы

200 OK

Service wallet balance retrieved

400 Bad Request

Invalid network

GET

Get Cold Wallet Balance

GET /v1/addresses/cold-wallet/{network}

Returns the balance of the cold wallet for specified network.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug (e.g., bitcoin, ethereum, tron)
coinstringНетOptional coin parameter to filter by specific coin

Ответы

200 OK

Cold wallet balance retrieved

400 Bad Request

Invalid network or coin

POST

Register Service Wallet

POST /v1/addresses/service-wallets

Register a service wallet for a certain network. For cold wallet need provide only an address. For rest wallets may provide an address and private key, otherwise the wallet will be created and address and private key will be returned.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug
typestringДаWallet type: hot, cold, tokens_collector
addressstringНетWallet address (required for cold wallets)
privateKeystringНетPrivate key (optional, will be generated if not provided)

Ответы

201 Created

Service wallet registered successfully

400 Bad Request

Invalid parameters

GET

Get Grey List

GET /v1/addresses/grey-list

Returns the list of grey-listed addresses for security monitoring.

Ответы

200 OK

Grey list retrieved

POST

Register Grey Address

POST /v1/addresses/grey-list

Register a grey address for a certain network for security monitoring.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug
addressstringДаAddress to add to grey list
reasonstringНетReason for grey listing

Ответы

201 Created

Grey address registered

400 Bad Request

Invalid parameters

DELETE

Delete Grey Address

DELETE /v1/addresses/grey-list

Delete the grey address for a certain network.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug
addressstringДаAddress to remove from grey list

Ответы

200 OK

Grey address deleted

400 Bad Request

Invalid parameters

404 Not Found

Address not found in grey list

API Configuration

Create Address

bash
curl -X POST "https://cp-merch-dev.wsdemo.online/api/v1/addresses" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "ethereum",
    "coin": "eth"
  }'

Response:

json
{
  "id": "addr_abc123def456",
  "address": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
  "network": "ethereum",
  "coin": "eth",
  "type": "user",
  "mode": "single",
  "createdAt": "2025-01-15T10:30:00Z"
}

Get Address Information

bash
curl -X GET "https://cp-merch-dev.wsdemo.online/api/v1/addresses/0x742d35Cc6634C0532925a3b8D4C9db96590c6C87" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

json
{
  "address": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
  "network": "ethereum",
  "balances": [
    {
      "coin": "eth",
      "balance": "1.234567890123456789",
      "balanceUSD": 2468.90
    },
    {
      "coin": "usdt",
      "balance": "1000.000000",
      "balanceUSD": 1000.00
    }
  ],
  "totalBalanceUSD": 3468.90
}

Get Hot Wallet Balance

bash
curl -X GET "https://cp-merch-dev.wsdemo.online/api/v1/addresses/hot-wallet/ethereum" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

json
{
  "network": "ethereum",
  "walletType": "hot",
  "balances": [
    {
      "coin": "eth",
      "balance": "10.567890123456789",
      "balanceUSD": 21135.78
    },
    {
      "coin": "usdt",
      "balance": "50000.000000",
      "balanceUSD": 50000.00
    }
  ],
  "totalBalanceUSD": 71135.78
}

Go HTTP Client

go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    // Create address
    payload := map[string]string{
        "network": "ethereum",
        "coin":    "eth",
    }
    
    jsonData, _ := json.Marshal(payload)
    
    req, _ := http.NewRequest("POST", "https://cp-merch-dev.wsdemo.online/api/v1/addresses", bytes.NewBuffer(jsonData))
    req.Header.Set("X-Api-Key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")
    
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    
    body, _ := io.ReadAll(resp.Body)
    fmt.Printf("Response: %s\n", body)
}

JavaScript Fetch

javascript
// Create new address
const createAddress = async () => {
  const response = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/addresses', {
    method: 'POST',
    headers: {
      'X-Api-Key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      network: 'ethereum',
      coin: 'eth'
    })
  });
  
  const address = await response.json();
  console.log('Created address:', address);
  
  // Get address information
  const addressResponse = await fetch(`https://cp-merch-dev.wsdemo.online/api/v1/addresses/${address.address}`, {
    headers: {
      'X-Api-Key': 'YOUR_API_KEY'
    }
  });
  
  const addressInfo = await addressResponse.json();
  console.log('Address info:', addressInfo);
};

createAddress();

Python Requests

python
import requests
import json

# API configuration
API_BASE = 'https://cp-merch-dev.wsdemo.online/api/v1'
headers = {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}

# Create new address
payload = {
    'network': 'ethereum',
    'coin': 'eth'
}

response = requests.post(f'{API_BASE}/addresses', 
                        headers=headers, 
                        json=payload)

if response.status_code == 201:
    address = response.json()
    print(f"Created address: {address['address']}")
    
    # Get address information
    addr_response = requests.get(f"{API_BASE}/addresses/{address['address']}", 
                                headers=headers)
    
    if addr_response.status_code == 200:
        address_info = addr_response.json()
        print(f"Address balances: {address_info['balances']}")
else:
    print(f"Error: {response.status_code}")

PHP cURL

php
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://cp-merch-dev.wsdemo.online/api/v1';

// Create new address
$payload = json_encode([
    'network' => 'ethereum',
    'coin' => 'eth'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . '/addresses');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-Api-Key: ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 201) {
    $address = json_decode($response, true);
    echo "Created address: " . $address['address'] . "\n";
} else {
    echo "Error: " . $httpCode . "\n";
}
?>

Released under the MIT License.