getCompressedAccount

Returns the compressed account with the given address or hash.

POSThttps://devnet.helius-rpc.com?api-key=<api_key>/
Body
id*enum

An ID to identify the request.

test-account
jsonrpc*enum

The version of the JSON-RPC protocol.

2.0
method*enum

The name of the method to invoke.

getCompressedAccount
params*object

Request for compressed account data

Response
Body
context*Context (object)
valueAccount (object)
Request
const response = await fetch('https://devnet.helius-rpc.com?api-key=<api_key>/', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "jsonrpc": "2.0",
      "id": "test-account",
      "method": "getCompressedAccount",
      "params": {
        "address": null,
        "hash": "11111111111111111111111111111111"
      }
    }),
});
const data = await response.json();
Response
{
  "context": {
    "slot": 100
  },
  "value": {
    "address": "11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3",
    "data": {
      "data": "SGVsbG8sIFdvcmxkIQ==",
      "dataHash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
      "discriminator": 100
    },
    "hash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
    "lamports": 100,
    "leafIndex": 100,
    "owner": "11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3",
    "seq": 100,
    "slotCreated": 100,
    "tree": "11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3"
  }
}

Last updated