2022-11-30 09:41:35 +00:00
|
|
|
package wakusync
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
2023-04-19 14:44:57 +00:00
|
|
|
"github.com/status-im/status-go/multiaccounts/accounts"
|
2022-11-30 09:41:35 +00:00
|
|
|
"github.com/status-im/status-go/multiaccounts/settings"
|
|
|
|
"github.com/status-im/status-go/protocol/protobuf"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WakuBackedUpDataResponse struct {
|
2023-05-16 10:48:00 +00:00
|
|
|
Clock uint64
|
2022-11-30 09:41:35 +00:00
|
|
|
FetchingDataProgress map[string]protobuf.FetchingBackedUpDataDetails // key represents the data/section backup details refer to
|
|
|
|
Profile *BackedUpProfile
|
|
|
|
Setting *settings.SyncSettingField
|
2023-05-16 10:48:00 +00:00
|
|
|
Keycards []*accounts.Keycard
|
|
|
|
Keypair *accounts.Keypair
|
|
|
|
WatchOnlyAccount *accounts.Account
|
2022-11-30 09:41:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (sfwr *WakuBackedUpDataResponse) MarshalJSON() ([]byte, error) {
|
|
|
|
responseItem := struct {
|
2023-05-16 10:48:00 +00:00
|
|
|
Clock uint64 `json:"clock,omitempty"`
|
2022-11-30 09:41:35 +00:00
|
|
|
FetchingDataProgress map[string]FetchingBackupedDataDetails `json:"fetchingBackedUpDataProgress,omitempty"`
|
|
|
|
Profile *BackedUpProfile `json:"backedUpProfile,omitempty"`
|
|
|
|
Setting *settings.SyncSettingField `json:"backedUpSettings,omitempty"`
|
2023-05-16 10:48:00 +00:00
|
|
|
Keycards []*accounts.Keycard `json:"backedUpKeycards,omitempty"`
|
|
|
|
Keypair *accounts.Keypair `json:"backedUpKeypair,omitempty"`
|
|
|
|
WatchOnlyAccount *accounts.Account `json:"backedUpWatchOnlyAccount,omitempty"`
|
2022-11-30 09:41:35 +00:00
|
|
|
}{
|
2023-05-16 10:48:00 +00:00
|
|
|
Clock: sfwr.Clock,
|
|
|
|
Profile: sfwr.Profile,
|
|
|
|
Setting: sfwr.Setting,
|
|
|
|
Keycards: sfwr.Keycards,
|
|
|
|
Keypair: sfwr.Keypair,
|
|
|
|
WatchOnlyAccount: sfwr.WatchOnlyAccount,
|
2022-11-30 09:41:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
responseItem.FetchingDataProgress = sfwr.FetchingBackedUpDataDetails()
|
|
|
|
|
|
|
|
return json.Marshal(responseItem)
|
|
|
|
}
|