Setup
Clients
Setting up the viem clients.
1. src/lib/client.ts setup
In this demo, we will be using a "Relay Account" (not the EOA) to execute the Transaction. This is typically how EIP-7702 is used in practice, as the relayer can sponsor the gas fees to perform the Transaction. However, it is also possible for the EOA to sign and also execute the Transaction.
Quick brief:
relayClientis used to call functions on our EOA / Embedded Wallet.publicClientis used to read data from the chain.eip5792Actionsis experimental and not yet stable, but allows to have EIP-7702 compatible transactions.- we're going to be sending txs on ethereum
sepoliatestnet, since it has 7702 enabled.
We export these components to later use in App.tsx.