Building Web3 Applications¶
The reader of this book is a software engineer, and this section is where that matters most directly: it shows how ordinary TypeScript and React code talks to the blockchain infrastructure covered in every preceding section. Most of this section's non-browser-dependent examples have been run against live, real mainnet data, not illustrative pseudocode, actual verified queries against actual deployed contracts.
What you need to know first¶
JSON-RPC, Ethereum Accounts, and Contract ABI. This section builds application-layer patterns directly on top of those underlying mechanics, and assumes you understand what a readContract call or a signed transaction is actually doing underneath.
Chapters¶
- RPC Providers: what you're actually trusting when you query a third-party endpoint
- Connecting Wallets: EIP-1193, and exactly what a connection does and doesn't grant
- WalletConnect: bridging a dapp to a wallet on a different device entirely
- Reading Blockchain State: why reads are free, verified against WETH's live total supply
- Calling Contracts: call vs. transaction, and why you simulate before you send
- Sending Transactions: the full lifecycle, and the two distinct ways a transaction can fail
- Signing Messages: gasless authentication, verified end to end, and the EIP-191 prefix that makes it safe
- Typed Data and EIP-712: structured, human-readable signatures, verified with a real signature round-trip
- Transaction Receipts: a real, historical mainnet receipt, decoded field by field
- Event Indexing: a live eth_getLogs query returning 187 real WETH transfers
- viem: the library behind every code example in this book's Ethereum-side chapters
- wagmi: React hooks for the state-management problems viem deliberately leaves alone
Build one¶
examples/wallet-stats/ is a small, runnable application built directly on this section's patterns, reading real balances and transaction history for any address you give it.
Next¶
Continue to DeFi, where this section's contract-calling and event-reading patterns get applied to real, live decentralized exchange and lending protocols.