-
Notifications
You must be signed in to change notification settings - Fork 1
/
list.go
64 lines (55 loc) · 2.01 KB
/
list.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
// Copyright 2016, 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were auto generated. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/
package sdk
import (
// EXISTING_CODE
"encoding/json"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
// EXISTING_CODE
)
type ListOptions struct {
Addrs []string `json:"addrs,omitempty"`
NoZero bool `json:"noZero,omitempty"`
Unripe bool `json:"unripe,omitempty"`
Silent bool `json:"silent,omitempty"`
FirstRecord uint64 `json:"firstRecord,omitempty"`
MaxRecords uint64 `json:"maxRecords,omitempty"`
Reversed bool `json:"reversed,omitempty"`
Publisher base.Address `json:"publisher,omitempty"`
FirstBlock base.Blknum `json:"firstBlock,omitempty"`
LastBlock base.Blknum `json:"lastBlock,omitempty"`
RenderCtx *output.RenderCtx `json:"-"`
Globals
}
// String implements the stringer interface
func (opts ListOptions) String() string {
bytes, _ := json.Marshal(opts)
return string(bytes)
}
// List implements the chifra list command.
func (opts *ListOptions) List() ([]types.Appearance, *types.MetaData, error) {
in := opts.toInternal()
return queryList[types.Appearance](in)
}
// ListCount implements the chifra list --count command.
func (opts *ListOptions) ListCount() ([]types.Monitor, *types.MetaData, error) {
in := opts.toInternal()
in.Count = true
return queryList[types.Monitor](in)
}
// ListBounds implements the chifra list --bounds command.
func (opts *ListOptions) ListBounds() ([]types.Bounds, *types.MetaData, error) {
in := opts.toInternal()
in.Bounds = true
return queryList[types.Bounds](in)
}
// No enums
// EXISTING_CODE
// EXISTING_CODE