getState

getState is a method on the ANT class that retrieves the complete state of the ANT process, including all records, balances, controllers, and metadata.

getState does not require authentication.

Parameters

The getState method does not accept any parameters.

Examples

getState

const { ANT } = require('@ar.io/sdk');

async function main() {
  const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" });
  const state = await ant.getState();

  console.log(state);
}

main();

Output

{
  "Name": "ArDrive",
  "Ticker": "ARDRIVE",
  "Denomination": 0,
  "Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A",
  "Description": "The ArDrive ANT",
  "Keywords": ["File-sharing", "Publishing", "dApp"],
  "TotalSupply": 1,
  "Initialized": true,
  "Balances": {
    "ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4": 1
  },
  "Controllers": ["ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4"],
  "Records": {
    "@": {
      "transactionId": "UyC5P5qKPZaltMmmZAWdakhlDXsBF6qmyrbWYFchRTk",
      "ttlSeconds": 3600
    },
    "blog": {
      "transactionId": "f5-cw-0Gl60FqmKhP5Sj3gQlJ1FhWXPkXB3UQEVoV4o",
      "ttlSeconds": 3600
    }
  },
  "Owner": "ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4"
}