nano

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 13 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) (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, username, password 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"`
}

Jump to

Keyboard shortcuts

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