Skip to main content
Version: v2

Initialise provider and connect wallet with Passport

Learn how to initialise the zkEVM provider and connect the user's wallet in your Unreal game.

Overview

After users have successfully logged into Passport, you need to initialise the zkEVM provider and connect their wallet to enable blockchain functionality. This involves two main steps:

  1. ConnectEvm - Initialises the zkEVM provider
  2. ZkEvmRequestAccounts - Creates/connects the user's wallet and retrieves their wallet address

Implementation

In order to interact with Immutable zkEVM, you will need to instantiate the Passport's zkEVM provider via ConnectEvm. Then, ZkEvmRequestAccounts blueprint node must be called to initialise the gamer's wallet and retrieve their wallet address.

⚠️Warning
Android and iOS are not officially supported.
⚠️Warning

The player will not have a wallet until the ZkEvmRequestAccounts function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.

For more details on authenticating users without a wallet, see the Authenticating users without wallet section.

⚠️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.
PKCE
⚠️Warning

The player will not have a wallet until the ZkEvmRequestAccounts function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.

For more details on authenticating users without a wallet, see the Authenticating users without wallet section.

⚠️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.

Important Considerations

💡Performance
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.
  1. Background Initialisation: 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.

  2. On-Demand Initialisation: Call ConnectEvm and ZkEvmRequestAccounts functions later when users need to use their wallet for specific features.

When is a Wallet Created?

💡Wallet Creation
The player will not have a wallet until the ZkEvmRequestAccounts function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.

For more details on authenticating users without a wallet, see the Authenticating users without wallet section.

Next Steps

Once you've initialised the provider and wallet, you can: