status-go/server/pairing/events.go

47 lines
1.2 KiB
Go
Raw Normal View History

package pairing
2022-01-27 09:52:13 +00:00
import "github.com/status-im/status-go/multiaccounts"
2022-01-27 09:52:13 +00:00
// EventType type for event types.
type EventType string
const (
// Both Sender and Receiver
2022-01-27 09:52:13 +00:00
EventPeerDiscovered EventType = "peer-discovered"
EventConnectionError EventType = "connection-error"
EventConnectionSuccess EventType = "connection-success"
EventTransferError EventType = "transfer-error"
EventTransferSuccess EventType = "transfer-success"
EventReceivedInstallation EventType = "received-installation"
2022-01-27 09:52:13 +00:00
// Only Receiver side
EventReceivedAccount EventType = "received-account"
EventProcessSuccess EventType = "process-success"
EventProcessError EventType = "process-error"
2022-01-27 09:52:13 +00:00
)
// Event is a type for transfer events.
type Event struct {
Type EventType `json:"type"`
Error string `json:"error,omitempty"`
Action Action `json:"action"`
Data any `json:"data,omitempty"`
2022-01-27 09:52:13 +00:00
}
type Action int
const (
ActionConnect Action = iota + 1
ActionPairingAccount
ActionSyncDevice
ActionPairingInstallation
2023-04-12 10:30:12 +00:00
ActionPeerDiscovery
)
type AccountData struct {
Account *multiaccounts.Account `json:"account,omitempty"`
Password string `json:"password,omitempty"`
}