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);
}
}