mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 14:16:21 +00:00
28506bcd17
This commit simplifies the sending process of the best route suggested by the router. It also makes the sending process the same for accounts (key pairs) migrated to a keycard and those stored locally in local keystore files. Deprecated endpoints: - `CreateMultiTransaction` - `ProceedWithTransactionsSignatures` Deprecated signal: - `wallet.sign.transactions` New endpoints: - `BuildTransactionsFromRoute` - `SendRouterTransactionsWithSignatures` The flow for sending the best router suggested by the router: - call `BuildTransactionsFromRoute` - wait for the `wallet.router.sign-transactions` signal - sign received hashes using `SignMessage` call or sign on keycard - call `SendRouterTransactionsWithSignatures` with the signatures of signed hashes from the previous step - `wallet.router.transactions-sent` signal will be sent after transactions are sent or if an error occurs New signals: - `wallet.router.sending-transactions-started` // notifies client that the sending transactions process started - `wallet.router.sign-transactions` // notifies client about the list of transactions that need to be signed - `wallet.router.transactions-sent` // notifies client about transactions that are sent - `wallet.transaction.status-changed` // notifies about status of sent transactions
19 lines
758 B
Go
19 lines
758 B
Go
package signal
|
|
|
|
type SignalType string
|
|
|
|
const (
|
|
Wallet = SignalType("wallet")
|
|
SignTransactions = SignalType("wallet.sign.transactions")
|
|
RouterSendingTransactionsStarted = SignalType("wallet.router.sending-transactions-started")
|
|
SignRouterTransactions = SignalType("wallet.router.sign-transactions")
|
|
RouterTransactionsSent = SignalType("wallet.router.transactions-sent")
|
|
TransactionStatusChanged = SignalType("wallet.transaction.status-changed")
|
|
SuggestedRoutes = SignalType("wallet.suggested.routes")
|
|
)
|
|
|
|
// SendWalletEvent sends event from services/wallet/events.
|
|
func SendWalletEvent(signalType SignalType, event interface{}) {
|
|
send(string(signalType), event)
|
|
}
|