github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/farm/client/rest/tx.go (about) 1 package rest 2 3 // The packages below are commented out at first to prevent an error if this file isn't initially saved. 4 import ( 5 // "bytes" 6 // "net/http" 7 8 "github.com/gorilla/mux" 9 10 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/client/context" 11 // sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types" 12 // "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types/rest" 13 // "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/x/auth/client/utils" 14 // "github.com/fibonacci-chain/fbc/x/farm/types" 15 ) 16 17 func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router) { 18 // r.HandleFunc( 19 // TODO: Define the Rest route , 20 // Call the function which should be executed for this route), 21 // ).Methods("POST") 22 } 23 24 /* 25 // Action TX body 26 type <Action>Req struct { 27 BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` 28 // TODO: Define more types if needed 29 } 30 31 func <Action>RequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { 32 return func(w http.ResponseWriter, r *http.Request) { 33 var req <Action>Req 34 vars := mux.Vars(r) 35 36 baseReq := req.BaseReq.Sanitize() 37 if !baseReq.ValidateBasic(w) { 38 return 39 } 40 41 // TODO: Define the module tx logic for this action 42 43 utils.WriteGenerateStdTxResponse(w, cliCtx, BaseReq, []sdk.Msg{msg}) 44 } 45 } 46 */