-
Notifications
You must be signed in to change notification settings - Fork 56
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:
However, when I open one of the 2 failed swaps in the screenshot, I see this ugly error message:
The app should be able to recognize that the swap has failed, by issuing a 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):
{
"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:
- The label needs to show a swap has failed
- The user / app should remove such orders, as they clearly aren't Open Orders anymore. They should only show up in trade history.