接入UUAPI

获取币种信息

获取系统支持的 TRON 币种列表。该接口返回的 token_id 是创建收款订单时的必填参数,同时包含币种相应的基础配置信息。

1. 请求地址

Request URI
curl -X POST https://{BASE_URI}/api/tron/token/list

2. 返回示例

Response.json
{
  "code": 1000,
  "message": "success",
  "data": [
    {
      "id": 3,
      "icon": "https://res.uuapi.help/trc20_USDC.svg",
      "name": "Circle USD",
      "symbol": "USDC",
      "type": "TRC20",
      "contract": "TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8",
      "min_re_amt": "1.000000",
      "status": 1
    },
    {
      "id": 1,
      "icon": "https://res.uuapi.help/trx.svg",
      "name": "TRX",
      "symbol": "TRX",
      "type": "TRX",
      "contract": "TRX",
      "min_re_amt": "1.000000",
      "status": 1
    },
    {
      "id": 2,
      "icon": "https://res.uuapi.help/trc20_USDT.svg",
      "name": "Tether USD",
      "symbol": "USDT",
      "type": "TRC20",
      "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "min_re_amt": "1.000000",
      "status": 1
    }
  ]
}

参数说明

参数名类型说明
idnumber币种ID
iconstring币种图标URL
namestring币种名称
symbolstring币种符号
typestring币种类型 (TRX/TRC10/TRC20/TRC721)
contractstring合约地址
min_re_amtstring最小收款金额
statusnumber状态 (1: 正常)

3. 请求示例

<?php
$baseUri = 'your_base_uri';
$apiKey = 'your_api_key';
$url = 'https://' . $baseUri . '/api/tron/token/list';
$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'uu-api-key: ' . $apiKey,
    ],
    CURLOPT_POSTFIELDS => '{}',
]);
$response = curl_exec($ch);
if ($response === false) {
    $err = curl_error($ch);
    curl_close($ch);
    throw new RuntimeException('Request failed: ' . $err);
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status !== 200) {
    throw new RuntimeException('HTTP status ' . $status . ', body: ' . $response);
}
$data = json_decode($response, true);
if (!is_array($data)) {
    throw new RuntimeException('Invalid JSON response');
}
print_r($data);