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"
|
2023-05-09 18:48:56 +00:00
|
|
|
"github.com/status-im/status-go/multiaccounts/keycards"
|
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 {
|
|
|
|
FetchingDataProgress map[string]protobuf.FetchingBackedUpDataDetails // key represents the data/section backup details refer to
|
|
|
|
Profile *BackedUpProfile
|
|
|
|
Setting *settings.SyncSettingField
|
2023-05-09 18:48:56 +00:00
|
|
|
Keycards []*keycards.Keycard
|
2023-04-19 14:44:57 +00:00
|
|
|
WalletAccount *accounts.Account
|
2022-11-30 09:41:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (sfwr *WakuBackedUpDataResponse) MarshalJSON() ([]byte, error) {
|
|
|
|
responseItem := struct {
|
|
|
|
FetchingDataProgress map[string]FetchingBackupedDataDetails `json:"fetchingBackedUpDataProgress,omitempty"`
|
|
|
|
Profile *BackedUpProfile `json:"backedUpProfile,omitempty"`
|
|
|
|
Setting *settings.SyncSettingField `json:"backedUpSettings,omitempty"`
|
2023-05-09 18:48:56 +00:00
|
|
|
Keycards []*keycards.Keycard `json:"backedUpKeycards,omitempty"`
|
2023-04-19 14:44:57 +00:00
|
|
|
WalletAccount *accounts.Account `json:"backedUpWalletAccount,omitempty"`
|
2022-11-30 09:41:35 +00:00
|
|
|
}{
|
2023-04-19 14:44:57 +00:00
|
|
|
Profile: sfwr.Profile,
|
|
|
|
Setting: sfwr.Setting,
|
|
|
|
Keycards: sfwr.Keycards,
|
|
|
|
WalletAccount: sfwr.WalletAccount,
|
2022-11-30 09:41:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
responseItem.FetchingDataProgress = sfwr.FetchingBackedUpDataDetails()
|
|
|
|
|
|
|
|
return json.Marshal(responseItem)
|
|
|
|
}
|