contracts

The contract state from a contract on the network

Returns a list of all contract's slots. If no timestamp is provided, returns the current state.

get/api/v1/contracts/{contractIdOrAddress}/state

Path parameters

contractIdOrAddressstring required

Contract or account identifier in format shard.realm.num, realm.num, num or a 20-byte EVM address (with or without 0x prefix).

Query parameters

limitinteger

The maximum number of items to return

order'asc' | 'desc'

The order in which items are listed

slotstring

The slot's number

timestampstring[]

The consensus timestamp of the contract state as a Unix timestamp in seconds.nanoseconds format with an optional comparison operator. See unixtimestamp.com for a simple way to convert a date to the 'seconds' part of the Unix time.

Response

OK

Example response

{
  "state": [
    {
      "address": "0000000000000000000000000000000000001f41",
      "contract_id": "0.0.2",
      "timestamp": "1586567700.453054000",
      "slot": "0x00000000000000000000000000000000000000000000000000000000000000fa",
      "value": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"
    }
  ]
}

Changes

Changed in 2 of the 53 revisions of this API.42

    • removed the non-success response with the status 404

      response-non-success-status-removed

  • v1db389f03b09741See the full diff
    • the response property _status/messages/items/data became nullable for the status 400

      response-property-became-nullable

    • the response property _status/messages/items/detail became nullable for the status 400

      response-property-became-nullable

    • the response property links/next became nullable for the status 200

      response-property-became-nullable

    • the response property state/items/contract_id became nullable for the status 200

      response-property-became-nullable

    • added the non-success response with the status 404

      response-non-success-status-added

    This revision also has 22 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog