> For the complete documentation index, see [llms.txt](https://docs.blockchainsecurity.asia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockchainsecurity.asia/documentation/assets-and-market-data/assets.md).

# 幣種與鏈

提供平台支援的鏈別、原生資產與 Token 資訊。此類端點屬於基礎資料查詢，不扣除 credit，但仍需使用 API key。

所有回應皆採用 { data, meta } 信封格式，請在 request header 帶入 X-API-Key。

## 列出支援鏈別與資產

```bash
curl https://api.blockchainsecurity.asia/v1/chains \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{
  "data": [
    {
      "name": "ethereum",
      "token_addresses": [
        { "name": "ETH",  "symbol": "ETH",  "address": "0x0", "decimals": 18, "verified": true },
        { "name": "USDT", "symbol": "USDT", "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "decimals": 6, "verified": true }
      ]
    }
  ],
  "meta": { "request_id": "9b1c2d3e-..." }
}
```

## 完整 token registry

```bash
curl https://api.blockchainsecurity.asia/v1/registry \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{
  "data": {
    "tokens": [
      { "chain": "ethereum", "symbol": "usdt", "contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
        "decimals": 6, "usd_mode": "stable", "rate_symbol": null, "verified": true, "display_name": "USDT" }
    ]
  },
  "meta": { "request_id": "..." }
}
```

## 查詢指定鏈資產

```bash
curl "https://api.blockchainsecurity.asia/v1/assets?chain=ethereum" \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{
  "data": {
    "chain": "ethereum",
    "assets": [
      { "symbol": "usdt", "contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "decimals": 6, "usd_mode": "stable", "rate_symbol": null }
    ]
  },
  "meta": { "request_id": "..." }
}
```

## 解析 symbol / 合約 → 資產規格

將 symbol 或合約地址解析為標準資產格式，包含鏈別、資產符號、合約地址、decimals 與資產類型。原生資產的 contract\_address 為 null。

```bash
# 用 symbol
curl -X POST https://api.blockchainsecurity.asia/v1/resolve \
  -H "X-API-Key: ak_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"blockchain":"ethereum","symbols":["usdt","weth"]}'

# contract-first（含原生幣 null）
curl -X POST https://api.blockchainsecurity.asia/v1/resolve \
  -H "X-API-Key: ak_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"blockchain":"tron","contracts":["TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",null]}'
```

```json
{
  "data": {
    "blockchain": "tron",
    "assets": [
      { "symbol": "trx",  "contract": null, "decimals": 6, "usd_mode": "rate", "rate_symbol": "TRX" },
      { "symbol": "usdt", "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "decimals": 6, "usd_mode": "stable", "rate_symbol": null }
    ]
  },
  "meta": { "request_id": "..." }
}
```

## 端點與計費

| Method | 路徑                  | 說明                   | Credit |
| ------ | ------------------- | -------------------- | ------ |
| `GET`  | `/v1/chains`        | 查詢支援鏈別與資產            | 0      |
| `GET`  | `/v1/registry`      | 查詢完整 Token Registry  | 0      |
| `GET`  | `/v1/assets?chain=` | 查詢指定鏈資產              | 0      |
| `POST` | `/v1/resolve`       | 解析 symbol 或合約地址為資產規格 | 0      |
