rest

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastRawTxRequestHandlerFn

func BroadcastRawTxRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

BroadcastTxRequestHandlerFn returns the broadcast tx REST handler

func BroadcastTxRawRequestHandlerFn

func BroadcastTxRawRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

BroadcastTxRequestHandlerFn returns the broadcast tx REST handler

func BroadcastTxRequestHandlerFn

func BroadcastTxRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

BroadcastTxRequestHandlerFn returns the broadcast tx REST handler

func CompleteAndBroadcastTxREST

func CompleteAndBroadcastTxREST(w http.ResponseWriter, cliCtx context.CLIContext,
	baseReq rest.BaseReq, password string, msgs []sdk.Msg, cdc *codec.Codec)

CompleteAndBroadcastTxREST implements a utility function that facilitates sending a series of messages in a signed tx. In addition, it will handle tx gas simulation and estimation.

NOTE: Also see CompleteAndBroadcastTxCLI.

func CreateTxRequestHandlerFn

func CreateTxRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

CreateTxRequestHandlerFn - http request handler to send coins to a address.

func QueryContractRequestHandlerFn added in v1.1.0

func QueryContractRequestHandlerFn(
	storeName string, cdc *codec.Codec,
	decoder auth.AccountDecoder, cliCtx context.CLIContext,
) http.HandlerFunc

query contractREST Handler

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec, storeName string)

RegisterRoutes - Central function to define routes that get registered by the main application

func SendTxRequestHandlerFn

func SendTxRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

SendTxRequestHandlerFn - http request handler to send coins to a address.

func SignTxRawRequestHandlerFn

func SignTxRawRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

sign tx REST handler

func SignTxRequestHandlerFn

func SignTxRequestHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

nolint: unparam sign tx REST handler

func WriteGenerateStdTxResponse

func WriteGenerateStdTxResponse(w http.ResponseWriter, cdc *codec.Codec,
	cliCtx context.CLIContext, br rest.BaseReq, msgs []sdk.Msg, encodeflag bool)

junying-todo-20190330 WriteGenerateStdTxResponse writes response for the generate only mode.

github.com/cosmos/cosmos-sdk/client/rest
WriteGenerateStdTxResponse

Types

type CreateReq

type CreateReq struct {
	BaseReq rest.BaseReq `json:"base_req"`
	To      string       `json:"to"`
	Amount  sdk.Coins    `json:"amount"`
	Encode  bool         `json:"encode"`
}

CreateReq defines the properties of a send request's body.

type SendReq

type SendReq struct {
	BaseReq rest.BaseReq `json:"base_req"`
	To      string       `json:"to"`
	Amount  sdk.Coins    `json:"amount"`
	Data    string       `json:"data"`
}

SendReq defines the properties of a send request's body.

type SignBody

type SignBody struct {
	Tx         auth.StdTx   `json:"tx"`
	BaseReq    rest.BaseReq `json:"base_req"`
	Passphrase string       `json:"passphrase"`
}

SignBody defines the properties of a sign request's body.

type SignRawBody

type SignRawBody struct {
	Tx         string `json:"tx"`
	Passphrase string `json:"passphrase"`
	Offline    bool   `json:"offline"`
	Encode     bool   `json:"encode"`
}

SignBody defines the properties of a sign request's body.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL