You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow createFetchMiddleware to take an RPC service
The `RpcService` class from `@metamask/network-controller` now
incorporates the vast majority of logic contained in
`createFetchMiddleware`. Using this class not only allows us to remove
a lot of code from this package, but it also allows us to automatically
cut over to a failover node when the network goes down.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
7
## [Unreleased]
8
+
### Changed
9
+
- Deprecate passing an RPC endpoint to `createFetchMiddleware` in favor of passing an RPC service
10
+
- The new, recommended method signature is now `createFetchMiddleware({ rpcService: AbstractRpcService; originHttpHeaderKey?: string; })`, where `AbstractRpcService` matches the same interface from `@metamask/network-controller`
11
+
- This allows us to support automatic failover to a secondary node when the network goes down
12
+
- The existing method signature `createFetchMiddleware({ btoa: typeof btoa; fetch: typeof fetch; rpcUrl: string; originHttpHeaderKey?: string; })` will be removed in a future major version
0 commit comments