Documentation ¶
Overview ¶
Package accounts provides types for working with Spacemesh blockchain accounts.
Index ¶
- func LoadAllAccounts() error
- type Account
- func (a *Account) IsAccountLocked() bool
- func (a *Account) IsAccountUnlocked() bool
- func (a *Account) LockAccount(passphrase string)
- func (a *Account) Log()
- func (a *Account) Persist(accountsDataPath string) (string, error)
- func (a *Account) Pretty() string
- func (a *Account) String() string
- func (a *Account) UnlockAccount(passphrase string) error
- type AccountData
- type CryptoData
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAllAccounts ¶
func LoadAllAccounts() error
LoadAllAccounts loads all account persisted to store
Types ¶
type Account ¶
type Account struct { PrivKey crypto.PrivateKey PubKey crypto.PublicKey // contains filtered or unexported fields }
Account is an end user blockchain account.
func NewAccount ¶
NewAccount Creates a new account using the provided passphrase. Clients should persist newly create accounts - without this the account only lasts for one app session.
func NewAccountFromStore ¶
NewAccountFromStore creates a new account by id and stored data. Account will be locked after creation as there's no persisted passphrase. accountsDataPath: os-specific full path to accounts data folder.
func (*Account) IsAccountLocked ¶
IsAccountLocked returns true if account is locked.
func (*Account) IsAccountUnlocked ¶
IsAccountUnlocked returns true if account is unlocked.
func (*Account) LockAccount ¶
LockAccount locks an account with user provided passphrase.
func (*Account) Persist ¶
Persist all account data to store Passphrases are never persisted to store accountsDataPath: os-specific full path to accounts data folder Returns full path of persisted file (useful for testing)
func (*Account) UnlockAccount ¶
UnlockAccount unlocks an account using the user provided passphrase.
type AccountData ¶
type AccountData struct { PublicKey string `json:"publicKey"` CryptoData CryptoData `json:"crypto"` KDParams crypto.KDParams `json:"kd"` }
AccountData is used to persist an account.