wallet

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimAddress added in v0.1.10

func TrimAddress(addr string) string

func Write

func Write(path string, m *Alfred) error

Types

type Alfred

type Alfred struct {
	Stellar WalletsManager `yaml:"stellar,omitempty"`
	// contains filtered or unexported fields
}

func Open

func Open(path string, secret []byte) (*Alfred, error)

func OpenSecretString

func OpenSecretString(path string, secretStr string) (*Alfred, error)

func (*Alfred) AddContact

func (m *Alfred) AddContact(name, addr string, memo *Memo) error

func (*Alfred) AddWallet

func (m *Alfred) AddWallet(w *Wallet) error

func (*Alfred) IsUnlocked

func (a *Alfred) IsUnlocked() bool

func (Alfred) MarshalYAML

func (a Alfred) MarshalYAML() (interface{}, error)

func (*Alfred) Unlock

func (a *Alfred) Unlock(secret []byte) error

func (*Alfred) UnmarshalYAML

func (a *Alfred) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Alfred) WalletByAddress

func (m *Alfred) WalletByAddress(address string) *Wallet

func (*Alfred) WalletByName

func (m *Alfred) WalletByName(name string) *Wallet

type Contact

type Contact struct {
	Address string `yaml:"address,omitempty"`
	Memo    *Memo  `yaml:"memo,omitempty"`
}

type Memo

type Memo struct {
	Type  MemoKind  `yaml:"type,omitempty"`
	Value MemoValue `yaml:"value,omitempty"`
}

func MemoFromString

func MemoFromString(kind MemoKind, str string) (*Memo, error)

func (Memo) MarshalYAML

func (v Memo) MarshalYAML() (interface{}, error)

func (Memo) ToTransactionMutator

func (m Memo) ToTransactionMutator() build.TransactionMutator

func (*Memo) UnmarshalYAML

func (m *Memo) UnmarshalYAML(unmarshal func(interface{}) error) error

type MemoKind

type MemoKind int
const (
	MEMO_TEXT   MemoKind = iota + 1 // text
	MEMO_ID                         // id
	MEMO_HASH                       // hash
	MEMO_RETURN                     // return
)

func (MemoKind) String

func (i MemoKind) String() string

type MemoValue

type MemoValue struct {
	HashValue   xdr.Hash
	IntValue    uint64
	StringValue string
}

type Wallet

type Wallet struct {
	Name    string
	Keypair keypair.KP
}

func New

func New(name string, keypair *keypair.Full) *Wallet

func (*Wallet) Balances

func (w *Wallet) Balances(testnet bool) ([]horizon.Balance, error)

func (*Wallet) String

func (w *Wallet) String() string

type WalletsManager

type WalletsManager struct {
	Wallets  []*Wallet          `yaml:"wallets,omitempty"`
	Contacts map[string]Contact `yaml:"contacts,omitempty"`
}

Jump to

Keyboard shortcuts

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