Skip to content

The repository contains fcl-unity, blocto-unity-sdk and demo app.

License

Notifications You must be signed in to change notification settings

blocto/blocto-unity-sdk

Repository files navigation

Unity Demo App

The repository contains fcl-unity, blocto-unity-sdk and demo app. This demo application demonstrates how it is to access the blocto wallet through blocto-unity-sdk. If you are trying to access the flow chain, you will need to install additional fcl-unity

Requirements

  • Unity version 2021.3.12f1
  • .Net Core version >= 2.1
  • iOS version >= 13
  • Android version >= 7.1

Support Chain

  • Flow
  • Solana
  • Evm base
    • Ethereum
    • Binance Smart Chain
    • Polygon
    • Avalanche
    • Optimism
    • Arbitrum
  • Aptos

Get Started

You can browse this repository and find your desired utility or you can clone this repository to run demo app.

git clone https://github.com/portto/blocto-unity-sdk.git

After clone repository, the entire directory is the Unity project directory, open it with Unity and open the scene to see demo app's showcase feature

Scenes

In the project settings, you need to fill in your contracted team ID in Identification to be able to run the demo app in the iOS simulator.

Signing Team ID

Please check Script has been add to inspector of main camera flowscene

Tutorials Demo App

The demo app include five access to flow blockchain interactions

  • Interact with Flow networks (Mainnet-beta, Testnet), Solana networks (Mainnet, Devnet)
  • Sign and verify messages
  • Send transactions
  • Query smart contract state
  • Mutate smart contract state

How to use demo app

  1. You can first connect to the blocto wallet by clicking ConnectWallet, which will display the wallet address in the textbox (wallet address) when the successfully connected.

    ConnectWallet

  1. The Sign Message button means that use your’s private key to sign inpufield string. (only support flowchain)

    Sign Message

    When the sign is completed, the signature and key index will be displayed in the same inputfield.

    SignMessage Result

  1. When the sign message is completed, you can click Verify Message to verify the signature on the blockchain. The verification results will be displayed in inputField.

    Verify Message

  1. The Transfer button means to write data to blockchain. The textbox (wallet address) is the recipient address, which you can change to any address, and the textbox (wallet address) is the value of the token transferred. When mutate is completed it will show the transaction hash in the inputfield.

    Transfer

  1. The SetValue button implies interaction with a smart contract on the blockchain, that is the same as Transfer, only with a different script for the transaction structure. The button allows setting the property of smart contract to the specified value. You can enter the value in textbox. When mutate is completed it will show the transaction hash in the inputfield. Transaction
  1. The GetValue button means to send a query to a smart contract to get properties of smart contract and then display the results in the inputfield.

    Query

Project setting

On android platform, please follow the below steps to set up the project property.

  1. Create a new Keystore, you can refer to the following links to create Keystore.

  2. Make sure the description of App - Android on Blocto dashboard matches with your unity project’s Identification on unity editor (check screenshot below)

    Android_Identification

  1. Go to “Publishing Settings”, choose Project Settings > Player > Publishing Settings then enable
    • Custom Main Manifest
    • Custom Main Gradle Template
    • Custom Gradle Properties Template

Publish Setting

On iOS platform, please set up target minimum iOS version as 13.0.

iOS version

More detailed description at fcl-unity and blocto-unity-sdk

About

The repository contains fcl-unity, blocto-unity-sdk and demo app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages