Giter Site home page Giter Site logo

moosesnwoop / walletconnectunity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walletconnect/walletconnectunity

0.0 0.0 0.0 24.96 MB

This project is an extension of WalletConnectSharp that brings WalletConnect to Unity.

License: MIT License

C# 100.00%

walletconnectunity's Introduction

WalletConnectUnity

This repository is a monorepo of packages that extend WalletConnectSharp and brings WalletConnect to Unity.

Packages

Package Description OpenUPM
Core High-level, Unity-friendly extension of WalletConnectSharp
- Automatic active session management
- Option to resume session from storage
- Deep linking support
- IL2CPP support
- Lightweight IJsonRpcConnection implementation
- QR Code generation utility
- API to load wallets data and visual assets
openupm
Modal Simplest and most minimal way to connect your players with WalletConnect openupm
UI This is a technical package that provides UI for WalletConnect Modal. It is not intended to be used directly, but rather as a dependency of WalletConnect Modal. openupm

Supported Platforms

  • Unity Editor 2021.3 or above
  • Android
  • iOS
  • macOS
  • Windows
  • WebGL (soon)

⚠️ This is beta software: This software is currently in beta and under development. Please proceed with caution, and open a new issue if you encounter a bug. Older versions of WalletConnectUnity are available under legacy/* branches ⚠️

Installation

Install via OpenUPM CLI

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:

  • WalletConnect Modal:
    openupm add com.walletconnect.modal
  • WalletConnectUnity Core:
    openupm add com.walletconnect.core
Install via Package Manager with OpenUPM
  1. Open Advanced Project Settings from the gear ⚙ menu located at the top right of the Package Manager’s toolbar
  2. Add a new scoped registry with the following details:
    • Name: OpenUPM
    • URL: https://package.openupm.com
    • Scope(s): com.walletconnect
  3. Press plus ➕ and then Save buttons
  4. In the Package Manager windows open the add ➕ menu from the toolbar
  5. Select Add package by name...
  6. Enter the name of the package you want to install:
    • WalletConnectUnity Modal: com.walletconnect.modal
    • WalletConnectUnity Core: com.walletconnect.core
  7. Press Add button
Install via Package Manager with Git URL
  1. Open the add ➕ menu in the Package Manager’s toolbar
  2. Select Add package from git URL...
  3. Enter the package URL. Note that when installing via a git URL, the package manager won't install git dependencies automatically. Follow the error messages from the console and add all necessary packages manually
    • WalletConnectUnity Modal: https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.modal
    • WalletConnectUnity UI: https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.ui
    • WalletConnectUnity Core: https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.core
  4. Press Add button

It's possible to lock the version of the package by adding #{version} at the end of the git URL, where #{version} is the git tag of the version you want to use. For example, to install version 1.0.0 of WalletConnectUnity Modal, use the following URL:

https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.modal#modal/1.0.0

Usage

  1. Set up in project id and metadata WalletConnectProjectConfig ScriptableAsset (created automatically located at Assets/WalletConnectUnity/Resources/WalletConnectProjectConfig.asset, do NOT move it outside of Resources directory).
  2. Initialize WalletConnect and connect wallet:
// Initialize singleton
await WalletConnect.Instance.InitializeAsync();

// Or handle instancing manually
var walletConnectUnity = new WalletConnect();
await walletConnectUnity.InitializeAsync();


// Try resume last session
var sessionResumed = await WalletConnect.Instance.TryResumeSessionAsync();              
if (!sessionResumed)                                                                         
{                                                                                            
    var connectedData = await WalletConnect.Instance.ConnectAsync(connectOptions);

    // Use connectedData.Uri to generate QR code

    // Wait for wallet approval
    await connectedData.Approval;                                                            
}                                                                                            

WalletConnectProjectConfig Fields

  • Id - The id of your project. This will be used inside the relay server.
  • Client Metadata
    • Name - The name of your app. This will be used inside the authentication request.
    • Description - The description of your app. This will be used inside the authentication request.
    • Url - The url of your app. This will be used inside the authentication request.
    • Icons - The icons of your app. This will be used inside the authentication request.
    • Very Url - The verification URL of your app. Currently used but not enforced

walletconnectunity's People

Contributors

ecp4224 avatar gigajuwels avatar skibitsky avatar koenrijpstra avatar underclockeddev avatar samikammoun avatar favoyang avatar leon-do avatar michitomo avatar alansley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.