Documentation
¶
Index ¶
- Variables
- func HashMessage(message string) ([]byte, error)
- func RunAsync(f func() error) <-chan error
- type StatusBackend
- func (b *StatusBackend) AccountManager() *account.Manager
- func (b *StatusBackend) AppStateChange(state string)
- func (b *StatusBackend) CallPrivateRPC(inputJSON string) (string, error)
- func (b *StatusBackend) CallRPC(inputJSON string) (string, error)
- func (b *StatusBackend) ConnectionChange(typ string, expensive bool)
- func (b *StatusBackend) CreateContactCode() (string, error)
- func (b *StatusBackend) DisableInstallation(installationID string) error
- func (b *StatusBackend) EnableInstallation(installationID string) error
- func (b *StatusBackend) ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
- func (b *StatusBackend) ExtractIdentityFromContactCode(contactCode string) (string, error)
- func (b *StatusBackend) GetContactCode(identity string) (string, error)
- func (b *StatusBackend) GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)
- func (b *StatusBackend) HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, gethcommon.Hash, error)
- func (b *StatusBackend) HashTypedData(typed typeddata.TypedData) (common.Hash, error)
- func (b *StatusBackend) InjectChatAccount(chatKeyHex, encryptionKeyHex string) error
- func (b *StatusBackend) IsNodeRunning() bool
- func (b *StatusBackend) LoadFilter(chat *filter.Chat) ([]*filter.Chat, error)
- func (b *StatusBackend) LoadFilters(chats []*filter.Chat) ([]*filter.Chat, error)
- func (b *StatusBackend) Logout() error
- func (b *StatusBackend) ProcessContactCode(contactCode string) error
- func (b *StatusBackend) Recover(rpcParams personal.RecoverParams) (gethcommon.Address, error)
- func (b *StatusBackend) RemoveFilter(chat *filter.Chat) error
- func (b *StatusBackend) ResetChainData() error
- func (b *StatusBackend) RestartNode() error
- func (b *StatusBackend) SelectAccount(walletAddress, chatAddress, password string) error
- func (b *StatusBackend) SendDataNotification(dataPayloadJSON string, tokens ...string) error
- func (b *StatusBackend) SendTransaction(sendArgs transactions.SendTxArgs, password string) (hash gethcommon.Hash, err error)
- func (b *StatusBackend) SendTransactionWithSignature(sendArgs transactions.SendTxArgs, sig []byte) (hash gethcommon.Hash, err error)
- func (b *StatusBackend) SignGroupMembership(content string) (string, error)
- func (b *StatusBackend) SignHash(hexEncodedHash string) (string, error)
- func (b *StatusBackend) SignMessage(rpcParams personal.SignParams) (hexutil.Bytes, error)
- func (b *StatusBackend) SignTypedData(typed typeddata.TypedData, password string) (hexutil.Bytes, error)
- func (b *StatusBackend) StartNode(config *params.NodeConfig) error
- func (b *StatusBackend) StatusNode() *node.StatusNode
- func (b *StatusBackend) StopNode() error
- func (b *StatusBackend) Transactor() *transactions.Transactor
- func (b *StatusBackend) UpdateMailservers(enodes []string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWhisperClearIdentitiesFailure clearing whisper identities has failed. ErrWhisperClearIdentitiesFailure = errors.New("failed to clear whisper identities") // ErrWhisperIdentityInjectionFailure injecting whisper identities has failed. ErrWhisperIdentityInjectionFailure = errors.New("failed to inject identity into Whisper") // ErrUnsupportedRPCMethod is for methods not supported by the RPC interface ErrUnsupportedRPCMethod = errors.New("method is unsupported by RPC interface") // This is a normal situation when a node is stopped. ErrRPCClientUnavailable = errors.New("JSON-RPC client is unavailable") )
Functions ¶
func HashMessage ¶
HashMessage calculates the hash of a message to be safely signed by the keycard The hash is calulcated as
keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
This gives context to the signed message and prevents signing of transactions.
Types ¶
type StatusBackend ¶
type StatusBackend struct {
// contains filtered or unexported fields
}
StatusBackend implements Status.im service
func NewStatusBackend ¶
func NewStatusBackend() *StatusBackend
NewStatusBackend create a new NewStatusBackend instance
func (*StatusBackend) AccountManager ¶
func (b *StatusBackend) AccountManager() *account.Manager
AccountManager returns reference to account manager
func (*StatusBackend) AppStateChange ¶
func (b *StatusBackend) AppStateChange(state string)
AppStateChange handles app state changes (background/foreground). state values: see https://facebook.github.io/react-native/docs/appstate.html
func (*StatusBackend) CallPrivateRPC ¶
func (b *StatusBackend) CallPrivateRPC(inputJSON string) (string, error)
CallPrivateRPC executes public and private RPC requests on node's in-proc RPC server.
func (*StatusBackend) CallRPC ¶
func (b *StatusBackend) CallRPC(inputJSON string) (string, error)
CallRPC executes public RPC requests on node's in-proc RPC server.
func (*StatusBackend) ConnectionChange ¶
func (b *StatusBackend) ConnectionChange(typ string, expensive bool)
ConnectionChange handles network state changes logic.
func (*StatusBackend) CreateContactCode ¶ added in v0.15.1
func (b *StatusBackend) CreateContactCode() (string, error)
CreateContactCode create or return the latest contact code
func (*StatusBackend) DisableInstallation ¶
func (b *StatusBackend) DisableInstallation(installationID string) error
DisableInstallation disables an installation for multi-device sync.
func (*StatusBackend) EnableInstallation ¶
func (b *StatusBackend) EnableInstallation(installationID string) error
EnableInstallation enables an installation for multi-device sync.
func (*StatusBackend) ExtractGroupMembershipSignatures ¶ added in v0.16.3
func (b *StatusBackend) ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
ExtractGroupMembershipSignatures extract signatures from tuples of content/signature
func (*StatusBackend) ExtractIdentityFromContactCode ¶ added in v0.15.1
func (b *StatusBackend) ExtractIdentityFromContactCode(contactCode string) (string, error)
ExtractIdentityFromContactCode extract the identity of the user generating the contact code
func (*StatusBackend) GetContactCode ¶
func (b *StatusBackend) GetContactCode(identity string) (string, error)
GetContactCode return the latest contact code
func (*StatusBackend) GetNodesFromContract ¶
func (b *StatusBackend) GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)
GetNodesFromContract returns a list of nodes from the contract
func (*StatusBackend) HashTransaction ¶
func (b *StatusBackend) HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, gethcommon.Hash, error)
HashTransaction validate the transaction and returns new sendArgs and the transaction hash.
func (*StatusBackend) HashTypedData ¶
HashTypedData generates the hash of TypedData.
func (*StatusBackend) InjectChatAccount ¶
func (b *StatusBackend) InjectChatAccount(chatKeyHex, encryptionKeyHex string) error
InjectChatAccount selects the current chat account using chatKeyHex and injects the key into whisper.
func (*StatusBackend) IsNodeRunning ¶
func (b *StatusBackend) IsNodeRunning() bool
IsNodeRunning confirm that node is running
func (*StatusBackend) LoadFilter ¶
LoadFilter loads filter on sshext
func (*StatusBackend) LoadFilters ¶
LoadFilters loads filter on sshext
func (*StatusBackend) Logout ¶
func (b *StatusBackend) Logout() error
Logout clears whisper identities.
func (*StatusBackend) ProcessContactCode ¶ added in v0.15.1
func (b *StatusBackend) ProcessContactCode(contactCode string) error
ProcessContactCode process and adds the someone else's bundle
func (*StatusBackend) Recover ¶ added in v0.11.0
func (b *StatusBackend) Recover(rpcParams personal.RecoverParams) (gethcommon.Address, error)
Recover calls the personalAPI to return address associated with the private key that was used to calculate the signature in the message
func (*StatusBackend) RemoveFilter ¶
func (b *StatusBackend) RemoveFilter(chat *filter.Chat) error
RemoveFilter remove a filter
func (*StatusBackend) ResetChainData ¶
func (b *StatusBackend) ResetChainData() error
ResetChainData remove chain data from data directory. Node is stopped, and new node is started, with clean data directory.
func (*StatusBackend) RestartNode ¶
func (b *StatusBackend) RestartNode() error
RestartNode restart running Status node, fails if node is not running
func (*StatusBackend) SelectAccount ¶
func (b *StatusBackend) SelectAccount(walletAddress, chatAddress, password string) error
SelectAccount selects current wallet and chat accounts, by verifying that each address has corresponding account which can be decrypted using provided password. Once verification is done, the decrypted chat key is injected into Whisper (as a single identity, all previous identities are removed).
func (*StatusBackend) SendDataNotification ¶
func (b *StatusBackend) SendDataNotification(dataPayloadJSON string, tokens ...string) error
SendDataNotification sends data push notifications to users. dataPayloadJSON is a JSON string that looks like this:
{ "data": { "msg-v2": { "from": "0x2cea3bd5", // hash of sender (first 10 characters/4 bytes of sha3 hash) "to": "0xb1f89744", // hash of recipient (first 10 characters/4 bytes of sha3 hash) "id": "0x872653ad", // message ID hash (first 10 characters/4 bytes of sha3 hash) } } }
func (*StatusBackend) SendTransaction ¶
func (b *StatusBackend) SendTransaction(sendArgs transactions.SendTxArgs, password string) (hash gethcommon.Hash, err error)
SendTransaction creates a new transaction and waits until it's complete.
func (*StatusBackend) SendTransactionWithSignature ¶
func (b *StatusBackend) SendTransactionWithSignature(sendArgs transactions.SendTxArgs, sig []byte) (hash gethcommon.Hash, err error)
func (*StatusBackend) SignGroupMembership ¶ added in v0.15.1
func (b *StatusBackend) SignGroupMembership(content string) (string, error)
SignGroupMembership signs a piece of data containing membership information
func (*StatusBackend) SignHash ¶
func (b *StatusBackend) SignHash(hexEncodedHash string) (string, error)
SignHash exposes vanilla ECDSA signing for signing a message for Swarm
func (*StatusBackend) SignMessage ¶ added in v0.11.0
func (b *StatusBackend) SignMessage(rpcParams personal.SignParams) (hexutil.Bytes, error)
SignMessage checks the pwd vs the selected account and passes on the signParams to personalAPI for message signature
func (*StatusBackend) SignTypedData ¶
func (b *StatusBackend) SignTypedData(typed typeddata.TypedData, password string) (hexutil.Bytes, error)
SignTypedData accepts data and password. Gets verified account and signs typed data.
func (*StatusBackend) StartNode ¶
func (b *StatusBackend) StartNode(config *params.NodeConfig) error
StartNode start Status node, fails if node is already started
func (*StatusBackend) StatusNode ¶
func (b *StatusBackend) StatusNode() *node.StatusNode
StatusNode returns reference to node manager
func (*StatusBackend) StopNode ¶
func (b *StatusBackend) StopNode() error
StopNode stop Status node. Stopped node cannot be resumed.
func (*StatusBackend) Transactor ¶
func (b *StatusBackend) Transactor() *transactions.Transactor
Transactor returns reference to a status transactor
func (*StatusBackend) UpdateMailservers ¶
func (b *StatusBackend) UpdateMailservers(enodes []string) error
UpdateMailservers on ShhExtService.