Introduction
The accounts
package provides abstractions that wrap operations that interact with an account. An account typically
contains a private key, allowing it to sign various types of payloads.
There are the following objects that provide account operations:
ECDSASigner
The ECDSASigner
is responsible for signing various types of transactions, including
EIP-712 transactions. It abstracts the complexities involved in signing transactions, making it easier for developers
to handle secure and authenticated interactions with the blockchain.
WalletL1
The WalletL1
is designed to manage and perform common operations on the Layer 1
(L1) network. This includes sending transactions, checking balances, and interacting with smart contracts deployed on
the Ethereum mainnet.
WalletL2
The WalletL2
facilitates operations on the Layer 2 (L2) network, specifically
tailored for ZKsync Era. It handles transactions that benefit from the scalability and low fees of L2 solutions,
providing a seamless way to interact with the L2 environment.
Deployer
The Deployer
provides functionalities for deploying smart contracts and
smart accounts on the L2 network. It simplifies the deployment process, ensuring that developers can easily and
efficiently deploy their applications on ZKsync Era.
Wallet
The Wallet
object combines the functionalities of AdapterL1
, AdapterL2
,
and Deployer
, offering a comprehensive tool for managing accounts and performing operations across both L1 and L2
networks. It is the recommended object for most use cases as it provides all necessary operations in one place.
SmartAccount
Provides enhanced support for account abstraction. The SmartAccount
is designed to offer advanced account
management capabilities, supporting complex account structures and operations.
NewECDSASmartAccount
Uses a single ECDSA key for signing payloads. This factory method creates a SmartAccount
that leverages a single
ECDSA key, ensuring simple yet secure transaction signing.
NewMultisigECDSASmartAccount
Uses multiple ECDSA keys for signing payloads. This method creates a SmartAccount
that supports multisig
functionality, enhancing security by requiring multiple signatures for transaction approval.