Documentation for using web3.js, a JavaScript library for interacting with EVM-compatible blockchains. This page covers installation, setup, connecting to the Base network and interacting with smart contracts.
Web3
object with a RPC URL of the Base network:
https://mainnet.base.org
to https://sepolia.base.org
.getBlockNumber
method to get the latest block:
web3.eth.accounts
:
PRIVATE_KEY
is the private key of the wallet to use when creating the account.Contract
object using the ABI and address of a deployed contract:
Contract
object, you can use it to call desired methods on the smart contract: