v1

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 16 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")
	ErrWalletFileIsEmpty                      = errors.New("the wallet file is empty")
)

Functions

This section is empty.

Types

type FileStore added in v0.68.0

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

func InitialiseStore

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

func (*FileStore) Close added in v0.68.0

func (s *FileStore) Close()

func (*FileStore) CreateWallet added in v0.68.0

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 added in v0.68.0

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 added in v0.68.0

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 added in v0.68.0

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

func (*FileStore) GetWalletsPath added in v0.72.0

func (s *FileStore) GetWalletsPath() string

func (*FileStore) IsWalletAlreadyUnlocked added in v0.69.0

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

func (*FileStore) ListWallets added in v0.68.0

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 added in v0.68.0

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

func (*FileStore) OnUpdate added in v0.68.0

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

func (*FileStore) RenameWallet added in v0.68.0

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 added in v0.68.0

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

func (*FileStore) UpdatePassphrase added in v0.68.0

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 added in v0.68.0

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 added in v0.68.0

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