HyperPlay API Docs
  • đŸŸŖHyperPlay
  • 🎮Overview
  • âŦ‡ī¸Install HyperPlay
  • ❓FAQ
  • Developer Docs
    • 📜Publish / List a Game
      • âš’ī¸Building with HyperPlay
      • 📃Publishing Your Game
      • đŸ›ŗī¸CI/CD Automation
      • đŸ–Ĩī¸Developer Portal
      • 📛HyperPlay Store Badges
      • 🎨HyperPlay Hex Codes
      • 🆘Feedback & Developer Support
      • 🩹[Beta] Patching
    • âŒ¨ī¸Design Considerations
      • Unreal Engine Integration
      • Unity Integration
    • đŸ•šī¸API for Native Games (EVM)
      • Get Accounts
      • Sign-in With Ethereum
      • Get Balance
      • Call Contract Example
      • Send Transaction
      • Send Contract
      • Personal Sign
      • Sign Typed Data v3
      • Sign Typed Data v4
      • Add or Switch Network
      • Add Token
      • RPC Raw
    • 🎱API for Native Games (Non-EVM)
      • Sui Blockchain
        • Get Accounts
        • Get Balance
        • Get Object
        • Send Transaction
        • Send Contract
        • Personal Sign
    • 🌐API for Browser Games (EVM)
    • 🚀Quests
      • How to Create a Quest
    • đŸĒStore APIs
      • Listings by Popularity
    • 🍷Compatibility Layer
      • Benefits of using a Compatibility Layer
      • Downsides and Limitations of the Compatibility Layer
      • FAQ
  • 🔑Access Configs
    • How to create Access Codes
    • How to token gate a Release Branch
Powered by GitBook
On this page
  • Request
  • Response
  1. Developer Docs
  2. API for Native Games (Non-EVM)
  3. Sui Blockchain

Get Accounts

Request

Get the user's currently selected address

Note that HyperPlay currently supports a single globally selected account during its connection flow. In the future, multiple account addresses will be supported.

curl --location --request POST 'localhost:9680/sui/getAccounts'
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class GetAccounts: MonoBehaviour
{
    void Start()
    {
        StartCoroutine(Accounts());
    }

    private IEnumerator Accounts()
    {
        string jsonString = "{}";
        byte[] jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonString);

        UnityWebRequest request = new UnityWebRequest("localhost:9680/sui/getAccounts", "POST");
        request.uploadHandler = new UploadHandlerRaw(jsonBytes);
        request.downloadHandler = new DownloadHandlerBuffer();
        request.SetRequestHeader("Content-Type", "application/json");

        yield return request.SendWebRequest();
        Debug.Log(request.error);
        Debug.Log(request.downloadHandler.text);
    }
}

Response

["0xed272a655dcca880aeab1f89bdc8185d4049ab7f9ea72fd6a04153d0239a15f8"]

PreviousSui BlockchainNextGet Balance

Last updated 1 year ago

🎱