Documentation ¶
Index ¶
- type WalletExtension
- func (w *WalletExtension) AddAddressToUser(hexUserID string, address string, signature []byte) error
- func (w *WalletExtension) DeleteUser(hexUserID string) error
- func (w *WalletExtension) GenerateAndStoreNewUser() (string, error)
- func (w *WalletExtension) GenerateViewingKey(addr gethcommon.Address) (string, error)
- func (w *WalletExtension) GetTenNodeHealthStatus() (bool, error)
- func (w *WalletExtension) IsStopping() bool
- func (w *WalletExtension) Logger() gethlog.Logger
- func (w *WalletExtension) ProxyEthRequest(request *common.RPCRequest, conn userconn.UserConn, hexUserID string) (map[string]interface{}, error)
- func (w *WalletExtension) SubmitViewingKey(address gethcommon.Address, signature []byte) error
- func (w *WalletExtension) UserExists(hexUserID string) bool
- func (w *WalletExtension) UserHasAccount(hexUserID string, address string) (bool, error)
- func (w *WalletExtension) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WalletExtension ¶
type WalletExtension struct {
// contains filtered or unexported fields
}
WalletExtension handles the management of viewing keys and the forwarding of Ethereum JSON-RPC requests.
func New ¶
func New( hostAddrHTTP string, hostAddrWS string, userAccountManager *useraccountmanager.UserAccountManager, storage storage.Storage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, config *config.Config, ) *WalletExtension
func (*WalletExtension) AddAddressToUser ¶
func (w *WalletExtension) AddAddressToUser(hexUserID string, address string, signature []byte) error
AddAddressToUser checks if a message is in correct format and if signature is valid. If all checks pass we save address and signature against userID
func (*WalletExtension) DeleteUser ¶
func (w *WalletExtension) DeleteUser(hexUserID string) error
DeleteUser deletes user and accounts associated with user from the database for given userID
func (*WalletExtension) GenerateAndStoreNewUser ¶
func (w *WalletExtension) GenerateAndStoreNewUser() (string, error)
GenerateAndStoreNewUser generates new key-pair and userID, stores it in the database and returns hex encoded userID and error
func (*WalletExtension) GenerateViewingKey ¶
func (w *WalletExtension) GenerateViewingKey(addr gethcommon.Address) (string, error)
GenerateViewingKey generates the user viewing key and waits for signature
func (*WalletExtension) GetTenNodeHealthStatus ¶ added in v0.21.0
func (w *WalletExtension) GetTenNodeHealthStatus() (bool, error)
func (*WalletExtension) IsStopping ¶
func (w *WalletExtension) IsStopping() bool
IsStopping returns whether the WE is stopping
func (*WalletExtension) Logger ¶
func (w *WalletExtension) Logger() gethlog.Logger
Logger returns the WE set logger
func (*WalletExtension) ProxyEthRequest ¶
func (w *WalletExtension) ProxyEthRequest(request *common.RPCRequest, conn userconn.UserConn, hexUserID string) (map[string]interface{}, error)
ProxyEthRequest proxys an incoming user request to the enclave
func (*WalletExtension) SubmitViewingKey ¶
func (w *WalletExtension) SubmitViewingKey(address gethcommon.Address, signature []byte) error
SubmitViewingKey checks the signed viewing key and stores it
func (*WalletExtension) UserExists ¶
func (w *WalletExtension) UserExists(hexUserID string) bool
func (*WalletExtension) UserHasAccount ¶
func (w *WalletExtension) UserHasAccount(hexUserID string, address string) (bool, error)
UserHasAccount checks if provided account exist in the database for given userID
func (*WalletExtension) Version ¶
func (w *WalletExtension) Version() string