getProvider() method returns an Ethereum provider instance that complies with EIP-1193 standards. This provider can be used with popular web3 libraries like Viem, Wagmi, and Web3.js.
Usage
Usage
Returns
An EIP-1193 compliant Ethereum provider that supports:- Standard RPC methods (
eth_requestAccounts,eth_sendTransaction,wallet_sendCallsetc.) - Custom Wallet methods (
coinbase_fetchPermissions) - Event subscription (
accountsChanged,chainChanged, etc.)
Integration Examples
With viem
With viem
With wagmi
With wagmi
Direct Provider Usage
Direct Provider Usage
Event Handling
The provider emits standard EIP-1193 events:Event Handling
Error Handling
Handle provider errors gracefully:Error Handling
Provider Configuration
The provider behavior is configured through the SDK initialization:Provider Configuration
TypeScript Support
The provider is fully typed when using TypeScript:TypeScript Support
getProvider() method is the primary way to interact with Base Account from your application, providing a standard interface that works seamlessly with the web3 ecosystem.