Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions api/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,45 @@ import (

signercore "github.com/ethereum/go-ethereum/signer/core/apitypes"

"github.com/status-im/status-go/eth-node/types"
accsmanagementtypes "github.com/status-im/status-go/accounts-management/types"
"github.com/status-im/status-go/crypto/types"
"github.com/status-im/status-go/multiaccounts"
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/multiaccounts/settings"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/protocol/requests"
"github.com/status-im/status-go/services/personal"
"github.com/status-im/status-go/services/typeddata"
"github.com/status-im/status-go/services/wallet/wallettypes"
)

// StatusBackend defines the contract for the Status.im service
type StatusBackend interface {
// IsNodeRunning() bool // NOTE: Only used in tests
StartNode(config *params.NodeConfig) error
StartNode(config *params.NodeConfig) error // NOTE: Only used in canary
StartNodeWithKey(acc multiaccounts.Account, password string, keyHex string, conf *params.NodeConfig) error
StartNodeWithAccount(acc multiaccounts.Account, password string, conf *params.NodeConfig, chatKey *ecdsa.PrivateKey) error
StartNodeWithAccountAndInitialConfig(account multiaccounts.Account, password string, settings settings.Settings, conf *params.NodeConfig, subaccs []*accounts.Account, chatKey *ecdsa.PrivateKey) error
StartNodeWithChatKeyOrMnemonic(
request *requests.CreateAccount,
mnemonic string, // empty mnemonic is used for keycard account, not empty for regular account
keycardData *requests.KeycardData, // nil for regular account, not nil for keycard account
restoreAccount bool,
) (*multiaccounts.Account, error)
StartNodeWithAccountAndInitialConfig(
multiAccount *multiaccounts.Account,
password string,
settings settings.Settings,
nodecfg *params.NodeConfig,
keypair *accsmanagementtypes.Keypair,
chatKey *ecdsa.PrivateKey) error
StopNode() error
// RestartNode() error // NOTE: Only used in tests

GetNodeConfig() (*params.NodeConfig, error)
UpdateRootDataDir(datadir string)

// SelectAccount(loginParams account.LoginParams) error
SelectAccount(loginParams LoginParams, privateKey *ecdsa.PrivateKey) error
OpenAccounts() error
GetAccounts() ([]multiaccounts.Account, error)
LocalPairingStarted() error
// SaveAccount(account multiaccounts.Account) error
SaveAccountAndStartNodeWithKey(acc multiaccounts.Account, password string, settings settings.Settings, conf *params.NodeConfig, subaccs []*accounts.Account, keyHex string) error
SaveAccount(account multiaccounts.Account) error
Recover(rpcParams personal.RecoverParams) (types.Address, error)
Logout() error

Expand All @@ -42,7 +52,6 @@ type StatusBackend interface {
HashTransaction(sendArgs wallettypes.SendTxArgs) (wallettypes.SendTxArgs, types.Hash, error)
HashTypedData(typed typeddata.TypedData) (types.Hash, error)
HashTypedDataV4(typed signercore.TypedData) (types.Hash, error)
ResetChainData() error
SendTransaction(sendArgs wallettypes.SendTxArgs, password string) (hash types.Hash, err error)
SendTransactionWithChainID(chainID uint64, sendArgs wallettypes.SendTxArgs, password string) (hash types.Hash, err error)
SendTransactionWithSignature(sendArgs wallettypes.SendTxArgs, sig []byte) (hash types.Hash, err error)
Expand Down
Loading
Loading