It's actually IMPORTANT for the the drafting functions to NOT be async - it helps prevent duplicate spend issues and general state management issues (i.e. another process could request the same address).
Here's another summary of the tx lifecycle:
sync draftTx
(??) reserveFundsInWallet
backfill & await signTx
await broadcastTx
(??) commitWalletState
We want the loop between the draft and the reserve to be as close as possible so that other tasks can't use them, and without having to depend on storage and sync implementation details of the wallet.
Related to some of what was reviewed here: https://www.youtube.com/watch?v=7TBHmndBx00
It's actually IMPORTANT for the the drafting functions to NOT be
async
- it helps prevent duplicate spend issues and general state management issues (i.e. another process could request the same address).Here's another summary of the tx lifecycle:
We want the loop between the draft and the reserve to be as close as possible so that other tasks can't use them, and without having to depend on storage and sync implementation details of the wallet.