# 地址搜尋

模糊搜尋 / 自動完成地址，用於地址驗證、輸入糾錯與 type-ahead。回應包在 `{ data, meta }` 信封。

## 驗證 / 糾錯（resolve）

驗證一個完整地址；查無時回傳相似候選。成功扣 **5 credit**。

```bash
curl "https://api.atlantis.example/v1/addresses/resolve?chain=tron&address=TXgXcJwxbDsDfTHq3BSZagZor4Dg74tb5Z" \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

| 參數              | 必填 | 說明         |
| --------------- | -- | ---------- |
| `q` 或 `address` | 是  | 完整地址       |
| `chain`         | 否  | 鏈別；省略則嘗試推斷 |
| `limit`         | 否  | 相似候選數上限    |

```json
{
  "data": {
    "query": "TXgXcJwxbDsDfTHq3BSZagZor4Dg74tb5Z",
    "chain": "tron",
    "match": true,
    "candidates": [],
    "total": 0,
    "took_ms": 3
  },
  "meta": { "request_id": "..." }
}
```

> `match: true` 表示是真實地址；`match: false` 時 `candidates` 列出相似地址（可能打錯字）。

## 自動完成（autocomplete）

前綴搜尋，給輸入框 type-ahead 用。**免費（0 credit）**；`q` 至少 5 字。

```bash
curl "https://api.atlantis.example/v1/addresses/autocomplete?chain=tron&q=TXgXcJ" \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{
  "data": {
    "query": "TXgXcJ",
    "chain": "tron",
    "candidates": ["TXgXcJwxbDsDfTHq3BSZagZor4Dg74tb5Z"],
    "total": 1
  },
  "meta": { "request_id": "..." }
}
```

## 端點與計費

| Method | 路徑                           | 說明        | Credit |
| ------ | ---------------------------- | --------- | ------ |
| `GET`  | `/v1/addresses/resolve`      | 地址驗證 / 糾錯 | 5      |
| `GET`  | `/v1/addresses/autocomplete` | 前綴自動完成    | 0      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockchainsecurity.asia/documentation/zi-liao-api/search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
