accounts

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountTypeWatch = "watch"
)
View Source
const (
	// NodeConfigTag tag for a node configuration.
	NodeConfigTag = "node_config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address     types.Address
	Wallet      bool
	Chat        bool
	Type        string
	Storage     string
	Path        string
	PublicKey   types.HexBytes
	Name        string
	Emoji       string
	Color       string
	Hidden      bool
	DerivedFrom string
	Clock       uint64
	Removed     bool
}

func (*Account) IsOwnAccount added in v0.64.6

func (a *Account) IsOwnAccount() bool

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

func (*Account) MarshalJSON added in v0.100.0

func (a *Account) MarshalJSON() ([]byte, error)

type Database

type Database struct {
	*settings.Database
	*notificationssettings.NotificationsSettings
	// contains filtered or unexported fields
}

Database sql wrapper for operations with browser objects.

func NewDB

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

NewDB returns a new instance of *Database

func (*Database) AddressExists

func (db *Database) AddressExists(address types.Address) (exists bool, err error)

AddressExists returns true if given address is stored in database.

func (Database) Close

func (db Database) Close() error

Close closes database.

func (Database) DB added in v0.93.2

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

DB Gets db sql.DB

func (*Database) DeleteAccount added in v0.38.1

func (db *Database) DeleteAccount(address types.Address) error

func (*Database) DeleteAccountAndPublish added in v0.100.0

func (db *Database) DeleteAccountAndPublish(address types.Address) error

func (*Database) DeleteSeedAndKeyAccounts added in v0.83.0

func (db *Database) DeleteSeedAndKeyAccounts() error

func (*Database) GetAccountByAddress added in v0.62.16

func (db *Database) GetAccountByAddress(address types.Address) (rst *Account, err error)

func (*Database) GetAccounts

func (db *Database) GetAccounts() ([]*Account, error)

func (*Database) GetAddresses

func (db *Database) GetAddresses() (rst []types.Address, err error)

func (*Database) GetChatAddress

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

func (*Database) GetNodeConfig added in v0.38.4

func (db *Database) GetNodeConfig() (*params.NodeConfig, error)

func (*Database) GetWalletAddress

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

func (*Database) GetWalletAddresses added in v0.40.0

func (db *Database) GetWalletAddresses() (rst []types.Address, err error)

func (*Database) SaveAccounts

func (db *Database) SaveAccounts(accounts []*Account) (err error)

func (*Database) SaveAccountsAndPublish added in v0.100.0

func (db *Database) SaveAccountsAndPublish(accounts []*Account) (err error)

func (*Database) SubscribeToAccountChanges added in v0.100.0

func (db *Database) SubscribeToAccountChanges() chan []*Account

Jump to

Keyboard shortcuts

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