Complete the code to create a new instance of Web3 using a provider.
const Web3 = require('web3'); const web3 = new Web3([1]);
In Web3.js, you create a new instance by passing a provider like window.ethereum.
Complete the code to create a new ethers.js provider connected to a JSON RPC URL.
const { ethers } = require('ethers');
const provider = new ethers.providers.[1]('https://mainnet.infura.io/v3/YOUR-PROJECT-ID');Use JsonRpcProvider to connect to a JSON RPC URL in ethers.js.
Fix the error in the code to get the balance of an address using ethers.js.
const balance = await provider.getBalance([1]);The getBalance method requires a valid Ethereum address as a string.
Fill both blanks to create a contract instance using ethers.js with ABI and address.
const contract = new ethers.Contract([1], [2], provider);
The first argument is the contract address as a string, the second is the ABI array.
Fill all three blanks to send a transaction using Web3.js with from address, to address, and value.
web3.eth.sendTransaction({ from: [1], to: [2], value: [3] });Use string addresses for from and to, and a string of wei for value.