v1

package
v0.0.0-...-f6bc33c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 16 Imported by: 0

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")
	ErrWalletFileIsEmpty                      = errors.New("the wallet file is empty")
)

Functions

This section is empty.

Types

type FileStore

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

func InitialiseStore

func InitialiseStore(walletsHome string, withFileWatcher bool) (*FileStore, error)

func (*FileStore) Close

func (s *FileStore) Close()

func (*FileStore) CreateWallet

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

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

func (*FileStore) DeleteWallet

func (s *FileStore) 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 (*FileStore) GetWallet

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

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

func (*FileStore) GetWalletPath

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

func (*FileStore) IsWalletAlreadyUnlocked

func (s *FileStore) IsWalletAlreadyUnlocked(ctx context.Context, name string) (bool, error)

func (*FileStore) ListWallets

func (s *FileStore) 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 (*FileStore) LockWallet

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

func (*FileStore) OnUpdate

func (s *FileStore) OnUpdate(callbackFn func(context.Context, wallet.Event))

func (*FileStore) RenameWallet

func (s *FileStore) 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 (*FileStore) UnlockWallet

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

func (*FileStore) UpdatePassphrase

func (s *FileStore) 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 (*FileStore) UpdateWallet

func (s *FileStore) 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 FileStore.RenameWallet() should be used instead.

func (*FileStore) WalletExists

func (s *FileStore) 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