settings

package
v0.178.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBColumnMnemonic = "mnemonic"
)

Variables

View Source
var (
	AnonMetricsShouldSend = SettingField{
							// contains filtered or unexported fields
	}
	Appearance = SettingField{
				// contains filtered or unexported fields
	}
	AutoMessageEnabled = SettingField{
						// contains filtered or unexported fields
	}
	BackupEnabled = SettingField{
					// contains filtered or unexported fields
	}
	BackupFetched = SettingField{
					// contains filtered or unexported fields
	}
	ChaosMode = SettingField{
				// contains filtered or unexported fields
	}
	Currency = SettingField{
				// contains filtered or unexported fields
	}
	CurrentUserStatus = SettingField{
						// contains filtered or unexported fields
	}
	CustomBootNodes = SettingField{
					// contains filtered or unexported fields
	}
	CustomBootNodesEnabled = SettingField{
							// contains filtered or unexported fields
	}
	DappsAddress = SettingField{
					// contains filtered or unexported fields
	}
	DefaultSyncPeriod = SettingField{
						// contains filtered or unexported fields
	}
	DeviceName = SettingField{
				// contains filtered or unexported fields
	}
	DisplayName = SettingField{
				// contains filtered or unexported fields
	}
	Bio = SettingField{
		// contains filtered or unexported fields
	}
	EIP1581Address = SettingField{
					// contains filtered or unexported fields
	}
	Fleet = SettingField{
			// contains filtered or unexported fields
	}
	GifAPIKey = SettingField{
				// contains filtered or unexported fields
	}
	GifFavourites = SettingField{
					// contains filtered or unexported fields
	}
	GifRecents = SettingField{
				// contains filtered or unexported fields
	}
	HideHomeTooltip = SettingField{
					// contains filtered or unexported fields
	}
	KeycardInstanceUID = SettingField{
						// contains filtered or unexported fields
	}
	KeycardPairedOn = SettingField{
					// contains filtered or unexported fields
	}
	KeycardPairing = SettingField{
					// contains filtered or unexported fields
	}
	LastBackup = SettingField{
				// contains filtered or unexported fields
	}
	LastUpdated = SettingField{
				// contains filtered or unexported fields
	}
	LatestDerivedPath = SettingField{
						// contains filtered or unexported fields
	}
	LinkPreviewRequestEnabled = SettingField{
								// contains filtered or unexported fields
	}
	LinkPreviewsEnabledSites = SettingField{
								// contains filtered or unexported fields
	}
	LogLevel = SettingField{
				// contains filtered or unexported fields
	}
	MessagesFromContactsOnly = SettingField{
								// contains filtered or unexported fields
	}
	Mnemonic = SettingField{
				// contains filtered or unexported fields
	}

	MnemonicRemoved = SettingField{
					// contains filtered or unexported fields
	}

	MutualContactEnabled = SettingField{
							// contains filtered or unexported fields
	}
	Name = SettingField{
			// contains filtered or unexported fields
	}
	NetworksCurrentNetwork = SettingField{
							// contains filtered or unexported fields
	}
	NetworksNetworks = SettingField{
						// contains filtered or unexported fields
	}
	NodeConfig = SettingField{
				// contains filtered or unexported fields
	}
	// NotificationsEnabled - we should remove this and realated things once mobile team starts usign `settings_notifications` package
	NotificationsEnabled = SettingField{
							// contains filtered or unexported fields
	}
	OpenseaEnabled = SettingField{
					// contains filtered or unexported fields
	}
	PhotoPath = SettingField{
				// contains filtered or unexported fields
	}
	PinnedMailservers = SettingField{
						// contains filtered or unexported fields
	}
	PreferredName = SettingField{
					// contains filtered or unexported fields
	}
	PreviewPrivacy = SettingField{
					// contains filtered or unexported fields
	}
	ProfilePicturesShowTo = SettingField{
							// contains filtered or unexported fields
	}
	ProfilePicturesVisibility = SettingField{
								// contains filtered or unexported fields
	}
	PublicKey = SettingField{
				// contains filtered or unexported fields
	}
	PushNotificationsBlockMentions = SettingField{
									// contains filtered or unexported fields
	}
	PushNotificationsFromContactsOnly = SettingField{
										// contains filtered or unexported fields
	}
	PushNotificationsServerEnabled = SettingField{
									// contains filtered or unexported fields
	}
	RememberSyncingChoice = SettingField{
							// contains filtered or unexported fields
	}
	RemotePushNotificationsEnabled = SettingField{
									// contains filtered or unexported fields
	}
	SendPushNotifications = SettingField{
							// contains filtered or unexported fields
	}
	SendStatusUpdates = SettingField{
						// contains filtered or unexported fields
	}
	StickersPacksInstalled = SettingField{
							// contains filtered or unexported fields
	}
	StickersPacksPending = SettingField{
							// contains filtered or unexported fields
	}
	StickersRecentStickers = SettingField{
							// contains filtered or unexported fields
	}
	SyncingOnMobileNetwork = SettingField{
							// contains filtered or unexported fields
	}
	TelemetryServerURL = SettingField{
						// contains filtered or unexported fields
	}
	TestNetworksEnabled = SettingField{
						// contains filtered or unexported fields
	}
	IsGoerliEnabled = SettingField{
					// contains filtered or unexported fields
	}
	TokenGroupByCommunity = SettingField{
							// contains filtered or unexported fields
	}
	ShowCommunityAssetWhenSendingTokens = SettingField{
										// contains filtered or unexported fields
	}
	DisplayAssetsBelowBalance = SettingField{
								// contains filtered or unexported fields
	}
	DisplayAssetsBelowBalanceThreshold = SettingField{
										// contains filtered or unexported fields
	}
	CollectibleGroupByCollection = SettingField{
									// contains filtered or unexported fields
	}
	CollectibleGroupByCommunity = SettingField{
								// contains filtered or unexported fields
	}
	UseMailservers = SettingField{
					// contains filtered or unexported fields
	}
	WakuBloomFilterMode = SettingField{
						// contains filtered or unexported fields
	}
	WalletSetUpPassed = SettingField{
						// contains filtered or unexported fields
	}
	WalletVisibleTokens = SettingField{
						// contains filtered or unexported fields
	}
	WebviewAllowPermissionRequests = SettingField{
									// contains filtered or unexported fields
	}
	WalletRootAddress = SettingField{
						// contains filtered or unexported fields
	}
	MasterAddress = SettingField{
					// contains filtered or unexported fields
	}
	ProfileMigrationNeeded = SettingField{
							// contains filtered or unexported fields
	}
	URLUnfurlingMode = SettingField{
						// contains filtered or unexported fields
	}
	OmitTransfersHistoryScan = SettingField{
								// contains filtered or unexported fields
	}
	MnemonicWasNotShown = SettingField{
						// contains filtered or unexported fields
	}
	PeerSyncingEnabled = SettingField{
						// contains filtered or unexported fields
	}
	SettingFieldRegister = []SettingField{
		AnonMetricsShouldSend,
		Appearance,
		AutoMessageEnabled,
		BackupEnabled,
		BackupFetched,
		Bio,
		ChaosMode,
		CollectibleGroupByCollection,
		CollectibleGroupByCommunity,
		Currency,
		CurrentUserStatus,
		CustomBootNodes,
		CustomBootNodesEnabled,
		DappsAddress,
		DefaultSyncPeriod,
		DeviceName,
		DisplayAssetsBelowBalance,
		DisplayAssetsBelowBalanceThreshold,
		DisplayName,
		EIP1581Address,
		Fleet,
		GifAPIKey,
		GifFavourites,
		GifRecents,
		HideHomeTooltip,
		IsGoerliEnabled,
		KeycardInstanceUID,
		KeycardPairedOn,
		KeycardPairing,
		LastBackup,
		LastUpdated,
		LatestDerivedPath,
		LinkPreviewRequestEnabled,
		LinkPreviewsEnabledSites,
		LogLevel,
		MessagesFromContactsOnly,
		Mnemonic,
		MnemonicRemoved,
		MutualContactEnabled,
		Name,
		NetworksCurrentNetwork,
		NetworksNetworks,
		NodeConfig,
		NotificationsEnabled,
		OpenseaEnabled,
		PeerSyncingEnabled,
		PhotoPath,
		PinnedMailservers,
		PreferredName,
		PreviewPrivacy,
		ProfileMigrationNeeded,
		ProfilePicturesShowTo,
		ProfilePicturesVisibility,
		PublicKey,
		PushNotificationsBlockMentions,
		PushNotificationsFromContactsOnly,
		PushNotificationsServerEnabled,
		RememberSyncingChoice,
		RemotePushNotificationsEnabled,
		SendPushNotifications,
		SendStatusUpdates,
		ShowCommunityAssetWhenSendingTokens,
		StickersPacksInstalled,
		StickersPacksPending,
		StickersRecentStickers,
		SyncingOnMobileNetwork,
		TelemetryServerURL,
		TestNetworksEnabled,
		TokenGroupByCommunity,
		URLUnfurlingMode,
		UseMailservers,
		WakuBloomFilterMode,
		WalletRootAddress,
		WalletSetUpPassed,
		WalletVisibleTokens,
		WebviewAllowPermissionRequests,
	}
)
View Source
var (
	ErrTypeAssertionFailed = errors.New("type assertion of interface value failed")
)

