-
Notifications
You must be signed in to change notification settings - Fork 341
/
rest.go
64 lines (55 loc) · 1.83 KB
/
rest.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 (c) 2016-2021 Shanghai Bianjie AI Technology Inc. (licensed under the Apache License, Version 2.0)
// Modifications Copyright (c) 2021, CRO Protocol Labs ("Crypto.org") (licensed under the Apache License, Version 2.0)
package rest
import (
"github.com/gorilla/mux"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/types/rest"
)
// RegisterHandlers registers the NFT REST routes.
func RegisterHandlers(cliCtx client.Context, r *mux.Router, queryRoute string) {
registerQueryRoutes(cliCtx, r, queryRoute)
registerTxRoutes(cliCtx, r, queryRoute)
}
const (
RestParamDenomID = "denom-id"
RestParamDenomName = "denom-name"
RestParamTokenID = "token-id"
RestParamOwner = "owner"
)
type issueDenomReq struct {
BaseReq rest.BaseReq `json:"base_req"`
Owner string `json:"owner"`
ID string `json:"id"`
Name string `json:"name"`
Schema string `json:"schema"`
}
type mintNFTReq struct {
BaseReq rest.BaseReq `json:"base_req"`
Owner string `json:"owner"`
Recipient string `json:"recipient"`
DenomID string `json:"denom_id"`
ID string `json:"id"`
Name string `json:"name"`
URI string `json:"uri"`
Data string `json:"data"`
}
type editNFTReq struct {
BaseReq rest.BaseReq `json:"base_req"`
Owner string `json:"owner"`
Name string `json:"name"`
URI string `json:"uri"`
Data string `json:"data"`
}
type transferNFTReq struct {
BaseReq rest.BaseReq `json:"base_req"`
Owner string `json:"owner"`
Recipient string `json:"recipient"`
Name string `json:"name"`
URI string `json:"uri"`
Data string `json:"data"`
}
type burnNFTReq struct {
BaseReq rest.BaseReq `json:"base_req"`
Owner string `json:"owner"`
}