Initialise provider and connect wallet
In order to interact with Immutable zkEVM, you will need to instantiate the Passport'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
ConnectEvmandZkEvmRequestAccountsfunctions to initialise their wallet and get their address. - Or later, when users need to use their wallet, call
ConnectEvmandZkEvmRequestAccountsfunctions to initialise their wallet and get their address.