Bigmap Value Table
GET /tables/bigmap_values?args
Lists individual bigmap values exist in a bigmap at the time of the call. Use this table to bulk-fetch large quantities of bigmap content. A better way might be to use 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. |
height int64 | Height when this key was last updated. |
time datetime | Time of the latest key update. |
key_id uint64 | Short hash of the bigmap 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. |
[
[
3447263, // row_id
515, // bigmap_id
3143289717337607700, // key_id
1669888, // height
"07070a0000001600003f365276e50080856992f4382eaf5e4e6e6b93360000", // key
"00bca2f501", // value
"exprucYwnpqVYDKuUkPsoGAJ4213DjAJHef2FSqrLx66aFoyEn1Ygv" // key_hash
1630908360000 // time
]
]
curl "https://api.tzpro.io/tables/bigmap_values?bigmap_id=515&limit=1&order=desc"
import (
"context"
"github.com/trilitech/tzpro-go/tzpro"
)
// create a new query object
q := tzpro.DefaultClient.Contract.NewBigmapValueQuery()
// 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 active keys
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)
}