v1

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWalletNameCannotContainSlashCharacters = errors.New("the name cannot contain slash (\"/\", \"\\\") characters")
	ErrWalletNameCannotStartWithDot           = errors.New("the name cannot start with a dot (\".\") character")
)

Functions

This section is empty.

Types

type Store

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

func InitialiseStore

func InitialiseStore(walletsHome string) (*Store, error)

func (*Store) CreateWallet added in v0.67.0

func (s *Store) CreateWallet(ctx context.Context, w wallet.Wallet, passphrase string) error

CreateWallet creates a wallet, and automatically load it as an unlocked wallet.

func (*Store) DeleteWallet

func (s *Store) DeleteWallet(ctx context.Context, name string) error

DeleteWallet deletes the wallet file in place. It does not require the wallets to be unlocked, but lock it if so.

func (*Store) GetWallet

func (s *Store) GetWallet(ctx context.Context, name string) (wallet.Wallet, error)

GetWallet requires the wallet to be unlocked first, using Store.UnlockWallet().

func (*Store) GetWalletPath

func (s *Store) GetWalletPath(name string) string

func (*Store) ListWallets

func (s *Store) ListWallets(ctx context.Context) ([]string, error)

ListWallets list all existing wallets stored locally. It does not require the wallets to be unlocked. It assumes that all the file under the "walletHome" are wallets. It does not ensure the files are actual wallets. Hidden files are excluded.

func (*Store) LockWallet added in v0.67.0

func (s *Store) LockWallet(ctx context.Context, name string) error

func (*Store) OnUpdate added in v0.67.0

func (s *Store) OnUpdate(callbackFn func(context.Context, wallet.Wallet))

func (*Store) RenameWallet added in v0.60.0

func (s *Store) RenameWallet(ctx context.Context, currentName, newName string) error

RenameWallet renames a wallet file in place. It does not require the wallets to be unlocked, but updates the unlocked wallet if so.

func (*Store) UnlockWallet added in v0.67.0

func (s *Store) UnlockWallet(ctx context.Context, name, passphrase string) error

func (*Store) UpdatePassphrase added in v0.67.0

func (s *Store) UpdatePassphrase(ctx context.Context, name, newPassphrase string) error

UpdatePassphrase update the passphrase used to encrypt the wallet. It requires the wallet to be unlocked.

func (*Store) UpdateWallet added in v0.67.0

func (s *Store) UpdateWallet(ctx context.Context, w wallet.Wallet) error

UpdateWallet updates an unlocked wallet. If this method is called with a wallet that had the name changed, a new file is written and the previous one is not deleted. To rename the wallet in-place, the method Store.RenameWallet() should be used instead.

func (*Store) WalletExists

func (s *Store) WalletExists(ctx context.Context, name string) (bool, error)

WalletExists verify if file matching the name exist locally. It does not require the wallet to be unlocked. It does not ensure the file is an actual wallet.

Jump to

Keyboard shortcuts

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