Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidParams represents a generic 'invalid parameters' error.
	ErrInvalidParams = NewInvalidParamsError("", nil)
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code     int64  `json:"code"`
	HTTPCode int    `json:"-"`
	Cause    error  `json:"-"`
	Message  string `json:"message"`
	Data     string `json:"data,omitempty"`
}

    Error object for outputting JSON-RPC 2.0 errors.

    func NewError

    func NewError(code int64, httpCode int, message string, data string, cause error) *Error

      NewError is an Error constructor that takes Error contents from its parameters.

      func NewInternalServerError

      func NewInternalServerError(data string, cause error) *Error

        NewInternalServerError creates a new error with code -32603.

        func NewInvalidParamsError

        func NewInvalidParamsError(data string, cause error) *Error

          NewInvalidParamsError creates a new error with code -32602.

          func NewInvalidRequestError

          func NewInvalidRequestError(data string, cause error) *Error

            NewInvalidRequestError creates a new error with code -32600.

            func NewMethodNotFoundError

            func NewMethodNotFoundError(data string, cause error) *Error

              NewMethodNotFoundError creates a new error with code -32601.

              func NewParseError

              func NewParseError(data string, cause error) *Error

                NewParseError creates a new error with code -32700.:%s

                func NewRPCError

                func NewRPCError(message string, data string, cause error) *Error

                  NewRPCError creates a new error with code -100

                  func (*Error) Error

                  func (e *Error) Error() string

                    Error implements the error interface.

                    type GetRawTx

                    type GetRawTx struct {
                    	HeaderAndError
                    	Result *result.TransactionOutputRaw `json:"result"`
                    }

                      GetRawTx represents verbose output of `getrawtransaction` RPC call.

                      type GetTxOut

                      type GetTxOut struct {
                      	HeaderAndError
                      	Result *result.TransactionOutput
                      }

                        GetTxOut represents result of `gettxout` RPC call.

                        type Header struct {
                        	ID      json.RawMessage `json:"id"`
                        	JSONRPC string          `json:"jsonrpc"`
                        }

                          Header is a generic JSON-RPC 2.0 response header (ID and JSON-RPC version).

                          type HeaderAndError

                          type HeaderAndError struct {
                          	Header
                          	Error *Error `json:"error,omitempty"`
                          }

                            HeaderAndError adds an Error (that can be empty) to the Header, it's used to construct type-specific responses.

                            type InvokeResult

                            type InvokeResult struct {
                            	State       vm.State `json:"state"`
                            	GasConsumed string   `json:"gas_consumed"`
                            	Script      string   `json:"script"`
                            	Stack       []request.StackParam
                            }

                              InvokeResult represents the outcome of a script that is executed by the NEO VM.

                              type Raw

                              type Raw struct {
                              	HeaderAndError
                              	Result json.RawMessage `json:"result,omitempty"`
                              }

                                Raw represents a standard raw JSON-RPC 2.0 response: http://www.jsonrpc.org/specification#response_object.

                                Source Files

                                Directories

                                Path Synopsis