elements

package
v0.0.0-...-5fb183d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingRPCHost ...
	ErrMissingRPCHost = fmt.Errorf("missing RPC host")
	// ErrMissingRPCPort ...
	ErrMissingRPCPort = fmt.Errorf("missing RPC port")
	// ErrMissingRPCUser ...
	ErrMissingRPCUser = fmt.Errorf("missing RPC user")
	// ErrMissingRPCPassword ...
	ErrMissingRPCPassword = fmt.Errorf("missing RPC password")
	// ErrInvalidRescaTimestamp ...
	ErrInvalidRescaTimestamp = fmt.Errorf("rescan timestamp must be 'now', 0 or a unix timestamp")
	// ErrInvalidAddress ...
	ErrInvalidAddress = fmt.Errorf("invalid address")
	// ErrBlindKeyNotFound ...
	ErrBlindKeyNotFound = fmt.Errorf("blindkey not found for address")
	// ErrInvalidTxJSON ...
	ErrInvalidTxJSON = fmt.Errorf("invalid tx JSON")
)

Functions

func NewService

func NewService(endpoint string, rescanTimestamp interface{}) (
	explorer.Service,
	error,
)

NewService returns the Elements implementation of the Explorer interface. It establishes an insecure connection with the JSON-RPC interface of the node with no TLS termination.

func NewTxFromHex

func NewTxFromHex(txhex string, confirmed bool) (explorer.Transaction, error)

func NewTxFromJSON

func NewTxFromJSON(txJSON string) (explorer.Transaction, error)

Types

type RPCClient

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

A RPCClient represents a JSON RPC client (over HTTP(s)).

func NewClient

func NewClient(host string, port int, user, passwd string, useSSL bool, timeout int) (c *RPCClient, err error)

NewClient retursn an RpcClient

type RPCError

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

RPCError represents an error that is used as a part of a JSON-RPC Response object.

func (RPCError) Error

func (e RPCError) Error() string

Error returns a string describing the RPC error. This satisfies the builtin error interface.

type RPCErrorCode

type RPCErrorCode int

RPCErrorCode represents an error code to be used as a part of an RPCError which is in turn used in a JSON-RPC Response object.

A specific type is used to help ensure the wrong errors aren't used.

Jump to

Keyboard shortcuts

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