wallet: Make `fetch` injectable in `NetworkController` initialization
维护者通常 1 天内回复
@grypez 已经在做这个了。
开始于 2026年5月26日。
评估
这个 Issue 还没有评估数据。
描述
Problem
getRpcServiceOptions in packages/wallet/src/initialization/instances/network-controller.ts hardcodes fetch to globalThis.fetch. Platforms that provide their own fetch implementation — React Native being the primary example — cannot supply it, making the wallet non-portable across those environments.
Proposed direction
Add an optional fetch?: typeof globalThis.fetch field to WalletOptions. The NetworkController init should use options.fetch ?? globalThis.fetch.bind(globalThis) when building getRpcServiceOptions, so the default behaviour is unchanged and platform-specific implementations can be injected at construction time.
Acceptance
WalletOptionshas an optionalfetchfield.getRpcServiceOptionsuses the injected fetch when provided, falling back toglobalThis.fetch.- Existing tests pass; a test covers the injected-fetch path.
- Changelog entry added.
- 主要语言
- TypeScript
- 星标
- 424
- 派生
- 311
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 446
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetaMask/core 的其他 Issue
-
EIP-1898 object selectors fail before downstream RPC in eth-json-rpc-middleware 26.0.0可能已有人在做 @debojyoti10CC 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
CI: "Validate changelog diffs" job fails on every fork-sourced pull request可能已有人在做 @Roxen-AS 于 37 天前认领。 未关闭
难度 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 于 38 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`可能已有人在做 @avantikonde 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
MetaMask/core#10210 · 1 个 reaction ·
维护者通常 1 天内回复
-
[utils] `toWei` accepts fractional wei and returns wrong values可能已有人在做 @Roxen-AS 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
Flaky test: selecting a portion just after inserting it can also match its Change and Delete buttons未关闭ready-for-agent
难度 2/5 1-3 小时 新手友好度 84/100
linagora/dcs-onlyoffice#172 ·
-
bug follow-up
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
nightly-tests
难度 2/5 1-3 小时 新手友好度 68/100
BlackBeltTechnology/pi-agent-dashboard#1226 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
danielmiessler/LifeOS#3028 ·
维护者通常 5 天内回复
-
execute_sql cannot create a SQLite trigger or a PostgreSQL BEGIN ATOMIC function: the statement is cut at the semicolons inside its body可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复