Skip to main content

Initialise provider and connect wallet

📋Prerequisites

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 and ZkEvmRequestAccounts functions to initialise their wallet and get their address.
  • Or later, when users need to use their wallet, call ConnectEvm and ZkEvmRequestAccounts functions to initialise their wallet and get their address.