Functions

func AddressHandler

func AddressHandler(value interface{}) (interface{}, error)

func BoolFromSyncProtobuf

func BoolFromSyncProtobuf(ss *protobuf.SyncSetting) interface{}

func BoolHandler

func BoolHandler(value interface{}) (interface{}, error)

func BytesFromSyncProtobuf

func BytesFromSyncProtobuf(ss *protobuf.SyncSetting) interface{}

func Float64ToInt64Handler added in v0.175.3

func Float64ToInt64Handler(value interface{}) (interface{}, error)

func Int64FromSyncProtobuf

func Int64FromSyncProtobuf(ss *protobuf.SyncSetting) interface{}

func Int64Handler added in v0.172.1

func Int64Handler(value interface{}) (interface{}, error)

func JSONBlobHandler

func JSONBlobHandler(value interface{}) (interface{}, error)

func NodeConfigHandler

func NodeConfigHandler(value interface{}) (interface{}, error)

func StringFromSyncProtobuf

func StringFromSyncProtobuf(ss *protobuf.SyncSetting) interface{}

Types

type Database

type Database struct {
	SyncQueue chan SyncSettingField
	// contains filtered or unexported fields
}

Database sql wrapper for operations with browser objects.

func MakeNewDB

func MakeNewDB(db *sql.DB) (*Database, error)

