wallets

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWalletNonExistent = errors.New("wallet non-existent")

Functions

This section is empty.

Types

type Storage

type Storage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func InitializeStorage

func InitializeStorage() *Storage

InitializeStorage returns an empty wallet storage instance.

func (*Storage) CheckNonce

func (s *Storage) CheckNonce(idPair publicwallets.KeyIDPair, nonce uint64) error

CheckNonce ensures the provided nonce is newer than the stored one.

s.RWMutex RLock should be used when calling this method.

func (*Storage) Get

Get retrieves a copy of the wallet or returns ErrWalletNonExistent.

s.RWMutex RLock should be used when calling this method.

func (*Storage) GetWallets

func (s *Storage) GetWallets() []*publicwallets.Wallet

GetWallets returns deep copies of all stored wallets.

s.RWMutex RLock should be used when calling this method.

func (*Storage) Nonce

func (s *Storage) Nonce(idPair publicwallets.KeyIDPair) (uint64, error)

Nonce returns the stored nonce for the wallet.

s.RWMutex RLock should be used when calling this method.

func (*Storage) Remove

func (s *Storage) Remove(idPair publicwallets.KeyIDPair) bool

Remove deletes the wallet entry for the given identifier pair.

s.RWMutex Lock should be used when calling this method.

func (*Storage) Store

func (s *Storage) Store(wallet *publicwallets.Wallet) error

Store adds the wallet to storage while preserving status state.

s.RWMutex Lock should be used when calling this method.

func (*Storage) UpdateNonce

func (s *Storage) UpdateNonce(idPair publicwallets.KeyIDPair, nonce uint64)

UpdateNonce sets the wallet's nonce to the provided value.

s.RWMutex Lock should be used when calling this method.

func (*Storage) WalletExists

func (s *Storage) WalletExists(idPair publicwallets.KeyIDPair) bool

WalletExists reports whether the wallet is present in storage.

s.RWMutex RLock should be used when calling this method.

func (*Storage) WalletExistsPermanent

func (s *Storage) WalletExistsPermanent(idPair publicwallets.KeyIDPair) bool

WalletExistsPermanent reports whether the wallet is present in permanent storage.

s.RWMutex RLock should be used when calling this method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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