respwrap

package
v0.0.0-...-da2935b Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseWrapper

func ResponseWrapper(cdc *amino.Codec, result interface{}, err error) ([]byte, error)

Types

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data,omitempty"`
}

type RPCResponse

type RPCResponse struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      string          `json:"id"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *RPCError       `json:"error,omitempty"`
}

func NewRPCErrorResponse

func NewRPCErrorResponse(id string, code int, msg string, data string) RPCResponse

func NewRPCSuccessResponse

func NewRPCSuccessResponse(cdc *amino.Codec, id string, res interface{}) RPCResponse

func RPCInternalError

func RPCInternalError(id string, err error) RPCResponse

Jump to

Keyboard shortcuts

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