wallets

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PeriodicWalletsSyncTrigger

func PeriodicWalletsSyncTrigger(ctx context.Context, c chan bool, d time.Duration)

PeriodicWalletsSyncTrigger adds a signal to the channel once per duration.

Types

type IDPair

type IDPair = wallets.KeyIDPair

type Service

type Service struct {
	KeysForWallet map[common.Hash][]uint64       // slice of keyIDs per walletID
	Keys          map[IDPair]*pkgwallets.KeyData // key data per IDPair

	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Service) FetchBackup

func (s *Service) FetchBackup(ctx context.Context, idHash common.Hash) (*wallets.TEEBackupResponse, error)

FetchBackup fetches backup for backupIDHash

func (*Service) FetchLatestBackup

func (s *Service) FetchLatestBackup(ctx context.Context, idPair IDPair) (*wallets.TEEBackupResponse, error)

FetchLatestBackup fetches latest backup for id pair.

func (*Service) InitiateBackups

func (s *Service) InitiateBackups(ctx context.Context) error

InitiateBackups triggers TEE_BACKUP action for all stored keys.

func (*Service) KeyData

func (s *Service) KeyData(walletID common.Hash, keyID uint64) (*pkgwallets.KeyData, error)

func (*Service) KeyProof

func (s *Service) KeyProof(walletID common.Hash, keyID uint64) (*wallets.SignedKeyExistenceProof, error)

KeyProof returns the signed key existence proof for the given wallet/key pair.

The returned pointer is safe to use after the lock is released because SignedKeyExistenceProof values are immutable once created: updateOrAddKey replaces the Proof field with a new pointer rather than writing through the existing one. If that invariant ever changes this must be updated to return a copy.

func (*Service) RunUpdateInfo

func (s *Service) RunUpdateInfo(ctx context.Context, walletSyncTrigger, backupTrigger <-chan bool, keyActions <-chan *types.ActionResult, backups chan *types.ActionResult, keyInfo <-chan *types.ActionResult)

func (*Service) WalletInfo

func (s *Service) WalletInfo(walletID common.Hash) (*pkgwallets.KeyExistence, error)

func (*Service) WalletsInfo added in v0.0.16

func (s *Service) WalletsInfo() WalletsInfoResponse

WalletsInfo returns summary information about all stored wallets and keys.

type WalletsInfoResponse added in v0.0.16

type WalletsInfoResponse struct {
	Wallets int      `json:"wallets"`
	Keys    int      `json:"keys"`
	Pairs   []IDPair `json:"pairs"`
}

WalletsInfoResponse contains summary information about stored wallets.

Jump to

Keyboard shortcuts

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