Skip to content

docs: 补充交易 webhook 载荷示例、字段字典与订阅场景指南 - #381

Open
rcsh1 wants to merge 4 commits into
CoboGlobal:masterfrom
rcsh1:playbook/job-14-webhooks-transaction-docs
Open

docs: 补充交易 webhook 载荷示例、字段字典与订阅场景指南#381
rcsh1 wants to merge 4 commits into
CoboGlobal:masterfrom
rcsh1:playbook/job-14-webhooks-transaction-docs

Conversation

@rcsh1

@rcsh1 rcsh1 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

关联来源

  • Aladdin 工单:1128876036453798224
  • Aladdin 工单:1126429538992722086
  • Aladdin 工单:1141153803280355711

意图

Custody/WaaS 2.0 的 webhook 与 callback 交易类文档存在 7 项内容缺口,均从 FAQ 分析(issue webhook-event-types-payload;H1 反馈 126 条,custody 相关 112 条,pain 值 61.0,webhook 模块排名第一)中定位,并通过 3 个 Aladdin 工单交叉验证。本次新增交易 webhook 载荷示例、字段字典、按场景订阅指南三个页面,并在既有页面中补充 callback 阶段字段为空的说明、succeeded 才可安全用于入账的规则、以及事件保留期限说明。其中"10 次 vs 5 次"重试次数矛盾、以及 changelog 中 max_fee_amount 字段的回填条目,因缺乏足够代码证据未在本轮改动,留待人工确认。

变更摘要

  • v2/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdx(新增):新增交易 webhook 完整 JSON 载荷示例参考页,覆盖 deposit/withdrawal 方向、EVM/UTXO/TRON 手续费与 raw_tx_info 差异、原生币与 token 场景。
  • v2_cn/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdx(新增):上述页面的中文镜像,字段/事件/枚举名保持英文原文。
  • v2/guides/webhooks-callbacks/transaction-field-dictionary.mdx(新增):新增交易字段字典页,澄清 token_idasset_id(后者仅适用于 Exchange Wallet)、request_id 可空性、replacement.replaced_by_transaction_hash(RBF)等易混淆字段。
  • v2_cn/guides/webhooks-callbacks/transaction-field-dictionary.mdx(新增):上述页面中文镜像。
  • v2/guides/webhooks-callbacks/subscription-scenarios.mdx(新增):新增按场景订阅指南,含入账最小订阅集合、提现状态跟踪映射表、订阅按端点但归属组织级 channel 的说明,以及 webhook+API 对账模式。
  • v2_cn/guides/webhooks-callbacks/subscription-scenarios.mdx(新增):上述页面中文镜像。
  • v2/guides/webhooks-callbacks/webhook-event-type.mdx(修改):新增 callback 阶段字段可能为空的说明、succeeded 才可安全触发入账的规则,并链接新增的载荷示例/字段字典页面。
  • v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx(修改):上述改动的中文镜像。
  • v2/guides/webhooks-callbacks/set-up-endpoint.mdx(修改):补充 webhook 事件数据 7 天保留期限说明,未改动既有的"最多重试 10 次"表述(该项存疑,见下方待确认事项)。
  • v2_cn/guides/webhooks-callbacks/set-up-endpoint.mdx(修改):上述改动的中文镜像。
  • docs.json(修改):在中英文 webhooks-callbacks 导航分组中注册上述 3 个新页面。

