LIST_ACCOUNT_SNAPSHOTS

Return a list of account snapshots within the provided slot range

Overview

This method returns a list of snapshot accounts within the provided slot range.

Example

Program - Candy Machine

Description - Return a list of snapshots of the CandyMachine account: Avax...wh8K for the given slot range. Only include the following fields in the response body: slot, writeVersion, owner, pubKey, data.

Javascript

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<API_KEY>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "type": "LIST_ACCOUNT_SNAPSHOTS",
  "query": {
    "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
    "accountName": "CandyMachine",
    "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
    "slotRange": {
      "before": 206312643,
      "after": 202424643
    },
    "limit": 10,
    "fields": [
      "slot",
      "writeVersion",
      "owner",
      "pubKey",
      "data"
    ],
    "pagination": {
      "offset": 0,
      "limit": 20
    }
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://mainnet.carpool.dev/query/solana", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

cURL

curl --location 'https://mainnet.carpool.dev/query/solana' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "type": "LIST_ACCOUNT_SNAPSHOTS",
    "query": {
        "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
        "accountName": "CandyMachine",
        "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
        "slotRange": {
            "before": 206312643,
            "after": 202424643
        },
        "limit": 10,
        "fields": ["slot", "writeVersion", "owner", "pubKey", "data"],
        "pagination": {
            "offset": 0,
            "limit": 20
        }
    }
}'

Last updated