Documentation
¶
Index ¶
- func AddPeer(enode string) string
- func AppStateChange(state string)
- func CallPrivateRPC(inputJSON string) string
- func CallRPC(inputJSON string) string
- func ChangeDatabasePassword(KeyUID, password, newPassword string) string
- func CheckAddressChecksum(address string) string
- func ColorHash(pk string) string
- func ColorID(pk string) string
- func CompressPublicKey(key string) string
- func ConnectionChange(typ string, expensive int)
- func ConvertToKeycardAccount(accountData, settingsJSON, keycardUID, password, newPassword string) string
- func ConvertToRegularAccount(mnemonic, currPassword, newPassword string) string
- func CreateAccountAndLogin(requestJSON string) string
- func CreateAccountFromMnemonicAndDeriveAccountsForPaths(paramsJSON string) string
- func CreateAccountFromPrivateKey(paramsJSON string) string
- func DecodeParameters(decodeParamJSON string) string
- func DecompressPublicKey(key string) string
- func DeleteImportedKey(address, password, keyStoreDir string) string
- func DeleteMultiaccount(keyUID, keyStoreDir string) string
- func DeserializeAndCompressKey(DesktopKey string) string
- func EmojiHash(pk string) string
- func EncodeFunctionCall(method string, paramsJSON string) string
- func EncodeTransfer(to string, value string) string
- func ExportNodeLogs() string
- func ExportUnencryptedDatabase(accountData, password, databasePath string) string
- func ExtractGroupMembershipSignatures(signaturePairsStr string) string
- func GenerateAlias(pk string) string
- func GenerateImages(filepath string, aX, aY, bX, bY int) string
- func GetConnectionStringForBeingBootstrapped(configJSON string) string
- func GetConnectionStringForBootstrappingAnotherDevice(configJSON string) string
- func GetNodeConfig() string
- func GetPasswordStrength(paramsJSON string) string
- func GetPasswordStrengthScore(paramsJSON string) string
- func HashMessage(message string) string
- func HashTransaction(txArgsJSON string) string
- func HashTypedData(data string) string
- func HashTypedDataV4(data string) string
- func HexToNumber(hex string) string
- func HexToUtf8(hexString string) string
- func Identicon(pk string) string
- func ImageServerTLSCert() string
- func ImportUnencryptedDatabase(accountData, password, databasePath string) string
- func InitKeystore(keydir string) string
- func InitLogging(logSettingsJSON string) string
- func InputConnectionStringForBootstrapping(cs, configJSON string) string
- func InputConnectionStringForBootstrappingAnotherDevice(cs, configJSON string) string
- func IsAddress(address string) string
- func IsAlias(value string) string
- func LocalPairingPreflightOutboundCheck() string
- func Login(accountData, password string) string
- func LoginAccount(requestJSON string) string
- func LoginWithConfig(accountData, password, configJSON string) string
- func LoginWithKeycard(accountData, password, keyHex string) string
- func Logout() string
- func MigrateKeyStoreDir(accountData, password, oldDir, newDir string) string
- func MultiAccountDeriveAddresses(paramsJSON string) string
- func MultiAccountGenerate(paramsJSON string) string
- func MultiAccountGenerateAndDeriveAddresses(paramsJSON string) string
- func MultiAccountImportMnemonic(paramsJSON string) string
- func MultiAccountImportPrivateKey(paramsJSON string) string
- func MultiAccountLoadAccount(paramsJSON string) string
- func MultiAccountReset() string
- func MultiAccountStoreAccount(paramsJSON string) string
- func MultiAccountStoreDerivedAccounts(paramsJSON string) string
- func MultiformatDeserializePublicKey(key, outBase string) string
- func MultiformatSerializePublicKey(key, outBase string) string
- func NumberToHex(numString string) string
- func OpenAccounts(datadir string) string
- func Recover(rpcParams string) string
- func ResetChainData() string
- func RestoreAccountAndLogin(requestJSON string) string
- func SaveAccountAndLogin(accountData, password, settingsJSON, configJSON, subaccountData string) string
- func SaveAccountAndLoginWithKeycard(accountData, password, settingsJSON, configJSON, subaccountData string, ...) string
- func SendTransaction(txArgsJSON, password string) string
- func SendTransactionWithChainID(chainID int, txArgsJSON, password string) string
- func SendTransactionWithSignature(txArgsJSON, sigString string) string
- func SerializeLegacyKey(key string) string
- func SetMobileSignalHandler(handler SignalHandler)
- func SetSignalEventCallback(cb unsafe.Pointer)
- func Sha3(str string) string
- func SignGroupMembership(content string) string
- func SignHash(hexEncodedHash string) string
- func SignMessage(rpcParams string) string
- func SignTypedData(data, address, password string) string
- func SignTypedDataV4(data, address, password string) string
- func StartCPUProfile(dataDir string) string
- func StartLocalNotifications() string
- func StartSearchForLocalPairingPeers() string
- func StopCPUProfiling() string
- func StopLocalNotifications() string
- func SwitchFleet(fleet string, configJSON string) string
- func ToChecksumAddress(address string) string
- func Utf8ToHex(str string) string
- func ValidateConnectionString(cs string) string
- func ValidateMnemonic(mnemonic string) string
- func ValidateNodeConfig(configJSON string) string
- func VerifyAccountPassword(keyStoreDir, address, password string) string
- func VerifyDatabasePassword(keyUID, password string) string
- func WriteHeapProfile(dataDir string) string
- type APIDetailedResponse
- type APIError
- type APIFieldError
- type APIKeyUIDResponse
- type APIResponse
- type AccountInfo
- type GetPasswordStrengthRequest
- type MultiAccountDeriveAddressesParams
- type MultiAccountGenerateAndDeriveAddressesParams
- type MultiAccountGenerateParams
- type MultiAccountImportMnemonicParams
- type MultiAccountImportPrivateKeyParams
- type MultiAccountLoadAccountParams
- type MultiAccountStoreAccountParams
- type MultiAccountStoreDerivedAccountsParams
- type NotifyResult
- type OnboardingAccount
- type PasswordScoreResponse
- 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 ChangeDatabasePassword ¶ added in v0.80.2
func CheckAddressChecksum ¶ added in v0.111.5
func CompressPublicKey ¶ added in v0.114.3
CompressPublicKey compresses uncompressed 65-byte format to 33-byte compressed format.
func ConnectionChange ¶
ConnectionChange handles network state changes as reported by ReactNative (see https://facebook.github.io/react-native/docs/netinfo.html)
func ConvertToKeycardAccount ¶ added in v0.83.0
func ConvertToRegularAccount ¶ added in v0.125.4
func CreateAccountAndLogin ¶ added in v0.138.8
func CreateAccountFromMnemonicAndDeriveAccountsForPaths ¶ added in v0.114.2
CreateAccountFromMnemonicAndDeriveAccountsForPaths returns an account derived from the mnemonic phrase and the Bip39Passphrase and generate derived accounts for the list of paths without storing it
func CreateAccountFromPrivateKey ¶ added in v0.142.1
CreateAccountFromPrivateKey returns an account derived from the private key without storing it
func DecodeParameters ¶ added in v0.109.4
func DecompressPublicKey ¶ added in v0.114.3
DecompressPublicKey decompresses 33-byte compressed format to uncompressed 65-byte format.
func DeleteImportedKey ¶ added in v0.83.12
DeleteImportedKey
func DeleteMultiaccount ¶ added in v0.55.2
DeleteMultiaccount
func DeserializeAndCompressKey ¶ added in v0.117.3
func EncodeFunctionCall ¶ added in v0.109.4
func EncodeTransfer ¶ added in v0.109.4
func ExportNodeLogs ¶
func ExportNodeLogs() string
ExportNodeLogs reads current node log and returns content to a caller.
func ExportUnencryptedDatabase ¶ added in v0.69.0
ExportUnencryptedDatabase exports the database unencrypted to the given path
func ExtractGroupMembershipSignatures ¶
ExtractGroupMembershipSignatures extract public keys from tuples of content/signature.
func GenerateAlias ¶
func GenerateImages ¶ added in v0.98.3
func GetConnectionStringForBeingBootstrapped ¶ added in v0.109.1
GetConnectionStringForBeingBootstrapped starts a pairing.ReceiverServer then generates a pairing.ConnectionParams. Used when the device is Logged out or has no Account keys and the device has no camera to read a QR code with
Example: A desktop device (device without camera) receiving account data from mobile (device with camera)
func GetConnectionStringForBootstrappingAnotherDevice ¶ added in v0.109.1
GetConnectionStringForBootstrappingAnotherDevice starts a pairing.SenderServer then generates a pairing.ConnectionParams. Used when the device is Logged in and therefore has Account keys and the device might not have a camera
Example: A mobile or desktop device (devices that MAY have a camera but MUST have a screen) sending account data to a mobile (device with camera)
func GetNodeConfig ¶ added in v0.77.1
func GetNodeConfig() string
GetNodeConfig returns the current config of the Status node
func GetPasswordStrength ¶ added in v0.96.0
GetPasswordStrength uses zxcvbn module and generates a JSON containing information about the quality of the given password (Entropy, CrackTime, CrackTimeDisplay, Score, MatchSequence and CalcTime). userInputs argument can be whatever list of strings like user's personal info or site-specific vocabulary that zxcvbn will make use to determine the result. For more details on usage see https://github.com/status-im/zxcvbn-go
func GetPasswordStrengthScore ¶ added in v0.96.4
GetPasswordStrengthScore uses zxcvbn module and gets the score information about the given password. userInputs argument can be whatever list of strings like user's personal info or site-specific vocabulary that zxcvbn will make use to determine the result. For more details on usage see https://github.com/status-im/zxcvbn-go
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 HashTypedDataV4 ¶ added in v0.76.4
HashTypedDataV4 unmarshalls data into TypedData, validates it and hashes it.
func HexToNumber ¶ added in v0.109.4
func ImageServerTLSCert ¶ added in v0.94.0
func ImageServerTLSCert() string
func ImportUnencryptedDatabase ¶ added in v0.69.0
ImportUnencryptedDatabase imports the database unencrypted to the given directory
func InitKeystore ¶
InitKeystore initialize keystore before doing any operations with keys.
func InitLogging ¶ added in v0.159.3
InitLogging The InitLogging function should be called only once during the application's lifetime, specifically when the application starts. This ensures that we can capture logs before the user login. Before this, we can only capture logs after user login since we will only configure the logging after the login process.
func InputConnectionStringForBootstrapping ¶ added in v0.109.1
InputConnectionStringForBootstrapping starts a pairing.ReceiverClient The given server.ConnectionParams string will determine the server.Mode
server.Mode = server.Sending Used when the device is Logged out or has no Account keys and has a camera to read a QR code
Example: A mobile device (device with a camera) receiving account data from a device with a screen (mobile or desktop devices)
func InputConnectionStringForBootstrappingAnotherDevice ¶ added in v0.140.0
InputConnectionStringForBootstrappingAnotherDevice starts a pairing.SendingClient The given server.ConnectionParams string will determine the server.Mode
server.Mode = server.Receiving Used when the device is Logged in and therefore has Account keys and the has a camera to read a QR code
Example: A mobile (device with camera) sending account data to a desktop device (device without camera)
func LocalPairingPreflightOutboundCheck ¶ added in v0.154.4
func LocalPairingPreflightOutboundCheck() string
LocalPairingPreflightOutboundCheck creates a local tls server accessible via an outbound network address. The function creates a client and makes an outbound network call to the local server. This function should be triggered to ensure that the device has permissions to access its LAN or to make outbound network calls.
In addition, the functionality attempts to address an issue with iOS devices https://stackoverflow.com/a/64242745
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 LoginAccount ¶ added in v0.154.2
func LoginWithConfig ¶ added in v0.92.6
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. It then updates the accounts node db configuration mergin the values received in the configJSON parameter
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 MigrateKeyStoreDir ¶ added in v0.55.1
MigrateKeyStoreDir migrates key files to a new directory
func MultiAccountDeriveAddresses ¶
MultiAccountDeriveAddresses derive addresses from an account selected by ID, without storing them.
func MultiAccountGenerate ¶
MultiAccountGenerate generates account in memory without storing them.
func MultiAccountGenerateAndDeriveAddresses ¶
MultiAccountGenerateAndDeriveAddresses combines Generate and DeriveAddresses in one call.
func MultiAccountImportMnemonic ¶
MultiAccountImportMnemonic imports an account derived from the mnemonic phrase and the Bip39Passphrase storing it.
func MultiAccountImportPrivateKey ¶
MultiAccountImportPrivateKey imports a raw private key without storing it.
func MultiAccountLoadAccount ¶
MultiAccountLoadAccount loads in memory the account specified by address unlocking it with password.
func MultiAccountReset ¶
func MultiAccountReset() string
MultiAccountReset remove all the multi-account keys from memory.
func MultiAccountStoreAccount ¶
MultiAccountStoreAccount stores the select account.
func MultiAccountStoreDerivedAccounts ¶
MultiAccountStoreDerivedAccounts derive accounts from the specified key and store them encrypted with the specified password.
func MultiformatDeserializePublicKey ¶ added in v0.55.1
DeserializePublicKey decompresses a compressed multibase encoded multicodec identified EC public key For details on usage see specs https://specs.status.im/spec/2#public-key-serialization
func MultiformatSerializePublicKey ¶ added in v0.55.1
SerializePublicKey compresses an uncompressed multibase encoded multicodec identified EC public key For details on usage see specs https://specs.status.im/spec/2#public-key-serialization
func NumberToHex ¶ added in v0.109.4
func OpenAccounts ¶
OpenAccounts opens database and returns accounts list.
func Recover ¶
Recover unmarshals rpc params {signDataString, signedData} and passes them onto backend.
func ResetChainData ¶
func ResetChainData() string
ResetChainData removes chain data from data directory.
func RestoreAccountAndLogin ¶ added in v0.139.1
func SaveAccountAndLogin ¶
func SaveAccountAndLogin(accountData, password, settingsJSON, configJSON, subaccountData string) string
SaveAccountAndLogin saves account in status-go database..
func SaveAccountAndLoginWithKeycard ¶
func SaveAccountAndLoginWithKeycard(accountData, password, settingsJSON, configJSON, subaccountData string, keyHex string) string
SaveAccountAndLoginWithKeycard saves account in status-go database..
func SendTransaction ¶
SendTransaction converts RPC args and calls backend.SendTransaction.
func SendTransactionWithChainID ¶ added in v0.101.1
SendTransactionWithChainID converts RPC args and calls backend.SendTransactionWithChainID.
func SendTransactionWithSignature ¶
SendTransactionWithSignature converts RPC args and calls backend.SendTransactionWithSignature
func SerializeLegacyKey ¶ added in v0.125.4
SerializeLegacyKey compresses an old format public key (0x04...) to the new one zQ...
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 SignTypedDataV4 ¶ added in v0.76.4
SignTypedDataV4 unmarshall data into TypedData, validate it and signs with selected account, if password matches selected account.
func StartCPUProfile ¶
StartCPUProfile runs pprof for CPU.
func StartLocalNotifications ¶ added in v0.62.16
func StartLocalNotifications() string
StartLocalNotifications
func StartSearchForLocalPairingPeers ¶ added in v0.146.3
func StartSearchForLocalPairingPeers() string
StartSearchForLocalPairingPeers starts a UDP multicast beacon that both listens for and broadcasts to LAN peers on discovery the beacon will emit a signal with the details of the discovered peer.
Currently, beacons are configured to search for 2 minutes pinging the network every 500 ms;
- If no peer discovery is made before this time elapses the operation will terminate.
- If a peer is discovered the pairing.PeerNotifier will terminate operation after 5 seconds, giving the peer reasonable time to discover this device.
Peer details are represented by a json.Marshal peers.LocalPairingPeerHello
func StopLocalNotifications ¶ added in v0.62.16
func StopLocalNotifications() string
StopLocalNotifications
func SwitchFleet ¶ added in v0.96.4
func ToChecksumAddress ¶ added in v0.111.5
func ValidateConnectionString ¶ added in v0.131.7
func ValidateMnemonic ¶ added in v0.38.1
func ValidateNodeConfig ¶
ValidateNodeConfig validates config for the Status node.
func VerifyAccountPassword ¶
VerifyAccountPassword verifies account password.
func VerifyDatabasePassword ¶ added in v0.83.0
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 APIKeyUIDResponse ¶ added in v0.141.2
type APIKeyUIDResponse struct {
KeyUID string `json:"keyUID"`
}
APIKeyUIDResponse
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 GetPasswordStrengthRequest ¶ added in v0.96.4
type MultiAccountDeriveAddressesParams ¶
type MultiAccountDeriveAddressesParams struct { AccountID string `json:"accountID"` Paths []string `json:"paths"` }
MultiAccountDeriveAddressesParams are the params sent to MultiAccountDeriveAddresses.
type MultiAccountGenerateAndDeriveAddressesParams ¶
type MultiAccountGenerateAndDeriveAddressesParams struct { MultiAccountGenerateParams Paths []string `json:"paths"` }
MultiAccountGenerateAndDeriveAddressesParams are the params sent to MultiAccountGenerateAndDeriveAddresses.
type MultiAccountGenerateParams ¶
type MultiAccountGenerateParams struct { N int `json:"n"` MnemonicPhraseLength int `json:"mnemonicPhraseLength"` Bip39Passphrase string `json:"bip39Passphrase"` }
MultiAccountGenerateParams are the params sent to MultiAccountGenerate.
type MultiAccountImportMnemonicParams ¶
type MultiAccountImportMnemonicParams struct { MnemonicPhrase string `json:"mnemonicPhrase"` Bip39Passphrase string `json:"Bip39Passphrase"` Paths []string `json:"paths"` }
MultiAccountImportMnemonicParams are the params sent to MultiAccountImportMnemonic.
type MultiAccountImportPrivateKeyParams ¶
type MultiAccountImportPrivateKeyParams struct {
PrivateKey string `json:"privateKey"`
}
MultiAccountImportPrivateKeyParams are the params sent to MultiAccountImportPrivateKey.
type MultiAccountLoadAccountParams ¶
type MultiAccountLoadAccountParams struct { Address string `json:"address"` Password string `json:"password"` }
MultiAccountLoadAccountParams are the params sent to MultiAccountLoadAccount.
type MultiAccountStoreAccountParams ¶
type MultiAccountStoreAccountParams struct { AccountID string `json:"accountID"` Password string `json:"password"` }
MultiAccountStoreAccountParams are the params sent to MultiAccountStoreAccount.
type MultiAccountStoreDerivedAccountsParams ¶
type MultiAccountStoreDerivedAccountsParams struct { MultiAccountDeriveAddressesParams Password string `json:"password"` }
MultiAccountStoreDerivedAccountsParams are the params sent to MultiAccountStoreDerivedAccounts.
type NotifyResult ¶
NotifyResult is a JSON returned from notify message.
type OnboardingAccount ¶
type OnboardingAccount struct { ID string `json:"id"` 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"` }
OnboardingAccount represents accounts info generated for the onboarding.
type PasswordScoreResponse ¶ added in v0.96.4
type PasswordScoreResponse struct {
Score int `json:"score"`
}
type SignalHandler ¶
type SignalHandler interface {
HandleSignal(string)
}
SignalHandler defines a minimal interface a signal handler needs to implement.