rest

package
v0.2.2-0...-13ba25a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCodeSpace = "commit"

Variables

This section is empty.

Functions

func AddNewKeyRequestHandler

func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request)

func BroadcastRest

func BroadcastRest(cliCtx context.CLIContext, cdc *codec.Codec, stdTx auth.StdTx, mode string) ([]byte, cTypes.Error)

func ForgotPasswordRequestHandler

func ForgotPasswordRequestHandler(cliCtx context.CLIContext) http.HandlerFunc

func KafkaConsumerMsgs

func KafkaConsumerMsgs(cliCtx context.CLIContext, kafkaState kafka.KafkaState)

KafkaConsumerMsgs : msgs to consume 5 second delay

func ParseFloat64OrReturnBadRequest

func ParseFloat64OrReturnBadRequest(s string, defaultIfEmpty float64) (float64, int, error)

func PostProcessResponse

func PostProcessResponse(cliCtx context.CLIContext, response interface{}) ([]byte, cTypes.Error)

func QueryKeysRequestHandler

func QueryKeysRequestHandler(w http.ResponseWriter, r *http.Request)

func QueryMnemonicRequestHandler

func QueryMnemonicRequestHandler(w http.ResponseWriter, r *http.Request)

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router)

RegisterRoutes : resgister REST routes

func SignAndBroadcast

func SignAndBroadcast(br rest.BaseReq, cliCtx context.CLIContext,
	mode, password string, msgs []cTypes.Msg) ([]byte, cTypes.Error)

func SignAndBroadcastMultiple

func SignAndBroadcastMultiple(brs []rest.BaseReq, cliCtxs []context.CLIContext,
	mode []string, passwords []string, msgs []cTypes.Msg) ([]byte, error)

func SignStdTxFromRest

func SignStdTxFromRest(txBldr auth.TxBuilder, cliCtx context.CLIContext, name string, stdTx auth.StdTx, appendSig bool, offline bool, password string) (auth.StdTx, error)

func SimulationResponse

func SimulationResponse(cdc *codec.Codec, gas uint64) ([]byte, cTypes.Error)

func UpdateKeyRequestHandler

func UpdateKeyRequestHandler(cliCtx context.CLIContext) http.HandlerFunc

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteErrorResponse

func WriteErrorResponse(w http.ResponseWriter, err cTypes.Error)

Types

type ErrorResponse

type ErrorResponse struct {
	Success   bool                 `json:"success"`
	Error     interface{}          `json:"error"`
	Code      cTypes.CodeType      `json:"code"`
	CodeSpace cTypes.CodespaceType `json:"codeSpace"`
}

func NewErrorResponse

func NewErrorResponse(success bool, err interface{}, code cTypes.CodeType, codeSpace cTypes.CodespaceType) ErrorResponse

type ForgotPasswordBody

type ForgotPasswordBody struct {
	Seed               string `json:"seed"`
	NewPassword        string `json:"newPassword"`
	ConfirmNewPassword string `json:"confirmNewPassword"`
}

type Log

type Log struct {
	CodeType  cTypes.CodeType
	CodeSpace cTypes.CodespaceType
	Message   string
}

type NewKeyBody

type NewKeyBody struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Seed     string `json:"seed"`
}

type UpdateKeyBody

type UpdateKeyBody struct {
	NewPassword        string `json:"newPassword"`
	OldPassword        string `json:"oldPassword"`
	ConfirmNewPassword string `json:"confirmNewPassword"`
}

Jump to

Keyboard shortcuts

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