MakeNewDB ensures that a singleton instance of Database is returned per sqlite db file

func (*Database) AutoMessageEnabled

func (db *Database) AutoMessageEnabled() (result bool, err error)

func (*Database) BackupEnabled

func (db *Database) BackupEnabled() (result bool, err error)

func (*Database) BackupFetched

func (db *Database) BackupFetched() (result bool, err error)

func (*Database) Bio added in v0.105.1

func (db *Database) Bio() (string, error)

func (*Database) CanSyncOnMobileNetwork

func (db *Database) CanSyncOnMobileNetwork() (result bool, err error)

func (*Database) CanUseMailservers

func (db *Database) CanUseMailservers() (result bool, err error)

func (*Database) CreateSettings

func (db *Database) CreateSettings(s Settings, n params.NodeConfig) error

TODO remove photoPath from settings

func (*Database) DeleteMnemonic added in v0.145.2

func (db *Database) DeleteMnemonic() error

func (*Database) DeviceName added in v0.159.10

func (db *Database) DeviceName() (string, error)

func (*Database) DisplayName

func (db *Database) DisplayName() (string, error)

func (*Database) ENSName

func (db *Database) ENSName() (string, error)

func (*Database) GetChangesSubscriptions added in v0.171.39

func (db *Database) GetChangesSubscriptions() []chan *SyncSettingField

func (*Database) GetCollectibleGroupByCollection added in v0.172.6

func (db *Database) GetCollectibleGroupByCollection() (result bool, err error)

func (*Database) GetCollectibleGroupByCommunity added in v0.172.6

func (db *Database) GetCollectibleGroupByCommunity() (result bool, err error)

func (*Database) GetCurrency added in v0.100.0

func (db *Database) GetCurrency() (string, error)

func (*Database) GetCurrentStatus

func (db *Database) GetCurrentStatus(status interface{}) error

func (*Database) GetDB added in v0.171.39

func (db *Database) GetDB() *sql.DB

func (*Database) GetDappsAddress

func (db *Database) GetDappsAddress() (rst types.Address, err error)

func (*Database) GetDefaultSyncPeriod

func (db *Database) GetDefaultSyncPeriod() (result uint32, err error)

func (*Database) GetEIP1581Address added in v0.125.4

func (db *Database) GetEIP1581Address() (rst types.Address, err error)

func (*Database) GetFleet

func (db *Database) GetFleet() (string, error)

func (*Database) GetInstalledStickerPacks

func (db *Database) GetInstalledStickerPacks() (rst *json.RawMessage, err error)

func (*Database) GetIsGoerliEnabled added in v0.175.4

func (db *Database) GetIsGoerliEnabled() (result bool, err error)

