Closed sflanary97 closed 1 month ago
Hey From Joshua
@sflanary97 Try to pass the object inside the request function
let response: string[] = await provider.request({
method: 'eth_requestAccounts',
})
Hi @sflanary97 thanks for catching this. This was a typo but has since been addressed. Also, we have new and improved docs here: https://www.smartwallet.dev/sdk/makeWeb3Provider#usage
Describe the bug
The documentation on the README here: https://github.com/coinbase/coinbase-wallet-sdk
Steps
Following documentation for Wallet SDK Version 4.0.0-rc on README, or Coinbase Smart Wallet Docs:
In my case, after inspecting the
util.js
code for theCoinbaseWalletProvider.request
'scheckErrorForInvalidRequestArgs
, it seems to be failing from this line:The documentation in this README as well as CoinBase Smart Wallet Docs pass in a single string argument to
provider.request
as 'eth_requestAccounts' but following the EIP-1193 specs, "The Provider MUST identify the requested RPC method by the value of RequestArguments.method."To properly request accounts and view the Coinbase Wallet pop up, the documentation should be updated to
provider.request({ method: 'eth_requestAccounts' })
instead ofprovider.request('eth_requestAccounts')
. This update resolves theExpected a single, non-array, object argument
Expected behavior
Coinbase Smart Wallet should open after following README docs.
Version
4.0.0-rc.1
Additional info
Version from documentation
Produces this error:
Proposed Fix:
const addresses = provider.request({ method: 'eth_requestAccounts' })
Produces expected wallet pop up:
Desktop
Browser - [tested on Brave, Chrome, Safari]
Smartphone
No response