Skip to content

Mirage SDK

The Mirage platform serves as a gateway to a comprehensive suite of proven solutions tailored for the development, enhancement, scalability, support, and publication of Web3 games.

The SDKs for both platforms are EVM compatible and have the following features:

  • Interaction with Web3 wallets (either WalletConnect or MetaMask) for all supported platforms
  • Interaction with EVM-compatible blockchains
  • Interaction with smart contracts

Implementation Example

  1. Package Install

    On Package Manager select Add package from git URL and add the following:

    https://github.com/Ankr-network/game-unity-sdk.git?path=Assets/MirageSDK
  2. Scene Creation
    1. Go to Packages -> Examples -> Scenes -> Examples_WebGL.unity
    2. Copy and paste that scene into your Assets folder
  3. Assets Setup
    1. (optional) Create a scriptable object with the following properties: contract address, contract ABI and SKALE chain RPC.
    2. Create a script to call the contract you deployed on one of the SKALE chains
  4. Contract Call
    public class NFTMint : UseCaseBodyUI
    {
    public Contract contract;
    private const string MintMethodName = "safeMint";
    private IContract _erc721Contract;
    private IEthHandler _eth;
    private string[] contractArgs = new string[] { "0x...someAddress" };
    public void ContractSetup()
    {
    var sdkInstance = MirageSDKFactory.GetMirageSDKInstance(contract.RPC);
    _erc721Contract =
    sdkInstance.GetContract(
    contract.contractAddress,
    contract.contractABI);
    _eth = sdkInstance.Eth;
    }
    public async void SmartContractCall()
    {
    var receipt = await _erc721Contract.CallMethod(MintMethodName, contractArgs);
    Debug.Log($"Receipt: {receipt}");
    var trx = await _eth.GetTransaction(receipt);
    Debug.Log($"Nonce: {trx.Nonce}");
    }
    }
  5. NFTMint call
    1. Call contract setup method to initialize the contract instance
    2. Call the SmartContractCall function to perform the contract call

Additional Mirage SDK Documentation

Click here for the official documentation.