func (*Database) GetLatestDerivedPath

func (db *Database) GetLatestDerivedPath() (result uint, err error)

func (*Database) GetMasterAddress added in v0.125.4

func (db *Database) GetMasterAddress() (rst types.Address, err error)

func (*Database) GetMessagesFromContactsOnly

func (db *Database) GetMessagesFromContactsOnly() (result bool, err error)

func (*Database) GetMnemonicWasNotShown added in v0.171.26

func (db *Database) GetMnemonicWasNotShown() (result bool, err error)

func (*Database) GetNotificationsEnabled

func (db *Database) GetNotificationsEnabled() (result bool, err error)

We should remove this and realated things once mobile team starts usign `settings_notifications` package

func (*Database) GetNotifier added in v0.171.39

func (db *Database) GetNotifier() Notifier

func (*Database) GetPeerSyncingEnabled added in v0.176.3

func (db *Database) GetPeerSyncingEnabled() (result bool, err error)

func (*Database) GetPendingStickerPacks

func (db *Database) GetPendingStickerPacks() (rst *json.RawMessage, err error)

func (*Database) GetPinnedMailservers

func (db *Database) GetPinnedMailservers() (rst map[string]string, err error)

func (*Database) GetPreferredUsername

func (db *Database) GetPreferredUsername() (string, error)

func (*Database) GetProfilePicturesShowTo added in v0.117.3

func (db *Database) GetProfilePicturesShowTo() (result int64, err error)

func (*Database) GetProfilePicturesVisibility

func (db *Database) GetProfilePicturesVisibility() (result int, err error)

func (*Database) GetPublicKey

func (db *Database) GetPublicKey() (string, error)

func (*Database) GetRecentStickers

func (db *Database) GetRecentStickers() (rst *json.RawMessage, err error)

func (*Database) GetSettingLastSynced

func (db *Database) GetSettingLastSynced(setting SettingField) (result uint64, err error)

func (*Database) GetSettings

func (db *Database) GetSettings() (Settings, error)

func (*Database) GetSyncQueue added in v0.171.39

func (db *Database) GetSyncQueue() chan SyncSettingField

func (*Database) GetTelemetryServerURL added in v0.128.0

func (db *Database) GetTelemetryServerURL() (string, error)

func (*Database) GetTestNetworksEnabled added in v0.101.1

func (db *Database) GetTestNetworksEnabled() (result bool, err error)

func (*Database) GetTokenGroupByCommunity added in v0.171.27

func (db *Database) GetTokenGroupByCommunity() (result bool, err error)

func (*Database) GetWalletRootAddress added in v0.98.6

func (db *Database) GetWalletRootAddress() (rst types.Address, err error)

func (*Database) GifAPIKey

func (db *Database) GifAPIKey() (string, error)

func (*Database) GifFavorites

func (db *Database) GifFavorites() (favorites json.RawMessage, err error)

func (*Database) GifRecents

func (db *Database) GifRecents() (recents json.RawMessage, err error)

func (*Database) LastBackup

func (db *Database) LastBackup() (result uint64, err error)

func (*Database) Mnemonic added in v0.145.2

func (db *Database) Mnemonic() (string, error)

func (*Database) MnemonicRemoved added in v0.145.2

func (db *Database) MnemonicRemoved() (result bool, err error)

func (*Database) MnemonicWasShown added in v0.171.26

func (db *Database) MnemonicWasShown() error

func (*Database) MutualContactEnabled added in v0.101.1

func (db *Database) MutualContactEnabled() (result bool, err error)

func (*Database) ProfileMigrationNeeded added in v0.166.7

func (db *Database) ProfileMigrationNeeded() (result bool, err error)

func (*Database) SaveSetting

func (db *Database) SaveSetting(setting string, value interface{}) error

SaveSetting stores data from any non-sync source If the field requires syncing the field data is pushed on to the SyncQueue

func (*Database) SaveSettingField

func (db *Database) SaveSettingField(sf SettingField, value interface{}) error

SaveSettingField is identical in functionality to SaveSetting, except the setting parameter is a SettingField and doesn't require any SettingFieldRegister lookup. This func is useful if you already know the SettingField to save

func (*Database) SaveSyncSetting

func (db *Database) SaveSyncSetting(setting SettingField, value interface{}, clock uint64) error

SaveSyncSetting stores setting data from a sync protobuf source, note it does not call SettingField.ValueHandler() nor does this function attempt to write to the Database.SyncQueue, yet it still writes to Database.changesSubscriptions.

