accounts

package
v0.94.8 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MPL-2.0 Imports: 16 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(manager *account.GethManager, config *params.NodeConfig, db *accounts.Database, feed *event.Feed) *API

func (*API) AddAccountWatch added in v0.93.3

func (api *API) AddAccountWatch(ctx context.Context, address string, name string, color string) error

func (*API) AddAccountWithMnemonic added in v0.93.3

func (api *API) AddAccountWithMnemonic(
	ctx context.Context,
	mnemonic string,
	password string,
	name string,
	color string,
) error

func (*API) AddAccountWithPrivateKey added in v0.93.3

func (api *API) AddAccountWithPrivateKey(
	ctx context.Context,
	privateKey string,
	password string,
	name string,
	color string,
) error

func (*API) DeleteAccount added in v0.38.1

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

func (*API) GenerateAccount added in v0.93.3

func (api *API) GenerateAccount(
	ctx context.Context,
	password string,
	name string,
	color string,
) 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) *MultiAccountsAPI

func (*MultiAccountsAPI) DeleteIdentityImage added in v0.65.0

func (api *MultiAccountsAPI) DeleteIdentityImage(keyUID string) error

DeleteIdentityImage deletes an IdentityImage from the db with the given name

func (*MultiAccountsAPI) GetIdentityImage added in v0.65.0

func (api *MultiAccountsAPI) GetIdentityImage(keyUID, name string) (*images.IdentityImage, error)

GetIdentityImage returns a json object representing the image with the given name

func (*MultiAccountsAPI) GetIdentityImages added in v0.65.0

func (api *MultiAccountsAPI) GetIdentityImages(keyUID string) ([]*images.IdentityImage, error)

GetIdentityImages returns an array of json marshalled IdentityImages assigned to the user's identity

func (*MultiAccountsAPI) StoreIdentityImage added in v0.65.0

func (api *MultiAccountsAPI) StoreIdentityImage(keyUID, filepath string, aX, aY, bX, bY int) ([]*images.IdentityImage, error)

StoreIdentityImage takes the filepath of an image, crops it as per the rect coords and finally resizes the image. The resulting image(s) will be stored in the DB along with other user account information. aX and aY represent the pixel coordinates of the upper left corner of the image's cropping area bX and bY represent the pixel coordinates of the lower right corner of the image's cropping area

func (*MultiAccountsAPI) StoreIdentityImageFromURL added in v0.87.2

func (api *MultiAccountsAPI) StoreIdentityImageFromURL(keyUID, url string) ([]*images.IdentityImage, error)

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.GethManager, config *params.NodeConfig, 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() 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) NodeConfig added in v0.93.2

func (api *SettingsAPI) NodeConfig(ctx context.Context) (*params.NodeConfig, error)

func (*SettingsAPI) SaveNodeConfig

func (api *SettingsAPI) SaveNodeConfig(ctx context.Context, n *params.NodeConfig) 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