Skip to content

Commit

Permalink
save some calls on the redundant chain id requests
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jul 21, 2020
1 parent 3272f8e commit 806623c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/connectors/NetworkConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class MiniRpcProvider implements AsyncSendable {
if (typeof method !== 'string') {
return this.request(method.method, method.params)
}
if (method === 'eth_chainId') {
return `0x${this.chainId.toString(16)}`
}
const response = await fetch(this.url, {
method: 'POST',
body: JSON.stringify({
Expand Down

0 comments on commit 806623c

Please sign in to comment.