Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

[API] /account returns not documented structure #49

Open
EnoRage opened this issue Jan 27, 2020 · 1 comment
Open

[API] /account returns not documented structure #49

EnoRage opened this issue Jan 27, 2020 · 1 comment

Comments

@EnoRage
Copy link

EnoRage commented Jan 27, 2020

How it is described:
https://api.tzstats.com/explorer/account/tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m
Response:

{
  "address": "tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m",
  "address_type": "secp256k1",
  "delegate": "tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m",
  "manager": "",
  "pubkey": "sppk7bn9MKAWDUFwqowcxA1zJgp12yn2kEnMQJP3WmqSZ4W8WQhLqJN",
  "first_in": 360996,
  "first_out": 360997,
  "last_in": 798547,
  "last_out": 798547,
  "first_seen": 360996,
  "last_seen": 798547,
  "delegated_since": 0,
  "delegate_since": 361000,
  "first_in_time": "2019-03-20T23:10:52Z",
  "first_out_time": "2019-03-20T23:11:52Z",
  "last_in_time": "2020-01-27T15:48:29Z",
  "last_out_time": "2020-01-27T15:48:29Z",
  "first_seen_time": "2019-03-20T23:10:52Z",
  "last_seen_time": "2020-01-27T15:48:29Z",
  "delegated_since_time": "0001-01-01T00:00:00Z",
  "delegate_since_time": "2019-03-20T23:14:52Z",
  "total_received": 4202918.18456,
  "total_sent": 2249591.094354,
  "total_burned": 0,
  "total_fees_paid": 0.085097,
  "total_rewards_earned": 1172359.071348,
  "total_fees_earned": 191.42406,
  "total_lost": 0,
  "frozen_deposits": 2824832,
  "frozen_rewards": 87364.083332,
  "frozen_fees": 22.206582,
  "unclaimed_balance": 0,
  "spendable_balance": 213659.210603,
  "total_balance": 3038513.417185,
  "delegated_balance": 24983342.325077,
  "total_delegations": 31,
  "active_delegations": 13,
  "is_funded": true,
  "is_activated": false,
  "is_vesting": false,
  "is_spendable": true,
  "is_delegatable": false,
  "is_delegated": false,
  "is_revealed": true,
  "is_delegate": true,
  "is_active_delegate": true,
  "is_contract": false,
  "blocks_baked": 15107,
  "blocks_missed": 53,
  "blocks_stolen": 337,
  "blocks_endorsed": 238342,
  "slots_endorsed": 472966,
  "slots_missed": 530,
  "n_ops": 238992,
  "n_ops_failed": 0,
  "n_tx": 65,
  "n_delegation": 1,
  "n_origination": 0,
  "n_proposal": 2,
  "n_ballot": 3,
  "token_gen_min": 2,
  "token_gen_max": 8144,
  "grace_period": 200,
  "staking_balance": 28021855.742262,
  "rolls": 3502,
  "rich_rank": 29,
  "traffic_rank": 0,
  "flow_rank": 0,
  "last_bake_height": 798530,
  "last_bake_block": "BKxWH3nQ29jkZfED3QpqBkU9vhGcixqRoHsKjbA7YKHTK9nBXNi",
  "last_bake_time": "2020-01-27T15:31:29Z",
  "last_endorse_height": 798547,
  "last_endorse_block": "BKmFFRn7HJbhfygiibGk88DoLTLqKAGta3xvrEQbaBneYQ2vBNg",
  "last_endorse_time": "2020-01-27T15:48:29Z",
  "next_bake_height": 798562,
  "next_bake_priority": 0,
  "next_bake_time": "2020-01-27T16:03:29Z",
  "next_endorse_height": 798549,
  "next_endorse_time": "2020-01-27T15:50:29Z"
}

How it works with another address:
https://api.tzstats.com/explorer/account/tz1VFiQwFL36Ru7EtugLjXVh3dqp9B4KRSAV
Response:

{
  "address": "tz1VFiQwFL36Ru7EtugLjXVh3dqp9B4KRSAV",
  "address_type": "ed25519",
  "delegate": "tz1Vyuu4EJ5Nym4JcrfRLnp3hpaq1DSEp1Ke",
  "manager": "",
  "pubkey": "edpkuqrs2A3DjNnVVYJEbkk5Lf18PzXwryZxnzwUNaDENhwDdw6iQo",
  "first_in": 678309,
  "first_out": 678311,
  "last_in": 794781,
  "last_out": 793743,
  "first_seen": 678309,
  "last_seen": 794781,
  "delegated_since": 793743,
  "delegate_since": 0,
  "first_in_time": "2019-11-03T18:27:17Z",
  "first_out_time": "2019-11-03T18:29:17Z",
  "last_in_time": "2020-01-25T00:39:33Z",
  "last_out_time": "2020-01-24T07:17:44Z",
  "first_seen_time": "2019-11-03T18:27:17Z",
  "last_seen_time": "2020-01-25T00:39:33Z",
  "delegated_since_time": "2020-01-24T07:17:44Z",
  "delegate_since_time": "0001-01-01T00:00:00Z",
  "total_received": 111.326197,
  "total_sent": 19.04,
  "total_burned": 0.771,
  "total_fees_paid": 0.2742,
  "total_rewards_earned": 0,
  "total_fees_earned": 0,
  "total_lost": 0,
  "frozen_deposits": 0,
  "frozen_rewards": 0,
  "frozen_fees": 0,
  "unclaimed_balance": 0,
  "spendable_balance": 91.240997,
  "total_balance": 91.240997,
  "delegated_balance": 0,
  "total_delegations": 0,
  "active_delegations": 0,
  "is_funded": true,
  "is_activated": false,
  "is_vesting": false,
  "is_spendable": true,
  "is_delegatable": false,
  "is_delegated": true,
  "is_revealed": true,
  "is_delegate": false,
  "is_active_delegate": false,
  "is_contract": false,
  "blocks_baked": 0,
  "blocks_missed": 0,
  "blocks_stolen": 0,
  "blocks_endorsed": 0,
  "slots_endorsed": 0,
  "slots_missed": 0,
  "n_ops": 26,
  "n_ops_failed": 1,
  "n_tx": 21,
  "n_delegation": 4,
  "n_origination": 0,
  "n_proposal": 0,
  "n_ballot": 0,
  "token_gen_min": 3,
  "token_gen_max": 11163,
  "grace_period": 0,
  "staking_balance": 0,
  "rolls": 0,
  "rich_rank": 23549,
  "traffic_rank": 0,
  "flow_rank": 0,
  "last_bake_height": 0,
  "last_bake_block": "",
  "last_bake_time": "0001-01-01T00:00:00Z",
  "last_endorse_height": 0,
  "last_endorse_block": "",
  "last_endorse_time": "0001-01-01T00:00:00Z",
  "next_bake_height": 0,
  "next_bake_priority": 0,
  "next_bake_time": "0001-01-01T00:00:00Z",
  "next_endorse_height": 0,
  "next_endorse_time": "0001-01-01T00:00:00Z",
  "delegate_account": {
    "address": "tz1Vyuu4EJ5Nym4JcrfRLnp3hpaq1DSEp1Ke",
    "address_type": "ed25519",
    "delegate": "tz1Vyuu4EJ5Nym4JcrfRLnp3hpaq1DSEp1Ke",
    "manager": "",
    "pubkey": "edpkvNz7AFBaPLxgRXTQa7wKSCEGw9vwxmaQQA1p2Fx5KAH2oYu9jL",
    "first_in": 259217,
    "first_out": 259219,
    "last_in": 798453,
    "last_out": 798453,
    "first_seen": 259217,
    "last_seen": 798453,
    "delegated_since": 0,
    "delegate_since": 267088,
    "first_in_time": "2019-01-06T18:46:51Z",
    "first_out_time": "2019-01-06T18:48:51Z",
    "last_in_time": "2020-01-27T14:13:49Z",
    "last_out_time": "2020-01-27T14:13:49Z",
    "first_seen_time": "2019-01-06T18:46:51Z",
    "last_seen_time": "2020-01-27T14:13:49Z",
    "delegated_since_time": "0001-01-01T00:00:00Z",
    "delegate_since_time": "2019-01-12T11:49:35Z",
    "total_received": 19561.091364,
    "total_sent": 7080.706701,
    "total_burned": 0.031,
    "total_fees_paid": 6.902242,
    "total_rewards_earned": 8579.599998,
    "total_fees_earned": 0.853818,
    "total_lost": 0,
    "frozen_deposits": 17280,
    "frozen_rewards": 538.4,
    "frozen_fees": 0.036448,
    "unclaimed_balance": 0,
    "spendable_balance": 3235.468789,
    "total_balance": 20515.505236999998,
    "delegated_balance": 193420.775675,
    "total_delegations": 245,
    "active_delegations": 114,
    "is_funded": true,
    "is_activated": false,
    "is_vesting": false,
    "is_spendable": true,
    "is_delegatable": false,
    "is_delegated": false,
    "is_revealed": true,
    "is_delegate": true,
    "is_active_delegate": true,
    "is_contract": false,
    "blocks_baked": 114,
    "blocks_missed": 8,
    "blocks_stolen": 3,
    "blocks_endorsed": 3423,
    "slots_endorsed": 3440,
    "slots_missed": 127,
    "n_ops": 8165,
    "n_ops_failed": 0,
    "n_tx": 4731,
    "n_delegation": 1,
    "n_origination": 0,
    "n_proposal": 3,
    "n_ballot": 6,
    "token_gen_min": 3,
    "token_gen_max": 5185,
    "grace_period": 200,
    "staking_balance": 213936.280912,
    "rolls": 26,
    "rich_rank": 2461,
    "traffic_rank": 0,
    "flow_rank": 0,
    "last_bake_height": 0,
    "last_bake_block": "",
    "last_bake_time": "0001-01-01T00:00:00Z",
    "last_endorse_height": 0,
    "last_endorse_block": "",
    "last_endorse_time": "0001-01-01T00:00:00Z",
    "next_bake_height": 0,
    "next_bake_priority": 0,
    "next_bake_time": "0001-01-01T00:00:00Z",
    "next_endorse_height": 0,
    "next_endorse_time": "0001-01-01T00:00:00Z"
  }
}

There is "delegate_account": {} inside second response

@echa
Copy link
Contributor

echa commented Jan 27, 2020

Yeah, that's missing in the docs because it's an unstable/internal feature that may break. The same applies to the manager_account field when the account is a contract. We embed related accounts to avoid extra calls for our block explorer but may remove these embeds or add a query arg to enable/disable embeds in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants