You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR
Expected a single, non-array, object argument.
at getEthJsonRpcError
at Object.invalidRequest
at checkErrorForInvalidRequestArgs
at CoinbaseWalletProvider.request
In my case, after inspecting the util.js code for the CoinbaseWalletProvider.request's checkErrorForInvalidRequestArgs, it seems to be failing from this line:
/**
* Validates the arguments for an invalid request and returns an error if any validation fails.
* Valid request args are defined here: https://eips.ethereum.org/EIPS/eip-1193#request
* @param args The request arguments to validate.
* @returns An error object if the arguments are invalid, otherwise undefined.
*/
function checkErrorForInvalidRequestArgs(args) {
if (!args || typeof args !== 'object' || Array.isArray(args)) {
return error_1.standardErrors.rpc.invalidRequest({
message: 'Expected a single, non-array, object argument.',
data: args,
});
}
...
}
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 of provider.request('eth_requestAccounts'). This update resolves the Expected a single, non-array, object argument
Expected behavior
Coinbase Smart Wallet should open after following README docs.
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
The text was updated successfully, but these errors were encountered: