Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type Database
- func (db *Database) AddressExists(address types.Address) (exists bool, err error)
- func (db *Database) AutoMessageEnabled() (bool, error)
- func (db *Database) BackupEnabled() (bool, error)
- func (db *Database) BackupFetched() (bool, error)
- func (db *Database) CanSyncOnMobileNetwork() (bool, error)
- func (db *Database) CanUseMailservers() (bool, error)
- func (db Database) Close() error
- func (db *Database) CreateSettings(s Settings, nodecfg params.NodeConfig) error
- func (db *Database) DeleteAccount(address types.Address) error
- func (db *Database) DeleteSeedAndKeyAccounts() error
- func (db *Database) ENSName() (string, error)
- func (db *Database) GetAccountByAddress(address types.Address) (rst *Account, err error)
- func (db *Database) GetAccounts() ([]Account, error)
- func (db *Database) GetAddresses() (rst []types.Address, err error)
- func (db *Database) GetChatAddress() (rst types.Address, err error)
- func (db *Database) GetCurrentStatus(status interface{}) error
- func (db *Database) GetDefaultSyncPeriod() (uint32, error)
- func (db *Database) GetMessagesFromContactsOnly() (bool, error)
- func (db *Database) GetNodeConfig(nodecfg interface{}) error
- func (db *Database) GetNotificationsEnabled() (bool, error)
- func (db *Database) GetProfilePicturesVisibility() (int, error)
- func (db *Database) GetSettings() (Settings, error)
- func (db *Database) GetWalletAddress() (rst types.Address, err error)
- func (db *Database) GetWalletAddresses() (rst []types.Address, err error)
- func (db *Database) LastBackup() (uint64, error)
- func (db *Database) SaveAccounts(accounts []Account) (err error)
- func (db *Database) SaveSetting(setting string, value interface{}) error
- func (db *Database) SetBackupFetched(fetched bool) error
- func (db *Database) SetLastBackup(time uint64) error
- func (db *Database) ShouldBroadcastUserStatus() (bool, error)
- type ProfilePicturesShowToType
- type ProfilePicturesVisibilityType
- type Settings
Constants ¶
View Source
const (
// NodeConfigTag tag for a node configuration.
NodeConfigTag = "node_config"
)
Variables ¶
View Source
var ( // ErrWalletNotUnique returned if another account has `wallet` field set to true. ErrWalletNotUnique = errors.New("another account is set to be default wallet. disable it before using new") // ErrChatNotUnique returned if another account has `chat` field set to true. ErrChatNotUnique = errors.New("another account is set to be default chat. disable it before using new") // ErrInvalidConfig returned if config isn't allowed ErrInvalidConfig = errors.New("configuration value not allowed") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Address types.Address `json:"address"` Wallet bool `json:"wallet"` Chat bool `json:"chat"` Type string `json:"type,omitempty"` Storage string `json:"storage,omitempty"` Path string `json:"path,omitempty"` PublicKey types.HexBytes `json:"public-key,omitempty"` Name string `json:"name"` Color string `json:"color"` Hidden bool `json:"hidden"` }
func (*Account) IsOwnAccount ¶ added in v0.64.6
IsOwnAccount returns true if this is an account we have the private key for NOTE: Wallet flag can't be used as it actually indicates that it's the default Wallet
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database sql wrapper for operations with browser objects.
func (*Database) AddressExists ¶
AddressExists returns true if given address is stored in database.
func (*Database) AutoMessageEnabled ¶ added in v0.91.12
func (*Database) BackupEnabled ¶ added in v0.90.0
func (*Database) BackupFetched ¶ added in v0.90.0
func (*Database) CanSyncOnMobileNetwork ¶ added in v0.79.0
func (*Database) CanUseMailservers ¶ added in v0.79.0
func (*Database) CreateSettings ¶ added in v0.38.4
func (db *Database) CreateSettings(s Settings, nodecfg params.NodeConfig) error
TODO remove photoPath from settings
func (*Database) DeleteAccount ¶ added in v0.38.1
func (*Database) DeleteSeedAndKeyAccounts ¶ added in v0.83.0
func (*Database) GetAccountByAddress ¶ added in v0.62.16
func (*Database) GetAccounts ¶
func (*Database) GetChatAddress ¶
func (*Database) GetCurrentStatus ¶ added in v0.83.2
func (*Database) GetDefaultSyncPeriod ¶ added in v0.79.7
func (*Database) GetMessagesFromContactsOnly ¶ added in v0.76.0
func (*Database) GetNodeConfig ¶ added in v0.38.4
func (*Database) GetNotificationsEnabled ¶ added in v0.74.2
func (*Database) GetProfilePicturesVisibility ¶ added in v0.89.9
func (*Database) GetSettings ¶ added in v0.38.4
func (*Database) GetWalletAddress ¶
func (*Database) GetWalletAddresses ¶ added in v0.40.0
func (*Database) LastBackup ¶ added in v0.90.0
func (*Database) SaveAccounts ¶
func (*Database) SaveSetting ¶ added in v0.38.4
func (*Database) SetBackupFetched ¶ added in v0.90.0
func (*Database) SetLastBackup ¶ added in v0.90.0
func (*Database) ShouldBroadcastUserStatus ¶ added in v0.83.2
type ProfilePicturesShowToType ¶ added in v0.89.2
type ProfilePicturesShowToType int
const ( ProfilePicturesShowToContactsOnly ProfilePicturesShowToType = iota + 1 ProfilePicturesShowToEveryone ProfilePicturesShowToNone )
type ProfilePicturesVisibilityType ¶ added in v0.89.2
type ProfilePicturesVisibilityType int
const ( ProfilePicturesVisibilityContactsOnly ProfilePicturesVisibilityType = iota + 1 ProfilePicturesVisibilityEveryone ProfilePicturesVisibilityNone )
type Settings ¶ added in v0.38.4
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"` 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"` 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 *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"` }
Click to show internal directories.
Click to hide internal directories.