Qortal Project

The future of blockchain platforms

User Tools

Site Tools


Sidebar

Qortal Project Wiki

Important Notices

Introduction

Project Model

Minting

Communications

Trade Portal

Qortal Hosting (QDN)

Voting System

AT System

Hardware

Frequently Asked Questions (FAQ)

How-To Guides

Node Setup Guides

Third-Party Services

trade_portal_coin_recovery

This is an old revision of the document!


Trade Portal Coin Recovery

QORT Recovery

This only relates to QORT refunds on the seller side, on the rare occasion that a trade fails half way through. LTC/DOGE refunds on the buyer side are unaffected.

The AT becomes eligible for refunding after a certain amount of time has passed in the TRADING state. We’re still unsure exactly how long this is - will have some more info on this soon.

Since 2.1 (sleeping ATs) you need to issue a cancel request to trigger the refund once that time has passed. This should wake up the AT and execute the refund. Longer term we may be able to do this automatically without needing to cancel it.

We thought there was a button in the UI, but after checking the code it looks like the UI hides it in this state. We’ll see about modifying that in the next version.

This new requirement to cancel was an unintended consequence of sleeping ATs - essentially a bug. So it may take a little while to smooth things out.

An alternate option to cancelling (and only option at the moment) is to send any transaction at all to the AT. The easiest option is to send the AT a tiny amount of QORT:

  1. Find the trade's `atAddress` via this API and copy it: http://localhost:12391/api-documentation/#/Cross-Chain%20(Trade-Bot)/getTradeBotStates (you will need to find the one that matches the QORT and/or LTC amount
  2. In the UI, go to ‘Send Coin’
  3. Select QORT
  4. In the amount, enter `0.00000001`
  5. In the ‘To’ field, paste the `atAddress` value that you copied
  6. Click ‘Send’

If the AT has reached its refund timeout (the exact time is still being determined) then it should then enter REFUNDING mode. CalDescent is going to try and keep an eye on failed trades on the network and will take care of this process on behalf of users, so most shouldn't need to worry about this.

LTC/DOGE Recovery

There is currently a bug in the core that can cause it to go into the BOB_REFUNDED state even though the coins have sold. Generally calling the

redeemAll

API should be enough to credit the missing LTC to your wallet.

You should be able to run this command directly in a terminal window. It has to be on the same machine that you originally listed the QORT for sale on, the core must be running, and the db folder in your qortal directory must not have been replaced with a bootstrap since listing the QORT.

curl -X GET “http://localhost:12391/crosschain/htlc/redeemAll/LITECOIN" -H  "accept: text/plain"

Alternatively, you can go to the API documentation via this link, click "Try it out", then "Execute":

http://localhost:12391/api-documentation/#/Cross-Chain%20(Hash%20time-locked%20contracts)/redeemAllHtlc

Either method is fine and they both achieve the same result.

If you have replaced the db folder since originally listing the QORT, there are a couple of possible options for recovery:

1. If you still have a copy of the old db folder, just stop the core, then rename the current one to something else like “db_new”, then move the old one (named “db”) into its place. Start the core and then try the command again.

2. If you don't have the old db folder, search your system for both “TradeBotStates.script” and “TradeBotStates.json”. These would normally be found in your qortal directory, or in the “qortal-backup” subfolder. You would then need to import these files in order to give your core access to the trades contained in the backup. The actual import process is quite complicated so we won't detail it out here, but if anyone does find themselves in this situation please let us know and we can write up some instructions.

trade_portal_coin_recovery.1638710020.txt.gz · Last modified: 12/05/2021 08:13 by gfactor