Skip to content

Venly/Unity-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

Venly SDK for Unity3D

Version 3.1.0

  • Wallet API
  • Token API
  • Pay API

Quick start

Initialization (call once at startup)

using Venly;
using Venly.Core;
using UnityEngine;

public class VenlyBootstrap : MonoBehaviour
{
    void Start()
    {
        if (!VenlyAPI.IsInitialized)
        {
            VenlyUnity.Initialize();
        }
    }
}

Create a user (PIN signing)

using System.Threading.Tasks;
using Venly;
using Venly.Models.Wallet;

async Task<VyUserDto> CreateUserAsync(string pin, string reference = "my-user")
{
    var request = new VyCreateUserRequest
    {
        Reference = reference,
        SigningMethod = new VyCreatePinSigningMethodRequest { Value = pin }
    };

    var result = await VenlyAPI.Wallet.CreateUser(request);
    if (!result.Success) throw result.Exception;
    return result.Data;
}

Get NFTs for a wallet (non-async VyTask)

using Venly;
using Venly.Models.Wallet;
using UnityEngine;

void LoadNfts(string walletId)
{
    VenlyAPI.Wallet.GetNfts(walletId)
        .OnSuccess(nfts =>
        {
            // handle NFTs (e.g., display or cache)
            Debug.Log($"Loaded {nfts.Length} NFTs");
        })
        .OnFail(ex =>
        {
            Debug.LogError(ex);
        });
}

Backend Provider Support

  • DevMode (Editor Only)
  • PlayFab
  • Beamable
  • Custom

API Explorer (Sample)

  • Wallet API samples
  • Token API samples
  • User Login/Create Flow (Beamable/PlayFab)

Sample Project (VenlyDash)

Documentation

Documentation can be found here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages