2023-01-06 20:21:14 +08:00
|
|
|
package pairing
|
2022-01-27 09:52:13 +00:00
|
|
|
|
2023-06-01 08:33:57 +03: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 (
|
2023-02-27 11:46:46 +00:00
|
|
|
// Both Sender and Receiver
|
2022-01-27 09:52:13 +00:00
|
|
|
|
2023-04-26 14:48:49 +03: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
|
|
|
|
2023-02-27 11:46:46 +00:00
|
|
|
// Only Receiver side
|
|
|
|
|
2023-08-18 10:51:16 +02:00
|
|
|
EventReceivedAccount EventType = "received-account"
|
|
|
|
EventProcessSuccess EventType = "process-success"
|
|
|
|
EventProcessError EventType = "process-error"
|
|
|
|
EventReceivedKeystoreFiles EventType = "received-keystore-files"
|
2022-01-27 09:52:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Event is a type for transfer events.
|
|
|
|
type Event struct {
|
2023-01-06 20:21:14 +08:00
|
|
|
Type EventType `json:"type"`
|
|
|
|
Error string `json:"error,omitempty"`
|
|
|
|
Action Action `json:"action"`
|
2023-02-27 11:46:46 +00:00
|
|
|
Data any `json:"data,omitempty"`
|
2022-01-27 09:52:13 +00:00
|
|
|
}
|
2023-01-06 20:21:14 +08:00
|
|
|
|
|
|
|
type Action int
|
|
|
|
|
|
|
|
const (
|
2023-03-23 11:44:15 +00:00
|
|
|
ActionConnect Action = iota + 1
|
2023-01-31 16:47:30 +08:00
|
|
|
ActionPairingAccount
|
2023-01-06 20:21:14 +08:00
|
|
|
ActionSyncDevice
|
2023-02-28 20:32:45 +08:00
|
|
|
ActionPairingInstallation
|
2023-04-12 11:30:12 +01:00
|
|
|
ActionPeerDiscovery
|
2023-08-18 10:51:16 +02:00
|
|
|
ActionKeystoreFilesTransfer
|
2023-01-06 20:21:14 +08:00
|
|
|
)
|
2023-06-01 08:33:57 +03:00
|
|
|
|
|
|
|
type AccountData struct {
|
2023-09-12 21:31:46 +02:00
|
|
|
Account *multiaccounts.Account `json:"account,omitempty"`
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
ChatKey string `json:"chatKey,omitempty"`
|
2023-06-01 08:33:57 +03:00
|
|
|
}
|