func (*Database) SetBackupFetched

func (db *Database) SetBackupFetched(fetched bool) error

func (*Database) SetCollectibleGroupByCollection added in v0.172.6

func (db *Database) SetCollectibleGroupByCollection(value bool) error

func (*Database) SetCollectibleGroupByCommunity added in v0.172.6

func (db *Database) SetCollectibleGroupByCommunity(value bool) error

func (*Database) SetLastBackup

func (db *Database) SetLastBackup(time uint64) error

func (*Database) SetPeerSyncingEnabled added in v0.176.3

func (db *Database) SetPeerSyncingEnabled(value bool) error

func (*Database) SetPinnedMailservers

func (db *Database) SetPinnedMailservers(mailservers map[string]string) error

func (*Database) SetSettingLastSynced

func (db *Database) SetSettingLastSynced(setting SettingField, clock uint64) error

func (*Database) SetSettingsNotifier added in v0.170.0

func (db *Database) SetSettingsNotifier(n Notifier)

func (*Database) SetTokenGroupByCommunity added in v0.171.27

func (db *Database) SetTokenGroupByCommunity(value bool) error

func (*Database) SetUseMailservers

func (db *Database) SetUseMailservers(value bool) error

func (*Database) ShouldBroadcastUserStatus

func (db *Database) ShouldBroadcastUserStatus() (result bool, err error)

func (*Database) SubscribeToChanges added in v0.171.5

func (db *Database) SubscribeToChanges() chan *SyncSettingField

func (*Database) URLUnfurlingMode added in v0.171.1

func (db *Database) URLUnfurlingMode() (result int64, err error)

type DatabaseSettingsManager added in v0.171.39

type DatabaseSettingsManager interface {
	GetDB() *sql.DB
	GetSyncQueue() chan SyncSettingField
	GetChangesSubscriptions() []chan *SyncSettingField
	GetNotifier() Notifier
	GetSettingLastSynced(setting SettingField) (result uint64, err error)
	GetSettings() (Settings, error)
	GetNotificationsEnabled() (result bool, err error)
	GetProfilePicturesVisibility() (result int, err error)
	GetPublicKey() (string, error)
	GetFleet() (string, error)
	GetDappsAddress() (rst types.Address, err error)
	GetPinnedMailservers() (rst map[string]string, err error)
	GetDefaultSyncPeriod() (result uint32, err error)
	GetMessagesFromContactsOnly() (result bool, err error)
	GetProfilePicturesShowTo() (result int64, err error)
	GetLatestDerivedPath() (result uint, err error)
	GetCurrentStatus(status interface{}) error
	GetMnemonicWasNotShown() (result bool, err error)
	GetPreferredUsername() (string, error)
	GetCurrency() (string, error)
	GetInstalledStickerPacks() (rst *json.RawMessage, err error)
	GetPendingStickerPacks() (rst *json.RawMessage, err error)
	GetRecentStickers() (rst *json.RawMessage, err error)
	GetWalletRootAddress() (rst types.Address, err error)
	GetEIP1581Address() (rst types.Address, err error)
	GetMasterAddress() (rst types.Address, err error)
	GetTestNetworksEnabled() (result bool, err error)
	GetIsGoerliEnabled() (result bool, err error)
	GetTokenGroupByCommunity() (result bool, err error)
	GetCollectibleGroupByCommunity() (result bool, err error)
	GetCollectibleGroupByCollection() (result bool, err error)
	GetTelemetryServerURL() (string, error)

	SetSettingsNotifier(n Notifier)
	SetSettingLastSynced(setting SettingField, clock uint64) error
	SetLastBackup(time uint64) error
	SetBackupFetched(fetched bool) error
	SetPinnedMailservers(mailservers map[string]string) error
	SetUseMailservers(value bool) error
	SetTokenGroupByCommunity(value bool) error
	SetPeerSyncingEnabled(value bool) error

	CreateSettings(s Settings, n params.NodeConfig) error
	SaveSetting(setting string, value interface{}) error
	SaveSettingField(sf SettingField, value interface{}) error
	DeleteMnemonic() error
	SaveSyncSetting(setting SettingField, value interface{}, clock uint64) error
	CanUseMailservers() (result bool, err error)
	CanSyncOnMobileNetwork() (result bool, err error)
	ShouldBroadcastUserStatus() (result bool, err error)
	BackupEnabled() (result bool, err error)
	AutoMessageEnabled() (result bool, err error)
	LastBackup() (result uint64, err error)
	BackupFetched() (result bool, err error)
	ENSName() (string, error)
	DeviceName() (string, error)
	DisplayName() (string, error)
	Bio() (string, error)
	Mnemonic() (string, error)
	MnemonicRemoved() (result bool, err error)
	GifAPIKey() (string, error)
	MutualContactEnabled() (result bool, err error)
	GifRecents() (recents json.RawMessage, err error)
	GifFavorites() (favorites json.RawMessage, err error)
	ProfileMigrationNeeded() (result bool, err error)
	URLUnfurlingMode() (result int64, err error)
	SubscribeToChanges() chan *SyncSettingField
	MnemonicWasShown() error
	GetPeerSyncingEnabled() (result bool, err error)
}

