wallet

package
v0.0.0-...-17a8ecb Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account represents a wallet account.

func (*Account) Address

func (a *Account) Address() string

Address returns the address of the account.

func (*Account) Balance

func (a *Account) Balance() (balance, pending *big.Int, err error)

Balance gets the confirmed and pending balances for account.

func (*Account) ChangeRep

func (a *Account) ChangeRep(representative string) (hash rpc.BlockHash, err error)

ChangeRep changes the account's representative.

func (*Account) Index

func (a *Account) Index() uint32

Index returns the derivation index of the account.

func (*Account) ReceivePending

func (a *Account) ReceivePending(link rpc.BlockHash) (hash rpc.BlockHash, err error)

ReceivePending pockets the specified link block.

func (*Account) ReceivePendings

func (a *Account) ReceivePendings() (err error)

ReceivePendings pockets all pending amounts.

func (*Account) Send

func (a *Account) Send(account string, amount *big.Int) (hash rpc.BlockHash, err error)

Send sends an amount to an account.

func (*Account) SendBlock

func (a *Account) SendBlock(account string, amount *big.Int) (block *rpc.Block, err error)

SendBlock generates a signed send block.

func (*Account) SetRep

func (a *Account) SetRep(representative string) (err error)

SetRep sets the account's representative for future blocks.

type Wallet

type Wallet struct {
	RPC, RPCWork rpc.Client
	// contains filtered or unexported fields
}

Wallet represents a wallet.

func NewBip39Wallet

func NewBip39Wallet(mnemonic, password string) (w *Wallet, err error)

NewBip39Wallet creates a new BIP39 wallet.

func NewLedgerWallet

func NewLedgerWallet() (w *Wallet, err error)

NewLedgerWallet creates a new Ledger wallet.

func NewWallet

func NewWallet(seed []byte) (w *Wallet, err error)

NewWallet creates a new wallet.

func (*Wallet) GetAccount

func (w *Wallet) GetAccount(address string) *Account

GetAccount gets the account with address or nil if not found.

func (*Wallet) GetAccounts

func (w *Wallet) GetAccounts() (accounts []*Account)

GetAccounts gets all the accounts in the wallet.

func (*Wallet) NewAccount

func (w *Wallet) NewAccount(index *uint32) (a *Account, err error)

NewAccount creates a new account.

func (*Wallet) ReceivePendings

func (w *Wallet) ReceivePendings() (err error)

ReceivePendings pockets all pending amounts.

func (*Wallet) ScanForAccounts

func (w *Wallet) ScanForAccounts() (err error)

ScanForAccounts scans for accounts.

Directories

Path Synopsis
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.

Jump to

Keyboard shortcuts

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