Unity
With AppKit, you can easily let people interact with multiple EVM compatible wallets and blockchains.
Install
Let's get started by installing the package!
Prerequisites
- Unity 2022.3 or above
- IL2CPP code stripping level: Minimal (or lower)
- Target platform: Android, iOS, Windows, macOS, WebGL
- Gamma color space
- If you need Linear color space, please open a GitHub issue
Package
- OpenUPM CLI
- Package Manager with OpenUPM
To install packages via OpenUPM, you need to have Node.js and openupm-cli installed. Once you have them installed, you can run the following commands:
openupm add com.walletconnect.web3modal
- Open
Advanced Project Settings
from the gear ⚙ menu located at the top right of the Package Manager’s toolbar - Add a new scoped registry with the following details:
- Name:
OpenUPM
- URL:
https://package.openupm.com
- Scope(s):
com.walletconnect
andcom.nethereum
- Name:
- Press plus ➕ and then
Save
buttons - In the Package Manager windows open the add ➕ menu from the toolbar
- Select
Add package by name...
- Enter the package name:
com.walletconnect.web3modal
- Press
Add
button
Configure
The minimum configuration required is filling in a Project ID
and Metadata
fields inside of WalletConnectProjectConfig
scriptable object. The scriptable object is automatically created after package installation. You can find it in the Assets/WalletConnect/Resources
directory.
Don't have a project ID?
Head over to WalletConnect Cloud and create a new project now!
- Id: The project ID is a unique identifier for your project.
- If you don’t have a Project ID, you can create one at WalletConnect Cloud.
- Name: The project name is a human-readable name for your project.
- Description: The project description is a human-readable description for your project.
- URL: The project URL
- Icons: At least one icon is required for the project.
Other fields are optional and will be covered in the next sections.
Implement
- Add
Web3Modal
prefab fromPackages/Web3Modal/Prefabs
to your scene. - Initialize Web3Modal from your script
public async void Start()
{
await Web3Modal.InitializeAsync();
}
- Open the modal
public void OpenModal()
{
Web3Modal.OpenModal();
}