代码证据

  • custody/waas2/transactions/mongo/manager/read/waas_transaction.py:178,470,503,598,620,669 — 证明 source/destination/fee/raw_tx_info 按钱包来源(CustodialAsset/CustodialWeb3/MPC/Exchange/Deposit)分支组装,支撑载荷示例页的方向性/链类型示例。
  • custody/waas2/transactions/dev/bo/transaction_query/fee.py:8,17,31,43 — Fixed/EIP1559/Legacy/UTXO 四类手续费 DTO,支撑 EVM/UTXO 手续费示例差异。
  • developer-site-waas2/.../transaction_destination.yaml:1-16source_type.yaml:1-16 — destination_type 15 路 oneOf 与 source_type 枚举,证明载荷按交易类型确有形状差异。
  • custody/waas2/transactions/dev/bo/transaction_query/transaction.py:364-396 — 证明 asset_id/cobo_id/request_id/result/confirmed_num/confirming_threshold/cobo_category 均为 Optional,支撑字段字典与 callback 空字段说明。
  • custody/waas2/transactions/mongo/manager/read/waas_transaction.py:335custody/waas2/transactions/dev/bo/transaction_query/transaction.py:320-326replaced_by_transaction_hash 来自 RBF/重发关系,支撑字段字典中 RBF 字段说明。
  • developer-site-waas2/.../transaction.yaml:45-52token_id 示例 ETH_USDT 搭配仅 Exchange Wallet 适用的 asset_id 示例 USDT,是导致客户误读的原始来源,支撑字段字典的澄清内容。
  • custody/waas2/webhooks/managers/wallet_event.py:90-109get_transaction_data() 直接对查询 API 的 TransactionData 对象调用 to_dict() 作为 webhook 事件数据,证明 webhook 与查询 API 共享 schema。
  • custody/waas2/developers/managers/callback_message.py:164-204,556-558 — callback 在提现请求阶段(广播/确认之前)即通过旧版 TransactionQueryManager 生成 body=tx.to_json(),解释 callback 阶段字段为空的原因。
  • custody/waas2/webhooks/managers/wallet_event_by_source.py:26-31,139-152wallets.transaction.succeeded 仅在状态变为 Success 时触发,而 updated 无条件触发,支撑"仅 succeeded 可安全入账"规则。
  • custody/waas2/webhooks/managers/wallet_event.py:145-171delete_old_webhook_events() 每小时清理 7 天前的 webhook 事件记录,支撑事件保留期限说明。
  • custody/waas2/webhooks/controller/webhook_endpoint.py:27,65cobo-libs/cobo_libs/webhook/client/client.py:126-137cobo-libs/cobo_libs/webhook/utils/channel_id_resolver.py:9 — 证明订阅按端点(subscribed_events)配置但 channel_id 对应组织级 Portal org_id,支撑订阅场景指南中"按端点订阅、组织级 channel"的说明。

⚠️ 待确认事项

  • 待人工确认set-up-endpoint.mdx 中"webhook 最多重试 10 次"的既有表述与一份客户工单描述的"1 秒内重试 5 次后停止"存在矛盾。已检索 custody/waas2/webhooks/managers/managers.py:105custody/waas2/webhooks/client/client.py:206custody/waas2/webhooks/services/webhook_service.py:225-233cobo-libs/cobo_libs/webhook/data/enums.py:4-6,确认 custody 与 cobo-libs 仅将事件批次提交一次给外部 WEBHOOK_SERVICE_HOST 微服务,实际面向客户端点的 HTTP 重试次数/退避策略/是否端点间独立,均在该外部服务代码中,未在本轮可探索仓库范围内,因此本次未修改该数字,需要人工在该外部服务仓库中核实后再更新。
  • 待人工确认:changelog 回填条目(为 max_fee_amount 新增 changelog 条目,格式参照 changelog.mdx:436estimated_fee_used 条目)本轮未完成——需要先从 developer-site-waas2/custody 的提交历史中确定该字段实际上线的版本号与日期,避免编造日期,因此本 PR 暂不包含该改动,需人工补充。
  • 上一轮审查中遗留的开放问题(Main 类型 source / ExchangeWallet 类型 destination 是否要求 wallet_id/amount)已通过在载荷示例页对应数组处添加说明性 Note 的方式安全规避,不阻塞本次合并,如后续可访问 developer-site-waas2 schema 仓库可再行核实。

@rcsh1

rcsh1 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

运行过程记录(自动生成)

本评论记录本次 doc 运行的内部过程,便于审查每个结论的来源。

1. 意图(确认后)

