2018-02-23 02:25:25 -08:00
|
|
|
package tx
|
|
|
|
|
|
|
|
import (
|
2018-03-09 01:15:56 -08:00
|
|
|
"github.com/gorilla/mux"
|
2018-02-23 02:25:25 -08:00
|
|
|
"github.com/spf13/cobra"
|
2018-03-02 01:24:07 -08:00
|
|
|
|
2018-04-25 07:49:31 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
2018-03-02 01:24:07 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/wire"
|
2018-02-23 02:25:25 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// AddCommands adds a number of tx-query related subcommands
|
2018-02-28 17:57:38 -08:00
|
|
|
func AddCommands(cmd *cobra.Command, cdc *wire.Codec) {
|
2018-02-23 02:25:25 -08:00
|
|
|
cmd.AddCommand(
|
2018-04-18 21:49:24 -07:00
|
|
|
SearchTxCmd(cdc),
|
|
|
|
QueryTxCmd(cdc),
|
2018-02-23 02:25:25 -08:00
|
|
|
)
|
|
|
|
}
|
2018-03-09 01:15:56 -08:00
|
|
|
|
2018-04-18 21:49:24 -07:00
|
|
|
// register REST routes
|
2018-04-25 07:49:31 -07:00
|
|
|
func RegisterRoutes(ctx context.CoreContext, r *mux.Router, cdc *wire.Codec) {
|
2018-04-25 13:32:22 -07:00
|
|
|
r.HandleFunc("/txs/{hash}", QueryTxRequestHandlerFn(cdc, ctx)).Methods("GET")
|
2018-06-11 13:09:29 -07:00
|
|
|
r.HandleFunc("/txs", SearchTxRequestHandlerFn(ctx, cdc)).Methods("GET")
|
2018-03-14 05:01:55 -07:00
|
|
|
// r.HandleFunc("/txs/sign", SignTxRequstHandler).Methods("POST")
|
|
|
|
// r.HandleFunc("/txs/broadcast", BroadcastTxRequestHandler).Methods("POST")
|
2018-03-09 01:15:56 -08:00
|
|
|
}
|