-
Notifications
You must be signed in to change notification settings - Fork 246
/
backend.go
55 lines (47 loc) · 2.57 KB
/
backend.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package api
import (
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/multiaccounts"
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/services/personal"
"github.com/status-im/status-go/services/typeddata"
"github.com/status-im/status-go/transactions"
)
// StatusBackend defines the contract for the Status.im service
type StatusBackend interface {
// IsNodeRunning() bool // NOTE: Only used in tests
StartNode(config *params.NodeConfig) error // NOTE: Only used in canary
StartNodeWithKey(acc multiaccounts.Account, password string, keyHex string) error
StartNodeWithAccount(acc multiaccounts.Account, password string) error
StartNodeWithAccountAndConfig(account multiaccounts.Account, password string, conf *params.NodeConfig, subaccs []accounts.Account) error
StopNode() error
// RestartNode() error // NOTE: Only used in tests
UpdateRootDataDir(datadir string)
UpdateMailservers(enodes []string) error
// SelectAccount(loginParams account.LoginParams) error
OpenAccounts() error
GetAccounts() ([]multiaccounts.Account, error)
// SaveAccount(account multiaccounts.Account) error
SaveAccountAndStartNodeWithKey(acc multiaccounts.Account, conf *params.NodeConfig, password string, keyHex string) error
Recover(rpcParams personal.RecoverParams) (types.Address, error)
Logout() error
CallPrivateRPC(inputJSON string) (string, error)
CallRPC(inputJSON string) (string, error)
GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)
HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, types.Hash, error)
HashTypedData(typed typeddata.TypedData) (types.Hash, error)
ResetChainData() error
SendTransaction(sendArgs transactions.SendTxArgs, password string) (hash types.Hash, err error)
SendTransactionWithSignature(sendArgs transactions.SendTxArgs, sig []byte) (hash types.Hash, err error)
SignHash(hexEncodedHash string) (string, error)
SignMessage(rpcParams personal.SignParams) (types.HexBytes, error)
SignTypedData(typed typeddata.TypedData, address string, password string) (types.HexBytes, error)
ConnectionChange(typ string, expensive bool)
AppStateChange(state string)
InjectChatAccount(chatKeyHex, encryptionKeyHex string) error // NOTE: Only used in lib and in tests
ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
SignGroupMembership(content string) (string, error)
EnableInstallation(installationID string) error
DisableInstallation(installationID string) error
}