Initialise provider and connect wallet
In order to interact with Immutable zkEVM, you will need to instantiate thePassport's zkEVM provider:
await passport.ConnectEvm();
and then call
await passport.ZkEvmRequestAccounts();
to initialise the gamer's wallet and retrieve their wallet address.
⚠️Warning
ZkEvmRequestAccounts
is a resource-intensive function. To ensure optimal gaming experience and performance, it is recommended to call this function separately or asynchronously from the login process.
For example, call Login
to log users into the game and let them start playing:
- In the background, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address. - Or later, when users need to use their wallet, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address.