NAC_Blockchain/docs_center/LENS_API_UPDATE_20260318.md

46 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# lens.newassetchain.io API 接口更新日志
**日期**: 2026-03-18
**工单**: LENS-API-001
**状态**: ✅ 已完成
## 变更内容
### 1. nginx 代理端口更新
- **旧**: `proxy_pass http://127.0.0.1:9551` (nac-explorer-api旧版)
- **新**: `proxy_pass http://127.0.0.1:9550` (nac-api-server v3.1.0NAC_Lens/4.0)
### 2. 前端 API 调用架构更新
新增 `nacRpc(module, method, params)` 函数,使用 NAC_Lens/4.0 协议:
```javascript
// 协议字段: jsonac_lens: "2.0"(非 jsonrpc
POST /api/v1/{module}
{ "jsonac_lens": "2.0", "method": "nac_xxx", "params": {...}, "id": ... }
```
### 3. API 端点映射
| 旧 REST 端点 | 新 NAC_Lens RPC |
|-------------|----------------|
| GET `/api/v1/network/stats` | POST `cbpp``nac_getNetworkStats` |
| GET `/api/v1/blocks?limit=N` | POST `cbpp``nac_getLatestBlocks` |
| GET `/api/v1/blocks/{id}` | POST `cbpp``nac_getBlockByNumber/Hash` |
| GET `/api/v1/transactions/latest` | POST `cbpp``nac_getLatestTransactions` |
| GET `/api/v1/transactions/{hash}` | POST `cbpp``nac_getTransaction` |
| GET `/api/v1/addresses/{addr}` | POST `wallet``nac_getAddress` |
| GET `/api/v1/addresses/{addr}/transactions` | POST `cbpp``nac_getAddressTransactions` |
| GET `/api/v1/contracts/{addr}` | POST `charter``nac_getContract` |
| GET `/api/v1/assets` | POST `acc``nac_getAssets` |
| GET `/api/v1/search?q=` | POST `cbpp``nac_search` |
### 4. Manus 内联检查
- 结果: ✅ 无 Manus 内联引用(中国用户可正常访问)
## Git 提交
- **lens 仓库**: `699b4a0` — feat: 更新 API 接口为 NAC_Lens/4.0 RPC 风格
- **nginx 配置**: 已更新,已 reload
## 备份
- 原始 index.html 已备份至 `/www/wwwroot/lens.newassetchain.io/backup/`