Documentation
¶
Index ¶
- func BuildStdTxAndResponse(writer http.ResponseWriter, request *http.Request, cliCtx context.CLIContext, ...)
- func ParseEvents(rte []atypes.Event) ([]events, error)
- func ParseURIPathAddress(request *http.Request, pathName string) (types.AccAddress, error)
- func ParseURIPathValue(request *http.Request, pathName string) (string, error)
- func PostProcessResponseBare(w http.ResponseWriter, ctx context.CLIContext, body interface{})
- func ServerCommand(cdc *amino.Codec, registerRoutesFn func(*RestServer)) *cobra.Command
- func Write40XErrorResponse(w http.ResponseWriter, err error)
- func WriteErrorResponse(w http.ResponseWriter, status int, err string)
- func WriteGenStdTxResponse(writer http.ResponseWriter, cliCtx context.CLIContext, req BaseRequest, ...)
- type BaseRequest
- type BroadcastReq
- type Config
- type ErrorResponse
- type Event
- type EventKeyPair
- type EventResult
- type RestServer
- type TxGenerateResponse
- type TxResponse
- type TxsSearchEvent
- type TxsSearchItem
- type TxsSearchRequest
- type TxsSearchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStdTxAndResponse ¶
func BuildStdTxAndResponse(writer http.ResponseWriter, request *http.Request, cliCtx context.CLIContext, typ reflect.Type, fn func(req interface{}, from types.AccAddress, vars map[string]string) (txs.ITx, error))
func ParseEvents ¶
func ParseURIPathAddress ¶
func ParseURIPathValue ¶
func PostProcessResponseBare ¶
func PostProcessResponseBare(w http.ResponseWriter, ctx context.CLIContext, body interface{})
func ServerCommand ¶
func ServerCommand(cdc *amino.Codec, registerRoutesFn func(*RestServer)) *cobra.Command
func Write40XErrorResponse ¶
func Write40XErrorResponse(w http.ResponseWriter, err error)
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, status int, err string)
func WriteGenStdTxResponse ¶
func WriteGenStdTxResponse(writer http.ResponseWriter, cliCtx context.CLIContext, req BaseRequest, tx txs.ITx)
Types ¶
type BaseRequest ¶
type BaseRequest struct {
From string `json:"from"`
ChainId string `json:"chain_id"`
Nonce int64 `json:"nonce"`
MaxGas int64 `json:"max_gas"`
Height int64 `json:"height"`
Indent bool `json:"indent"`
Mode string `json:"mode"`
}
func NewBaseRequest ¶
func NewBaseRequest(from, chainId string, nonce, maxGas, height int64, indent bool, mode string) BaseRequest
func ParseRequestForm ¶
func ParseRequestForm(r *http.Request) (br BaseRequest, err error)
func (BaseRequest) Sanitize ¶
func (br BaseRequest) Sanitize() BaseRequest
func (BaseRequest) Setup ¶
func (br BaseRequest) Setup(ctx context.CLIContext) context.CLIContext
func (BaseRequest) ValidateBasic ¶
func (br BaseRequest) ValidateBasic() error
type BroadcastReq ¶
type ErrorResponse ¶
func NewErrorResponse ¶
func NewErrorResponse(code int, err string) ErrorResponse
type Event ¶ added in v0.2.5
type Event struct {
Type string `json:"type"`
Pairs []EventKeyPair `json:"pairs"`
}
type EventKeyPair ¶ added in v0.2.5
type EventResult ¶ added in v0.2.5
type RestServer ¶
type RestServer struct {
Mux *mux.Router
CliCtx context.CLIContext
// contains filtered or unexported fields
}
func NewRestServer ¶
func NewRestServer(cdc *amino.Codec) *RestServer
type TxGenerateResponse ¶
type TxResponse ¶
type TxResponse struct {
Height int64 `json:"height"`
TxHash string `json:"txhash"`
Code uint32 `json:"code"`
Data string `json:"data,omitempty"`
RawLog string `json:"raw_log,omitempty"`
Info string `json:"info,omitempty"`
GasWanted int64 `json:"gas_wanted,omitempty"`
GasUsed int64 `json:"gas_used,omitempty"`
Codespace string `json:"codespace,omitempty"`
Tx types.Tx `json:"tx,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Events []events `JSON:"event,omitempty"`
}
func NewResponseResultTx ¶
type TxsSearchEvent ¶
type TxsSearchItem ¶
type TxsSearchRequest ¶
type TxsSearchRequest struct {
Events []TxsSearchEvent `json:"events"`
Proof bool `json:"proof"`
Page int `json:"page"`
Limit int `json:"limit"`
}
type TxsSearchResponse ¶
type TxsSearchResponse struct {
Txs []TxsSearchItem `json:"txs"`
TotalCount int `json:"total_count"`
}
Click to show internal directories.
Click to hide internal directories.