Introduction
A Provider interacts with the blockchain network, allowing applications to send transactions, query data, and listen to events. Providers bridge the application and blockchain, ensuring smooth communication.
The zksync-ethers
library supports providers from
the ethers.js
library and adds extra functionality.
Two providers are available:
- Provider: Extends
ethers.JsonRpcProvider
with ZKsync-specific methods. - BrowserProvider: Extends the ZKsync Era
Provider
class for better compatibility with Web3 wallets.
BrowserProvider
for browser integrations.Provider
The Provider
class in zksync-ethers
library extends the ethers.providers.JsonRpcProvider
with additional
ZKsync-specific methods. This lets users leverage the familiar ethers.js interface while accessing advanced features
specific to ZKsync.
BrowserProvider
The BrowserProvider
class extends the ZKsync Era Provider
class to offer enhanced compatibility with Web3 wallets,
making it ideal for browser-based integrations. This provider ensures seamless interaction with wallet extensions like
MetaMask, enabling users to manage their accounts and sign transactions directly from the browser.