-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: shared transactions sending saga for swap and send (#5067)
### Description This PR creates a `sendTransactionsSaga` which: 1. unlocks the wallet 2. takes some prepared transactions and sends them to the network 3. adds standby transactions 4. returns the tx hashes This is then shared by the swap and send sagas. A few changes were made to the existing flows: 1. for unlocking the account, the send saga uses `getConnectedUnlockedAccount`. since this also creates the signed message when missing, i used this one in the shared saga. so the key change is the swap saga used to use `unlockAccount` but now uses `getConnectedUnlockedAccount` for unlocking the wallet. 2. the send flow used to use the viem `sendTransaction` method for signing and sending the transaction, now it uses what the swap flow uses (`signTransaction` with an explicitly set nonce, plus `sendRawTransaction`) ([some context](https://valora-app.slack.com/archives/C029Z1QMD7B/p1710155212351269)) 3. both the send and swap sagas used to monitor the tx receipt and manually settle the tx with `handleTransactionReceiptReceived`. i've removed this monitoring because it is already triggered by the internal pending tx's [watcher](https://github.com/valora-inc/wallet/blob/main/src/transactions/saga.ts#L300). the sagas now only wait for the tx receipts for analytics purposes. This shared saga will also be used for the jumpstart stuff (not included in this PR) ### Test plan Manually tested swaps and send flows still work ### Related issues - Relates to RET-994 ### Backwards compatibility Y ### Network scalability Y
- Loading branch information
1 parent
2af14ff
commit a658959
Showing
9 changed files
with
455 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.