0g-chain/x/pricefeed/client/rest/rest.go

27 lines
667 B
Go
Raw Normal View History

2019-11-25 19:46:02 +00:00
package rest
import (
2020-04-30 14:23:41 +00:00
"github.com/gorilla/mux"
2019-11-25 19:46:02 +00:00
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/types/rest"
)
const (
RestMarketID = "market_id"
2019-11-25 19:46:02 +00:00
)
// PostPriceReq defines the properties of a PostPrice request's body.
type PostPriceReq struct {
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
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
registerQueryRoutes(cliCtx, r)
registerTxRoutes(cliCtx, r)
2019-11-25 19:46:02 +00:00
}