accounts

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

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")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Address   common.Address `json:"address"`
	Wallet    bool           `json:"wallet"`
	Chat      bool           `json:"chat"`
	Type      string         `json:"type"`
	Storage   string         `json:"storage"`
	Path      string         `json:"path"`
	PublicKey hexutil.Bytes  `json:"publicKey"`
	Name      string         `json:"name"`
	Color     string         `json:"color"`
}

type Database

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

Database sql wrapper for operations with browser objects.

func NewDB

func NewDB(db *sql.DB) *Database

func (*Database) AddressExists

func (db *Database) AddressExists(address common.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) GetAccounts

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

func (*Database) GetAddresses

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

func (*Database) GetChatAddress

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

func (*Database) GetConfig

func (db *Database) GetConfig(typ string, value interface{}) error

func (*Database) GetConfigBlob

func (db *Database) GetConfigBlob(typ string) (rst json.RawMessage, err error)

func (*Database) GetConfigBlobs

func (db *Database) GetConfigBlobs(types []string) (map[string]json.RawMessage, error)

func (*Database) GetWalletAddress

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

func (*Database) SaveAccounts

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

func (*Database) SaveConfig

func (db *Database) SaveConfig(typ string, value interface{}) error

Jump to

Keyboard shortcuts

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