For the complete documentation index, see llms.txt. This page is also available as Markdown.

RPC Raw

Request

HyperPlay’s API includes chainId in the request body for better UX and security.

rpcRaw

  • Does not require chainId

  • Allows multiple RPC calls

curl --location 'localhost:9680/rpcRaw' \
--header 'Content-Type: application/json' \
--data '[
    {
      "method": "eth_accounts"
    },
    {
      "method": "eth_getBalance",
      "params": ["0x87885AaEEdED51C7e3858a782644F5d89759f245", "latest"]
    }
]
'
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class RawRpc: MonoBehaviour
{
    void Start()
    {
        StartCoroutine(Send());
    }

    private IEnumerator Send()
    {
        string jsonString = "[ { \"method\": \"eth_accounts\" }, { \"method\": \"eth_getBalance\", \"params\": [\"0x87885AaEEdED51C7e3858a782644F5d89759f245\", \"latest\"] } ]";
        byte[] jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonString);

        UnityWebRequest request = new UnityWebRequest("localhost:9680/rpcRaw", "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

Errors will have an HTTP response status 500-599

Last updated