Wrong return value for eth_requestAccounts
See original GitHub issueThe documentation says the method eth_requestAccounts returns an array of accounts, however it returns a JSON-RPC response as of MetaMask 7.4.0. Probably a bug of MetaMask.
To reproduce
In any page containing an EthereumProvider for a browser installed MetaMask 7.4.0, evaluate the following statement:
ethereum.send('eth_requestAccounts').then(console.log)
// {id: 1, jsonrpc: "2.0", result: ['0x1234...']}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
RPC API - MetaMask Docs
Returns a Promise that resolves to an array of a single Ethereum address string. If the user denies the request, the Promise will...
Read more >Understanding and resolving MetaMask error codes
This error is returned when the user's MetaMask wallet is not connected to any chain ... from: accounts[0], to: paymentAddress, value: web3.
Read more >requesting Metamask with "eth_requestAccounts" does not ...
First <Button onClick={() => { // this is logging. console.log("clicked to send request to Metamask"); connect; }} > Connect </Button>.
Read more >web3.eth — web3.js 1.0.0 documentation
The revert reason string and the signature does exist as property on the returned error. Returns¶. boolean : The current value of handleRevert...
Read more >MetaMask - Internal JSON-RPC error
Smart Contract Error: Returned values aren't valid, did it run Out of Gas? 0 · Getting Metamask Error Message into web3.js DApp after...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, this would’ve been a breaking change, and so there was a very recent change to EIP-1193:
send()behavior which returnsPromise<{ results: <any> }>will remain.request()will be added, which returns the intended resultPromise<any>.https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md
So this is indeed a problem with he docs: @BboyAkers is correct, and we should change to match his description.
I’ll create a pull request and change it in the docs