@@ -129,8 +129,8 @@ Additionally, follow the [Consensys guidelines on adding images](https://docs-te
129
129
130
130
## Update the interactive API reference
131
131
132
- The [ Wallet JSON-RPC API reference] ( https://docs.metamask.io/wallet/reference/json-rpc-api/ ) uses the
133
- [ ` docusaurus-openrpc ` ] ( https://github.com/MetaMask/docusaurus-openrpc ) plugin to import OpenRPC
132
+ The [ Wallet JSON-RPC API reference] ( https://docs.metamask.io/wallet/reference/json-rpc-api/ ) uses
133
+ an internal plugin to import and parse OpenRPC
134
134
specifications from [ ` MetaMask/api-specs ` ] ( https://github.com/MetaMask/api-specs ) (MetaMask-specific
135
135
methods) and [ ` ethereum/execution-apis ` ] ( https://github.com/ethereum/execution-apis ) (standard
136
136
Ethereum methods).
@@ -152,17 +152,33 @@ To update documentation for MetaMask-specific JSON-RPC API methods:
152
152
2 . Follow the repository's [ ` README.md ` ] ( https://github.com/MetaMask/api-specs/blob/main/README.md )
153
153
instructions to edit the OpenRPC specification and generate the output file, ` openrpc.json ` .
154
154
155
- 3 . To test the API updates in the MetaMask doc site's interactive reference, make the following
156
- temporary changes on a local branch of the doc site, ` metamask-docs ` :
155
+ 3 . To test the API updates in the MetaMask doc site's interactive reference:
157
156
158
- 1 . Copy and paste the output file ` openrpc.json ` into the root directory of ` metamask-docs ` .
159
- 2 . In ` docusaurus.config.js ` , update the following line to point to your local output file:
157
+ 1 . Create and switch to a temporary local branch of the doc site, [ ` MetaMask/metamask-docs ` ] ( https://github.com/MetaMask/metamask-docs ) .
158
+ For example, to create and switch to a branch named ` test-api-updates ` :
159
+ ``` bash
160
+ cd metamask-docs
161
+ git checkout -b test-api-updates
162
+ ```
163
+ 2. Copy and paste the output file ` openrpc.json` into the root directory of ` metamask-docs` .
164
+ 3. Use [` http-server` ](https://www.npmjs.com/package/http-server) to serve ` openrpc.json` locally.
165
+ Install ` http-server` if you haven' t yet, and start the server:
166
+ ```bash
167
+ npm install --global http-server
168
+ http-server
169
+ ```
170
+ The `openrpc.json` file is now served at [`http://127.0.0.1:8080/openrpc.json`](http://127.0.0.1:8080/openrpc.json).
171
+ 4. In `src/plugins/plugin-json-rpc.ts`, update the following line to point to the locally served `openrpc.json` file:
160
172
```diff
161
- openrpcDocument:
162
- - "https://metamask.github.io/api-specs/0.10.5/openrpc.json",
163
- + "./openrpc.json",
173
+ - export const MM_RPC_URL = "https://metamask.github.io/api-specs/latest/openrpc.json";
174
+ + export const MM_RPC_URL = "http://127.0.0.1:8080/openrpc.json";
175
+ ```
176
+ 5. In a new terminal window, preview the doc site locally:
177
+ ```bash
178
+ cd metamask-docs
179
+ npm start
164
180
```
165
- 3. Preview the doc site locally, navigate to the API reference, and view your updates.
181
+ 6. Navigate to the API reference, and view your updates.
166
182
167
183
4. Add and commit your changes to `api-specs`, and create a PR.
168
184
@@ -180,14 +196,6 @@ To update documentation for MetaMask-specific JSON-RPC API methods:
180
196
For example:
181
197
> @metamask-npm-publishers `@metamask/[email protected] ` is awaiting deployment :rocketship:
182
198
https://github.com/MetaMask/api-specs/actions/runs/10615788573
183
- 3. Once the release is published on npm, `docusaurus.config.js` in `metamask-docs` must be
184
- updated with the new `api-specs` version to publish.
185
- For example:
186
- ```diff
187
- openrpcDocument:
188
- - "https://metamask.github.io/api-specs/0.10.5/openrpc.json",
189
- + "https://metamask.github.io/api-specs/0.10.6/openrpc.json",
190
- ```
191
199
192
200
### Update `ethereum/execution-apis`
193
201
@@ -204,17 +212,8 @@ To update documentation for standard Ethereum JSON-RPC API methods:
204
212
2. Follow the repository' s [` README.md` ](https://github.com/ethereum/execution-apis/blob/main/README.md)
205
213
instructions to edit the OpenRPC specification and generate the output file, ` openrpc.json` .
206
214
207
- 3 . To test the API updates in the MetaMask doc site's interactive reference, make the following
208
- temporary changes on a local branch of the doc site, ` metamask-docs ` :
209
-
210
- 1 . Copy and paste the output file ` openrpc.json ` into the root directory of ` metamask-docs ` .
211
- 2 . In ` docusaurus.config.js ` , update the following line to point to your local output file:
212
- ``` diff
213
- openrpcDocument:
214
- - "https://metamask.github.io/api-specs/0.10.5/openrpc.json",
215
- + "./openrpc.json",
216
- ```
217
- 3. Preview the doc site locally, navigate to the API reference, and view your updates.
215
+ 3. To test the API updates in the MetaMask doc site' s interactive reference, complete Step 3 in
216
+ [Update `MetaMask/api-specs`](#update-metamaskapi-specs).
218
217
219
218
4. Add and commit your changes to `execution-apis`, and create a PR.
220
219
0 commit comments