Documentation
¶
Index ¶
- Variables
- type Error
- func NewError(code int64, httpCode int, message string, data string, cause error) *Error
- func NewInternalServerError(data string, cause error) *Error
- func NewInvalidParamsError(data string, cause error) *Error
- func NewInvalidRequestError(data string, cause error) *Error
- func NewMethodNotFoundError(data string, cause error) *Error
- func NewParseError(data string, cause error) *Error
- func NewRPCError(message string, data string, cause error) *Error
- func NewSubmitError(code int64, message string) *Error
- type GetRawTx
- type GetTxOut
- type Header
- type HeaderAndError
- type Raw
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidParams represents a generic 'invalid parameters' error. ErrInvalidParams = NewInvalidParamsError("", nil) // ErrAlreadyExists represents SubmitError with code -501 ErrAlreadyExists = NewSubmitError(-501, "Block or transaction already exists and cannot be sent repeatedly.") // ErrOutOfMemory represents SubmitError with code -502 ErrOutOfMemory = NewSubmitError(-502, "The memory pool is full and no more transactions can be sent.") // ErrUnableToVerify represents SubmitError with code -503 ErrUnableToVerify = NewSubmitError(-503, "The block cannot be validated.") // ErrValidationFailed represents SubmitError with code -504 ErrValidationFailed = NewSubmitError(-504, "Block or transaction validation failed.") // ErrPolicyFail represents SubmitError with code -505 ErrPolicyFail = NewSubmitError(-505, "One of the Policy filters failed.") // ErrUnknown represents SubmitError with code -500 ErrUnknown = NewSubmitError(-500, "Unknown error.") )
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 NewInternalServerError ¶
NewInternalServerError creates a new error with code -32603.
func NewInvalidParamsError ¶
NewInvalidParamsError creates a new error with code -32602.
func NewInvalidRequestError ¶
NewInvalidRequestError creates a new error with code -32600.
func NewMethodNotFoundError ¶
NewMethodNotFoundError creates a new error with code -32601.
func NewParseError ¶
NewParseError creates a new error with code -32700.:%s
func NewRPCError ¶
NewRPCError creates a new error with code -100
func NewSubmitError ¶
NewSubmitError creates a new error with specified error code and error message
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 ¶
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 ¶
HeaderAndError adds an Error (that can be empty) to the Header, it's used to construct type-specific responses.
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.