wallet: Document the state-injection contract in README
维护者通常 1 天内回复
@grypez 已经在做这个了。
开始于 2026年5月26日。
评估
这个 Issue 还没有评估数据。
描述
Problem
@metamask/wallet has no usage documentation. The persistence contract — how consumers supply initial state and subscribe to controller state changes — is entirely implicit. Callers must read the source to understand how to wire persistence, and there is no canonical reference for the expected data shapes or event subscription pattern.
Proposed direction
Add a Usage section to packages/wallet/README.md covering:
- Hydration: pass an initial
stateobject keyed by controller name to theWalletconstructor. Missing keys fall back to each controller's default state. - Writes: subscribe to
${ControllerName}:stateChangedevents onwallet.messenger; usewallet.controllerMetadatato identify which fields carrypersist: true. - Include short code examples for both.
Acceptance
README.mdhas a Usage section with working code examples for both hydration and the stateChanged subscription pattern.- The role of
wallet.controllerMetadata(identifying persist-flagged fields) is explained. - Changelog entry added.
- 主要语言
- TypeScript
- 星标
- 420
- 派生
- 313
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 384
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetaMask/core 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
CI: "Validate changelog diffs" job fails on every fork-sourced pull request可能已有人在做 @Roxen-AS 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`可能已有人在做 @gaohan1994 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`可能已有人在做 @avantikonde 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
MetaMask/core#10210 · 1 个 reaction ·
维护者通常 1 天内回复
-
[utils] `toWei` accepts fractional wei and returns wrong values可能已有人在做 @Roxen-AS 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 72/100
DSpace/dspace-angular#6511 ·
维护者通常 1 天内回复
-
area: frontend area:byok bug severity:low
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Phone app shows Unknown for a remote machine whose key changed可能已有人在做 @janicduplessis 今天认领。 未关闭area: mobile priority: P3 type: bug
难度 1/5 1 小时以内 新手友好度 78/100
appandflow/stim#5006 · 1 条评论 ·
维护者通常 1 天内回复
-
Area - Local to Cloud Bug
难度 2/5 1-3 小时 新手友好度 66/100
microsoft/vscode-mssql#23209 ·
维护者通常 1 天内回复