Story
As a user who has just clicked "confirm" to authorize a transaction (either inside an app or sending in wallet), I want to know what the status of that transaction is until it's final so I can understand why it's taking so long.
This is especially important for most naive UI's which will be implemented synchronously and thus have the user staring at a waiting screen for some period of time.
See NOTES below for discussion.
Acceptance Criteria
Assets
NOTES
- When we send money, what waiting states do we actually have access to (now or possible in the future)? For example:
- Transaction sent
- Transaction received/acknowledged by the network (a node)
- Transaction in block mempool (or equivalent)
- Transaction executed in block 12345 [link]
- Transaction was success with return_value_or_state_change or failure for reason.
This is important so we can provide users with clarity around what they're actually waiting for while we're making them wait for things.
Also important that some apps have different finality than others, so their UIs might prefer to implement immediate finality or they might wait until X blocks (or other criteria) passes before showing the user a confirmation. That's fine -- let's expose the raw blockchain stuff to start with and assume immediate finality and if the app doesn't want this, they can use those same hooks and modify the UI on top to wait a bit longer.
This is inspired by how AJAX has a clear 5-step state machine that defines its status and allows developers to build waiting icons and UI notifications against those states.
It sounds like there are RPC endpoints for transaction status so this can be done via polling. Can it be done via the nodes sending something back to avoid constant read pings?
Complication: For transactions that generate receipts for later, what is finality anyway? How do we model states for something that's inherently unclear when it will end (how many calls deep it will take, and they're async)?
Visual inspiration
These are dumb loading bars since they tend to only have a "% complete" but are the basic idea: https://www.downgraf.com/inspiration/25-beautiful-loading-bar-design-examples-gif-animated/
What I imagine the naive implementation is something like a list of grayed-out checkboxes with state descriptions that get highlighted then checked off with a green checkmark in realtime as the transaction propagates through the various states so the user can see it happening. Then it disappears to the confirmation screen when all is well. But that's ultimately @jake 's realm