aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/accounts.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/accounts.go')
-rw-r--r--accounts/accounts.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/accounts/accounts.go b/accounts/accounts.go
index 640de5220..5872bb4a3 100644
--- a/accounts/accounts.go
+++ b/accounts/accounts.go
@@ -147,9 +147,26 @@ type Backend interface {
Subscribe(sink chan<- WalletEvent) event.Subscription
}
+// WalletEventType represents the different event types that can be fired by
+// the wallet subscription subsystem.
+type WalletEventType int
+
+const (
+ // WalletArrived is fired when a new wallet is detected either via USB or via
+ // a filesystem event in the keystore.
+ WalletArrived WalletEventType = iota
+
+ // WalletOpened is fired when a wallet is successfully opened with the purpose
+ // of starting any background processes such as automatic key derivation.
+ WalletOpened
+
+ // WalletDropped
+ WalletDropped
+)
+
// WalletEvent is an event fired by an account backend when a wallet arrival or
// departure is detected.
type WalletEvent struct {
- Wallet Wallet // Wallet instance arrived or departed
- Arrive bool // Whether the wallet was added or removed
+ Wallet Wallet // Wallet instance arrived or departed
+ Kind WalletEventType // Event type that happened in the system
}