nano

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountNotFound = errors.New("account not found")

Functions

func GenerateWork

func GenerateWork(hash string, forSend bool) (string, error)

Types

type AccountInfo

type AccountInfo struct {
	Frontier            string `json:"frontier"`
	OpenBlock           string `json:"open_block"`
	RepresentativeBlock string `json:"representative_block"`
	Balance             string `json:"balance"`
	ModifiedTimestamp   string `json:"modified_timestamp"`
	BlockCount          string `json:"block_count"`
	Representative      string `json:"representative"`
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Key

type Key struct {
	Private string `json:"private"`
	Public  string `json:"public"`
	Account string `json:"account"`
}

type Node

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

func New

func New(nodeURL string) *Node

func (*Node) AccountInfo

func (n *Node) AccountInfo(account string) (*AccountInfo, error)

func (*Node) BlockCreate

func (n *Node) BlockCreate(previous, account, representative, balance, link, key, work string) (string, error)

func (*Node) DeterministicKey

func (n *Node) DeterministicKey(seed string, index string) (*Key, error)

func (*Node) Pending

func (n *Node) Pending(account string, count int, threshold string) (map[string]PendingBlock, error)

func (*Node) Process

func (n *Node) Process(block string) (string, error)

func (*Node) SetTimeout added in v1.1.5

func (n *Node) SetTimeout(d time.Duration)

type NodeError

type NodeError struct {
	Message *string `json:"error"`
}

func (*NodeError) Error

func (e *NodeError) Error() string

type PendingBlock

type PendingBlock struct {
	Amount string `json:"amount"`
	Source string `json:"source"`
}

type Websocket added in v1.5.0

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

func NewWebsocket added in v1.5.0

func NewWebsocket(wsURL string) *Websocket

func (*Websocket) Close added in v1.5.0

func (w *Websocket) Close() error

func (*Websocket) Connect added in v1.5.0

func (w *Websocket) Connect() error

func (*Websocket) Recv added in v1.5.0

func (w *Websocket) Recv(msg interface{}) error

func (*Websocket) Send added in v1.5.0

func (w *Websocket) Send(action, topic string, ack bool, options map[string]interface{}) error

Jump to

Keyboard shortcuts

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