Skip to content

获取 AML 服务 ​

列出您的项目可购买的 AML 检查类型,每种类型有各自的价格。

POST /v1/aml-checks

请求 ​

此请求无需任何参数。

bash
#!/bin/bash
API_TOKEN="your_api_token"
API_SECRET="your_api_secret"
REQUEST_BODY='{}'

# 计算签名
SIGNATURE=$(echo -n "${REQUEST_BODY}${API_SECRET}" | sha256sum | cut -d' ' -f1)

# 发送请求
curl -X POST "https://api.trxup.com/v1/aml-checks" \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "X-Signature: ${SIGNATURE}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}"
javascript
const crypto = require('crypto');
const axios = require('axios');

const apiToken = 'your_api_token';
const apiSecret = 'your_api_secret';
const requestBody = JSON.stringify({});

// 计算签名
const signature = crypto
  .createHash('sha256')
  .update(requestBody + apiSecret)
  .digest('hex');

// 发送请求
axios({
  method: 'post',
  url: 'https://api.trxup.com/v1/aml-checks',
  headers: {
    'Authorization': `Bearer ${apiToken}`,
    'X-Signature': signature,
    'Content-Type': 'application/json'
  },
  data: requestBody
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
php
<?php
$apiToken = 'your_api_token';
$apiSecret = 'your_api_secret';
$requestBody = json_encode([]);

// 计算签名
$signature = hash('sha256', $requestBody . $apiSecret);

// 发送请求
$ch = curl_init('https://api.trxup.com/v1/aml-checks');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer ' . $apiToken,
  'X-Signature: ' . $signature,
  'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
python
import hashlib
import json
import requests

api_token = 'your_api_token'
api_secret = 'your_api_secret'
request_body = json.dumps({})

# 计算签名
signature = hashlib.sha256((request_body + api_secret).encode()).hexdigest()

# 发送请求
headers = {
  'Authorization': f'Bearer {api_token}',
  'X-Signature': signature,
  'Content-Type': 'application/json'
}

response = requests.post(
  'https://api.trxup.com/v1/aml-checks',
  headers=headers,
  data=request_body
)

print(response.json())

响应 ​

响应始终是一个列表,您的项目可购买的每种检查类型对应一项:address 和/或 hash。每种类型都是独立的服务,拥有各自的标识符和价格——交易哈希检查的价格可能与地址检查不同。若没有可购买的服务,列表为空([])。

响应字段 ​

字段类型说明
codeinteger响应码(0 = 成功)
request_idstring唯一请求标识符
resultarray可用 AML 服务列表
result[].idstringAML 服务标识符
result[].typestringAML 服务类型(address 或 hash)
result[].pricefloat该类型的单次检查价格

响应示例 ​

json
{
  "code": 0,
  "request_id": "bbf74bcd-fb36-4df8-adc8-25f2bacd087b",
  "result": [
    {
      "id": "3",
      "type": "address",
      "price": 2.5
    },
    {
      "id": "4",
      "type": "hash",
      "price": 3.75
    }
  ]
}

可能的错误 ​

错误码Key说明
1auth认证错误(令牌或签名无效)
500internal_server_error服务器内部错误

Tron Energy API Documentation