type Notifier added in v0.170.0

type Notifier func(SettingField, interface{})

type ProfilePicturesShowToType

type ProfilePicturesShowToType int
const (
	ProfilePicturesShowToContactsOnly ProfilePicturesShowToType = iota + 1
	ProfilePicturesShowToEveryone
	ProfilePicturesShowToNone
)

type ProfilePicturesVisibilityType

type ProfilePicturesVisibilityType int
const (
	ProfilePicturesVisibilityContactsOnly ProfilePicturesVisibilityType = iota + 1
	ProfilePicturesVisibilityEveryone
	ProfilePicturesVisibilityNone
)

type SettingField

type SettingField struct {
	// contains filtered or unexported fields
}

SettingField represents an individual setting in the database, it contains context dependant names and optional pre-store value parsing, along with optional *SyncProtobufFactory

func GetFieldFromProtobufType

func GetFieldFromProtobufType(pbt protobuf.SyncSetting_Type) (SettingField, error)

func (SettingField) CanSync

func (s SettingField) CanSync(source SyncSource) bool

CanSync checks if a SettingField has functions supporting the syncing of

func (SettingField) Equals added in v0.170.0

func (s SettingField) Equals(other SettingField) bool

func (SettingField) GetDBName

func (s SettingField) GetDBName() string

func (SettingField) GetReactName

func (s SettingField) GetReactName() string

func (SettingField) SyncProtobufFactory

func (s SettingField) SyncProtobufFactory() *SyncProtobufFactory

func (SettingField) ValueCastHandler added in v0.175.3

func (s SettingField) ValueCastHandler() ValueCastHandler

func (SettingField) ValueHandler

func (s SettingField) ValueHandler() ValueHandler

type Settings

