2019-11-25 19:46:02 +00:00
|
|
|
package rest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
|
|
|
"github.com/cosmos/cosmos-sdk/types/rest"
|
|
|
|
"github.com/gorilla/mux"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2020-02-02 16:06:33 +00:00
|
|
|
RestMarketID = "market_id"
|
2019-11-25 19:46:02 +00:00
|
|
|
)
|
|
|
|
|
2020-02-02 16:06:33 +00:00
|
|
|
// PostPriceReq defines the properties of a PostPrice request's body.
|
|
|
|
type PostPriceReq struct {
|
2020-01-17 12:29:19 +00:00
|
|
|
BaseReq rest.BaseReq `json:"base_req"`
|
|
|
|
MarketID string `json:"market_id"`
|
|
|
|
Price string `json:"price"`
|
|
|
|
Expiry string `json:"expiry"`
|
2019-11-25 19:46:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RegisterRoutes - Central function to define routes that get registered by the main application
|
2020-01-17 12:29:19 +00:00
|
|
|
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
|
|
|
|
registerQueryRoutes(cliCtx, r)
|
|
|
|
registerTxRoutes(cliCtx, r)
|
2019-11-25 19:46:02 +00:00
|
|
|
}
|