makeWeb3Provider
Creates a new CoinbaseWalletProvider
instance using a CoinbaseWalletSDK
instance.
Usage
provider.ts
import {sdk} from "./setup";
// Create provider
const provider = sdk.makeWeb3Provider({options: 'smartWalletOnly'});
// Use provider
const addresses = provider.request({method: 'eth_requestAccounts'});
Returns
A new CoinbaseWalletProvider
instance, which is an Ethereum Javascript provider provider.
Parameters
options (optional)
- Type:
'all' | 'smartWalletOnly' | 'eoaOnly'
Determines which connection options users will see. Defaults to all
.
all
Users will see Smart Wallet and mobile app connection options.
smartWalletOnly
With this option, users will only see an option to create a Smart Wallet or sign into their Smart Wallet.
eoaOnly
Users will only see the mobile app connection option. If the user is on mobile, they will be taken directly to the Coinbase Wallet app. If the user is using a browser with Coinbase Wallet Extension, they will be taken directly to the Extension.