Carpool
WebsiteTwitter
  • 👋Welcome
    • 🚘What is Carpool?
    • ☕Getting Started
  • 📘Guides
    • 🔖Onboarding Programs
    • ❓Querying
    • 🚨Alerting
    • 📖Organization Management
  • ⚙️API Reference
    • 📚About our Query API
    • 📝Instructions
      • LIST_INSTRUCTIONS
      • GET_INSTRUCTION
      • GET_INSTRUCTIONS_IN_TRANSACTION
      • GET_INSTRUCTIONS_INVOLVING_ACCOUNT
      • SEARCH_INSTRUCTION_LOGS
      • SEARCH_INSTRUCTIONS
      • COUNT_INSTRUCTIONS
      • FIELD_STATISTIC_INSTRUCTION
      • MOST_COMMON_VALUES_INSTRUCTION
      • MOST_COMMON_ACCOUNTS_INSTRUCTION
    • 🗄️Accounts
      • LIST_ACCOUNTS
      • GET_ACCOUNT
      • GET_ACCOUNTS_WITH_LAMPORTS
      • SEARCH_ACCOUNTS
      • COUNT_ACCOUNTS
      • FIELD_STATISTIC_ACCOUNT
      • MOST_COMMON_VALUES_ACCOUNT
    • ⏳Account Archive
      • GET_ACCOUNT_SNAPSHOT
      • GET_ACCOUNT_SNAPSHOT_AT_SLOT
      • LIST_ACCOUNT_SNAPSHOTS
    • 🗃️Filters
      • 👓Instruction Filters
      • 🎛️Account Filters
  • ❔Resources
    • 🔗Links
    • 📄Blog Posts
Powered by GitBook
On this page
  1. API Reference
  2. Account Archive

GET_ACCOUNT_SNAPSHOT

Get a snapshot of an account at a specific slot & writeVersion

PreviousAccount ArchiveNextGET_ACCOUNT_SNAPSHOT_AT_SLOT

Last updated 1 year ago

Overview

This method returns a snapshot of specific account data for a program based on a slot & writeVersion

Example

Program - Candy Machine

Description - Return a snapshot of the CandyMachine account: Avax...wh8K at slot 204584643 and writeVersion 773978115822. Return all fields in the post body.

Javascript

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

var raw = JSON.stringify({
  "type": "GET_ACCOUNT_SNAPSHOT",
  "query": {
    "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
    "accountName": "CandyMachine",
    "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
    "slot": 204584643,
    "writeVersion": 773978115822,
    "fields": []
  }
});

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": "GET_ACCOUNT_SNAPSHOT",
  "query": {
    "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
    "accountName": "CandyMachine",
    "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
    "slot": 204584643,
    "writeVersion": 773978115822,
    "fields": []
  }
}'
⚙️
⏳
  • Overview
  • POSTGET_ACCOUNT_SNAPSHOT
  • Example

GET_ACCOUNT_SNAPSHOT

post

Get a snapshot of an account at a specific slot & writeVersion

Header parameters
x-api-keystringRequired

the API key

Body
typestringRequired

Should be set to 'GET_ACCOUNT_SNAPSHOT'. This is the type of query you want to perform.

Example: GET_ACCOUNT_SNAPSHOT
Responses
200
Successful Response
application/json; charset=utf-8
post
POST /query/solana HTTP/1.1
Host: mainnet.carpool.dev
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 338

"{\n    \"type\": \"GET_ACCOUNT_SNAPSHOT\",\n    \"query\": {\n        \"programId\": \"CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR\",\n        \"accountName\": \"CandyMachine\",\n        \"accountPubKey\": \"AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K\",\n        \"slot\": 204584643,\n        \"writeVersion\": 773978115822\n    }\n}"
200

Successful Response

{
    "response": {
        "account": {
            "slot": 204584643,
            "writeVersion": 773978115822,
            "timestamp": 1689017859133,
            "lamports": 7015680,
            "owner": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
            "pubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
            "data": {
                "version": {
                    "v2": {}
                },
                "tokenStandard": 0,
                "features": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0
                ],
                "authority": "DVPhVwgssaskEevaQa71VpUR9mzdp7XRZUMRnvtiVbDe",
                "mintAuthority": "DVPhVwgssaskEevaQa71VpUR9mzdp7XRZUMRnvtiVbDe",
                "collectionMint": "HqsBdYeGWbedthx5ggk7sPsHvQwmeMFxkrL4nbKyTD24",
                "itemsRedeemed": 0,
                "data": {
                    "itemsAvailable": 5,
                    "symbol": "KOBE",
                    "sellerFeeBasisPoints": 0,
                    "maxSupply": 0,
                    "isMutable": false,
                    "creators": [
                        {
                            "address": "KoBEBG6SncLYGhi5Cxim2NHJ8rDJWFV6ZsbbWE5xyiM",
                            "verified": false,
                            "percentageShare": 100
                        }
                    ],
                    "configLineSettings": {
                        "prefixName": "KOBE 10",
                        "nameLength": 1,
                        "prefixUri": "https://bafkreiaskqjguc7b2m4nt2xs6b7ekvkjhtjcmodtais2nwoippql3gmqlq.ipfs.nftstorage.link/",
                        "uriLength": 0,
                        "isSequential": false
                    },
                    "hiddenSettings": null
                }
            }
        }
    }
}