-
Notifications
You must be signed in to change notification settings - Fork 4
/
big_map.go
69 lines (62 loc) · 2.09 KB
/
big_map.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package data
import (
stdJSON "encoding/json"
"time"
)
// BigMap -
type BigMap struct {
Ptr int64 `json:"ptr"`
Contract Address `json:"contract"`
Path string `json:"path"`
Active bool `json:"active"`
FirstLevel uint64 `json:"firstLevel"`
LastLevel uint64 `json:"lastLevel"`
TotalKeys uint64 `json:"totalKeys"`
ActiveKeys uint64 `json:"activeKeys"`
Updates uint64 `json:"updates"`
KeyType stdJSON.RawMessage `json:"keyType"`
ValueType stdJSON.RawMessage `json:"valueType"`
}
// BigMapUpdate -
type BigMapUpdate struct {
ID uint64 `json:"id"`
Level uint64 `json:"level"`
Timestamp time.Time `json:"timestamp"`
Bigmap int64 `json:"bigmap"`
Contract Address `json:"contract"`
Path string `json:"path"`
Action string `json:"action"`
Content *BigMapUpdateContent `json:"content,omitempty"`
}
// BigMapKeyUpdate -
type BigMapKeyUpdate struct {
ID uint64 `json:"id"`
Level uint64 `json:"level"`
Timestamp time.Time `json:"timestamp"`
Action string `json:"action"`
Value stdJSON.RawMessage `json:"value"`
}
// BigMapUpdateContent -
type BigMapUpdateContent struct {
Hash string `json:"hash"`
Key stdJSON.RawMessage `json:"key"`
Value stdJSON.RawMessage `json:"value"`
}
// BigMapKey -
type BigMapKey struct {
ID uint64 `json:"id"`
Active bool `json:"active"`
Hash string `json:"hash"`
Key string `json:"key"`
Value stdJSON.RawMessage `json:"value"`
FirstLevel uint64 `json:"firstLevel"`
LastLevel uint64 `json:"lastLevel"`
Updates uint64 `json:"updates"`
}
// BigMapJSONSchema -
type BigMapJSONSchema struct {
Name string `json:"name"`
Path string `json:"path"`
Key JSONSchema `json:"keySchema"`
Value JSONSchema `json:"valueSchema"`
}