LogoLogo
  • Accumulate Core
  • Design
    • Model
      • Overview
      • Domains
      • Accounts
      • Messages
      • Transactions
      • Authority and Signing
      • Chains
    • Architecture
      • Partitions
      • Intermediate anchoring
      • Directory network
  • Implementation
    • Implementation
  • For Developers
    • Encoding
    • Simulator
    • API v3
      • Methods
        • Query
      • Transports
        • JSON-RPC
    • Examples
      • Status
      • Proofs
  • Glossary
    • Accounts
    • Transactions
Powered by GitBook
On this page
Edit on GitLab
Export as PDF
  1. For Developers
  2. API v3
  3. Methods

Query

Use the query method to read the state of the network. query has the following parameters:

  • scope is the scope of the query. This must be an account URL or a message ID. The message ID may be suffixed with an account or with unknown. For example:

    • acc://accumulate.acme

    • acc://bbcea39f9c5cc8175fd5b12ab4b1173adf7c00755386f8a9db0801682034c67f@unknown

    • acc://bbcea39f9c5cc8175fd5b12ab4b1173adf7c00755386f8a9db0801682034c67f@staking.acme/governance/1

  • query may be used to query specific parts of an account or message's state.

REST examples are relative to an endpoint such as https://mainnet.accumulatenetwork.io.

JSON-RPC must be submitted with POST /v3 to an endpoint, e.g. curl -X POST https://mainnet.accumulatenetwork.io/v3 --data-raw '<json>'.

Query an account

Parameters

Parameter
Optional
Description

account

URL of the account

include receipt

yes

Include a receipt for the account state

REST

GET /query/{account}?include_receipt={include receipt}

JSON-RPC

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "query",
    "params": {
        "scope": "<account>",
        "query": {
            "queryType": "default",
            "includeReceipt": <include receipt>
        }
    }
}

Examples

acc://ACME
{
  "recordType": "account",
  "account": {
    "type": "tokenIssuer",
    "url": "acc://ACME",
    "authorities": [
      {
        "url": "acc://dn.acme/operators",
        "disabled": true
      },
      {
        "url": "acc://staking.acme/book"
      }
    ],
    "symbol": "ACME",
    "precision": 8,
    "issued": "24452643448428198",
    "supplyLimit": "50000000000000000"
  },
  "pending": {
    "recordType": "range",
    "records": [
      {
        "recordType": "txID",
        "value": "acc://d0049b680a8acf4636e62eb46a973fc7efb0d913af0e34b06fce614d5bda495f@acme"
      }
    ],
    "start": 0,
    "total": 1
  }
}
PreviousMethodsNextTransports

Last updated 12 months ago