Skip to content

feat: add keyless Robinhood public head read - #12

Merged
gjwang merged 2 commits into
mainfrom
feat/keyless-first-read-20261025
Oct 25, 2026
Merged

gjwang merged 2 commits into
mainfrom
feat/keyless-first-read-20261025

Conversation

@gjwang

@gjwang gjwang commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Owner: market Leader 01a133d7-789f-7241-af41-185e49fc0fed

概要

新增明确无凭据、只读的 Robinhood 首次使用示例,保持既有开户、钱包、鉴权、余额与主流程不变。

验收项: keyless-first-read

变更内容

  • 新增 src/public-read.ts:校验链目录及 robinhood_mainnet 公开端点后,串行调用 eth_chainId 与 eth_blockNumber,返回精确的十进制区块号字符串。
  • 新增 src/public-read-cli.ts 与 npm run read:public:成功输出结果 JSON;失败输出固定且不含上游内容的错误,退出码为 1。
  • 新增 tests/public-read.test.ts:使用注入的 fetch mock 覆盖目录拒绝、错误链、HTTP 错误、非法 JSON、重试错误、128 KiB 流式上限、超安全整数高度、UA 开关及凭据隔离。
  • 更新中英文 README 顶部“先做无 Key 读取”说明。

边界与验证

  • 仅使用公开目录与公开端点,最多 3 次 HTTP 请求;不读取 API Key、私钥或会话凭据。
  • 合入后于 UTC 2026-10-25 15:24 执行一次内部公开读取验收:目录 + chain ID + block number 共 3 HTTP / 2 RPC、0 重试、HTTP 全200、native0;链 ID 4663、观察高度 97687425。没有钱包、注册、登录或 key 操作。仅证明此时首次读取,非外部采用、历史完整性或全服务验收。离线测试使用 fetch mock。
  • npm run typecheck 通过;独审 B1/B2 经原会话修复后 APPROVE;npm test 通过,134 项、0 失败;39 项 public-read 聚焦用例。
  • 本仓库无 lint 脚本,按要求未安装 lint。

Add a read-only public head example that validates the chain directory and
public endpoint before two serial JSON-RPC calls. Cover exact endpoint and
method checks, credential-free headers, bounded streamed bodies, explicit QA
user agent, CLI output, and offline mocked tests.
Race fetch, body reads, and cleanup against the same request signal so
injected streams and hanging cancels cannot block rejection or retain the
reader. Cancel non-2xx and redirected bodies without reading them, and add
bounded offline regressions for pending work and cleanup.
@gjwang
gjwang merged commit cac7799 into main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant