Snapshot Table
GET /tables/snapshot?args
List network-wide staking status across all bakers and delegators at snapshot blocks. this table contains all snapshots regardless of them being later chosen as cycle snapshot or not.
- Schema
- Response
- Example
Field | Description |
---|---|
row_id uint64 | Unique row identifier. |
height int64 | Block height of this snapshot. |
cycle int64 | Cycle of this snapshot. |
time datetime | Block time of this snapshot. |
index int64 | Snapshot index in the cycle [0..15]. |
own_stake money | (baker only) Amount of stake owned by the baker. |
staking_balance money | (baker only) Total amount of staked plus delegated (uncapped, may be over-delegated or over-staked). |
account_id uint64 | Unique row_id of the account this snapshot relates to. |
baker_id uint64 | Unique row_id of the baker this account delegates to. |
is_baker bool | Flag indicating the current account is a baker. |
is_active bool | Flag indicating the current account is an active baker. |
balance money | Account spendable balance. |
delegated money | (baker-only) Total delegated balance. |
n_delegations int64 | (baker-only) Incoming number of non-zero delegations. |
n_stakers int64 | (baker-only) Number of stakers. |
since int64 | (delegator-only) Block height at which this delegation was created. |
address hash | Account address. |
baker hash | Account delegate address. |
since_time datetime | (delegator-only) Timestamp when this delegation was created. |
[
[
77603856, // row_id
4858880, // height
690, // cycle
1704259861000, // time
0, // index
4411411.932779, // own_stake
44132493.923541, // staking_balance
43215, // account_id
43215, // baker_id
1, // is_baker
1, // is_active
5870034.494243, // balance
38262459.429298, // delegated
5504, // n_delegations
0, // n_stakers
53964, // since
"tz1VQnqCCqX4K5sP3FNkVSNKTdCAMJDd3E1n", // address
"tz1VQnqCCqX4K5sP3FNkVSNKTdCAMJDd3E1n", // baker
1533823255000 // since_time
]
]
curl "https://api.tzpro.io/tables/snapshot?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m&cycle=150&is_selected=1&limit=1"
import (
"context"
"github.com/trilitech/tzpro-go/tzpro"
)
// create a new query object
q := tzpro.DefaultClient.Baker.NewSnapshotQuery()
// add filters and configure the query
q.WithFilter(tzpro.FilterModeEqual, "address", "tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m").
WithFilter(tzpro.FilterModeEqual, "cycle", 150).
WithFilter(tzpro.FilterModeEqual, "is_selected", true).
Limit(1)
// execute the query
list, err := q.Run(context.Background())
// process rows
if _, snapshot := range list.Rows {
}