Documentation ¶
Index ¶
- type StatusAPI
- func (api *StatusAPI) AccountManager() common.AccountManager
- func (api *StatusAPI) CallRPC(inputJSON string) string
- func (api *StatusAPI) CompleteTransaction(id common.QueuedTxID, password string) (gethcommon.Hash, error)
- func (api *StatusAPI) CompleteTransactions(ids []common.QueuedTxID, password string) map[common.QueuedTxID]common.TransactionResult
- func (api *StatusAPI) CreateAccount(password string) (address, pubKey, mnemonic string, err error)
- func (api *StatusAPI) CreateAndInitCell(chatID, js string) string
- func (api *StatusAPI) CreateChildAccount(parentAddress, password string) (address, pubKey string, err error)
- func (api *StatusAPI) DiscardTransaction(id common.QueuedTxID) error
- func (api *StatusAPI) DiscardTransactions(ids []common.QueuedTxID) map[common.QueuedTxID]common.RawDiscardTransactionResult
- func (api *StatusAPI) JailCall(chatID, this, args string) string
- func (api *StatusAPI) JailExecute(chatID, code string) string
- func (api *StatusAPI) JailManager() common.JailManager
- func (api *StatusAPI) JailParse(chatID string, js string) string
- func (api *StatusAPI) Logout() error
- func (api *StatusAPI) NodeManager() common.NodeManager
- func (api *StatusAPI) Notify(token string) string
- func (api *StatusAPI) NotifyUsers(message string, payload fcm.NotificationPayload, tokens ...string) error
- func (api *StatusAPI) RecoverAccount(password, mnemonic string) (address, pubKey string, err error)
- func (api *StatusAPI) ResetChainData() error
- func (api *StatusAPI) ResetChainDataAsync() <-chan error
- func (api *StatusAPI) RestartNode() error
- func (api *StatusAPI) RestartNodeAsync() <-chan error
- func (api *StatusAPI) SelectAccount(address, password string) error
- func (api *StatusAPI) SendTransaction(ctx context.Context, args common.SendTxArgs) (gethcommon.Hash, error)
- func (api *StatusAPI) SetJailBaseJS(js string)
- func (api *StatusAPI) StartNode(config *params.NodeConfig) error
- func (api *StatusAPI) StartNodeAsync(config *params.NodeConfig) <-chan error
- func (api *StatusAPI) StopNode() error
- func (api *StatusAPI) StopNodeAsync() <-chan error
- func (api *StatusAPI) TxQueueManager() *transactions.Manager
- func (api *StatusAPI) VerifyAccountPassword(keyStoreDir, address, password string) (*keystore.Key, error)
- type StatusBackend
- func (m *StatusBackend) AccountManager() common.AccountManager
- func (m *StatusBackend) CallRPC(inputJSON string) string
- func (m *StatusBackend) CompleteTransaction(id common.QueuedTxID, password string) (gethcommon.Hash, error)
- func (m *StatusBackend) CompleteTransactions(ids []common.QueuedTxID, password string) map[common.QueuedTxID]common.TransactionResult
- func (m *StatusBackend) DiscardTransaction(id common.QueuedTxID) error
- func (m *StatusBackend) DiscardTransactions(ids []common.QueuedTxID) map[common.QueuedTxID]common.RawDiscardTransactionResult
- func (m *StatusBackend) IsNodeRunning() bool
- func (m *StatusBackend) JailManager() common.JailManager
- func (m *StatusBackend) NodeManager() common.NodeManager
- func (m *StatusBackend) ResetChainData() error
- func (m *StatusBackend) RestartNode() error
- func (m *StatusBackend) SendTransaction(ctx context.Context, args common.SendTxArgs) (hash gethcommon.Hash, err error)
- func (m *StatusBackend) StartNode(config *params.NodeConfig) error
- func (m *StatusBackend) StopNode() error
- func (m *StatusBackend) TxQueueManager() *transactions.Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatusAPI ¶
type StatusAPI struct {
// contains filtered or unexported fields
}
StatusAPI provides API to access Status related functionality.
func NewStatusAPIWithBackend ¶
func NewStatusAPIWithBackend(b *StatusBackend) *StatusAPI
NewStatusAPIWithBackend creates a new StatusAPI instance using the passed backend.
func (*StatusAPI) AccountManager ¶
func (api *StatusAPI) AccountManager() common.AccountManager
AccountManager returns reference to account manager
func (*StatusAPI) CompleteTransaction ¶
func (api *StatusAPI) CompleteTransaction(id common.QueuedTxID, password string) (gethcommon.Hash, error)
CompleteTransaction instructs backend to complete sending of a given transaction
func (*StatusAPI) CompleteTransactions ¶
func (api *StatusAPI) CompleteTransactions(ids []common.QueuedTxID, password string) map[common.QueuedTxID]common.TransactionResult
CompleteTransactions instructs backend to complete sending of multiple transactions
func (*StatusAPI) CreateAccount ¶
CreateAccount creates an internal geth account BIP44-compatible keys are generated: CKD#1 is stored as account key, CKD#2 stored as sub-account root Public key of CKD#1 is returned, with CKD#2 securely encoded into account key file (to be used for sub-account derivations)
func (*StatusAPI) CreateAndInitCell ¶
CreateAndInitCell creates a new jail cell context, with the given chatID as identifier. New context executes provided JavaScript code, right after the initialization.
func (*StatusAPI) CreateChildAccount ¶
func (api *StatusAPI) CreateChildAccount(parentAddress, password string) (address, pubKey string, err error)
CreateChildAccount creates sub-account for an account identified by parent address. CKD#2 is used as root for master accounts (when parentAddress is ""). Otherwise (when parentAddress != ""), child is derived directly from parent.
func (*StatusAPI) DiscardTransaction ¶
func (api *StatusAPI) DiscardTransaction(id common.QueuedTxID) error
DiscardTransaction discards a given transaction from transaction queue
func (*StatusAPI) DiscardTransactions ¶
func (api *StatusAPI) DiscardTransactions(ids []common.QueuedTxID) map[common.QueuedTxID]common.RawDiscardTransactionResult
DiscardTransactions discards given multiple transactions from transaction queue
func (*StatusAPI) JailCall ¶
JailCall executes given JavaScript function w/i a jail cell context identified by the chatID.
func (*StatusAPI) JailExecute ¶
JailExecute allows to run arbitrary JS code within a jail cell.
func (*StatusAPI) JailManager ¶
func (api *StatusAPI) JailManager() common.JailManager
JailManager returns reference to jail
func (*StatusAPI) JailParse ¶
JailParse creates a new jail cell context, with the given chatID as identifier. New context executes provided JavaScript code, right after the initialization. DEPRECATED in favour of CreateAndInitCell.
func (*StatusAPI) NodeManager ¶
func (api *StatusAPI) NodeManager() common.NodeManager
NodeManager returns reference to node manager
func (*StatusAPI) Notify ¶
Notify sends a push notification to the device with the given token. @deprecated
func (*StatusAPI) NotifyUsers ¶
func (api *StatusAPI) NotifyUsers(message string, payload fcm.NotificationPayload, tokens ...string) error
NotifyUsers send notifications to users.
func (*StatusAPI) RecoverAccount ¶
RecoverAccount re-creates master key using given details. Once master key is re-generated, it is inserted into keystore (if not already there).
func (*StatusAPI) ResetChainData ¶
ResetChainData remove chain data from data directory. Node is stopped, and new node is started, with clean data directory.
func (*StatusAPI) ResetChainDataAsync ¶
ResetChainDataAsync remove chain data from data directory, in async manner
func (*StatusAPI) RestartNode ¶
RestartNode restart running Status node, fails if node is not running
func (*StatusAPI) RestartNodeAsync ¶
RestartNodeAsync restart running Status node, in async manner
func (*StatusAPI) SelectAccount ¶
SelectAccount selects current account, by verifying that address has corresponding account which can be decrypted using provided password. Once verification is done, decrypted key is injected into Whisper (as a single identity, all previous identities are removed).
func (*StatusAPI) SendTransaction ¶
func (api *StatusAPI) SendTransaction(ctx context.Context, args common.SendTxArgs) (gethcommon.Hash, error)
SendTransaction creates a new transaction and waits until it's complete.
func (*StatusAPI) SetJailBaseJS ¶
SetJailBaseJS allows to setup initial JavaScript to be loaded on each jail.CreateAndInitCell().
func (*StatusAPI) StartNode ¶
func (api *StatusAPI) StartNode(config *params.NodeConfig) error
StartNode start Status node, fails if node is already started
func (*StatusAPI) StartNodeAsync ¶
func (api *StatusAPI) StartNodeAsync(config *params.NodeConfig) <-chan error
StartNodeAsync start Status node, fails if node is already started Returns immediately w/o waiting for node to start (see node.ready)
func (*StatusAPI) StopNodeAsync ¶
StopNodeAsync stop Status node. Stopped node cannot be resumed. Returns immediately, w/o waiting for node to stop (see node.stopped)
func (*StatusAPI) TxQueueManager ¶
func (api *StatusAPI) TxQueueManager() *transactions.Manager
TxQueueManager returns reference to account manager
func (*StatusAPI) VerifyAccountPassword ¶
func (api *StatusAPI) VerifyAccountPassword(keyStoreDir, address, password string) (*keystore.Key, error)
VerifyAccountPassword tries to decrypt a given account key file, with a provided password. If no error is returned, then account is considered verified.
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 (m *StatusBackend) AccountManager() common.AccountManager
AccountManager returns reference to account manager
func (*StatusBackend) CallRPC ¶
func (m *StatusBackend) CallRPC(inputJSON string) string
CallRPC executes RPC request on node's in-proc RPC server
func (*StatusBackend) CompleteTransaction ¶
func (m *StatusBackend) CompleteTransaction(id common.QueuedTxID, password string) (gethcommon.Hash, error)
CompleteTransaction instructs backend to complete sending of a given transaction
func (*StatusBackend) CompleteTransactions ¶
func (m *StatusBackend) CompleteTransactions(ids []common.QueuedTxID, password string) map[common.QueuedTxID]common.TransactionResult
CompleteTransactions instructs backend to complete sending of multiple transactions
func (*StatusBackend) DiscardTransaction ¶
func (m *StatusBackend) DiscardTransaction(id common.QueuedTxID) error
DiscardTransaction discards a given transaction from transaction queue
func (*StatusBackend) DiscardTransactions ¶
func (m *StatusBackend) DiscardTransactions(ids []common.QueuedTxID) map[common.QueuedTxID]common.RawDiscardTransactionResult
DiscardTransactions discards given multiple transactions from transaction queue
func (*StatusBackend) IsNodeRunning ¶
func (m *StatusBackend) IsNodeRunning() bool
IsNodeRunning confirm that node is running
func (*StatusBackend) JailManager ¶
func (m *StatusBackend) JailManager() common.JailManager
JailManager returns reference to jail
func (*StatusBackend) NodeManager ¶
func (m *StatusBackend) NodeManager() common.NodeManager
NodeManager returns reference to node manager
func (*StatusBackend) ResetChainData ¶
func (m *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 (m *StatusBackend) RestartNode() error
RestartNode restart running Status node, fails if node is not running
func (*StatusBackend) SendTransaction ¶
func (m *StatusBackend) SendTransaction(ctx context.Context, args common.SendTxArgs) (hash gethcommon.Hash, err error)
SendTransaction creates a new transaction and waits until it's complete.
func (*StatusBackend) StartNode ¶
func (m *StatusBackend) StartNode(config *params.NodeConfig) error
StartNode start Status node, fails if node is already started
func (*StatusBackend) StopNode ¶
func (m *StatusBackend) StopNode() error
StopNode stop Status node. Stopped node cannot be resumed.
func (*StatusBackend) TxQueueManager ¶
func (m *StatusBackend) TxQueueManager() *transactions.Manager
TxQueueManager returns reference to transactions manager