-
Notifications
You must be signed in to change notification settings - Fork 6
/
bigmaps.go
49 lines (40 loc) · 1.68 KB
/
bigmaps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package api
import (
"context"
"fmt"
"github.com/dipdup-net/go-lib/tzkt/data"
)
// GetBigmapsCount -
func (tzkt *API) GetBigmapsCount(ctx context.Context) (uint64, error) {
return tzkt.count(ctx, "/v1/bigmaps/count", nil)
}
// GetBigmaps -
func (tzkt *API) GetBigmaps(ctx context.Context, filters map[string]string) (response []data.BigMap, err error) {
err = tzkt.json(ctx, "/v1/bigmaps", filters, false, &response)
return
}
// GetBigmapUpdates -
func (tzkt *API) GetBigmapUpdates(ctx context.Context, filters map[string]string) (response []data.BigMapUpdate, err error) {
err = tzkt.json(ctx, "/v1/bigmaps/updates", filters, false, &response)
return
}
// GetBigmapByID -
func (tzkt *API) GetBigmapByID(ctx context.Context, id uint64, filters map[string]string) (response data.BigMap, err error) {
err = tzkt.json(ctx, fmt.Sprintf("/v1/bigmaps/%d", id), filters, false, &response)
return
}
// GetBigmapKeys -
func (tzkt *API) GetBigmapKeys(ctx context.Context, id uint64, filters map[string]string) (response []data.BigMapKey, err error) {
err = tzkt.json(ctx, fmt.Sprintf("/v1/bigmaps/%d/keys", id), filters, false, &response)
return
}
// GetBigmapKey -
func (tzkt *API) GetBigmapKey(ctx context.Context, id uint64, key string, filters map[string]string) (response data.BigMapKey, err error) {
err = tzkt.json(ctx, fmt.Sprintf("/v1/bigmaps/%d/keys/%s", id, key), filters, false, &response)
return
}
// GetBigmapKeyUpdates -
func (tzkt *API) GetBigmapKeyUpdates(ctx context.Context, id uint64, key string, filters map[string]string) (response []data.BigMapKeyUpdate, err error) {
err = tzkt.json(ctx, fmt.Sprintf("/v1/bigmaps/%d/keys/%s/updates", id, key), filters, false, &response)
return
}