/
rest.go
32 lines (27 loc) · 1.08 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
package rest
import (
"github.com/gorilla/mux"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/rest"
sdk "github.com/cosmos/cosmos-sdk/types"
sdktrest "github.com/cosmos/cosmos-sdk/types/rest"
)
// RegisterHandlers registers register-related REST handlers to a router
func RegisterHandlers(clientCtx client.Context, rtr *mux.Router) {
r := rest.WithHTTPDeprecationHeaders(rtr)
sdsQueryRoutes(clientCtx, r)
sdsTxHandlers(clientCtx, r)
}
// FileUploadReq defines the properties of a file upload request's body.
type FileUploadReq struct {
BaseReq sdktrest.BaseReq `json:"base_req" yaml:"base_req"`
Reporter string `json:"reporter" yaml:"reporter"`
FileHash string `json:"file_hash" yaml:"file_hash"`
Uploader string `json:"uploader" yaml:"uploader"`
}
// PrepayReq defines the properties of a prepay request's body.
type PrepayReq struct {
BaseReq sdktrest.BaseReq `json:"base_req" yaml:"base_req"`
Beneficiary string `json:"beneficiary" yaml:"beneficiary"`
Amount sdk.Coins `json:"amount" yaml:"amount"`
}