The Coinbase Wallet browser extension injects an Ethereum provider, as specified by EIP-1193, into the browser at window.ethereum
.
You can use this provider in your app to request users’ Ethereum accounts, read on-chain data, and have the user sign messages and transactions, without using the Coinbase Wallet SDK.
The basic functionality between Coinbase Wallet SDK and the Coinbase Wallet injected provider is very similar. However, the SDK provides some additional helpful features:
ethereum.request({ method: 'eth_requestAccounts' })
will start a built-in onboarding flow.ethereum.request({ method: 'eth_requestAccounts' })
will automatically deep-link to your app in the Coinbase Wallet native mobile app.If the user has multiple wallet browser extensions installed that inject ethereum providers (e.g., both MetaMask and Coinbase Wallet), Coinbase Wallet’s injected provider will construct a “multiprovider” array at window.ethereum.providers
containing the injected provider from each wallet. Coinbase Wallet can be identified in this array by the isCoinbaseWallet
property.
More information can be found in our doc on Handling Multiple Injected Extensions.
isCoinbaseWallet
Identifies if this provider is Coinbase Wallet.
request(args)
Coinbase Wallet uses request(args)
to wrap an RPC API. The params and return value vary by RPC method.
If the request fails for any reason, the Promise will reject with an Ethereum RPC Error.
Coinbase Wallet supports many standardized Ethereum RPC methods, including:
eth_requestAccounts
wallet_addEthereumChain
wallet_switchEthereumChain
wallet_watchAsset
eth_sendTransaction
eth_sendRawTransaction
eth_newFilter
eth_newBlockFilter
eth_newPendingTransactionFilter
eth_getFilterChanges
eth_getFilterLogs
As well as all standard signing methods:
eth_sign
personal_sign
eth_signTypedData
eth_signTransaction
signTypedData_v1
signTypedData_v3
signTypedData_v4