API адресов предоставляет функциональность для управления криптовалютными адресами и сервисными кошельками.
Интерактивное тестирование
Тестируйте API в реальном времени! Введите ваш API ключ и нажимайте кнопки "Тест" для отправки запросов на https://cp-merch-dev.wsdemo.online/api
.
API адресов позволяет:
Создает новый адрес для определенной сети и монеты.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
network | string | Да | Слаг сети (например, bitcoin, ethereum, tron) |
coin | string | Нет | Слаг монеты (опционально) |
Адрес успешно создан
Возвращает информацию об адресе с балансом.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
address | string | Да | Криптовалютный адрес |
Информация об адресе получена
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"
}'
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]string{
"network": "ethereum",
}
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("Ответ: %s\n", body)
}
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'
})
});
const address = await response.json();
console.log('Создан адрес:', address);
};
createAddress();
import requests
import json
headers = {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {'network': 'ethereum'}
response = requests.post('https://cp-merch-dev.wsdemo.online/api/v1/addresses',
headers=headers,
json=payload)
if response.status_code == 201:
address = response.json()
print(f"Создан адрес: {address['address']}")
else:
print(f"Ошибка: {response.status_code}")
<?php
$apiKey = 'YOUR_API_KEY';
$payload = json_encode(['network' => 'ethereum']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://cp-merch-dev.wsdemo.online/api/v1/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 "Создан адрес: " . $address['address'] . "\n";
}
?>