Bigmap Update Table
GET /tables/bigmap_updates?args
Lists historic bigmap updates. Use this table to bulk-fetch large quantities of bigmap updates, e.g. to replay or reconstruct bigmap state. A different way to access updates is by using the explorer API endpoints.
- Schema
- Response
- Example
Field | Description |
---|---|
row_id uint64 | Unique row identifier. |
bigmap_id int64 | Unique on-chain id of the bigmap. |
key_id uint64 | Short hash of the bigmap key. |
key_hash string | Tezos script expression hash of the key. |
key string | Hex string with Micheline encoded data for the key. |
value string | Hex string with Micheline encoded data for the value. |
action enum | Update action, one of update , remove , alloc , copy . |
height int64 | Block height at which the update happened. |
time timestamp | Time of the update. |
op_id uint64 | Unique row id of the operation that contained the update. |
op_hash hash | Hash of the operation that contained the update. |
[
[
12520900, // row_id
515, // bigmap_id
14880518129034867591, // key_id
"update", // action
63514493, // op_id
1585371, // height
1628006826000, // time
"07070a0000001601b39686f116bb35115559f7e781200850e02854c4000000", // key
"008d96adb1af01", // value
"onw1dT9DssyqPN6fGXq99qG5nd5zK1MXuHZPHm5GTrjQy6aERt1", // op_hash
"exprvLWAQodM4mjNkpX3WzgbUi8KKhL8qPDchFuwNQBdPbt6CTQQjf" // key_hash
]
]
curl "https://api.tzpro.io/tables/bigmap_updates?bigmap_id=515&limit=1&order=desc"
import (
"context"
"github.com/trilitech/tzpro-go/tzpro"
)
// create a new query object
q := tzpro.DefaultClient.NewBigmapUpdateQuery()
// need typs for decoding
info, err := tzpro.DefaultClient.Contract.GetBigmap(
context.Background(),
511,
tzpro.WithPrim(),
)
keyType := info.MakeKeyType()
valType := info.MakeValueType()
// add filters and configure the query to list all updates (update/removal actions)
q.WithFilter(tzpro.FilterModeEqual, "bigmap_id", 511).
WithLimit(1).
WithDesc()
// execute the query
list, err := q.Run(context.Background())
// walk bigmap updates
for _, row := range list.Rows {
// access BigmapRow structs (use TzGo Type/Value to decode binary data)
key := row.GetKey(keyType)
val := row.GetValue(valType)
}