Documentation
¶
Index ¶
- Constants
- Variables
- func ClearAccounts(t *testing.T, walletPath string)
- func Filename(nickname string) string
- func GetWorkDir() (string, error)
- func Path() (string, error)
- type Wallet
- func (w *Wallet) AccountPath(nickname string) (string, error)
- func (w *Wallet) AddAccount(acc *account.Account, persist bool, force bool) error
- func (w *Wallet) AddressIsUnique(address *types.Address) error
- func (w *Wallet) AllAccounts() []*account.Account
- func (w *Wallet) DeleteAccount(nickname string) error
- func (w *Wallet) Discover() error
- func (w *Wallet) GenerateAccount(password *memguard.LockedBuffer, nickname string) (*account.Account, error)
- func (w *Wallet) GetAccount(nickname string) (*account.Account, error)
- func (w *Wallet) GetAccountCount() int
- func (w *Wallet) GetAccountFromAddress(needle string) (*account.Account, error)
- func (w *Wallet) Load(filePath string) (*account.Account, error)
- func (w *Wallet) MigrateWallet() error
- func (w *Wallet) NicknameIsUnique(nickname string) error
- func (w *Wallet) Persist(acc account.Account) error
Constants ¶
View Source
const (
FileModeUserReadWriteOnly = 0o600
)
Variables ¶
View Source
var ( ErrAddressNotUnique = errors.New("this account address already exists") ErrNicknameNotUnique = errors.New("this account nickname already exists") )
View Source
var ( ErrPersistingAccount = errors.New("error persisting account") AccountNotFoundError = errors.New("account not found") )
View Source
var ErrUnmarshalAccount = errors.New("unmarshaling account")
Functions ¶
func ClearAccounts ¶ added in v0.2.9
func GetWorkDir ¶
Types ¶
type Wallet ¶
type Wallet struct { InvalidAccountNicknames []string // List of invalid account nicknames WalletPath string // contains filtered or unexported fields }
func New ¶ added in v0.2.9
New creates a new wallet instance. If walletPath is empty, it will use the default wallet path.
func (*Wallet) AccountPath ¶ added in v0.2.9
func (*Wallet) AddAccount ¶ added in v0.2.9
Add an account into the wallet
func (*Wallet) AddressIsUnique ¶ added in v0.2.9
func (*Wallet) AllAccounts ¶ added in v0.2.9
func (*Wallet) DeleteAccount ¶ added in v0.2.9
Delete an account from the wallet
func (*Wallet) GenerateAccount ¶ added in v0.2.9
func (w *Wallet) GenerateAccount(password *memguard.LockedBuffer, nickname string) (*account.Account, error)
GenerateAccount generates a new account and adds it to the wallet. It returns the generated account. It destroys the password.
func (*Wallet) GetAccount ¶ added in v0.2.9
Get an account from the wallet by nickname
func (*Wallet) GetAccountCount ¶ added in v0.2.9
Get the number of accounts in the wallet
func (*Wallet) GetAccountFromAddress ¶ added in v0.2.9
func (*Wallet) MigrateWallet ¶ added in v0.2.9
MigrateWallet moves the wallet from the old location (executable file) to the new one (user config).
func (*Wallet) NicknameIsUnique ¶ added in v0.2.9
Source Files
¶
Click to show internal directories.
Click to hide internal directories.