Skip to content

🫡 List of commands

coccoinomane edited this page Oct 3, 2023 · 7 revisions

Please find below the list of available commands, in alphabetical order. To see what you can do with each command, run w3 <command> --help.

Command Description
w3 abi extract info about a contract's functions and events
w3 address add, edit, list or delete addresses
w3 app-key create the application key
w3 balance Get the balance of the given address in the blockchain coin (ETH, BNB, AVAX, etc)
w3 base-fee Get the base fee in gwei of the last block. Will error for non-EIP1559 chains.
w3 block Get the latest block, or the block corresponding to the given identifier
w3 call Simulate calling a function in the given smart contract using eth_call, and return the function output. This will not cost gas nor write to the blockchain. To see the list of functions in a given contract, run w3 abi functions <contract>.
w3 chain add, list or delete chains
w3 compound-v2 Interact with the Compound V2 lending protocol (https://docs.compound.finance/v2/). It also works with Compound forks, like Eralend on zkSync Era. Requires a Compound pool contract: create one with w3 contract add <name> <pool address> --type compound_v2_pool.
w3 config show, add or edit web3cli's setting values
w3 contract add, list or delete contracts
w3 db Interact with the local database of web3cli
w3 gas-price Get the current gas price in gwei by calling the eth_gasPrice method. For EIP1559 chains, use w3 base-fee.
w3 history add, list or delete transactions to the transaction history
w3 keccak-text Return the Keccak-256 hash of the given text
w3 keccak-hex Return the Keccak-256 hash of the given hex string
w3 key handle passwords and application keys
w3 keyfile create and read JSON keyfiles, like the ones used by geth, brownie, ape, etc
w3 nonce Get the number of transactions made by the given address
w3 reply Replay the given transaction on the blockchain
w3 rpc add, list or delete rpcs
w3 send Send a coin or token to the given address, and show the transaction hash
w3 sign Sign the given message and show the signed message, as returned by web3.py
w3 signer add, list or delete signers
w3 subscribe Subscribe to stuff happening on the blockchain. Requires a websocket connection. It uses the 'eth_subscribe' RPC method, which is not supported by all chains and nodes. More details here > https://geth.ethereum.org/docs/interacting-with-geth/rpc/pubsub
w3 swap Swap tokens using a DEX
w3 token transfer and approve tokens
w3 transact Execute a function in the given smart contract and, by default, return the transaction hash. This will cost gas and write to the blockchain, unless the --dry-run or --call flags are used. To send tokens, please use w3 send as it is easier to use. To see the list of functions in a given contract, run w3 abi functions <contract>.
w3 tx fetch transactions from the blockchain
w3 version Show the version of web3cli
Clone this wiki locally