0g-chain/x/pricefeed/client/rest/rest.go
Denali Marsh 4599caca07
R4R: update pricefeed module rest endpoints (#359)
* query get price implemented - /pricefeed/price/xrp:usd

* query rawprices implemented - /pricefeed/rawprices/xrp:usd

* refactored to QueryWithMarketIDParams, added rest logic for QueryOracles

* new query get oracles implemented for cli and rest - /pricefeed/oracles/xrp:usd

* tx postprice implemented - /pricefeed/postprice/{MsgPostPrice}

* updated contrib with post-price examples and added to README

* added cliCtx.WithHeight(height) and removed import comment
2020-02-02 11:06:33 -05:00

26 lines
666 B
Go

package rest
import (
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/gorilla/mux"
)
const (
RestMarketID = "market_id"
)
// 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"`
}
// 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)
}