client

package
v0.0.0-...-404ccd1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNodeHostPort = "localhost:9090"

Variables

This section is empty.

Functions

func InterfaceToBytes

func InterfaceToBytes(i interface{}) ([]byte, error)

Types

type HTTPRequester

type HTTPRequester struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewHTTPRequester

func NewHTTPRequester(url string) *HTTPRequester

func (HTTPRequester) AccountInfo

func (m HTTPRequester) AccountInfo(address string) (*accounts.AccountInfo, error)

func (*HTTPRequester) Get

func (hr *HTTPRequester) Get(api, data string, logIO bool) (map[string]interface{}, error)

func (HTTPRequester) ListTxs

func (m HTTPRequester) ListTxs(address string) ([]string, error)

func (HTTPRequester) NodeInfo

func (m HTTPRequester) NodeInfo() (*NodeInfo, error)

func (*HTTPRequester) NodeURL

func (hr *HTTPRequester) NodeURL() string

func (HTTPRequester) Rebel

func (m HTTPRequester) Rebel(datadir string, space uint, coinbase string) error

func (HTTPRequester) Sanity

func (m HTTPRequester) Sanity() error

func (HTTPRequester) Send

func (m HTTPRequester) Send(b []byte) (string, error)

func (HTTPRequester) SetCoinbase

func (m HTTPRequester) SetCoinbase(coinbase string) error

type HttpClient

type HttpClient struct {
	Requester
}

type InnerSerializableSignedTransaction

type InnerSerializableSignedTransaction struct {
	AccountNonce uint64
	Recipient    address.Address
	GasLimit     uint64
	Price        uint64
	Amount       uint64
}

TODO rename to SerializableTransaction once we remove the old SerializableTransaction

type NodeInfo

type NodeInfo struct {
	Synced                 bool
	SyncedLayer            string
	CurrentLayer           string
	VerifiedLayer          string
	Peers                  string
	MinPeers               string
	MaxPeers               string
	LibonomyDatadir        string
	LibonomyStatus         string
	LibonomyCoinbase       string
	LibonomyRemainingBytes string
}

type Requester

type Requester interface {
	Get(api, data string) []byte
}

type SerializableSignedTransaction

type SerializableSignedTransaction struct {
	InnerSerializableSignedTransaction
	Signature [64]byte
}

Once we support signed txs we should replace SerializableTransaction with this struct. Currently it is only used in the rpc server.

type WalletBE

type WalletBE struct {
	*HTTPRequester
	accounts.Store
	// contains filtered or unexported fields
}

func NewWalletBE

func NewWalletBE(serverHostPort, datadir string) (*WalletBE, error)

func (*WalletBE) CurrentAccount

func (w *WalletBE) CurrentAccount() *accounts.Account

func (*WalletBE) SetCurrentAccount

func (w *WalletBE) SetCurrentAccount(a *accounts.Account)

func (*WalletBE) StoreAccounts

func (w *WalletBE) StoreAccounts() error

func (*WalletBE) Transfer

func (w *WalletBE) Transfer(recipient address.Address, nonce, amount, gasPrice, gasLimit uint64, key ed25519.PrivateKey) (string, error)

Jump to

Keyboard shortcuts

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