Xerial
  • Intro
    • ⚡Introduction
    • 🏁Getting Started
    • ℹ️Before We Start: Important
  • 👷Build
    • Build Your Account
    • Create Your Assets
    • Inventory
    • Marketplace
    • User Flow
    • Best Practices
      • Attribute Guide
        • Attribute Use Cases
  • ☄️Xerial APIs
    • 🗝️API Authorization
    • 🛅Wallet API
      • Getting Started
      • Custodial Wallets
        • Create User
        • Create Wallet
        • Get Wallets
      • Wallet Management
        • Get Chain Native Currency Balance
        • Get Supported ERC20 Tokens Balances
        • Get Project Inventory
      • Transaction Proccessing
        • Transfer Xerial NFT
        • Transfer Chain Native Currency
        • Transfer ERC20 Token
        • Primary Purchase Xerial NFT
        • Secondary Purchase
        • List Xerial NFT
        • Delist Xerial NFT
        • Execute Custom Transaction
      • Errors Handling
        • Authentication Errors
        • Wallet Management Errors
        • Transaction Proccessing Errors
    • 🛒Marketplace API
      • Get Listed NFTs
      • Get Community Listed Items
      • Get Collections
      • Get Project Data
    • 🖼️NFT API
      • NFT Drop
    • 🌐Xerial Global Wallets
      • Get User Wallet Info
      • Get Global Inventory
      • User Authorization
      • Logout
  • 🛠️Xerial SDK
    • Wallet SDK
  • 🏎️Gaming Toolkit
    • 🕹️Xerial Unity SDK Guide
      • ⬇️Installation
      • ⚙️Configuration
      • Xerial Services
        • Set Up Xerial Services
        • Service Managers
          • Session Manager
          • Wallet Manager
            • UserData Class
              • Account Class
              • Wallet Class
              • Creating UserData Class
          • Inventory Manager
            • NFTs
              • Metadata
              • Attributes
            • NFTInventory Class
            • Creating NFT Inventory
          • MarketPlace Manager
    • Unreal Engine SDKs
Powered by GitBook
On this page
  1. Gaming Toolkit
  2. Xerial Unity SDK Guide
  3. Xerial Services
  4. Service Managers

Wallet Manager

The WalletManager classis responsible for managing user wallets within Unity applications using the Xerial services. It provides functionalities to retrieve user data and token balances.

Usage

using System.Collections;
using UnityEngine;
using Xerial;

public class WalletManager
{
    InitializeWalletServices();
}

Example

// Instantiate WalletManager
WalletManager walletManager = new WalletManager();

Properties

  • userData: An instance of the UserData class representing the user's data retrieved from the Xerial services.

  • nativeBalance: A float value representing the user's native token balance.

  • tokenBalances: An instance of the TokenBalances class representing the user's token balances.

  • nativeTokenRequester: An instance of the RequestTransferNativeToken class for requesting native token transfers.

  • transferERCTokenRequester: An instance of the RequestERCTokenTransfer class for requesting ERC token transfers.

Example

public class WalletManager
{
    public UserData userData;
    public float nativeBalance;
    public TokenBalances tokenBalances;
    public RequestTransferNativeToken nativeTokenRequester;
    public RequestERCTokenTransfer transferERCTokenRequester;
}

Methods

  • UpdateWallet(): Initiates the process of updating the user's wallet data.

  • RequestWalletData(): Coroutine method that requests and updates the user's wallet data, including user data, native token balance, and token balances.

  • RequestUserData(string accessToken): Coroutine method that requests and updates the user's data.

  • RequestNativeTokenBalance(): Coroutine method that requests and updates the user's native token balance.

  • RequestTokenBalances(): Coroutine method that requests and updates the user's token balances.

  • InitializeWalletServices(): Initializes the necessary wallet-related services and event subscriptions upon instantiation.

PreviousSession ManagerNextUserData Class

Last updated 1 year ago

🏎️
🕹️