Documentation ¶
Index ¶
- Variables
- type WalletExtension
- func (w *WalletExtension) AddAddressToUser(hexUserID string, message 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) IsStopping() bool
- func (w *WalletExtension) Logger() gethlog.Logger
- func (w *WalletExtension) ProxyEthRequest(request *accountmanager.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 ¶
var ErrSubscribeFailHTTP = fmt.Sprintf("received an %s request but the connection does not support subscriptions", rpc.Subscribe)
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 ¶ added in v0.14.0
func New( hostAddr string, userAccountManager *useraccountmanager.UserAccountManager, storage storage.Storage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, ) *WalletExtension
func (*WalletExtension) AddAddressToUser ¶ added in v0.14.0
func (w *WalletExtension) AddAddressToUser(hexUserID string, message string, signature []byte) error
AddAddressToUser checks if message is in correct format and if signature is valid. If all checks pass we save address and signature against userID
func (*WalletExtension) DeleteUser ¶ added in v0.14.0
func (w *WalletExtension) DeleteUser(hexUserID string) error
DeleteUser deletes user and accounts associated with user from the database for given userID
func (*WalletExtension) GenerateAndStoreNewUser ¶ added in v0.14.0
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 ¶ added in v0.14.0
func (w *WalletExtension) GenerateViewingKey(addr gethcommon.Address) (string, error)
GenerateViewingKey generates the user viewing key and waits for signature
func (*WalletExtension) IsStopping ¶ added in v0.14.0
func (w *WalletExtension) IsStopping() bool
IsStopping returns whether the WE is stopping
func (*WalletExtension) Logger ¶ added in v0.14.0
func (w *WalletExtension) Logger() gethlog.Logger
Logger returns the WE set logger
func (*WalletExtension) ProxyEthRequest ¶ added in v0.14.0
func (w *WalletExtension) ProxyEthRequest(request *accountmanager.RPCRequest, conn userconn.UserConn, hexUserID string) (map[string]interface{}, error)
ProxyEthRequest proxys an incoming user request to the enclave
func (*WalletExtension) SubmitViewingKey ¶ added in v0.14.0
func (w *WalletExtension) SubmitViewingKey(address gethcommon.Address, signature []byte) error
SubmitViewingKey checks the signed viewing key and stores it
func (*WalletExtension) UserExists ¶ added in v0.18.0
func (w *WalletExtension) UserExists(hexUserID string) bool
func (*WalletExtension) UserHasAccount ¶ added in v0.14.0
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 ¶ added in v0.18.0
func (w *WalletExtension) Version() string