Documentation ¶
Index ¶
- func PublicKey(key ed25519.PrivateKey) ed25519.PublicKey
- type Wallet
- func (w *Wallet) AddContact(nickname string, address types.Address) error
- func (w *Wallet) CurrentAccount() (*account, error)
- func (w *Wallet) GenerateNewPair(displayName string) (int, error)
- func (w *Wallet) GetAccountDisplayName(accountNumber int) (string, error)
- func (w *Wallet) GetAddress(accountNumber int) (types.Address, error)
- func (w Wallet) GetMnemonic() (string, error)
- func (w Wallet) GetNumberOfAccounts() (int, error)
- func (w *Wallet) GetPrivateKey(accountNumber int) (ed25519.PrivateKey, error)
- func (w *Wallet) GetPublicKey(accountNumber int) (ed25519.PublicKey, error)
- func (w *Wallet) SaveWallet() (err error)
- func (w *Wallet) SaveWalletAs(keystorePrefix string) (err error)
- func (w *Wallet) SetCurrent(accountNumber int) error
- func (w *Wallet) SignedTransaction(t *types.Transaction) ([]byte, error)
- func (w *Wallet) Unlock(password string) (err error)
- func (w *Wallet) WalletPath() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Wallet ¶
type Wallet struct { Meta walletMetadata `json:"meta"` Crypto walletEncryptedData `json:"crypto"` // contains filtered or unexported fields }
Wallet is the basic data structure.
func LoadWallet ¶
LoadWallet returns a wallet object for an existing file copy of a wallet
func NewWalletWithMnemonic ¶ added in v0.1.29
NewWalletWithMnemonic creates a new wallet with the provided mnemonic
func (*Wallet) AddContact ¶
func (*Wallet) CurrentAccount ¶
func (*Wallet) GenerateNewPair ¶
GenerateNewPair - add a new pair based on mnemonic key phrase
func (*Wallet) GetAccountDisplayName ¶
GetAccountDisplayName retrieves an account name from a wallet (if unlocked and account exists)
func (*Wallet) GetAddress ¶
GetAddress retrieves an address from a wallet if unlocked and it has been generated
func (Wallet) GetMnemonic ¶
GetMnemonic returns the mnemonic string associated with the wallet
func (Wallet) GetNumberOfAccounts ¶
GetNumberOfAccounts returns the number of accounts held in said wallet
func (*Wallet) GetPrivateKey ¶
func (w *Wallet) GetPrivateKey(accountNumber int) (ed25519.PrivateKey, error)
GetPrivateKey retrieve the private key
func (*Wallet) GetPublicKey ¶
GetPublicKey retrieves an address from a wallet if unlocked and it has been generated
func (*Wallet) SaveWallet ¶
SaveWallet saves a file only if it already has a filename
func (*Wallet) SaveWalletAs ¶
SaveWalletAs saves a wallet to a file and records the filename internally
func (*Wallet) SetCurrent ¶
SetCurrent - set current wallet by number
func (*Wallet) SignedTransaction ¶
func (w *Wallet) SignedTransaction(t *types.Transaction) ([]byte, error)
SignedTransaction turns a transaction into a signed transaction :-)