LYNC Metamask PC SDK
Last updated
Last updated
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.
Please get your API key before downloading the SDK from here
Download the LYNC - Metamask Wallet SDK from here
Example Project- https://github.com/LYNC-WORLD/Metamask-Unity-PC-SDK
Import the SDK .unitypackage file to your project. or simply drag and drop .unitypackage file to your project.
Once the Metamask PC SDK package has finished importing into your Unity project, you can begin integrating it into your game. To do this, open the Metamask scene provided by the LYNC - Metamask SDK. Path : Assets ->LYNC -> Metamask
If you haven't generated an API Key, please check Get Your API Key
the After opening Metamask scene, Go to LYNC Manager. In the "Inspector" window, go to the API key & Enter the API key.
To choose the blockchain network, simply go to the Network drop-down menu and pick the network of your preference to deploy your game on.
The Transactions are divided into 2 parts:
No Code Transactions
Modular Transactions
Check the LYNCIntigrationExample GameObject, you can just pass in a few parameters to write on any custom contract inside the game.
Just pass the following parameters:
Contract Address - Type any contract address on the chain you selected in the LYNCInterface GameObject.
ABI - You can get the contract ABI of a verified contract on the explorer.
Function Name - Write the exact function name from the contract
Arguments - The arguments required by the transaction, are left blank if none.
Check the TransactionExample GameObject, it has a TransactionExample.cs file attached. This example contains 3 types of transaction transactions, ERC-721, ERC-1155 and ERC-20.
In this example:
contractAddress - is the contract address for a custom transaction. (In this case, it's a Sepolia contract address on Ethereum Testnet)
functionName - Write the exact function name from the contract (In this case, sendToken)
cost - The cost required to do the transaction, if it's free you can pass 0 else pass the value in wei. (In this case, as the function is not payable the value is 0).
ParametersOfFunctions - You can pass in the arguments required for the transaction. (In this example, the argument is how much amount you want to send, 1000 is the value in wei, i.e 0.000000000000001 eth. You can pass n number of arguments separated with a comma( , ) ).
args - Converts compatible to be a JSON
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:
If you face any error in ABI, then open in JSON Format and select result as ABI.