2017-05-16 12:09:52 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2020-10-29 07:46:02 +00:00
|
|
|
signercore "github.com/ethereum/go-ethereum/signer/core"
|
|
|
|
|
2019-11-23 17:57:05 +00:00
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
2019-08-20 15:38:40 +00:00
|
|
|
"github.com/status-im/status-go/multiaccounts"
|
|
|
|
"github.com/status-im/status-go/multiaccounts/accounts"
|
2018-06-08 11:29:50 +00:00
|
|
|
"github.com/status-im/status-go/params"
|
2018-04-10 10:02:54 +00:00
|
|
|
"github.com/status-im/status-go/services/personal"
|
2018-11-06 06:26:12 +00:00
|
|
|
"github.com/status-im/status-go/services/typeddata"
|
2018-06-08 11:29:50 +00:00
|
|
|
"github.com/status-im/status-go/transactions"
|
2017-10-10 15:30:56 +00:00
|
|
|
)
|
|
|
|
|
2019-11-23 17:57:05 +00:00
|
|
|
// 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
|
2021-12-21 14:27:18 +00:00
|
|
|
StartNodeWithAccount(acc multiaccounts.Account, password string, conf *params.NodeConfig) error
|
|
|
|
StartNodeWithAccountAndInitialConfig(account multiaccounts.Account, password string, settings accounts.Settings, conf *params.NodeConfig, subaccs []accounts.Account) error
|
2019-11-23 17:57:05 +00:00
|
|
|
StopNode() error
|
|
|
|
// RestartNode() error // NOTE: Only used in tests
|
|
|
|
|
2021-04-29 19:22:10 +00:00
|
|
|
GetNodeConfig() (*params.NodeConfig, error)
|
2019-11-23 17:57:05 +00:00
|
|
|
UpdateRootDataDir(datadir string)
|
|
|
|
|
|
|
|
// SelectAccount(loginParams account.LoginParams) error
|
|
|
|
OpenAccounts() error
|
|
|
|
GetAccounts() ([]multiaccounts.Account, error)
|
|
|
|
// SaveAccount(account multiaccounts.Account) error
|
2019-12-27 09:58:25 +00:00
|
|
|
SaveAccountAndStartNodeWithKey(acc multiaccounts.Account, password string, settings accounts.Settings, conf *params.NodeConfig, subaccs []accounts.Account, keyHex string) error
|
2019-11-23 17:57:05 +00:00
|
|
|
Recover(rpcParams personal.RecoverParams) (types.Address, error)
|
|
|
|
Logout() error
|
|
|
|
|
|
|
|
CallPrivateRPC(inputJSON string) (string, error)
|
|
|
|
CallRPC(inputJSON string) (string, error)
|
|
|
|
HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, types.Hash, error)
|
|
|
|
HashTypedData(typed typeddata.TypedData) (types.Hash, error)
|
2020-10-29 07:46:02 +00:00
|
|
|
HashTypedDataV4(typed signercore.TypedData) (types.Hash, error)
|
2019-11-23 17:57:05 +00:00
|
|
|
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)
|
2020-10-29 07:46:02 +00:00
|
|
|
SignTypedDataV4(typed signercore.TypedData, address string, password string) (types.HexBytes, error)
|
2019-11-23 17:57:05 +00:00
|
|
|
|
|
|
|
ConnectionChange(typ string, expensive bool)
|
|
|
|
AppStateChange(state string)
|
|
|
|
|
|
|
|
ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
|
|
|
|
SignGroupMembership(content string) (string, error)
|
2019-04-18 13:52:08 +00:00
|
|
|
}
|