Personal Sign
Request
Signs message with wallet
Params
The string to sign
curl --location 'localhost:9680/sui/personalSign' \
--header 'Content-Type: application/json' \
--data '{
"message": "test"
}'
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public class GetAccounts: MonoBehaviour
{
void Start()
{
StartCoroutine(Accounts());
}
private IEnumerator Accounts()
{
string jsonString = "{ \"message\": \"test\"}";
byte[] jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonString);
UnityWebRequest request = new UnityWebRequest("localhost:9680/sui/personalSign", "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
AKo3pNTj/jobYt1rWw03ZRY170boh6NzM/wPvVfD+FOrTbnLEDwUpejtnq4um3LHK1rR86w47ZFe4gfJNC9pUwscrlJddixEJXiCXQuZyjoZNw2uOGrjnafvrFeqC3WoGg==
Errors will have an HTTP response status 500-599
{
"message": "error description here"
}
Last updated