---
description: Integrate OKX wallet into game engine
---

# OKX Wallet

<figure><img src="https://miro.medium.com/max/1100/1*zBhTVCuPi_qOcP-YEHMAnQ.webp" alt=""><figcaption></figcaption></figure>

The LYNC - OKX wallet SDK allows game developers to integrate OKX Wallet into their games quickly, and set up OKX Chain inside the game in less than 30 seconds. This SDK allows game developers to monitor gamers’ data via the LYNC analytics system and update the SDK without leaving the game engine.

## 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 - OKX Wallet SDK from [**here**](https://github.com/LYNC-WORLD/OKX-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 OKX 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-OKX SDK.\
\
&#x20;                                            **Path : Assets ->LYNC-OKX-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-OKX-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%2Fh87sh0Omm3My9L6z2qRK%2FLYNC%20Wallet%20Sdk.png?alt=media&#x26;token=16e1fb41-f9b4-48a5-82d5-fa12bd38ba56" alt=""><figcaption><p>Enter the API key</p></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%2FqCl29mjW7rRAWOQU1zz3%2FLYNC%20Choose%20your%20chain.png?alt=media&#x26;token=46f27f16-0a7d-4254-bb2d-6d9e865192a0" 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%2F6U7BcpmXNY6d41wIsMsT%2FLYNC%20OKX%20Build%20Settings.png?alt=media&#x26;token=fa2f71eb-194f-4e6d-ab1d-e3787d1439e9" 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 OKX 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");`

