rest

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagPreviousHeight = "prev_height" // Query data from previous height to avoid delay linked to state proof verification
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicReq

type BasicReq struct {
	BaseReq rest.BaseReq `json:"base_req"`
}

type RestContext

type RestContext struct {
	// contains filtered or unexported fields
}

func NewRestContext

func NewRestContext(w http.ResponseWriter, r *http.Request) RestContext

func (RestContext) BasicAuth

func (ctx RestContext) BasicAuth() (username, password string, ok bool)

func (RestContext) BlockchainInfo

func (ctx RestContext) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)

func (RestContext) BroadcastMessage

func (ctx RestContext) BroadcastMessage(message []byte) ([]byte, error)

func (RestContext) Codec

func (ctx RestContext) Codec() *codec.Codec

func (RestContext) Context

func (ctx RestContext) Context() client.CLIContext

func (RestContext) EncodeAndRespondWithHeight

func (ctx RestContext) EncodeAndRespondWithHeight(data interface{}, height int64)

func (RestContext) GetChainHeight

func (ctx RestContext) GetChainHeight() (int64, error)

func (RestContext) HandleWriteRequest

func (ctx RestContext) HandleWriteRequest(msg sdk.Msg)

func (RestContext) NodeStatus

func (ctx RestContext) NodeStatus() (*ctypes.ResultStatus, error)

func (RestContext) ParsePaginationParams

func (ctx RestContext) ParsePaginationParams() (pagination.PaginationParams, error)

func (RestContext) PostProcessResponse

func (ctx RestContext) PostProcessResponse(body interface{})

func (RestContext) PostProcessResponseBare

func (ctx RestContext) PostProcessResponseBare(body interface{})

func (RestContext) QueryList

func (ctx RestContext) QueryList(path string, params interface{})

func (RestContext) QueryStore

func (ctx RestContext) QueryStore(key []byte, storeName string) ([]byte, int64, error)

func (RestContext) QueryWithData

func (ctx RestContext) QueryWithData(path string, data interface{}) ([]byte, int64, error)

func (RestContext) ReadRESTReq

func (ctx RestContext) ReadRESTReq(req interface{}) bool

func (RestContext) Request

func (ctx RestContext) Request() *http.Request

func (RestContext) RespondWithHeight

func (ctx RestContext) RespondWithHeight(out interface{}, height int64)

func (RestContext) ResponseWriter

func (ctx RestContext) ResponseWriter() *http.ResponseWriter

func (RestContext) SignAndBroadcastMessage

func (ctx RestContext) SignAndBroadcastMessage(account string, passphrase string, msg []sdk.Msg) ([]byte, error)

func (RestContext) SignMessage

func (ctx RestContext) SignMessage(name string, passphrase string, msg []sdk.Msg) ([]byte, error)

func (RestContext) Signer

func (ctx RestContext) Signer() sdk.AccAddress

func (RestContext) TxnBuilder

func (ctx RestContext) TxnBuilder() (types.TxBuilder, error)

func (RestContext) Variables

func (ctx RestContext) Variables() map[string]string

func (RestContext) WithBaseRequest

func (ctx RestContext) WithBaseRequest(baseReq rest.BaseReq) (RestContext, error)

func (RestContext) WithCodec

func (ctx RestContext) WithCodec(cdc *codec.Codec) RestContext

func (RestContext) WithFormerHeight

func (ctx RestContext) WithFormerHeight() (RestContext, error)

func (RestContext) WithHeight

func (ctx RestContext) WithHeight(height int64) RestContext

func (RestContext) WithNodeURI

func (ctx RestContext) WithNodeURI(nodeURI string) RestContext

func (RestContext) WithResponseWriter

func (ctx RestContext) WithResponseWriter(w http.ResponseWriter) RestContext

func (RestContext) WithSigner

func (ctx RestContext) WithSigner() (RestContext, error)

func (RestContext) WriteErrorResponse

func (ctx RestContext) WriteErrorResponse(status int, err string)

Jump to

Keyboard shortcuts

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