accounts

package
v0.63.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

README

Settings service

Settings service provides private API for storing all configuration for a selected account.

To enable:

  1. Client must ensure that settings db is initialized in the api.Backend.
  2. Add settings to APIModules in config.

API

settings_saveConfig
Parameters
  • type: string - configuratin type. if not unique error is raised.
  • conf: bytes - raw json.
settings_getConfig
Parameters
  • type: string
Returns
  • conf raw json
settings_saveNodeConfig

Special case of the settings_saveConfig. In status-go we are using constant node-config as a type for node configuration. Application depends on this value and will try to load it when node is started. This method is provided in order to remove syncing mentioned constant between status-go and users.

Parameters
  • conf: params.NodeConfig

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUpdatingWrongAccount raised if caller tries to update any other account except one used for login.
	ErrUpdatingWrongAccount = errors.New("failed to update wrong account. Please login with that account first")
)

Functions

This section is empty.

Types

type API

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

API is class with methods available over RPC.

func NewAccountsAPI

func NewAccountsAPI(db *accounts.Database, feed *event.Feed) *API

func (*API) DeleteAccount added in v0.38.1

func (api *API) DeleteAccount(ctx context.Context, address types.Address) error

func (*API) GetAccounts

func (api *API) GetAccounts(ctx context.Context) ([]accounts.Account, error)

func (*API) SaveAccounts

func (api *API) SaveAccounts(ctx context.Context, accounts []accounts.Account) error

type MultiAccountsAPI

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

MultiAccountsAPI is class with methods available over RPC.

func NewMultiAccountsAPI

func NewMultiAccountsAPI(db *multiaccounts.Database, manager *account.Manager) *MultiAccountsAPI

func (*MultiAccountsAPI) UpdateAccount

func (api *MultiAccountsAPI) UpdateAccount(account multiaccounts.Account) error

type Service

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

Service is a browsers service.

func NewService

func NewService(db *accounts.Database, mdb *multiaccounts.Database, manager *account.Manager, feed *event.Feed) *Service

NewService initializes service instance.

func (*Service) APIs

func (s *Service) APIs() []rpc.API

APIs returns list of available RPC APIs.

func (*Service) Protocols

func (s *Service) Protocols() []p2p.Protocol

Protocols returns list of p2p protocols.

func (*Service) Start

func (s *Service) Start(*p2p.Server) error

Start a service.

func (*Service) Stop

func (s *Service) Stop() error

Stop a service.

type SettingsAPI

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

SettingsAPI is class with methods available over RPC.

func NewSettingsAPI

func NewSettingsAPI(db *accounts.Database) *SettingsAPI

func (*SettingsAPI) GetSettings added in v0.38.4

func (api *SettingsAPI) GetSettings(ctx context.Context) (accounts.Settings, error)

func (*SettingsAPI) SaveSetting added in v0.38.4

func (api *SettingsAPI) SaveSetting(ctx context.Context, typ string, val interface{}) error

Jump to

Keyboard shortcuts

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