Custody/WaaS 2.0 webhook 与 callback 交易类文档存在 7 项内容缺口,均从 FAQ 分析中定位(issue webhook-event-types-payload;H1 反馈 126 条,custody 相关 112 条,pain 值 61.0,webhook 模块排名第一),并通过 3 个已抓取的 Aladdin 工单交叉验证。仓库中已存在的相关页面:v2/guides/webhooks-callbacks/{introduction,set-up-endpoint,webhook-event-type}.mdxv2/api-references/developers--webhooks/*.mdx(较薄的 OpenAPI 自动生成 stub)、v2/cobo_waas2_openapi_spec/dev_openapi.yaml(Transaction schema,约第 2159/12544-12596 行)、v2/guides/overview/changelog.mdx

验收标准(源自需求):全部 7 项完成后,H2 复测应观察到本 issue 在 Mintlify 上的重复提问率下降,以及 TG/工单相关咨询量相较 H1 下降。

2. 探索发现(按仓库 × explorer)

本节按顶层探索分支(对应仓库)组织,每个分支下有 2 个并行 explorer,仅保留其 handoff_brief(含 code_evidence 指向),完整 findings 正文因篇幅过长已省略——如需详情请查阅运行产物 artifacts.all_repo_findings

分支 b1 — 仓库 custody

  • Explorer 1: Repo custody is relevant. Main docs target is developer-site (current worktree)。Confirmed in custody: public Transaction payload 由 WaaSTransactionViewModelConvert 组装,含 token_id、asset_id、source/destination unions、fee union variants、raw_tx_info、replacement/RBF fields、cobo_category;webhook events 先本地存储再提交给外部 webhook service。Not confirmed: downstream HTTP 重试次数/间隔、事件保留期、按端点独立重试实现、callback 阶段确切的 always-null 字段列表、KYT 排序、AutoSweep/Portal 发起交易的事件触发、max_fee_amount 的确切提交日期——均需 webhook-service 与 developer-site-waas2/api-spec history 或其归属服务仓库。
  • Explorer 2: custody repo is relevant and was searched. Doc targets 全部在 developer-site 本仓库。关键代码确认事实:webhook 与 callback payload 均序列化同一底层 transaction 对象(TransactionData / tx.to_json()),与查询 API 相同;TransactionData(transaction.py:364-396)token_id 必填,asset_id/cobo_id/request_id/result/confirmed_num/confirming_threshold/cobo_category 均可空;wallets.transaction.succeeded 仅在状态变为 Success 时派发,区别于无条件触发的 updated;WebhookEvent 保留期为 7 天。重要阻塞项set-up-endpoint.mdx 中"10 次 vs 5 次"重试次数矛盾无法由 custody 仓库解决——实际面向客户端点的 HTTP 投递重试逻辑在外部 WEBHOOK_SERVICE_HOST 服务中,custody 仅负责将批次提交给该服务一次。

分支 b2 — 仓库 custody-2.0-website(前端)与 developer-site

  • Explorer 1: Repo custody-2.0-website 仅部分相关,只能确认 Portal UI 层(Webhooks tab、订阅控件、walletScopes、事件详情 JSON 渲染、投递日志字段、下一次重试时间、剩余重试次数、手动重试操作),无法验证后端 payload 组装、重试次数/退避、事件保留期、confirmation-threshold 派发、KYT 排序、AutoSweep/Portal 发起事件、Transaction schema 字段历史。
  • Explorer 2: developer-site(本仓库)确认全部 7 项缺口基本存在,并有两点修正:(a) 第 6 项的重试次数(webhook 10 次/callback 30 次,2s 超时)已经写在 set-up-endpoint.mdx 中并附带 Common delivery failures 表格——真正缺口仅是"按端点独立重试"声明与保留期限;"10 次"本身仍需与后端核实(工单称 5 次)。(b) 第 7 项 changelog 已记录 estimated_fee_used(v1.15.0,2025-05-14);只缺 max_fee_amount 一条。前端确认 Callbacks 注册表单仅有 url+description,无事件类型选择器,支持"按端点订阅、组织级 channel"的文档表述;Console 端手动重试/事件日志 UI 已存在。

分支 b3 — 仓库 developer-site-waas2(API spec 源)

  • Explorer 1: developer-site-waas2 作为 WaaS 2.0 API spec 源仓库相关。Prose/新增指南/changelog 改动路由到 primary developer-site;OpenAPI description/example 改进路由到 api-spec 源 YAML,绝不改 dev_openapi.yaml。多项行为核实(callback 空字段、succeeded 阈值派发保证、AutoSweep/Portal 来源事件触发、KYT 排序、重试次数/退避/按端点独立、字段上线日期对应的 PR)无法从 spec 仓库确认,需 custody/backend 或 git 历史核实。
  • Explorer 2: 确认 docs 仓库(本 worktree)已包含意图中提到的全部页面;全部 7 项任务路由到 primary(散文改动),非 api-spec。对意图前提的两处修正:第 3 项 asset_id "仅 Exchange Wallet 适用"规则并非代码缺失——已是 OpenAPI 自身的 description(transaction.yaml),真正缺口只是指南正文从未体现该说明,且 spec 自身示例配对(token_id='ETH_USDT', asset_id='USDT')正是误导客户的原因;第 7 项 estimated_fee_used 已有 changelog 条目(v1.15.0),仅 max_fee_amount 缺失,修复范围应收窄。events.yaml 的"最近 30 天"是 List 接口的查询窗口默认值,不能等同于数据保留期限,不应在文档中混淆两者。

分支 b4 — 仓库 cobo-libs

  • Explorer 1: cobo-libs 仅部分相关,确认共享的 webhook 事件信封/持久化/提交路径(WebhookEvent、WebhookEventManager、WebhookService),但不包含 custody 交易 DTO、webhook 派发重试/退避、callback payload 组装、确认阈值逻辑、按钱包类型的 asset_id 填充、AutoSweep/Portal 交易触发、KYT 排序,或 OpenAPI changelog 历史。
  • Explorer 2: cobo-libs 是 payments 与 custody 后端共用的通用 Django webhook 派发库;仅定义通用 WebhookEvent 模型/状态(CREATED/SUBMITTED)与转发至外部 webhook 微服务(WEBHOOK_SERVICE_HOST)的瘦客户端,不实现重试次数/退避、payload 字段填充或产品特定业务逻辑。第 5 项:cobo-libs 确认按端点的 subscribed_events + 组织级 channel_id 模型,可作为引用依据。第 6 项关键发现:cobo-libs 不实现重试次数/间隔/退避;本地 WebhookEventStatus 枚举仅有 CREATED/SUBMITTED,Delivered/Retrying/Failed 等状态及实际重试次数均在外部服务中实现,超出 cobo-libs 与本次可探索仓库范围。
3. 综合结论

结论(result,节选):统一结论——全部 7 项缺口均指向本 docs 仓库的同三个 prose 页面(v2/guides/webhooks-callbacks/{introduction,set-up-endpoint,webhook-event-type}.mdx)以及 v2/guides/overview/changelog.mdx,EN 改动均需镜像到 v2_cn/guides/webhooks-callbacks/。生成的 stub(v2/api-references/developers--webhooks/*.mdxdev_openapi.yaml)绝不能手动编辑;任何 OpenAPI description/example 修复路由到 developer-site-waas2 源 YAML。四个探索分支结论一致,无实质性矛盾,差异仅在证据深度。(完整正文见 artifacts.exploration_synthesis.result,因篇幅过长此处节选。)

置信度(confidence):0.78

开放问题(open_questions)

  1. 实际的 webhook 事件重试次数/间隔/退避策略——文档写 10 次,工单称 5 次——确认该逻辑位于外部 WEBHOOK_SERVICE_HOST 服务中,不在 custody 或 cobo-libs 内,需要该服务的仓库才能核实。
  2. 重试是否真的按端点独立(端点 A 成功是否影响端点 B 的重试计划)?同样受限于外部服务,无法确认。
  3. TransactionData 各字段在 callback 派发时刻与 webhook 派发时刻分别为空的精确清单——schema 层面的可空性已确认,但按阶段的精确差异未确认。
  4. 确认交易状态仅在达到确认阈值后才变为 Success 的确切代码路径(第 4 项开放问题正文在源数据中被截断,完整内容见 artifacts.exploration_synthesis.open_questions)。

汇总代码证据清单:见下方"4. 编辑计划"中每个任务的 code_evidence 字段,以及本 PR 描述正文的「代码证据」小节。

4. 编辑计划
[
  {"task_id":"payload-ref-en-page","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"payload-ref-cn-page","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"payload-ref-crosslink-en","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"payload-ref-crosslink-cn","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"payload-ref-nav","action":"fix_docs","doc_file":"docs.json","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"callback-null-fields-en","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"callback-null-fields-cn","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"field-dictionary-en-page","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/transaction-field-dictionary.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"field-dictionary-cn-page","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/transaction-field-dictionary.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"field-dictionary-nav","action":"fix_docs","doc_file":"docs.json","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"succeeded-creditable-en","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"succeeded-creditable-cn","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"subscription-scenarios-en-page","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/subscription-scenarios.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"subscription-scenarios-cn-page","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/subscription-scenarios.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"subscription-scenarios-nav","action":"fix_docs","doc_file":"docs.json","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"retry-retention-en","action":"fix_docs","doc_file":"v2/guides/webhooks-callbacks/set-up-endpoint.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"retry-retention-cn","action":"fix_docs","doc_file":"v2_cn/guides/webhooks-callbacks/set-up-endpoint.mdx","repo_alias":"primary","code_evidence_missing":false},
  {"task_id":"retry-count-reconciliation","action":"skip","doc_file":"v2/guides/webhooks-callbacks/set-up-endpoint.mdx","repo_alias":"primary","code_evidence_missing":true,"skip_reason":"文档称重试 10 次,一份工单称 5 次。custody 与 cobo-libs 均确认(附代码引用)二者只将事件批次提交一次给外部 WEBHOOK_SERVICE_HOST 微服务,真实的客户端点 HTTP 重试次数/退避策略/是否按端点独立均在该外部服务代码中,不在本轮可探索仓库范围内。按写作规则,未核实的说法不得写入文档,因此未修改该数字,需人工在该外部服务仓库核实。"},
  {"task_id":"changelog-max-fee-amount-en","action":"fix_docs","doc_file":"v2/guides/overview/changelog.mdx","repo_alias":"primary","code_evidence_missing":true,"note":"需先从 developer-site-waas2/custody 提交历史确定正确版本号与上线日期,不得编造日期;本轮未完成,git 状态显示 changelog.mdx 未被改动。"},
  {"task_id":"changelog-max-fee-amount-cn","action":"fix_docs","doc_file":"v2_cn/guides/overview/changelog.mdx","repo_alias":"primary","code_evidence_missing":true,"note":"同上,本轮未完成。"}
]

(每个任务完整的 doc_edit_descriptioncode_evidence 文件:行号列表见运行产物中的完整计划 JSON;本 PR 描述的「代码证据」小节已列出已落地任务对应的引用。)

5. 评审轮次

第 1 轮 — REJECTED:审查发现上一轮要求的修复未落地。v2/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdxv2_cn/guides/webhooks-callbacks/transaction-webhook-payload-examples.mdx 中仍保留 "id": "..." 字段(第 20/77/133/185/257 行),而 schema 中并无 id 字段,正确的标识字段应为 transaction_id(uuid 格式,见 dev_openapi.yaml:8558-8576)。(反馈原文因篇幅过长在源数据中被截断,完整内容见 artifacts.final_review.feedback。)

第 2 轮 — APPROVED:两个被标记的缺陷均已修复并核实——idtransaction_id(每个文件 5 处,cobo_id 保留不变)以及被裁剪的 Exchange Wallet 对比数组条目已补充说明性 Note(EN/CN 均已添加)。独立验证方式:用 Python json 模块解析两个文件中全部 ```json 代码块(各 6 处,均有效);确认每个文件恰好有 5 个 transaction_id UUID 值与 5 个 cobo_id 值;确认不再残留裸露的 "id" 键;确认 docs.json 仍为合法 JSON。审查结论:本 PR 可进入合并/收尾阶段,本轮无遗留阻塞性「待确认事项」。唯一延续的开放项(Main 类型 source / ExchangeWallet 类型 destination 是否确实要求 wallet_id/amount)不阻塞本次合并,已通过载荷示例页的裁剪说明安全规避。

6. 基线与同步
  • 编辑前同步到的 upstream 基线 commit:执行者未报告。
  • Primary doc edits 验证:执行者运行 mintlify validate,退出码 0,输出 "success build validation passed";并独立核实了 payload-examples 文件中 transaction_id/cobo_id 出现位置与裁剪说明 Note 的存在。
  • API spec edits:无。
  • API spec sync:无(本次改动不涉及 developer-site-waas2 源 YAML)。

@rcsh1

rcsh1 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

原始反馈里面有要求按事件类型逐个建页(覆盖 wallets.mpc.* 等全部事件族), 但现在 :

Transaction events ← 这次唯一做了的

Fee Station events ← 没做

MPC TSS request events ← 没做(wallets.mpc.tss_request.*)

Wallet and address management events ← 没做

Token and chain management events ← 没做

Balance update events ← 没做

Compliance events ← 没做

也就是说 7 大事件族里只做了 1 个,其余 6 个都没有 payload/字段说明页。需要补上

@rcsh1

rcsh1 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Responding to both comments here since neither was posted as an inline file/line thread.

Comment #1 (auto-generated run process log, 2026-07-19T10:32:58Z): no action needed — this was the doc-writing agent's own internal log of 2 review rounds that were already resolved (idtransaction_id fix, Exchange Wallet trimming Note) before this PR state. Confirmed still correct in the current file content.

Comment #2 (must-fix, 2026-07-19T10:48:51Z) — "only 1 of 7 event families has payload/field docs, need the other 6": addressed in this push (commit 9c25da72). All 6 previously-thin families now have worked payload examples and/or field documentation, in both v2/guides/webhooks-callbacks/ and the v2_cn/ mirror:

  • Transaction — already covered pre-existing (unchanged scope).
  • Fee Station — added a new "Fee Station transactions" worked example + fueling_info field entry directly in transaction-webhook-payload-examples.mdx / transaction-field-dictionary.mdx, since Fee Station shares the same Transaction payload schema as wallets.transaction.* (verified: custody/waas2/webhooks/managers/wallet_event_by_source.py:34-113, custody/waas2/transactions/mongo/manager/read/waas_transaction.py:712-727,154-161). Cross-linked from webhook-event-type.mdx.
  • MPC TSS request (wallets.mpc.tss_request.*) — new tss-request-webhook-payload-examples.mdx + tss-request-field-dictionary.mdx, covering the TSSRequest schema (dev_openapi.yaml:7763-7830) and dispatch path (custody/waas2/mpc/managers/dev/webhook_wallet_mpc.py:21,24-73,110-139).
  • Wallet and address management — new wallet-address-webhook-payload-examples.mdx + wallet-address-field-dictionary.mdx, covering Addresses/WalletInfo/MPCVault (dev_openapi.yaml:12240-12393; dispatch: custody/waas2/webhooks/managers/address_event.py:26-181, vault_event.py:26-45).
  • Token and chain management — new token-chain-webhook-payload-examples.mdx + token-chain-field-dictionary.mdx, covering Tokens/Chains/TokenListing (dev_openapi.yaml:12240-12393; dispatch: custody/waas2/webhooks/managers/wallet_token_event.py:35-36,185,239, wallet_chain_event.py:23-24,95-104).
  • Balance update — new balance-update-webhook-payload-examples.mdx + balance-update-field-dictionary.mdx, covering BalanceUpdateInfo (dev_openapi.yaml:6862-6892; dispatch: custody/waas2/webhooks/managers/balance_event.py:15-16,80-105).
  • Compliance — the KYT half already had a deep-dive (unchanged). Added the missing ComplianceDisposition event data section directly in webhook-event-type.mdx (Disposition status/type tables + trigger path), covering DispositionEventData (dev_openapi.yaml:18627-18804; dispatch: custody/waas2/compliance/compliance_apps/processors/screening_webhook.py:18,22,44-124).

docs.json nav was updated (both v2 and v2_cn trees) to include all 8 new pages, and webhook-event-type.mdx (EN + CN) now cross-links every family to its new payload/field page.

Not addressed in this push (out of scope for this reviewer thread, called out separately in the revision's own notes): a non-blocking CN cross-link anchor concern and a balance-update wording polish item, both flagged as optional/deferrable — worth a quick manual spot-check in a rendered preview before merge.

运行过程记录(自动生成)
  • 读取的评审意见与修订要点(来自 revision brief):issues/381/comments 返回 2 条评论;无 inline review comments,无 submitted reviews。评论 1(id 5015381285)是文档撰写 agent 自身的运行过程日志,非评审意见,记录的 2 轮内部评审(idtransaction_id 修复、Exchange Wallet 裁剪 Note)已在当前文件内容中确认存在,无需处理。评论 2(id 5015425552)是真实评审反馈:原始需求要求按 7 大事件族(Transaction、Fee Station、MPC TSS request、Wallet and address management、Token and chain management、Balance update、Compliance)逐一建立 payload 示例 + 字段字典页,本 PR 此前只完成了 Transaction 一项,其余 6 项仍只有 webhook-event-type.mdx 中的事件类型/描述表格(无 worked JSON 示例或字段级字典)。

  • 代码核查结论与证据(repo/path:line):Fee Station 与 wallets.transaction.* 共享同一 Transaction payload 构造路径(custody/waas2/webhooks/managers/wallet_event_by_source.py:34-113wallet_event.py:42-44),cobo_category/fueling_info 为真正的 Fee Station 判别字段(custody/waas2/transactions/mongo/manager/read/waas_transaction.py:712-727,740-751,154-161);TSSRequest 字段与状态枚举(dev_openapi.yaml:7763-7830custody/waas2/mpc/bo/dev/vault.py:235-242webhook_wallet_mpc.py:21,24-73,110-139);Addresses/WalletInfo/MPCVault schema 与 dispatch(dev_openapi.yaml:12240-12393address_event.py:26-181vault_event.py:26-45);Tokens/Chains/TokenListing 与 dispatch(wallet_token_event.py:35-36,185,239wallet_chain_event.py:23-24,95-104);BalanceUpdateInfo schema 与 dispatch(dev_openapi.yaml:6862-6892balance_event.py:15-16,80-105);DispositionEventData schema 与 dispatch(dev_openapi.yaml:18627-18804screening_webhook.py:18,22,44-124)。

  • 本次推送的改动(来自 git log -1 --stat / --name-status,commit 9c25da72):新增 8 个文件(EN+CN 各 4 对)— tss-request-{webhook-payload-examples,field-dictionary}.mdxwallet-address-{webhook-payload-examples,field-dictionary}.mdxtoken-chain-{webhook-payload-examples,field-dictionary}.mdxbalance-update-{webhook-payload-examples,field-dictionary}.mdx;修改 transaction-webhook-payload-examples.mdx(新增 Fee Station 示例)、transaction-field-dictionary.mdx(新增 fueling_info)、webhook-event-type.mdx(EN+CN,新增 6 处跳转链接 + ComplianceDisposition 小节)、docs.json(EN+CN 导航各新增 8 条目)。共 23 个文件,1088 行新增,0 行删除。

  • 同步基线:a8ad72ddedd1676dad804f6fe444bce0795c76ab

@cobosteven cobosteven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

总评

本 PR 的代码证据整体高度可靠:claude 与 codex 对 custody / cobo-libs 中所抽样的 webhook 载荷、字段可空性、事件类型字符串、枚举值集、触发路径、7 天保留期与"仅 succeeded 可安全入账"规则均逐条复核确认,未发现任何被编造或错误的 error code,重试次数矛盾也被正确地留待人工确认。阻塞项来自标准合规维度的 2 处 must_fix:token-chain-field-dictionary.mdx 的 Token scope events 与 webhook-event-type.mdx(含 CN 镜像)的 ComplianceDisposition 事件均以 Cobo 内部工具/服务链路(CustodyCoinManager、Aladdin、DispositionFundsWebhookApiScreeningWebhookProcessor 等)而非开发者可观测/可操作视角撰写,违反 developer-perspective / no-internal-notes。

must_fix

  1. v2/guides/webhooks-callbacks/token-chain-field-dictionary.mdx > Token scope events(wallet.token.enabled / wallet.token.disabled):以 Cobo 内部 admin 工具与源码调用方(CustodyCoinManager、Aladdin、内部 WaaS 工具)解释事件,而非开发者可观测/可操作的机制。违反 developer-perspective / no-internal-notes。修复:改写为开发者视角——说明该事件在何种开发者可见操作后触发、载荷含哪些字段、订阅方应如何响应,删除内部服务/调用方名称。
  2. v2/guides/webhooks-callbacks/webhook-event-type.mdx(及 v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx 镜像)> ComplianceDisposition 事件数据:通过内部接收转发服务(DispositionFundsWebhookApiScreeningWebhookControllerScreeningWebhookProcessorScreeningAppClientProxy)解释事件,而非开发者能观察或处理的内容。违反 developer-perspective / no-internal-notes。修复:改写为"开发者收到该事件时能看到什么、应据此做什么",移除内部服务链路描述;中英文同步修改。

@rcsh1

rcsh1 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

已在最新推送 2e6435e0 中处理本轮 CHANGES_REQUESTED 的两项 must-fix:

  1. Token scope events:已重写 EN/CN 的 wallet.token.enabled / wallet.token.disabled 说明(v2/guides/webhooks-callbacks/token-chain-field-dictionary.mdx:16v2_cn/guides/webhooks-callbacks/token-chain-field-dictionary.mdx:16)。现在从订阅方可观察、可执行的角度说明 token visibility scope 生效后的 enabled/disabled 增量、接收机构的适用条件、tokens / wallet_type / wallet_subtypes 负载,以及收到事件后应更新对应 scope 或调用 List enabled tokens 重新同步;删除了 CustodyCoinManager.update_asset_coin、Aladdin、内部 WaaS token tooling 和 custody 源码引用。相关事实核查见 custody/waas2/webhooks/managers/wallet_token_event.py:59custody/waas2/webhooks/managers/wallet_token_event.py:87custody/waas2/webhooks/managers/wallet_token_event.py:168custody/waas2/webhooks/managers/wallet_token_event.py:178custody/waas2/webhooks/managers/wallet_token_event.py:290custody/waas2/webhooks/managers/wallet_token_event.py:318

  2. ComplianceDisposition:已同步重写 EN/CN 的 compliance.disposition.status.updated 小节(v2/guides/webhooks-callbacks/webhook-event-type.mdx:277v2_cn/guides/webhooks-callbacks/webhook-event-type.mdx:279)。现在说明订阅方收到的 transaction_iddisposition_typedisposition_statusdestination_addressdisposition_amountupdated_timestamp,如何关联 Refund / Isolate / Unfreeze 操作、记录状态增量,并在进一步操作前通过 Get disposition status 核对当前状态;删除了 DispositionFundsWebhookApiScreeningWebhookControllerScreeningWebhookProcessorScreeningAppClientProxy 和内部 custody 源码引用。相关事实核查见 custody/waas2/compliance/compliance_apps/processors/screening_webhook.py:45custody/waas2/compliance/compliance_apps/processors/screening_webhook.py:56custody/waas2/compliance/compliance_apps/processors/screening_disposition.py:34custody/waas2/compliance/compliance_apps/controllers/dev/screening_disposition.py:14

本轮没有 inline file/line review thread,因此没有可用的 inline comment id 供 threaded reply;上述回复集中发布在此顶层评论中。本 revision brief 无 deferred 项。

运行过程记录(自动生成)
  • 读取的评审意见与修订要点(来自 revision brief):重新读取 inline review comments、submitted reviews 与 issue-level comments。Inline comments 为空;submitted review 中有一条 CHANGES_REQUESTED,要求将 Token scope events 与 ComplianceDisposition 改写为开发者可观察、可处理的说明,移除内部实现与服务链路名称;issue-level 的早期事件族反馈已有既存回复。
  • 代码核查结论与证据(repo/path:line,如有):Token scope 的事件方向、机构差集、chain 过滤与四字段负载分别由 custody/waas2/webhooks/managers/wallet_token_event.py:59:87:168:178:290:318 支持;disposition 事件接受的类型、透传 envelope、操作输入与状态查询返回值由 custody/waas2/compliance/compliance_apps/processors/screening_webhook.py:45:56custody/waas2/compliance/compliance_apps/controllers/dev/screening_disposition.py:14custody/waas2/compliance/compliance_apps/processors/screening_disposition.py:34 支持。
  • 本次推送的改动(来自 git log -1 --stat):commit 2e6435e0cf85f651e9bbdbec02a67320c05a0b7adocs: address review feedback)修改 4 个文件:EN/CN 的 token-chain-field-dictionary.mdxwebhook-event-type.mdx;共 30 insertions、22 deletions。
  • 同步基线:9c25da72e94278a0868618395b03bc617558981b

| Event type | Trigger |
|------------|---------|
| `wallets.mpc.tss_request.created` | The request is newly created or enters the new-request status (`custody/waas2/mpc/managers/dev/webhook_wallet_mpc.py:42-47`). |
| `wallets.mpc.tss_request.succeeded` | The request status becomes `Success` (`custody/waas2/mpc/managers/dev/webhook_wallet_mpc.py:50-57`). |

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should never put internal codebase's file directory in the official docs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the latest push (6fc4ead) — removed internal codebase file/directory citations from the anchored TSS field dictionary while preserving the public schema, enum, and event-trigger guidance (v2/guides/webhooks-callbacks/tss-request-field-dictionary.mdx:12, v2/guides/webhooks-callbacks/tss-request-field-dictionary.mdx:22, v2/guides/webhooks-callbacks/tss-request-field-dictionary.mdx:35, v2/guides/webhooks-callbacks/tss-request-field-dictionary.mdx:41). Applied the same cleanup to the CN mirror (v2_cn/guides/webhooks-callbacks/tss-request-field-dictionary.mdx:12) and swept all other webhook documentation pages modified by this PR, rewriting implementation-facing prose where needed. The sweep covered 20 EN/CN files and removed all remaining custody/... and dev_openapi.yaml: citations from those guide trees.

@cobosteven cobosteven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

本 PR 为交易 webhook 载荷/字段字典/订阅场景类纯文档新增与修改。错误码、主要枚举值集合与关键行为性论断整体已核实通过,未发现错误码类捏造;但仍有 3 项 must_fix,需要修改后再合入。

【must_fix】

  1. balance.frozen 字段与示例值存疑:v2/guides/webhooks-callbacks/balance-update-field-dictionary.mdxbalance.frozen 行,以及 balance-update-webhook-payload-examples.mdx"frozen": "5.00"(含 CN 镜像)。公开 cobo_waas2 SDK Balance 模型只有 total/available/pending/locked,无 frozen;custody 内部虽有 frozen 默认值 '0',但当前事件构造路径只填充 4 个字段。面向公开文档应以公开 schema 为准。请删除 frozen 行与示例值;若产品确认会公开该字段,也最多标注为始终为 '0',不要给非零示例。

  2. v2/guides/webhooks-callbacks/set-up-endpoint.mdx 新增第 88 行 Portal 补投路径不完整且与本页自相矛盾:正文写 Cobo Portal > Developer > Webhook Events,但同页重试路径为 Developer > WaaS 2.0 > Webhook Eventsv2_cn 镜像同样需要修复。请统一为准确、完整的点击路径。

  3. set-up-endpoint.mdx 新增第 88 行 API 补投说明只列 [List webhook event logs] 与 [Retry webhook event by ID],但未说明必需参数,包括重试所需的 event ID、检索遗漏日志所需的过滤/范围。v2_cn 镜像同样需要补齐操作名 + 必需参数。

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.

2 participants