2022-03-23 18:47:00 +00:00
|
|
|
package settings
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/status-im/status-go/multiaccounts/errors"
|
|
|
|
"github.com/status-im/status-go/protocol/protobuf"
|
|
|
|
)
|
|
|
|
|
2023-04-13 00:45:25 +00:00
|
|
|
const (
|
|
|
|
DBColumnMnemonic = "mnemonic"
|
|
|
|
)
|
|
|
|
|
2022-03-23 18:47:00 +00:00
|
|
|
var (
|
|
|
|
AnonMetricsShouldSend = SettingField{
|
|
|
|
reactFieldName: "anon-metrics/should-send?",
|
|
|
|
dBColumnName: "anon_metrics_should_send",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
Appearance = SettingField{
|
|
|
|
reactFieldName: "appearance",
|
|
|
|
dBColumnName: "appearance",
|
|
|
|
}
|
|
|
|
AutoMessageEnabled = SettingField{
|
|
|
|
reactFieldName: "auto-message-enabled?",
|
|
|
|
dBColumnName: "auto_message_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
BackupEnabled = SettingField{
|
|
|
|
reactFieldName: "backup-enabled?",
|
|
|
|
dBColumnName: "backup_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
BackupFetched = SettingField{
|
|
|
|
reactFieldName: "backup-fetched?",
|
|
|
|
dBColumnName: "backup_fetched",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
ChaosMode = SettingField{
|
|
|
|
reactFieldName: "chaos-mode?",
|
|
|
|
dBColumnName: "chaos_mode",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
Currency = SettingField{
|
|
|
|
reactFieldName: "currency",
|
|
|
|
dBColumnName: "currency",
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: currencyProtobufFactory,
|
|
|
|
fromStruct: currencyProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: StringFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_CURRENCY,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
CurrentUserStatus = SettingField{
|
|
|
|
reactFieldName: "current-user-status",
|
|
|
|
dBColumnName: "current_user_status",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
CustomBootNodes = SettingField{
|
|
|
|
reactFieldName: "custom-bootnodes",
|
|
|
|
dBColumnName: "custom_bootnodes",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
CustomBootNodesEnabled = SettingField{
|
|
|
|
reactFieldName: "custom-bootnodes-enabled?",
|
|
|
|
dBColumnName: "custom_bootnodes_enabled",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
DappsAddress = SettingField{
|
|
|
|
reactFieldName: "dapps-address",
|
|
|
|
dBColumnName: "dapps_address",
|
|
|
|
valueHandler: AddressHandler,
|
|
|
|
}
|
|
|
|
DefaultSyncPeriod = SettingField{
|
|
|
|
reactFieldName: "default-sync-period",
|
|
|
|
dBColumnName: "default_sync_period",
|
|
|
|
}
|
2023-06-27 07:54:49 +00:00
|
|
|
DeviceName = SettingField{
|
|
|
|
reactFieldName: "device-name",
|
|
|
|
dBColumnName: "device_name",
|
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
DisplayName = SettingField{
|
|
|
|
reactFieldName: "display-name",
|
|
|
|
dBColumnName: "display_name",
|
2022-11-30 09:41:35 +00:00
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: displayNameProtobufFactory,
|
|
|
|
fromStruct: displayNameProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: StringFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_DISPLAY_NAME,
|
|
|
|
},
|
2022-03-23 18:47:00 +00:00
|
|
|
}
|
2022-08-05 11:22:35 +00:00
|
|
|
Bio = SettingField{
|
|
|
|
reactFieldName: "bio",
|
|
|
|
dBColumnName: "bio",
|
2023-04-13 00:45:25 +00:00
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: bioProtobufFactory,
|
|
|
|
fromStruct: bioProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: StringFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_BIO,
|
|
|
|
},
|
2022-08-05 11:22:35 +00:00
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
EIP1581Address = SettingField{
|
|
|
|
reactFieldName: "eip1581-address",
|
|
|
|
dBColumnName: "eip1581_address",
|
|
|
|
valueHandler: AddressHandler,
|
|
|
|
}
|
|
|
|
Fleet = SettingField{
|
|
|
|
reactFieldName: "fleet",
|
|
|
|
dBColumnName: "fleet",
|
|
|
|
}
|
|
|
|
GifAPIKey = SettingField{
|
|
|
|
reactFieldName: "gifs/api-key",
|
|
|
|
dBColumnName: "gif_api_key",
|
|
|
|
}
|
|
|
|
GifFavourites = SettingField{
|
|
|
|
reactFieldName: "gifs/favorite-gifs",
|
|
|
|
dBColumnName: "gif_favorites",
|
|
|
|
valueHandler: JSONBlobHandler,
|
2022-07-17 13:37:14 +00:00
|
|
|
// TODO resolve issue 8 https://github.com/status-im/status-mobile/pull/13053#issuecomment-1065179963
|
2022-03-23 18:47:00 +00:00
|
|
|
// The reported issue is not directly related, but I suspect that gifs suffer the same issue
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
inactive: true, // Remove after issue is resolved
|
|
|
|
fromInterface: gifFavouritesProtobufFactory,
|
|
|
|
fromStruct: gifFavouritesProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BytesFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_GIF_FAVOURITES,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
GifRecents = SettingField{
|
|
|
|
reactFieldName: "gifs/recent-gifs",
|
|
|
|
dBColumnName: "gif_recents",
|
|
|
|
valueHandler: JSONBlobHandler,
|
2022-07-17 13:37:14 +00:00
|
|
|
// TODO resolve issue 8 https://github.com/status-im/status-mobile/pull/13053#issuecomment-1065179963
|
2022-03-23 18:47:00 +00:00
|
|
|
// The reported issue is not directly related, but I suspect that gifs suffer the same issue
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
inactive: true, // Remove after issue is resolved
|
|
|
|
fromInterface: gifRecentsProtobufFactory,
|
|
|
|
fromStruct: gifRecentsProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BytesFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_GIF_RECENTS,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
HideHomeTooltip = SettingField{
|
|
|
|
reactFieldName: "hide-home-tooltip?",
|
|
|
|
dBColumnName: "hide_home_tooltip",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
KeycardInstanceUID = SettingField{
|
|
|
|
reactFieldName: "keycard-instance_uid",
|
|
|
|
dBColumnName: "keycard_instance_uid",
|
|
|
|
}
|
|
|
|
KeycardPairedOn = SettingField{
|
|
|
|
reactFieldName: "keycard-paired_on",
|
|
|
|
dBColumnName: "keycard_paired_on",
|
|
|
|
}
|
|
|
|
KeycardPairing = SettingField{
|
|
|
|
reactFieldName: "keycard-pairing",
|
|
|
|
dBColumnName: "keycard_pairing",
|
|
|
|
}
|
|
|
|
LastBackup = SettingField{
|
|
|
|
reactFieldName: "last-backup",
|
|
|
|
dBColumnName: "last_backup",
|
|
|
|
}
|
|
|
|
LastUpdated = SettingField{
|
|
|
|
reactFieldName: "last-updated",
|
|
|
|
dBColumnName: "last_updated",
|
|
|
|
}
|
2023-05-08 15:14:46 +00:00
|
|
|
LatestDerivedPath = SettingField{
|
|
|
|
reactFieldName: "latest-derived-path",
|
|
|
|
dBColumnName: "latest_derived_path",
|
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
LinkPreviewRequestEnabled = SettingField{
|
|
|
|
reactFieldName: "link-preview-request-enabled",
|
|
|
|
dBColumnName: "link_preview_request_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
LinkPreviewsEnabledSites = SettingField{
|
|
|
|
reactFieldName: "link-previews-enabled-sites",
|
|
|
|
dBColumnName: "link_previews_enabled_sites",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
LogLevel = SettingField{
|
|
|
|
reactFieldName: "log-level",
|
|
|
|
dBColumnName: "log_level",
|
|
|
|
}
|
|
|
|
MessagesFromContactsOnly = SettingField{
|
|
|
|
reactFieldName: "messages-from-contacts-only",
|
|
|
|
dBColumnName: "messages_from_contacts_only",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: messagesFromContactsOnlyProtobufFactory,
|
|
|
|
fromStruct: messagesFromContactsOnlyProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_MESSAGES_FROM_CONTACTS_ONLY,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
Mnemonic = SettingField{
|
2023-04-13 00:45:25 +00:00
|
|
|
reactFieldName: DBColumnMnemonic,
|
|
|
|
dBColumnName: DBColumnMnemonic,
|
|
|
|
}
|
|
|
|
|
|
|
|
MnemonicRemoved = SettingField{
|
|
|
|
reactFieldName: "mnemonic-removed?",
|
|
|
|
dBColumnName: "mnemonic_removed",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: mnemonicRemovedProtobufFactory,
|
|
|
|
fromStruct: mnemonicRemovedProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_MNEMONIC_REMOVED,
|
|
|
|
},
|
2022-03-23 18:47:00 +00:00
|
|
|
}
|
2023-04-13 00:45:25 +00:00
|
|
|
|
2022-06-08 16:18:56 +00:00
|
|
|
MutualContactEnabled = SettingField{
|
|
|
|
reactFieldName: "mutual-contact-enabled?",
|
|
|
|
dBColumnName: "mutual_contact_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
Name = SettingField{
|
|
|
|
reactFieldName: "name",
|
|
|
|
dBColumnName: "name",
|
|
|
|
}
|
|
|
|
NetworksCurrentNetwork = SettingField{
|
|
|
|
reactFieldName: "networks/current-network",
|
|
|
|
dBColumnName: "current_network",
|
|
|
|
}
|
|
|
|
NetworksNetworks = SettingField{
|
|
|
|
reactFieldName: "networks/networks",
|
|
|
|
dBColumnName: "networks",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
NodeConfig = SettingField{
|
|
|
|
reactFieldName: "node-config",
|
|
|
|
dBColumnName: "node_config",
|
|
|
|
valueHandler: NodeConfigHandler,
|
|
|
|
}
|
2022-05-20 08:59:36 +00:00
|
|
|
// NotificationsEnabled - we should remove this and realated things once mobile team starts usign `settings_notifications` package
|
2022-03-23 18:47:00 +00:00
|
|
|
NotificationsEnabled = SettingField{
|
|
|
|
reactFieldName: "notifications-enabled?",
|
|
|
|
dBColumnName: "notifications_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
OpenseaEnabled = SettingField{
|
|
|
|
reactFieldName: "opensea-enabled?",
|
|
|
|
dBColumnName: "opensea_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
PhotoPath = SettingField{
|
|
|
|
reactFieldName: "photo-path",
|
|
|
|
dBColumnName: "photo_path",
|
|
|
|
}
|
|
|
|
PinnedMailservers = SettingField{
|
|
|
|
reactFieldName: "pinned-mailservers",
|
|
|
|
dBColumnName: "pinned_mailservers",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
PreferredName = SettingField{
|
|
|
|
reactFieldName: "preferred-name",
|
|
|
|
dBColumnName: "preferred_name",
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: preferredNameProtobufFactory,
|
|
|
|
fromStruct: preferredNameProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: StringFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_PREFERRED_NAME,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
PreviewPrivacy = SettingField{
|
|
|
|
reactFieldName: "preview-privacy?",
|
|
|
|
dBColumnName: "preview_privacy",
|
|
|
|
valueHandler: BoolHandler,
|
2022-07-17 13:37:14 +00:00
|
|
|
// TODO resolved issue 7 https://github.com/status-im/status-mobile/pull/13053#issuecomment-1065179963
|
2022-03-23 18:47:00 +00:00
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
inactive: true, // Remove after issue is resolved
|
|
|
|
fromInterface: previewPrivacyProtobufFactory,
|
|
|
|
fromStruct: previewPrivacyProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_PREVIEW_PRIVACY,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
ProfilePicturesShowTo = SettingField{
|
|
|
|
reactFieldName: "profile-pictures-show-to",
|
|
|
|
dBColumnName: "profile_pictures_show_to",
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: profilePicturesShowToProtobufFactory,
|
|
|
|
fromStruct: profilePicturesShowToProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: Int64FromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_PROFILE_PICTURES_SHOW_TO,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
ProfilePicturesVisibility = SettingField{
|
|
|
|
reactFieldName: "profile-pictures-visibility",
|
|
|
|
dBColumnName: "profile_pictures_visibility",
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: profilePicturesVisibilityProtobufFactory,
|
|
|
|
fromStruct: profilePicturesVisibilityProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: Int64FromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_PROFILE_PICTURES_VISIBILITY,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
PublicKey = SettingField{
|
|
|
|
reactFieldName: "public-key",
|
|
|
|
dBColumnName: "public_key",
|
|
|
|
}
|
|
|
|
PushNotificationsBlockMentions = SettingField{
|
|
|
|
reactFieldName: "push-notifications-block-mentions?",
|
|
|
|
dBColumnName: "push_notifications_block_mentions",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
PushNotificationsFromContactsOnly = SettingField{
|
|
|
|
reactFieldName: "push-notifications-from-contacts-only?",
|
|
|
|
dBColumnName: "push_notifications_from_contacts_only",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
PushNotificationsServerEnabled = SettingField{
|
|
|
|
reactFieldName: "push-notifications-server-enabled?",
|
|
|
|
dBColumnName: "push_notifications_server_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
RememberSyncingChoice = SettingField{
|
|
|
|
reactFieldName: "remember-syncing-choice?",
|
|
|
|
dBColumnName: "remember_syncing_choice",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
RemotePushNotificationsEnabled = SettingField{
|
|
|
|
reactFieldName: "remote-push-notifications-enabled?",
|
|
|
|
dBColumnName: "remote_push_notifications_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
SendPushNotifications = SettingField{
|
|
|
|
reactFieldName: "send-push-notifications?",
|
|
|
|
dBColumnName: "send_push_notifications",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
SendStatusUpdates = SettingField{
|
|
|
|
reactFieldName: "send-status-updates?",
|
|
|
|
dBColumnName: "send_status_updates",
|
|
|
|
valueHandler: BoolHandler,
|
2022-07-17 13:37:14 +00:00
|
|
|
// TODO resolve issue 10 https://github.com/status-im/status-mobile/pull/13053#issuecomment-1075352256
|
2022-03-23 18:47:00 +00:00
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
inactive: true, // Remove after issue is resolved
|
|
|
|
fromInterface: sendStatusUpdatesProtobufFactory,
|
|
|
|
fromStruct: sendStatusUpdatesProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_SEND_STATUS_UPDATES,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
StickersPacksInstalled = SettingField{
|
|
|
|
reactFieldName: "stickers/packs-installed",
|
|
|
|
dBColumnName: "stickers_packs_installed",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
2022-06-20 11:08:40 +00:00
|
|
|
inactive: true, // TODO current version of stickers introduces a regression on deleting sticker packs
|
2022-03-23 18:47:00 +00:00
|
|
|
fromInterface: stickersPacksInstalledProtobufFactory,
|
|
|
|
fromStruct: stickersPacksInstalledProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BytesFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_STICKERS_PACKS_INSTALLED,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
StickersPacksPending = SettingField{
|
|
|
|
reactFieldName: "stickers/packs-pending",
|
|
|
|
dBColumnName: "stickers_packs_pending",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
2022-06-20 11:08:40 +00:00
|
|
|
inactive: true, // TODO current version of stickers introduces a regression on deleting sticker packs
|
2022-03-23 18:47:00 +00:00
|
|
|
fromInterface: stickersPacksPendingProtobufFactory,
|
|
|
|
fromStruct: stickersPacksPendingProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BytesFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_STICKERS_PACKS_PENDING,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
StickersRecentStickers = SettingField{
|
|
|
|
reactFieldName: "stickers/recent-stickers",
|
|
|
|
dBColumnName: "stickers_recent_stickers",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
2022-06-20 11:08:40 +00:00
|
|
|
inactive: true, // TODO current version of stickers introduces a regression on deleting sticker packs
|
2022-03-23 18:47:00 +00:00
|
|
|
fromInterface: stickersRecentStickersProtobufFactory,
|
|
|
|
fromStruct: stickersRecentStickersProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BytesFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_STICKERS_RECENT_STICKERS,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
SyncingOnMobileNetwork = SettingField{
|
|
|
|
reactFieldName: "syncing-on-mobile-network?",
|
|
|
|
dBColumnName: "syncing_on_mobile_network",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
TelemetryServerURL = SettingField{
|
|
|
|
reactFieldName: "telemetry-server-url",
|
|
|
|
dBColumnName: "telemetry_server_url",
|
|
|
|
}
|
2022-03-29 12:39:10 +00:00
|
|
|
TestNetworksEnabled = SettingField{
|
|
|
|
reactFieldName: "test-networks-enabled?",
|
|
|
|
dBColumnName: "test_networks_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2024-02-20 09:30:47 +00:00
|
|
|
IsGoerliEnabled = SettingField{
|
|
|
|
reactFieldName: "is-goerli-enabled?",
|
|
|
|
dBColumnName: "is_goerli_enabled",
|
2023-10-03 13:27:42 +00:00
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2023-12-04 10:18:05 +00:00
|
|
|
TokenGroupByCommunity = SettingField{
|
|
|
|
reactFieldName: "token-group-by-community?",
|
|
|
|
dBColumnName: "wallet_token_preferences_group_by_community",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2024-01-05 11:12:53 +00:00
|
|
|
ShowCommunityAssetWhenSendingTokens = SettingField{
|
|
|
|
reactFieldName: "show-community-asset-when-sending-tokens?",
|
|
|
|
dBColumnName: "wallet_show_community_asset_when_sending_tokens",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: showCommunityAssetWhenSendingTokensProtobufFactory,
|
|
|
|
fromStruct: showCommunityAssetWhenSendingTokensProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_SHOW_COMMUNITY_ASSET_WHEN_SENDING_TOKENS,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
DisplayAssetsBelowBalance = SettingField{
|
|
|
|
reactFieldName: "display-assets-below-balance?",
|
|
|
|
dBColumnName: "wallet_display_assets_below_balance",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: displayAssetsBelowBalanceProtobufFactory,
|
|
|
|
fromStruct: displayAssetsBelowBalanceProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: BoolFromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_DISPLAY_ASSETS_BELOW_BALANCE,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
DisplayAssetsBelowBalanceThreshold = SettingField{
|
2024-02-19 12:09:02 +00:00
|
|
|
reactFieldName: "display-assets-below-balance-threshold",
|
|
|
|
dBColumnName: "wallet_display_assets_below_balance_threshold",
|
|
|
|
valueHandler: Int64Handler,
|
|
|
|
valueCastHandler: Float64ToInt64Handler,
|
2024-01-05 11:12:53 +00:00
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: displayAssetsBelowBalanceThresholdProtobufFactory,
|
|
|
|
fromStruct: displayAssetsBelowBalanceThresholdProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: Int64FromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_DISPLAY_ASSETS_BELOW_BALANCE_THRESHOLD,
|
|
|
|
},
|
|
|
|
}
|
2024-01-17 13:12:49 +00:00
|
|
|
CollectibleGroupByCollection = SettingField{
|
|
|
|
reactFieldName: "collectible-group-by-collection?",
|
|
|
|
dBColumnName: "wallet_collectible_preferences_group_by_collection",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
CollectibleGroupByCommunity = SettingField{
|
|
|
|
reactFieldName: "collectible-group-by-community?",
|
|
|
|
dBColumnName: "wallet_collectible_preferences_group_by_community",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
UseMailservers = SettingField{
|
|
|
|
reactFieldName: "use-mailservers?",
|
|
|
|
dBColumnName: "use_mailservers",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
WakuBloomFilterMode = SettingField{
|
|
|
|
reactFieldName: "waku-bloom-filter-mode",
|
|
|
|
dBColumnName: "waku_bloom_filter_mode",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
WalletSetUpPassed = SettingField{
|
|
|
|
reactFieldName: "wallet-set-up-passed?",
|
|
|
|
dBColumnName: "wallet_set_up_passed",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
|
|
|
WalletVisibleTokens = SettingField{
|
|
|
|
reactFieldName: "wallet/visible-tokens",
|
|
|
|
dBColumnName: "wallet_visible_tokens",
|
|
|
|
valueHandler: JSONBlobHandler,
|
|
|
|
}
|
|
|
|
WebviewAllowPermissionRequests = SettingField{
|
|
|
|
reactFieldName: "webview-allow-permission-requests?",
|
|
|
|
dBColumnName: "webview_allow_permission_requests",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2022-04-11 16:35:18 +00:00
|
|
|
WalletRootAddress = SettingField{
|
|
|
|
reactFieldName: "wallet-root-address",
|
|
|
|
dBColumnName: "wallet_root_address",
|
|
|
|
valueHandler: AddressHandler,
|
|
|
|
}
|
2023-01-25 17:46:20 +00:00
|
|
|
MasterAddress = SettingField{
|
|
|
|
reactFieldName: "address",
|
|
|
|
dBColumnName: "address",
|
|
|
|
valueHandler: AddressHandler,
|
|
|
|
}
|
2023-08-02 07:39:58 +00:00
|
|
|
ProfileMigrationNeeded = SettingField{
|
|
|
|
reactFieldName: "profile-migration-needed",
|
|
|
|
dBColumnName: "profile_migration_needed",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2023-10-13 14:31:56 +00:00
|
|
|
URLUnfurlingMode = SettingField{
|
|
|
|
reactFieldName: "url-unfurling-mode",
|
|
|
|
dBColumnName: "url_unfurling_mode",
|
|
|
|
syncProtobufFactory: &SyncProtobufFactory{
|
|
|
|
fromInterface: urlUnfurlingModeProtobufFactory,
|
|
|
|
fromStruct: urlUnfurlingModeProtobufFactoryStruct,
|
|
|
|
valueFromProtobuf: Int64FromSyncProtobuf,
|
|
|
|
protobufType: protobuf.SyncSetting_URL_UNFURLING_MODE,
|
|
|
|
},
|
|
|
|
}
|
2023-12-01 11:30:42 +00:00
|
|
|
MnemonicWasNotShown = SettingField{
|
|
|
|
reactFieldName: "mnemonic-was-not-shown?",
|
|
|
|
dBColumnName: "mnemonic_was_not_shown",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2024-03-05 10:44:09 +00:00
|
|
|
PeerSyncingEnabled = SettingField{
|
|
|
|
reactFieldName: "peer-syncing-enabled?",
|
|
|
|
dBColumnName: "peer_syncing_enabled",
|
|
|
|
valueHandler: BoolHandler,
|
|
|
|
}
|
2022-03-23 18:47:00 +00:00
|
|
|
SettingFieldRegister = []SettingField{
|
|
|
|
AnonMetricsShouldSend,
|
|
|
|
Appearance,
|
|
|
|
AutoMessageEnabled,
|
|
|
|
BackupEnabled,
|
|
|
|
BackupFetched,
|
2024-03-05 10:44:09 +00:00
|
|
|
Bio,
|
2022-03-23 18:47:00 +00:00
|
|
|
ChaosMode,
|
2024-03-05 10:44:09 +00:00
|
|
|
CollectibleGroupByCollection,
|
|
|
|
CollectibleGroupByCommunity,
|
2022-03-23 18:47:00 +00:00
|
|
|
Currency,
|
|
|
|
CurrentUserStatus,
|
|
|
|
CustomBootNodes,
|
|
|
|
CustomBootNodesEnabled,
|
|
|
|
DappsAddress,
|
|
|
|
DefaultSyncPeriod,
|
2023-06-27 07:54:49 +00:00
|
|
|
DeviceName,
|
2024-03-05 10:44:09 +00:00
|
|
|
DisplayAssetsBelowBalance,
|
|
|
|
DisplayAssetsBelowBalanceThreshold,
|
2022-03-23 18:47:00 +00:00
|
|
|
DisplayName,
|
|
|
|
EIP1581Address,
|
|
|
|
Fleet,
|
|
|
|
GifAPIKey,
|
|
|
|
GifFavourites,
|
|
|
|
GifRecents,
|
|
|
|
HideHomeTooltip,
|
2024-03-05 10:44:09 +00:00
|
|
|
IsGoerliEnabled,
|
2022-03-23 18:47:00 +00:00
|
|
|
KeycardInstanceUID,
|
|
|
|
KeycardPairedOn,
|
|
|
|
KeycardPairing,
|
|
|
|
LastBackup,
|
|
|
|
LastUpdated,
|
2023-05-08 15:14:46 +00:00
|
|
|
LatestDerivedPath,
|
2022-03-23 18:47:00 +00:00
|
|
|
LinkPreviewRequestEnabled,
|
|
|
|
LinkPreviewsEnabledSites,
|
|
|
|
LogLevel,
|
|
|
|
MessagesFromContactsOnly,
|
|
|
|
Mnemonic,
|
2023-04-13 00:45:25 +00:00
|
|
|
MnemonicRemoved,
|
2022-06-08 16:18:56 +00:00
|
|
|
MutualContactEnabled,
|
2022-03-23 18:47:00 +00:00
|
|
|
Name,
|
|
|
|
NetworksCurrentNetwork,
|
|
|
|
NetworksNetworks,
|
|
|
|
NodeConfig,
|
|
|
|
NotificationsEnabled,
|
|
|
|
OpenseaEnabled,
|
2024-03-05 10:44:09 +00:00
|
|
|
PeerSyncingEnabled,
|
2022-03-23 18:47:00 +00:00
|
|
|
PhotoPath,
|
|
|
|
PinnedMailservers,
|
|
|
|
PreferredName,
|
|
|
|
PreviewPrivacy,
|
2024-03-05 10:44:09 +00:00
|
|
|
ProfileMigrationNeeded,
|
2022-03-23 18:47:00 +00:00
|
|
|
ProfilePicturesShowTo,
|
|
|
|
ProfilePicturesVisibility,
|
|
|
|
PublicKey,
|
|
|
|
PushNotificationsBlockMentions,
|
|
|
|
PushNotificationsFromContactsOnly,
|
|
|
|
PushNotificationsServerEnabled,
|
|
|
|
RememberSyncingChoice,
|
|
|
|
RemotePushNotificationsEnabled,
|
|
|
|
SendPushNotifications,
|
|
|
|
SendStatusUpdates,
|
2024-03-05 10:44:09 +00:00
|
|
|
ShowCommunityAssetWhenSendingTokens,
|
2022-03-23 18:47:00 +00:00
|
|
|
StickersPacksInstalled,
|
|
|
|
StickersPacksPending,
|
|
|
|
StickersRecentStickers,
|
|
|
|
SyncingOnMobileNetwork,
|
|
|
|
TelemetryServerURL,
|
2022-03-29 12:39:10 +00:00
|
|
|
TestNetworksEnabled,
|
2024-03-05 10:44:09 +00:00
|
|
|
TokenGroupByCommunity,
|
|
|
|
URLUnfurlingMode,
|
2022-03-23 18:47:00 +00:00
|
|
|
UseMailservers,
|
|
|
|
WakuBloomFilterMode,
|
2022-04-11 16:35:18 +00:00
|
|
|
WalletRootAddress,
|
2022-03-23 18:47:00 +00:00
|
|
|
WalletSetUpPassed,
|
|
|
|
WalletVisibleTokens,
|
|
|
|
WebviewAllowPermissionRequests,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetFieldFromProtobufType(pbt protobuf.SyncSetting_Type) (SettingField, error) {
|
|
|
|
if pbt == protobuf.SyncSetting_UNKNOWN {
|
|
|
|
return SettingField{}, errors.ErrUnrecognisedSyncSettingProtobufType
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, s := range SettingFieldRegister {
|
|
|
|
if s.SyncProtobufFactory() == nil {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if s.SyncProtobufFactory().SyncSettingProtobufType() == pbt {
|
|
|
|
return s, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return SettingField{}, errors.ErrUnrecognisedSyncSettingProtobufType
|
|
|
|
}
|