01 Регистрация / Вход
curl -X POST https://your-domain.com/api/register \
-H "Content-Type: application/json" \
-d '{"unique_hash": "my_super_secret_code_minimum_20chars"}'
02 Создать кошелёк (TRON)
curl -X POST https://your-domain.com/api/wallet/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"node": "TRON"}'
03 Список кошельков
curl -X POST https://your-domain.com/api/wallets \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"node": "TRON"}'
04 Баланс кошелька
curl -X POST https://your-domain.com/api/wallet/balance \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"node": "ETH", "address": "0x742d35Cc6634C0532925a3b8..."}'
05 Перевод средств
curl -X POST https://your-domain.com/api/wallet/transfer \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"node": "TRON",
"address_from": "TXyz123...",
"address_to": "TAbc456...",
"amount": 10,
"symbol": "TRX"
}'
06 GasFree USDT перевод (TRON)
curl -X POST https://your-domain.com/api/wallet/transfer \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"node": "TRON",
"mode": "gasfree",
"address_from": "TXyz123...",
"address_to": "TAbc456...",
"amount": 50,
"symbol": "USDT"
}'
07 Статус GasFree перевода
curl -X POST https://your-domain.com/api/wallet/gasfree/status \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"trace_id": "unique-trace-id-123"}'
setup Базовый клиент
<?php
define('API_BASE', 'https://your-domain.com');
define('API_TOKEN', 'YOUR_TOKEN'); // После регистрации
function apiRequest(string $path, array $body = [], bool $auth = true): array {
$headers = ['Content-Type: application/json'];
if ($auth) {
$headers[] = 'Authorization: Bearer ' . API_TOKEN;
}
$ch = curl_init(API_BASE . $path);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_HTTPHEADER => $headers,
CURLOPT_TIMEOUT => 30,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return ['code' => $httpCode, 'data' => json_decode($response, true)];
}
01 Регистрация / Вход
$result = apiRequest('/api/register', [
'unique_hash' => 'my_super_secret_code_minimum_20chars'
], false);
if ($result['data']['token'] ?? false) {
$token = $result['data']['token'];
echo "Токен: $token\n";
} else {
echo "Ошибка: " . ($result['data']['error'] ?? 'unknown') . "\n";
}
02 Создать кошелёк
// Создать TRON кошелёк
$result = apiRequest('/api/wallet/create', ['node' => 'TRON']);
$wallet = $result['data'];
echo "Адрес: " . $wallet['address'] . "\n";
echo "Приватный ключ: " . $wallet['private_key'] . "\n";
// Создать ETH кошелёк
$ethWallet = apiRequest('/api/wallet/create', ['node' => 'ETH'])['data'];
echo "ETH адрес: " . $ethWallet['address'] . "\n";
// Создать GasFree TRON кошелёк (без TRX на газ)
$gfWallet = apiRequest('/api/wallet/create', [
'node' => 'TRON',
'mode' => 'gasfree'
])['data'];
echo "GasFree адрес: " . $gfWallet['gasfree_address'] . "\n";
03 Список кошельков
// Все кошельки
$result = apiRequest('/api/wallets');
foreach ($result['data']['list'] ?? [] as $w) {
echo "[{$w['node_name']}] {$w['address']}\n";
}
// Только TRON кошельки
$tronWallets = apiRequest('/api/wallets', ['node' => 'TRON'])['data'];
// Только GasFree кошельки
$gfWallets = apiRequest('/api/wallets', [
'node' => 'TRON',
'mode' => 'gasfree'
])['data'];
04 Баланс кошелька
$result = apiRequest('/api/wallet/balance', [
'node' => 'TRON',
'address' => 'TXyz123...'
]);
foreach ($result['data']['balances'] ?? [] as $b) {
echo "{$b['symbol']}: {$b['balance']}\n";
}
// ETH баланс
$ethBalance = apiRequest('/api/wallet/balance', [
'node' => 'ETH',
'address' => '0x742d35Cc6634...'
])['data'];
05 Перевод средств
// Перевод TRX
$result = apiRequest('/api/wallet/transfer', [
'node' => 'TRON',
'address_from' => 'TXyz123...',
'address_to' => 'TAbc456...',
'amount' => 10,
'symbol' => 'TRX'
]);
echo "TXID: " . $result['data']['data']['txid'] . "\n";
// Перевод USDT (стандартный)
$usdtResult = apiRequest('/api/wallet/transfer', [
'node' => 'TRON',
'address_from' => 'TXyz123...',
'address_to' => 'TAbc456...',
'amount' => 25.5,
'symbol' => 'USDT'
]);
06 GasFree USDT перевод
$result = apiRequest('/api/wallet/transfer', [
'node' => 'TRON',
'mode' => 'gasfree',
'address_from' => 'TXyz123...', // EOA адрес
'address_to' => 'TAbc456...',
'amount' => 50,
'symbol' => 'USDT' // Только USDT
]);
$traceId = $result['data']['data']['traceId'];
echo "Trace ID: $traceId\n";
// Проверить статус
$status = apiRequest('/api/wallet/gasfree/status', [
'trace_id' => $traceId
]);
echo "Статус: " . $status['data']['data']['status'] . "\n";
07 Комиссии GasFree
$fees = apiRequest('/api/wallet/gasfree/fees')['data'];
echo "Перевод: " . $fees['data']['transfer_fee'] . " USDT\n";
echo "Активация: " . $fees['data']['activation_fee'] . " USDT\n";
setup Базовый клиент (axios)
// npm install axios
const axios = require('axios');
const API_BASE = 'https://your-domain.com';
const API_TOKEN = 'YOUR_TOKEN'; // После регистрации
const api = axios.create({
baseURL: API_BASE,
headers: { 'Content-Type': 'application/json' },
});
// Авторизованный запрос
async function apiPost(path, body = {}, auth = true) {
const headers = auth
? { Authorization: `Bearer ${API_TOKEN}` }
: {};
const { data } = await api.post(path, body, { headers });
return data;
}
01 Регистрация / Вход
const result = await apiPost('/api/register', {
unique_hash: 'my_super_secret_code_minimum_20chars'
}, false);
const token = result.token;
console.log('Токен:', token);
02 Создать кошелёк
// TRON
const tronWallet = await apiPost('/api/wallet/create', { node: 'TRON' });
console.log('Адрес:', tronWallet.address);
console.log('Приватный ключ:', tronWallet.private_key);
// ETH / BSC / Polygon — меняем только node
const ethWallet = await apiPost('/api/wallet/create', { node: 'ETH' });
const bscWallet = await apiPost('/api/wallet/create', { node: 'BSC' });
const solWallet = await apiPost('/api/wallet/create', { node: 'SOLANA' });
// GasFree кошелёк (TRON без газа в TRX)
const gfWallet = await apiPost('/api/wallet/create', {
node: 'TRON',
mode: 'gasfree'
});
console.log('GasFree адрес:', gfWallet.gasfree_address);
03 Список кошельков
// Все кошельки
const all = await apiPost('/api/wallets');
all.list.forEach(w => console.log(`[${w.node_name}] ${w.address}`));
// Только TRON
const tron = await apiPost('/api/wallets', { node: 'TRON' });
// GasFree кошельки
const gasfree = await apiPost('/api/wallets', {
node: 'TRON',
mode: 'gasfree'
});
04 Баланс кошелька
const result = await apiPost('/api/wallet/balance', {
node: 'TRON',
address: 'TXyz123...'
});
result.balances.forEach(b => {
console.log(`${b.symbol}: ${b.balance}`);
});
// ETH
const ethBal = await apiPost('/api/wallet/balance', {
node: 'ETH',
address: '0x742d35Cc6634...'
});
05 Перевод средств
// TRX перевод
const txResult = await apiPost('/api/wallet/transfer', {
node: 'TRON',
address_from: 'TXyz123...',
address_to: 'TAbc456...',
amount: 10,
symbol: 'TRX'
});
console.log('TXID:', txResult.data.txid);
// BNB на BSC
const bnbTx = await apiPost('/api/wallet/transfer', {
node: 'BSC',
address_from: '0xSender...',
address_to: '0xRecipient...',
amount: 0.5,
symbol: 'BNB'
});
06 GasFree USDT перевод
const result = await apiPost('/api/wallet/transfer', {
node: 'TRON',
mode: 'gasfree',
address_from: 'TXyz123...', // EOA адрес
address_to: 'TAbc456...',
amount: 50,
symbol: 'USDT' // только USDT
});
const { traceId } = result.data;
console.log('Trace ID:', traceId);
// Ждём и проверяем статус
const status = await apiPost('/api/wallet/gasfree/status', {
trace_id: traceId
});
console.log('Статус:', status.data.status);
07 Комиссии GasFree
const fees = await apiPost('/api/wallet/gasfree/fees');
console.log(`Перевод: ${fees.data.transfer_fee} USDT`);
console.log(`Активация: ${fees.data.activation_fee} USDT`);
setup Базовый клиент (fetch)
const API_BASE = 'https://your-domain.com';
let API_TOKEN = ''; // Установить после регистрации
async function apiPost(path, body = {}, auth = true) {
const headers = { 'Content-Type': 'application/json' };
if (auth) headers['Authorization'] = `Bearer ${API_TOKEN}`;
const res = await fetch(API_BASE + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.error || `HTTP ${res.status}`);
}
return res.json();
}
01 Регистрация / Вход
const result = await apiPost('/api/register', {
unique_hash: 'my_super_secret_code_minimum_20chars'
}, false);
API_TOKEN = result.token; // Сохраняем токен
console.log('Токен:', API_TOKEN);
02 Создать кошелёк
// TRON кошелёк
const wallet = await apiPost('/api/wallet/create', { node: 'TRON' });
console.log('Адрес:', wallet.address);
// Несколько сетей параллельно
const [tron, eth, bsc, sol] = await Promise.all([
apiPost('/api/wallet/create', { node: 'TRON' }),
apiPost('/api/wallet/create', { node: 'ETH' }),
apiPost('/api/wallet/create', { node: 'BSC' }),
apiPost('/api/wallet/create', { node: 'SOLANA' }),
]);
// GasFree (TRON, без газа в TRX)
const gfWallet = await apiPost('/api/wallet/create', {
node: 'TRON',
mode: 'gasfree'
});
03 Список кошельков
const { list } = await apiPost('/api/wallets');
list.forEach(w => console.log(`[${w.node_name}] ${w.address}`));
// Фильтр по сети
const tronWallets = await apiPost('/api/wallets', { node: 'TRON' });
// GasFree кошельки
const gfWallets = await apiPost('/api/wallets', {
node: 'TRON', mode: 'gasfree'
});
04 Баланс кошелька
const { balances } = await apiPost('/api/wallet/balance', {
node: 'TRON',
address: 'TXyz123...'
});
balances.forEach(b => console.log(`${b.symbol}: ${b.balance}`));
05 Перевод средств
const result = await apiPost('/api/wallet/transfer', {
node: 'TRON',
address_from: 'TXyz123...',
address_to: 'TAbc456...',
amount: 10,
symbol: 'TRX'
});
console.log('TXID:', result.data.txid);
console.log('Комиссия:', result.data.commission);
06 GasFree USDT перевод
const result = await apiPost('/api/wallet/transfer', {
node: 'TRON',
mode: 'gasfree',
address_from: 'TXyz123...',
address_to: 'TAbc456...',
amount: 50,
symbol: 'USDT'
});
const traceId = result.data.traceId;
// Проверка статуса
const status = await apiPost('/api/wallet/gasfree/status', {
trace_id: traceId
});
console.log('Статус:', status.data.status);
console.log('TX Hash:', status.data.txHash);
07 Комиссии GasFree
const { data } = await apiPost('/api/wallet/gasfree/fees');
console.log(`Перевод: ${data.transfer_fee} USDT`);
console.log(`Активация: ${data.activation_fee} USDT`);
setup Базовый клиент (requests)
# pip install requests
import requests
API_BASE = 'https://your-domain.com'
API_TOKEN = 'YOUR_TOKEN' # После регистрации
def api_post(path: str, body: dict = {}, auth: bool = True) -> dict:
headers = {'Content-Type': 'application/json'}
if auth:
headers['Authorization'] = f'Bearer {API_TOKEN}'
resp = requests.post(
API_BASE + path,
json=body,
headers=headers,
timeout=30
)
resp.raise_for_status()
return resp.json()
01 Регистрация / Вход
result = api_post('/api/register', {
'unique_hash': 'my_super_secret_code_minimum_20chars'
}, auth=False)
token = result['token']
print(f'Токен: {token}')
02 Создать кошелёк
# TRON кошелёк
wallet = api_post('/api/wallet/create', {'node': 'TRON'})
print(f"Адрес: {wallet['address']}")
print(f"Приватный ключ: {wallet['private_key']}")
# ETH / BSC / Polygon — меняем node
eth_wallet = api_post('/api/wallet/create', {'node': 'ETH'})
bsc_wallet = api_post('/api/wallet/create', {'node': 'BSC'})
sol_wallet = api_post('/api/wallet/create', {'node': 'SOLANA'})
ton_wallet = api_post('/api/wallet/create', {'node': 'TON'})
# GasFree кошелёк (TRON без TRX для газа)
gf_wallet = api_post('/api/wallet/create', {
'node': 'TRON',
'mode': 'gasfree'
})
print(f"GasFree адрес: {gf_wallet['gasfree_address']}")
03 Список кошельков
# Все кошельки
result = api_post('/api/wallets')
for w in result.get('list', []):
print(f"[{w['node_name']}] {w['address']}")
# Только TRON
tron_wallets = api_post('/api/wallets', {'node': 'TRON'})
# GasFree кошельки
gf_wallets = api_post('/api/wallets', {
'node': 'TRON',
'mode': 'gasfree'
})
04 Баланс кошелька
result = api_post('/api/wallet/balance', {
'node': 'TRON',
'address': 'TXyz123...'
})
for b in result.get('balances', []):
print(f"{b['symbol']}: {b['balance']}")
# ETH баланс
eth_bal = api_post('/api/wallet/balance', {
'node': 'ETH',
'address': '0x742d35Cc6634...'
})
05 Перевод средств
# Перевод TRX
result = api_post('/api/wallet/transfer', {
'node': 'TRON',
'address_from': 'TXyz123...',
'address_to': 'TAbc456...',
'amount': 10,
'symbol': 'TRX'
})
print(f"TXID: {result['data']['txid']}")
# Перевод BNB на BSC
bnb_result = api_post('/api/wallet/transfer', {
'node': 'BSC',
'address_from': '0xSender...',
'address_to': '0xRecipient...',
'amount': 0.5,
'symbol': 'BNB'
})
06 GasFree USDT перевод
result = api_post('/api/wallet/transfer', {
'node': 'TRON',
'mode': 'gasfree',
'address_from': 'TXyz123...', # EOA адрес
'address_to': 'TAbc456...',
'amount': 50,
'symbol': 'USDT' # только USDT
})
trace_id = result['data']['traceId']
print(f'Trace ID: {trace_id}')
# Проверить статус
status = api_post('/api/wallet/gasfree/status', {
'trace_id': trace_id
})
print(f"Статус: {status['data']['status']}")
07 Комиссии GasFree
fees = api_post('/api/wallet/gasfree/fees')
data = fees['data']
print(f"Перевод: {data['transfer_fee']} USDT")
print(f"Активация: {data['activation_fee']} USDT")