api

package
v0.26.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2019 License: MPL-2.0 Imports: 32 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
	// ErrRPCClientUnavailable is returned if an RPC client can't be retrieved.
	// This is a normal situation when a node is stopped.
	ErrRPCClientUnavailable = errors.New("JSON-RPC client is unavailable")
)

Functions

func HashMessage added in v0.35.0

func HashMessage(message string) ([]byte, error)

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 RunAsync

func RunAsync(f func() error) <-chan error

RunAsync runs the specified function asynchronously.

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 added in v0.35.0

func (b *StatusBackend) DisableInstallation(installationID string) error

DisableInstallation disables an installation for multi-device sync.

func (*StatusBackend) EnableInstallation added in v0.35.0

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 added in v0.35.0

func (b *StatusBackend) GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)

GetNodesFromContract returns a list of nodes from the contract

func (*StatusBackend) HashTransaction added in v0.35.0

HashTransaction validate the transaction and returns new sendArgs and the transaction hash.

func (*StatusBackend) HashTypedData added in v0.35.0

func (b *StatusBackend) HashTypedData(typed typeddata.TypedData) (common.Hash, error)

HashTypedData generates the hash of TypedData.

func (*StatusBackend) InjectChatAccount added in v0.35.0

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) 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) 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 added in v0.35.0

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 added in v0.35.0

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 added in v0.35.0

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 added in v0.35.0

func (b *StatusBackend) UpdateMailservers(enodes []string) error

UpdateMailservers on ShhExtService.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL