Documentation ¶
Index ¶
- func AddPeer(enode string) string
- func AppStateChange(state string)
- func CallPrivateRPC(inputJSON string) string
- func CallRPC(inputJSON string) string
- func ChaosModeUpdate(on bool) string
- func ConnectionChange(typ string, expensive int)
- func CreateAccount(password string) string
- func CreateChildAccount(parentAddress, password string) string
- func DisableInstallation(installationID string) string
- func EnableInstallation(installationID string) string
- func ExportNodeLogs() string
- func ExtractGroupMembershipSignatures(signaturePairsStr string) string
- func GenerateConfig(datadir string, networkID int) string
- func GetNodesFromContract(rpcEndpoint string, contractAddress string) string
- func HashMessage(message string) string
- func HashTransaction(txArgsJSON string) string
- func HashTypedData(data string) string
- func Login(address, password string) string
- func LoginWithKeycard(chatKeyData, encryptionKeyData string) string
- func Logout() string
- func ParseJSONArray(items string) ([]string, error)
- func Recover(rpcParams string) string
- func RecoverAccount(password, mnemonic string) string
- func ResetChainData() string
- func SendDataNotification(dataPayloadJSON, tokensArray string) (result string)
- func SendTransaction(txArgsJSON, password string) string
- func SendTransactionWithSignature(txArgsJSON, sigString string) string
- func SetMobileSignalHandler(handler SignalHandler)
- func SetSignalEventCallback(cb unsafe.Pointer)
- func SignGroupMembership(content string) string
- func SignHash(hexEncodedHash string) string
- func SignMessage(rpcParams string) string
- func SignTypedData(data, password string) string
- func StartCPUProfile(dataDir string) string
- func StartNode(configJSON string) string
- func StopCPUProfiling() string
- func StopNode() string
- func UpdateMailservers(data string) string
- func ValidateNodeConfig(configJSON string) string
- func VerifyAccountPassword(keyStoreDir, address, password string) string
- func WriteHeapProfile(dataDir string) string
- type APIDetailedResponse
- type APIError
- type APIFieldError
- type APIResponse
- type AccountInfo
- type NotifyResult
- type SendDataNotificationResult
- type SignalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppStateChange ¶
func AppStateChange(state string)
AppStateChange handles app state changes (background/foreground).
func CallPrivateRPC ¶
CallPrivateRPC calls both public and private APIs via RPC.
func ChaosModeUpdate ¶
ChaosModeUpdate sets the Chaos Mode on or off.
func ConnectionChange ¶
ConnectionChange handles network state changes as reported by ReactNative (see https://facebook.github.io/react-native/docs/netinfo.html)
func CreateAccount ¶
CreateAccount is equivalent to creating an account from the command line, just modified to handle the function arg passing.
func CreateChildAccount ¶
CreateChildAccount creates sub-account.
func DisableInstallation ¶
DisableInstallation disables an installation for multi-device sync.
func EnableInstallation ¶
EnableInstallation enables an installation for multi-device sync.
func ExportNodeLogs ¶
func ExportNodeLogs() string
ExportNodeLogs reads current node log and returns content to a caller.
func ExtractGroupMembershipSignatures ¶
ExtractGroupMembershipSignatures extract public keys from tuples of content/signature.
func GenerateConfig ¶
GenerateConfig for status node.
func GetNodesFromContract ¶
GetNodesFromContract returns a list of nodes from a given contract
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.
func HashTransaction ¶
HashTransaction validate the transaction and returns new txArgs and the transaction hash.
func HashTypedData ¶
HashTypedData unmarshalls data into TypedData, validates it and hashes it.
func Login ¶
Login loads a key file (for a given address), tries to decrypt it using the password, to verify ownership if verified, purges all the previous identities from Whisper, and injects verified key as shh identity.
func LoginWithKeycard ¶
LoginWithKeycard initializes an account with a chat key and encryption key used for PFS. It purges all the previous identities from Whisper, and injects the key as shh identity.
func ParseJSONArray ¶
ParseJSONArray parses JSON array into Go array of string.
func Recover ¶
Recover unmarshals rpc params {signDataString, signedData} and passes them onto backend.
func RecoverAccount ¶
RecoverAccount re-creates master key using given details.
func ResetChainData ¶
func ResetChainData() string
ResetChainData removes chain data from data directory.
func SendDataNotification ¶
SendDataNotification sends push notifications by given tokens. 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 SendTransaction ¶
SendTransaction converts RPC args and calls backend.SendTransaction.
func SendTransactionWithSignature ¶
SendTransactionWithSignature converts RPC args and calls backend.SendTransactionWithSignature
func SetMobileSignalHandler ¶
func SetMobileSignalHandler(handler SignalHandler)
SetMobileSignalHandler setup geth callback to notify about new signal used for gomobile builds
func SetSignalEventCallback ¶
SetSignalEventCallback setup geth callback to notify about new signal
func SignGroupMembership ¶
SignGroupMembership signs a string containing group membership information.
func SignMessage ¶
SignMessage unmarshals rpc params {data, address, password} and passes them onto backend.SignMessage.
func SignTypedData ¶
SignTypedData unmarshall data into TypedData, validate it and signs with selected account, if password matches selected account.
func StartCPUProfile ¶
StartCPUProfile runs pprof for CPU.
func UpdateMailservers ¶
UpdateMailservers updates mail servers in status backend.
func ValidateNodeConfig ¶
ValidateNodeConfig validates config for the Status node.
func VerifyAccountPassword ¶
VerifyAccountPassword verifies account password.
func WriteHeapProfile ¶
WriteHeapProfile starts pprof for heap
Types ¶
type APIDetailedResponse ¶
type APIDetailedResponse struct { Status bool `json:"status"` Message string `json:"message,omitempty"` FieldErrors []APIFieldError `json:"field_errors,omitempty"` }
APIDetailedResponse represents a generic response with possible errors.
func (APIDetailedResponse) Error ¶
func (r APIDetailedResponse) Error() string
Error string representation of APIDetailedResponse.
type APIError ¶
type APIError struct {
Message string `json:"message"`
}
APIError represents a single error.
type APIFieldError ¶
type APIFieldError struct { Parameter string `json:"parameter,omitempty"` Errors []APIError `json:"errors"` }
APIFieldError represents a set of errors related to a parameter.
func (APIFieldError) Error ¶
func (e APIFieldError) Error() string
Error string representation of APIFieldError.
type APIResponse ¶
type APIResponse struct {
Error string `json:"error"`
}
APIResponse generic response from API.
type AccountInfo ¶
type AccountInfo struct { Address string `json:"address"` // DEPRECATED PubKey string `json:"pubkey"` // DEPRECATED WalletAddress string `json:"walletAddress"` WalletPubKey string `json:"walletPubKey"` ChatAddress string `json:"chatAddress"` ChatPubKey string `json:"chatPubKey"` Mnemonic string `json:"mnemonic"` Error string `json:"error"` }
AccountInfo represents account's info.
type NotifyResult ¶
NotifyResult is a JSON returned from notify message.
type SendDataNotificationResult ¶
type SendDataNotificationResult struct { Status bool `json:"status"` Error string `json:"error,omitempty"` }
SendDataNotificationResult is a JSON returned from notify message.
type SignalHandler ¶
type SignalHandler interface {
HandleSignal(string)
}
SignalHandler defines a minimal interface a signal handler needs to implement.