atomiclabs / atomiclabs/hyperdex

failed swaps are not recognized by GUI

Open
#625 0 comments 0 reactions 0 assignees View on GitHub
bug mm2.0
Dominant language
JavaScript
Stars
151
Forks
55
PR merge metrics
No merged PRs in 30d

Description

Swaps that fail are not recognized by the GUI. This has been a change from mm1.0; in mm1.0 there wasn't a clear way to tell that a swap had failed.

In mm2.0 however, using the `my_swap_status` API call, there is a way to find out if something has failed.

As an example, I tried to swap 1 CHIPS for KMD. On the taker side (the HyperDEX app), the order stays in the Open Orders screen, with a `matched` label:

image

However, when I open one of the 2 failed swaps in the screenshot, I see this ugly error message:

image

The app should be able to recognize that the swap has failed, by issuing a [my_swap_status](https://developers.komodoplatform.com/basic-docs/atomicdex/atomicdex-api.html#my-swap-status) call and look for events that are labeled `[...]Failed`, like the following example (this is the maker side of the same swap):

```json
{
"event": {
"data": {
"error": "maker_swap:449] utxo:842] utxo:546] utxo:546] rpc_clients:934] JsonRpcError { request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"69275\", method: \"blockchain.scripthash.listunspent\", params: [String(\"2ae8a38b945cb64a96190d735fadca5ce9532b9e494b863aaeaedf6cf99b12c6\")] }, error: Transport(\"rpc_clients:770] rpc_clients:770] [\\\"rpc_clients:1412] common:1070] future timed out\\\"]\") }"
},
"type": "MakerPaymentTransactionFailed"
},
"timestamp": 1575016520768
},
```

The type of this event ends with Failed.

So 2 things need fixing here:
1. The label needs to show a swap has failed
2. The user / app should remove such orders, as they clearly aren't Open Orders anymore. They should only show up in trade history.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the GUI's Open Orders and trade-history handling, then use the documented my_swap_status API call to inspect swap events such as MakerPaymentTransactionFailed. Done means failed swaps are labeled as failed and removed from Open Orders so they appear only in trade history.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.