Conversation
b583df3 to
187dca2
Compare
Builds ready [187dca2]
Page Load Metrics (400 ± 51 ms)
|
7d596aa to
11bf9e8
Compare
|
I believe this addresses #5101 |
b4bbd83 to
3acb000
Compare
Builds ready [3acb000]
Page Load Metrics (672 ± 66 ms)
|
b606037 to
53028e1
Compare
Builds ready [335b9ab]
Page Load Metrics (522 ± 40 ms)
|
335b9ab to
53c77ed
Compare
Builds ready [b9c39cb]
Page Load Metrics (756 ± 60 ms)
|
| * or throws an error in case of failure. | ||
| */ | ||
| export async function jsonRpcRequest(rpcUrl, rpcMethod, rpcParams = []) { | ||
| let fetchUrl = rpcUrl; |
There was a problem hiding this comment.
Review note: this method has been moved to rpc.utils.js but it is unchanged
| * @param {Array<unknown>} [rpcParams] - The RPC method params. | ||
| * @returns {Promise<unknown|undefined>} Returns the result of the RPC method call, | ||
| * or throws an error in case of failure. | ||
| */ |
There was a problem hiding this comment.
Review note: this is the same as the jsonRpcRequest that was removed from ui/app/helpers/utils/util.js, the code is unchanged
| 'chainId', | ||
| 'chainName', | ||
| 'blockExplorerUrls', | ||
| 'iconUrls', |
There was a problem hiding this comment.
I notice that 'iconUrls' is not included in otherKeys, but neither is it used anywhere. Is there some reason we are allowing this in the request params even though it will go unused?
There was a problem hiding this comment.
It is a part of EIP-3085, the goal here being to warn for extraneous keys that are not a part of the EIP. For example: 'blockExplorerUrls' is what we want, but someone might put 'blockExplorerUrl'. Beings as blockExplorerUrls is optional, without this check we'd accept the request and add the chain to the user's MetaMask without the blockExplorer, and the dapp would be none the wiser.
| chainId: existingNetwork.chainId, | ||
| nickname: existingNetwork.nickname, | ||
| ticker: existingNetwork.ticker, | ||
| }, |
There was a problem hiding this comment.
Are we unable to support the updating of the block-explorer url?
There was a problem hiding this comment.
when we get here the user will have already added the chain to their MetaMask, and the block explorer URL will have been set. This requestData is set because updateRpcTarget requires it.
danjm
left a comment
There was a problem hiding this comment.
I left a couple comments and questions
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
b9c39cb to
bb63145
Compare
Builds ready [bb63145]
Page Load Metrics (590 ± 22 ms)
|
Builds ready [d04ab15]
Page Load Metrics (610 ± 36 ms)
|
Implement
wallet_addEthereumChainin background, per EIP-3085.Fixes #5101