Skip to content

Commit fbe755c

Browse files
authored
fix: Fix fetchJsonRpc example (#3213)
Example was previously passing in the full verbose json-rpc request which wasn't necessary
1 parent b539021 commit fbe755c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/util/src/provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ type rpcParams = {
1717
* const params = {
1818
* method: 'eth_getBlockByNumber',
1919
* params: ['latest', false],
20-
* id: 1,
21-
* jsonrpc: '2.0'
2220
* }
2321
* const block = await fetchFromProvider(provider, params)
2422
*/
@@ -53,6 +51,7 @@ export const fetchFromProvider = async (url: string, params: rpcParams) => {
5351
)
5452
}
5553
const json = await res.json()
54+
// TODO we should check json.error here
5655
return json.result
5756
}
5857

0 commit comments

Comments
 (0)