type Settings struct {
	// required
	Address                   types.Address    `json:"address"`
	AnonMetricsShouldSend     bool             `json:"anon-metrics/should-send?,omitempty"`
	ChaosMode                 bool             `json:"chaos-mode?,omitempty"`
	Currency                  string           `json:"currency,omitempty"`
	CurrentNetwork            string           `json:"networks/current-network"`
	CustomBootnodes           *json.RawMessage `json:"custom-bootnodes,omitempty"`
	CustomBootnodesEnabled    *json.RawMessage `json:"custom-bootnodes-enabled?,omitempty"`
	DappsAddress              types.Address    `json:"dapps-address"`
	DeviceName                string           `json:"device-name"`
	DisplayName               string           `json:"display-name"`
	Bio                       string           `json:"bio,omitempty"`
	EIP1581Address            types.Address    `json:"eip1581-address"`
	Fleet                     *string          `json:"fleet,omitempty"`
	HideHomeTooltip           bool             `json:"hide-home-tooltip?,omitempty"`
	InstallationID            string           `json:"installation-id"`
	KeyUID                    string           `json:"key-uid"`
	KeycardInstanceUID        string           `json:"keycard-instance-uid,omitempty"`
	KeycardPairedOn           int64            `json:"keycard-paired-on,omitempty"`
	KeycardPairing            string           `json:"keycard-pairing,omitempty"`
	LastUpdated               *int64           `json:"last-updated,omitempty"`
	LatestDerivedPath         uint             `json:"latest-derived-path"`
	LinkPreviewRequestEnabled bool             `json:"link-preview-request-enabled,omitempty"`
	LinkPreviewsEnabledSites  *json.RawMessage `json:"link-previews-enabled-sites,omitempty"`
	LogLevel                  *string          `json:"log-level,omitempty"`
	MessagesFromContactsOnly  bool             `json:"messages-from-contacts-only"`
	Mnemonic                  *string          `json:"mnemonic,omitempty"`
	// NOTE(rasom): negation here because it safer/simpler to have false by default
	MnemonicWasNotShown      bool             `json:"mnemonic-was-not-shown?,omitempty"`
	MnemonicRemoved          bool             `json:"mnemonic-removed?,omitempty"`
	OmitTransfersHistoryScan bool             `json:"omit-transfers-history-scan?,omitempty"`
	MutualContactEnabled     bool             `json:"mutual-contact-enabled?"`
	Name                     string           `json:"name,omitempty"`
	Networks                 *json.RawMessage `json:"networks/networks"`
	// NotificationsEnabled indicates whether local notifications should be enabled (android only)
	NotificationsEnabled bool             `json:"notifications-enabled?,omitempty"`
	PhotoPath            string           `json:"photo-path"`
	PinnedMailserver     *json.RawMessage `json:"pinned-mailservers,omitempty"`
	// PreferredName represents the user's preferred Ethereum Name Service (ENS) name.
	// If a user has multiple ENS names, they can select one as the PreferredName.
	// When PreferredName is set, it takes precedence over the DisplayName for displaying the user's name.
	// If PreferredName is empty or doesn't match any of the user's ENS names, the DisplayName is used instead.
	//
	// There is a race condition between updating DisplayName and PreferredName, where the account.Name field
	// could be incorrectly updated based on the order in which the backup messages (BackedUpProfile/BackedUpSettings) arrive.
	// To handle this race condition, the code checks the LastSynced clock value for both DisplayName and PreferredName,
	// and updates account.Name with the value that has the latest clock
	PreferredName  *string `json:"preferred-name,omitempty"`
	PreviewPrivacy bool    `json:"preview-privacy?"`
	PublicKey      string  `json:"public-key"`
	// PushNotificationsServerEnabled indicates whether we should be running a push notification server
	PushNotificationsServerEnabled bool `json:"push-notifications-server-enabled?,omitempty"`
	// PushNotificationsFromContactsOnly indicates whether we should only receive push notifications from contacts
	PushNotificationsFromContactsOnly bool `json:"push-notifications-from-contacts-only?,omitempty"`
	// PushNotificationsBlockMentions indicates whether we should receive notifications for mentions
	PushNotificationsBlockMentions bool `json:"push-notifications-block-mentions?,omitempty"`
	RememberSyncingChoice          bool `json:"remember-syncing-choice?,omitempty"`
	// RemotePushNotificationsEnabled indicates whether we should be using remote notifications (ios only for now)
	RemotePushNotificationsEnabled bool             `json:"remote-push-notifications-enabled?,omitempty"`
	SigningPhrase                  string           `json:"signing-phrase"`
	StickerPacksInstalled          *json.RawMessage `json:"stickers/packs-installed,omitempty"`
	StickerPacksPending            *json.RawMessage `json:"stickers/packs-pending,omitempty"`
	StickersRecentStickers         *json.RawMessage `json:"stickers/recent-stickers,omitempty"`
	SyncingOnMobileNetwork         bool             `json:"syncing-on-mobile-network?,omitempty"`
	// DefaultSyncPeriod is how far back in seconds we should pull messages from a mailserver
	DefaultSyncPeriod uint `json:"default-sync-period"`
	// SendPushNotifications indicates whether we should send push notifications for other clients
	SendPushNotifications bool `json:"send-push-notifications?,omitempty"`
	Appearance            uint `json:"appearance"`
	// ProfilePicturesShowTo indicates to whom the user shows their profile picture to (contacts, everyone)
	ProfilePicturesShowTo ProfilePicturesShowToType `json:"profile-pictures-show-to"`
	// ProfilePicturesVisibility indicates who we want to see profile pictures of (contacts, everyone or none)
	ProfilePicturesVisibility           ProfilePicturesVisibilityType `json:"profile-pictures-visibility"`
	UseMailservers                      bool                          `json:"use-mailservers?"`
	Usernames                           *json.RawMessage              `json:"usernames,omitempty"`
	WalletRootAddress                   types.Address                 `json:"wallet-root-address,omitempty"`
	WalletSetUpPassed                   bool                          `json:"wallet-set-up-passed?,omitempty"`
	WalletVisibleTokens                 *json.RawMessage              `json:"wallet/visible-tokens,omitempty"`
	WakuBloomFilterMode                 bool                          `json:"waku-bloom-filter-mode,omitempty"`
	WebViewAllowPermissionRequests      bool                          `json:"webview-allow-permission-requests?,omitempty"`
	SendStatusUpdates                   bool                          `json:"send-status-updates?,omitempty"`
	CurrentUserStatus                   *json.RawMessage              `json:"current-user-status"`
	GifRecents                          *json.RawMessage              `json:"gifs/recent-gifs"`
	GifFavorites                        *json.RawMessage              `json:"gifs/favorite-gifs"`
	OpenseaEnabled                      bool                          `json:"opensea-enabled?,omitempty"`
	TelemetryServerURL                  string                        `json:"telemetry-server-url,omitempty"`
	LastBackup                          uint64                        `json:"last-backup,omitempty"`
	BackupEnabled                       bool                          `json:"backup-enabled?,omitempty"`
	AutoMessageEnabled                  bool                          `json:"auto-message-enabled?,omitempty"`
	GifAPIKey                           string                        `json:"gifs/api-key"`
	TestNetworksEnabled                 bool                          `json:"test-networks-enabled?,omitempty"`
	ProfileMigrationNeeded              bool                          `json:"profile-migration-needed,omitempty"`
	IsGoerliEnabled                     bool                          `json:"is-goerli-enabled?,omitempty"`
	TokenGroupByCommunity               bool                          `json:"token-group-by-community?,omitempty"`
	ShowCommunityAssetWhenSendingTokens bool                          `json:"show-community-asset-when-sending-tokens?,omitempty"`
	DisplayAssetsBelowBalance           bool                          `json:"display-assets-below-balance?,omitempty"`
	DisplayAssetsBelowBalanceThreshold  int64                         `json:"display-assets-below-balance-threshold,omitempty"`
	CollectibleGroupByCollection        bool                          `json:"collectible-group-by-collection?,omitempty"`
	CollectibleGroupByCommunity         bool                          `json:"collectible-group-by-community?,omitempty"`
	URLUnfurlingMode                    URLUnfurlingModeType          `json:"url-unfurling-mode,omitempty"`
	PeerSyncingEnabled                  bool                          `json:"peer-syncing-enabled?,omitempty"`
}

Settings represents the entire setting row stored in the application db

func (Settings) GetFleet added in v0.175.3

func (s Settings) GetFleet() string

func (Settings) IsEmpty added in v0.142.9

func (s Settings) IsEmpty() bool

func (Settings) MarshalJSON added in v0.125.4

func (s Settings) MarshalJSON() ([]byte, error)

type SyncProtobufFactory

type SyncProtobufFactory struct {
	// contains filtered or unexported fields
}

SyncProtobufFactory represents a collection of functionality to generate and parse *protobuf.SyncSetting

func (*SyncProtobufFactory) ExtractValueFromProtobuf

func (spf *SyncProtobufFactory) ExtractValueFromProtobuf() SyncSettingProtobufToValue

func (*SyncProtobufFactory) FromInterface

func (*SyncProtobufFactory) FromStruct

func (*SyncProtobufFactory) Inactive

func (spf *SyncProtobufFactory) Inactive() bool

func (*SyncProtobufFactory) SyncSettingProtobufType

func (spf *SyncProtobufFactory) SyncSettingProtobufType() protobuf.SyncSetting_Type

type SyncSettingField

type SyncSettingField struct {
	SettingField
	Value interface{}
}

SyncSettingField represents a binding between a Value and a SettingField

func (SyncSettingField) MarshalJSON

func (s SyncSettingField) MarshalJSON() ([]byte, error)

type SyncSettingProtobufFactoryInterface

type SyncSettingProtobufFactoryInterface func(interface{}, uint64, string) (*common.RawMessage, *protobuf.SyncSetting, error)

type SyncSettingProtobufFactoryStruct

type SyncSettingProtobufFactoryStruct func(Settings, uint64, string) (*common.RawMessage, *protobuf.SyncSetting, error)

type SyncSettingProtobufToValue

type SyncSettingProtobufToValue func(setting *protobuf.SyncSetting) interface{}

type SyncSource

type SyncSource int
const (
	FromInterface SyncSource = iota + 1
	FromStruct
)

type URLUnfurlingModeType added in v0.171.1

type URLUnfurlingModeType int
const (
	URLUnfurlingAlwaysAsk URLUnfurlingModeType = iota + 1
	URLUnfurlingEnableAll
	URLUnfurlingDisableAll
)

type ValueCastHandler added in v0.175.3

type ValueCastHandler func(interface{}) (interface{}, error)

type ValueHandler

type ValueHandler func(interface{}) (interface{}, error)

Directories

Path Synopsis
URLUnfurlingMode mocks base method.
URLUnfurlingMode mocks base method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL