Send Transaction
What You'll Learn
In this project, you'll take a learn-by-doing approach and accomplish the following utilizing the Infura API:
- How to connect to a user's wallet
- Display the current balance in their wallet
- Send a transaction from one wallet address to another
- View the details of the transaction you just made on the blockchain
What You'll Do
- Sign up here for a free Infura account and create an Ethereum project and IPFS project. You'll need your project id's for the Infura API requests.
- Create a MetaMask wallet here if you don't have one.
- Fund your wallet with some testnet ETH. In your MetaMask wallet, switch to the
Goerli Test Network
(you may have to click 'show/hide test networks' and toggle the setting to see the Goerli network). Go to this testnet faucet, connect your wallet, and then request the test ETH be sent to your account. - The first page of the Send Transaction project is the Connect page. Here you'll click
Connect Wallet
and will be prompted by your MetaMask extension to connect. You'll then use Infura's eth_getBalance endpoint to display the balance of your wallet. - You'll then proceed to the 'Pay' step, where you'll transfer some testnet ETH from one wallet account to another using Infura's eth_sendTransaction endpoint. Once the transaction is written to the blockchain, you'll copy the transaction hash or ID to use in the next step.
- Finally, you'll use the transaction hash from the transaction you just made to view the transaction details using Infura's eth_getTransaction endpoint. You'll get useful data such as the sender and receiver addresses, the value of the transaction, the gas used, etc.