wallet

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientVersion   = "0.0.1"
	ProtocolVersion = "1.0"
)

Variables

View Source
var (
	ErrNotImplemented = errors.Base("not implemented")
	ErrNodeConnected  = errors.Base("node already connected")
	ErrConnectFailed  = errors.Base("failed to connect")
	ErrTimeout        = errors.Base("timeout")
)

Functions

This section is empty.

Types

type GetClaimsInTxResp

type GetClaimsInTxResp struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  []struct {
		Name            string        `json:"name"`
		ClaimID         string        `json:"claim_id"`
		Txid            string        `json:"txid"`
		Nout            int           `json:"nout"`
		Amount          int           `json:"amount"`
		Depth           int           `json:"depth"`
		Height          int           `json:"height"`
		Value           string        `json:"value"`
		ClaimSequence   int           `json:"claim_sequence"`
		Address         string        `json:"address"`
		Supports        []interface{} `json:"supports"` // TODO: finish me
		EffectiveAmount int           `json:"effective_amount"`
		ValidAtHeight   int           `json:"valid_at_height"`
	} `json:"result"`
}

type Node

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

func NewNode

func NewNode() *Node

NewNode creates a new node.

func (*Node) Connect

func (n *Node) Connect(addrs []string, config *tls.Config) error

Connect creates a new connection to the specified address.

func (*Node) GetClaimInTx added in v1.1.4

func (n *Node) GetClaimInTx(txid string, nout int) (*types.Claim, error)

func (*Node) GetClaimsInTx

func (n *Node) GetClaimsInTx(txid string) (*GetClaimsInTxResp, error)

func (*Node) GetTx added in v1.1.4

func (n *Node) GetTx(txid string) (string, error)

func (*Node) Raw added in v1.1.4

func (n *Node) Raw(method string, params []string, v interface{}) error

Raw makes a raw wallet server request

func (*Node) Resolve added in v1.1.4

func (n *Node) Resolve(url string) (*types.Output, error)

func (*Node) ServerVersion

func (n *Node) ServerVersion() (string, error)

ServerVersion returns the server's version. https://electrumx.readthedocs.io/en/latest/protocol-methods.html#server-version

func (*Node) Shutdown

func (n *Node) Shutdown()

type TCPTransport

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

func NewTransport

func NewTransport(addr string, config *tls.Config) (*TCPTransport, error)

func (*TCPTransport) Errors

func (t *TCPTransport) Errors() <-chan error

func (*TCPTransport) Responses

func (t *TCPTransport) Responses() <-chan []byte

func (*TCPTransport) Send

func (t *TCPTransport) Send(body []byte) error

func (*TCPTransport) Shutdown

func (t *TCPTransport) Shutdown()

Jump to

Keyboard shortcuts

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