Jaxkr / lisk-dex-ui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show better progress when a transaction is sent

jondubois opened this issue · comments

Transactions can take a minute or two to go through depending on the DEX config. For this reason, the UI should show as much progress as possible (e.g. pending orders not yet in order book, number of signatures collected on a pending order, etc...) so that the user doesn't think their order didn't go through and submits their trade twice.

Feel free to add comments to this issue to decide how to best achieve this.
Ideally, an order should have multiple states to indicate progress in as much detail as possible. DEX nodes have a /transfers/pending endpoint which tells us which orders are about to be transferred on what chain and how many DEX signatures they have collected so far; we can try to match those to the original order in lisk-dex-ui to show progress %.

I think I'm going to add a fake pending order once the transaction is submitted (but doesn't show up in pending transfers) and then follow the transaction through the process, so the user immediately starts getting feedback on the progress of their transaction.

The Lisk HTTP endpoint /api/transactions?senderId=16133463845442135476L&recipientId=10296650803908033510L&sort=timestamp:desc can be used to get the transactions sent by the user to the DEX's wallet address (in this case 10296650803908033510L). This should also include the list of transactions which are pending and haven't yet been processed by the DEX.

This was fixed in the Leasehold fork.