How to Connect a wallet to the SDK
Connecting to an Ethereum i.e. MetaMask wallet provides a link between a wallet address and a user's game account.
- You have to connect your wallet via WalletConnect.
There are a number of ways to get a session key from your wallet. Both of these methods will generate a linking url which will create a request in your wallet to connect.
If you accept the connection, a session key will be saved in 'PlayerPrefs' for future use.
Connect with QRCode using QRCodeImage component.
Connect using WalletConnect.Instance.OpenMobileWallet.
Create an instance of a
AnkrSDKWrapper
class viaAnkrSDKWrapper.GetSDKInstance(...)
method after successful connection to your walletvar ankrSdk = AnkrSDKWrapper.GetSDKInstance("<ethereum node url>");
Inside (AnkrSDK/Examples/UseCases/LinkingAccountWallet) is an example script demonstrating how to link a crypto wallet (MetaMask) to a player account.