zksync-cli wallet
Manage your wallet on ZKsync using zksync-cli.
Utilize the zksync-cli wallet
command for an easy way to manage your assets on ZKsync, like token transfers and balance check.
Commands
transfer [options]
- Transfer tokens on L2 to another account.balance [options]
- Get token balance of an L2 account.
Transfer
To transfer ETH between accounts on ZKsync, use the following command:
zksync-cli wallet transfer
Options
If no options are provided directly, the CLI will prompt the user to enter the necessary information
--amount <0.1>
: Specify the amount to transfer.--chain <chain>
: Select the chain to use.--rpc <URL>
: Override the default L2 RPC URL.--pk
,--private-key <wallet private key>
: Use the private key of the sender for the transaction.--to
,--recipient <0x address>
: Define the recipient address on L2.--token <token address>
: Specify an ERC-20 token for the transfer instead of ETH.
Examples
Transfer ERC-20 Token
For transferring ERC-20 tokens, include the --token
option with the token's contract address:
zksync-cli wallet transfer --token 0x3e622317f8C93f7328350cF0B56d9eD4C620C5d6
Balance
View an L2 wallet's ETH balance using the following command:
zksync-cli wallet balance
Options
If no options are provided directly, the CLI will prompt the user to enter the necessary information
--address <0x address>
: Address of the wallet to check.--token <token address>
: Specify an ERC-20 token for the transfer instead of ETH.--chain <chain>
: Chain to use.--rpc <URL>
: Override the default L2 RPC URL.
Examples
Checking ERC-20 Token Balance
To check the balance of a specific ERC-20 token, use the --token
option, for example:
zksync-cli wallet balance --token 0x3e622317f8C93f7328350cF0B56d9eD4C620C5d6