-
Notifications
You must be signed in to change notification settings - Fork 30
/
querier.go
88 lines (74 loc) · 1.91 KB
/
querier.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package types
// DONTCOVER
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// query endpoints supported by the NFT Querier
const (
QuerySupply = "supply"
QueryOwner = "owner"
QueryCollection = "collection"
QueryDenoms = "denoms"
QueryDenom = "denom"
QueryNFT = "nft"
)
// QuerySupplyParams defines the params for queries:
type QuerySupplyParams struct {
Denom string
Owner sdk.AccAddress
}
// NewQuerySupplyParams creates a new instance of QuerySupplyParams
func NewQuerySupplyParams(denom string, owner sdk.AccAddress) QuerySupplyParams {
return QuerySupplyParams{
Denom: denom,
Owner: owner,
}
}
// Bytes exports the Denom as bytes
func (q QuerySupplyParams) Bytes() []byte {
return []byte(q.Denom)
}
// QueryOwnerParams defines the params for queries:
type QueryOwnerParams struct {
Denom string
Owner sdk.AccAddress
}
// NewQuerySupplyParams creates a new instance of QuerySupplyParams
func NewQueryOwnerParams(denom string, owner sdk.AccAddress) QueryOwnerParams {
return QueryOwnerParams{
Denom: denom,
Owner: owner,
}
}
// QuerySupplyParams defines the params for queries:
type QueryCollectionParams struct {
Denom string
}
// NewQueryCollectionParams creates a new instance of QueryCollectionParams
func NewQueryCollectionParams(denom string) QueryCollectionParams {
return QueryCollectionParams{
Denom: denom,
}
}
// QueryDenomParams defines the params for queries:
type QueryDenomParams struct {
ID string
}
// NewQueryDenomParams creates a new instance of QueryDenomParams
func NewQueryDenomParams(id string) QueryDenomParams {
return QueryDenomParams{
ID: id,
}
}
// QueryNFTParams params for query 'custom/nfts/nft'
type QueryNFTParams struct {
Denom string
TokenID string
}
// NewQueryNFTParams creates a new instance of QueryNFTParams
func NewQueryNFTParams(denom, id string) QueryNFTParams {
return QueryNFTParams{
Denom: denom,
TokenID: id,
}
}