---
description: Integrate Metamask Wallet into game engine
---

# Metamask Wallet

LYNC Metamask Wallet SDK is a one-stop solution for game developers to easily integrate Metamask into their game engine and deploy their game on multiple networks with just a few clicks. This SDK allows game developers to monitor gamers’ data via LYNC analytics system and update the SDK without leaving the game engine.

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2F1X95NB6OUroiJ3oOpEKZ%2Flync-metamask.png?alt=media&#x26;token=78b1b708-fef3-4716-9bd9-fc047a782714" alt=""><figcaption><p>Integrate Metamask wallet inside any game using LYNC SDK</p></figcaption></figure>

## Get Your API Key&#x20;

Please get your API key before downloading the SDK from [**here**](https://www.lync.world/form.html)

## Installation

Download the LYNC - Metamask Wallet SDK from [**here**](https://github.com/LYNC-WORLD/Metamask-Unity-Wallet-SDK)\


Import the SDK .unitypackage file to your project. or simply drag and drop .unitypackage file to your project.

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FdDzWzt5kkCqpWZTINSsu%2FLYNC%20wallet%20sdk.png?alt=media&#x26;token=65ae978c-fa8b-4eb5-a2ba-548146b3bb14" alt=""><figcaption><p>Assets -> Import Package -> Custom Package</p></figcaption></figure>

Once the Metamask Wallet SDK package has finished importing into your Unity project, you can begin integrating it into your game. To do this, open the **ConnectWallet** scene provided by the LYNC - Metamask SDK.\
\
&#x20;                                            **Path : Assets ->LYNC-Metamask-SDK -> Scenes**\


<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2F0e5ptS2g38m6cM1SGKsw%2Fimage.png?alt=media&#x26;token=df2b4ac5-149b-47fc-b4eb-7f26a7bf27f9" alt=""><figcaption><p><strong>Assets ->LYNC-Metamask-SDK -> Scenes</strong></p></figcaption></figure>

## Choose blockchain network&#x20;

{% hint style="info" %}
If you haven't generated API Key, please check [#get-your-api-key](#get-your-api-key "mention")
{% endhint %}

After opening **ConnectWallet** scene, Go to **Interface.** In the "Inspector" window, go to the API key & Enter the **API key**.&#x20;

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FRnp2FCuQ12kWWVUQLDGn%2FLYNC%20metamask%20wallet%20sdk.png?alt=media&#x26;token=7ae549f5-ea46-467f-9725-2ac6485d0dcd" alt=""><figcaption></figcaption></figure>

To choose the blockchain network, simply go to the **CurrentChain** drop-down menu and pick the network of your preference to deploy your game on.

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FHpqGkDLiEehF4j8lwzNU%2FLYNC%20metamask%20wallet%20sdk%20integration.png?alt=media&#x26;token=0d6c3d8a-4c09-44c0-99c1-58817059654a" alt=""><figcaption><p>Interface -> CurrentChain -> Choose Your Chain</p></figcaption></figure>

## Integrating ConnetWallet scene into the build&#x20;

To deploy your Unity project, it's necessary to set up the Player Settings in Unity. Follow these steps to select the LYNC WebGL template.

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FvhM5TyzDTWyCecTKV5Ub%2FLYNC%20OKX%20Wallet%20Integration.png?alt=media&#x26;token=a98f0cb1-e8c0-4460-82f3-c3574e077b33" alt=""><figcaption><p>File -> Build Settings</p></figcaption></figure>

In the "**Build Settings**" window, place **ConnectWallet** and **FetchWallet** at the top of this section.&#x20;

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FCr5UxTMd4KVDiwmh4Qm3%2FLYNC%20metamask%20wallet%20sdk%20integration%20build.png.jpg?alt=media&#x26;token=46792188-2a8b-49d6-badf-1591099b4248" alt=""><figcaption><p>Add ConnectWallet &#x26; FetchWallet Scene to the top of Scenes in Build</p></figcaption></figure>

Go to "**Player Settings**" and navigate to "**Resolution and Presentation**". **Select LYNC - Template** in WebGL Template

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FfoYh0yqDI1JYc0qHNnpn%2FLYNC%20Unity%20SDK.png?alt=media&#x26;token=68432dc1-f421-434c-880f-3495b61d5755" alt=""><figcaption><p>Player Settings -> Resolution and Presentation -> Select LYNC - Template</p></figcaption></figure>

After completing all the necessary steps and configuring the Player Settings with the LYNC WebGL template, you can now build and run your game.

* To do this, go to "**File**" on the top menu bar in the Unity editor and select "**Build and Run**."&#x20;

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2FZu5tl1uaAbHiMBWnRacj%2FBuild%20and%20launch%20web3%20games.png?alt=media&#x26;token=7b3f782b-3c7e-47aa-ae3c-1be9ecdd63ac" alt=""><figcaption><p>Build and Run </p></figcaption></figure>

Congratulation, you have successfully integrated the Metamask wallet with your favourite blockchain network using LYNC SDK. \
\
NOTE: If you wish to use wallet address inside game after user's wallet is connected, use:

```
PlayerPrefs.GetString("WalletAddress");
```

If you face any error, while Build and Run.\
\
PLEASE ADD, Unity package install by git link\
\
com.unity.nuget.newtonsoft-json

<figure><img src="https://2257492769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3h3YUWYt8sR5rHLOIeFc%2Fuploads%2F9nwo1yYtk7mKRGrZZd5S%2FScreenshot%202023-08-21%20130643.png?alt=media&#x26;token=27f6acf8-4196-42be-8043-cc4c2bad2929" alt=""><figcaption></figcaption></figure>
