Difference between revisions of "How to "rescue" stuck DFI"

From DeFiChain-Wiki
Line 3: Line 3:
 
Open the Console in your DEFI Chain Wallet.   
 
Open the Console in your DEFI Chain Wallet.   
  
[[File:FAQ-Wallet-OpenConsole.jpg|150px]]
+
'''Disclaimer: Console should be used in care. We are not responsible if the wrong commands are issued resulting in lost coins!'''
  
Write the following commands in the console.
+
If you have problems sending your DFI from the Wallet try the following '''step-by-step instruction'''
  
Command 1: "getbalance" - This shows you how much DFI are available to send. This should be less than your actuall DFI
+
==Step 1: Checking DFI-coin vs. DFI-token==
 +
Before starting we should check, if a DFI-sending problem is caused by "unwrapped" DFI
  
Command 2: "listaccounts {} true true true" - This command lists all your current addresses that are holding tokens.
+
[[File:DFI_Wallet.webp|DFI-amount showed in the wallet]]
  
Search for the amounts which are missing in your DFI balance. If the amount starts with "0": then its an dfi account.
+
Your DFI-Wallet is showing an DFI amount. To see, how many coins and tokens you have, you need the following 2 commands:
Next step is to convert these token DFI into UTXO DFI. Therefore note the amount field and the addresses.  
 
Say in this example the address is dXXXXXXXXXXXXXXXXX and the amount is 12.3@DFI.
 
  
Command 3: "accounttoutxos dXXXXXXXXXXXXXXXXX {"dXXXXXXXXXXXXXXXXX":"12.3@DFI"}" - This converts your dfi on the account to utxo dfi, so you can spend them again.
+
<span style="color:#FF0000"> getbalance </span>
 +
<br><span style="color:#FF0000"> gettokenbalances {} true true</span>
  
If you get the error Can't find any UTXO's for owner, do sendtoaddress dXXXXXXXXXXXXXXXXX 0.01 first, wait for confiramtion before trying the accounttoutxos command again.
 
  
Now wait for confirmation, then check getbalance, you should see your UTXO DFI increases, now you should be able to send more DFI.
+
[[File:DFI-coins vs. DFI-token.webp|checking DFI-coins vs. DFI-token]]
  
Note that the app should do all the above for you. This workaround guide is provided to help you to "rescue" your stuck DFI in the meantime while the app developers address the issue.
+
<br>In the above picture you see, most DFI are Token and not Coins. These Tokens cannot be transferred to another address.
  
Disclaimer: Console should be used in care. We are not responsible if the wrong commands are issued resulting in lost coins.
+
<b>HINT : You may need some DFI-coins (see getbalance) to execute commands from Step 4.</b>
 +
 
 +
 
 +
 
 +
==Step 2: Find addresses holding DFI-Token==
 +
The above shown DFI-amount are hold by one or more addresses. To find out, which one are hold the token, use the following command:
 +
 
 +
<span style="color:#FF0000"> listaccounts {} false false true </span>
 +
 
 +
You are getting a list of entries, which should look like this:
 +
 
 +
[[File:Address with DFI-token.webp|address with DFI-token]]
 +
 
 +
 
 +
 
 +
==Step 3: Checking all tokens on relevant address==
 +
Before changing token to coin, please check the amount and all the other tokens on this address with:
 +
 
 +
<span style="color:#FF0000"> getaccount <i>address_from_command_before</i> </span>
 +
 
 +
You should get the following result:
 +
 
 +
[[File:Tokens on address.webp|List of tokens on the address]]
 +
 
 +
 
 +
 
 +
==Step 4: Converting token to coin==
 +
Now, we come to the last, essential step. This will convert an amount of token into coins. Use the command:
 +
 
 +
<span style="color:#FF0000"> accounttoutxos <i>address_from_above</i> {"<i>adress_from_above</i>":"<i>DFI_amount_to_convert</i>@DFI"} </span>
 +
 
 +
 
 +
===Error===
 +
<strong>If you execute the command from Step 4, you may get the following error:</strong>
 +
 
 +
[[File:Error changing token to coin.webp|Error when changing token to coin]]
 +
 
 +
Then you need additional steps:
 +
 
 +
 
 +
====Step 4.1: Sending DFI-coin to Token-adress====
 +
Send a small amount of DFI to this address!
 +
 
 +
[[File:Result Tx-Hash.webp|Sending DFI-coin to address with token, result is a Tx-hash]]
 +
 
 +
You will get an Tx-Hash as a result.
 +
 
 +
 
 +
====Step 4.2: Check Confirmation====
 +
Please go to https://explorer.defichain.io/#/DFI/mainnet/home to check, if it is confirmed before you proceed.
 +
 
 +
[[File:Check Confirmation.webp|Confirmations after exection of command]]
 +
 
 +
 
 +
====Step 4.3: Converting token to coin====
 +
Now, you can run the accounttoutxos command from above again. If it is successful, you will get an Tx-hash, which can be checked in the explorer again (Step 5)
 +
 
 +
[[File:Token-to-Coin conversion.webp|Successful execution of Token-to-Coin conversion]]
 +
 
 +
 
 +
 
 +
==Step 5: Check conversion==
 +
Just to be sure, everythin worked, you can run the commands <span style="color:#FF0000"> getaccount <i>address</i> </span> and <span style="color:#FF0000"> getbalance </span> again.
 +
<br>In the following Picture, you see that the DFI-coin amount is now increased by 2DFI. The token were converted.
 +
 
 +
[[File:New Balance.webp|New token and coin balance]]
 +
 
 +
 
 +
 
 +
==Source==
 +
Daniel Zirkel: https://www.reddit.com/r/defiblockchain/comments/kb10d3/stepbystep_changing_dfitoken_to_dficoin/?utm_medium=android_app&utm_source=share
 
</translate>
 
</translate>

Revision as of 22:20, 15 December 2020

<languages/> <translate> Open the Console in your DEFI Chain Wallet.

Disclaimer: Console should be used in care. We are not responsible if the wrong commands are issued resulting in lost coins!

If you have problems sending your DFI from the Wallet try the following step-by-step instruction

Step 1: Checking DFI-coin vs. DFI-token

Before starting we should check, if a DFI-sending problem is caused by "unwrapped" DFI

DFI-amount showed in the wallet

Your DFI-Wallet is showing an DFI amount. To see, how many coins and tokens you have, you need the following 2 commands:

getbalance
gettokenbalances {} true true


checking DFI-coins vs. DFI-token


In the above picture you see, most DFI are Token and not Coins. These Tokens cannot be transferred to another address.

HINT : You may need some DFI-coins (see getbalance) to execute commands from Step 4.


Step 2: Find addresses holding DFI-Token

The above shown DFI-amount are hold by one or more addresses. To find out, which one are hold the token, use the following command:

listaccounts {} false false true

You are getting a list of entries, which should look like this:

address with DFI-token


Step 3: Checking all tokens on relevant address

Before changing token to coin, please check the amount and all the other tokens on this address with:

getaccount address_from_command_before

You should get the following result:

List of tokens on the address


Step 4: Converting token to coin

Now, we come to the last, essential step. This will convert an amount of token into coins. Use the command:

accounttoutxos address_from_above {"adress_from_above":"DFI_amount_to_convert@DFI"}


Error

If you execute the command from Step 4, you may get the following error:

Error when changing token to coin

Then you need additional steps:


Step 4.1: Sending DFI-coin to Token-adress

Send a small amount of DFI to this address!

Sending DFI-coin to address with token, result is a Tx-hash

You will get an Tx-Hash as a result.


Step 4.2: Check Confirmation

Please go to https://explorer.defichain.io/#/DFI/mainnet/home to check, if it is confirmed before you proceed.

Confirmations after exection of command


Step 4.3: Converting token to coin

Now, you can run the accounttoutxos command from above again. If it is successful, you will get an Tx-hash, which can be checked in the explorer again (Step 5)

Successful execution of Token-to-Coin conversion


Step 5: Check conversion

Just to be sure, everythin worked, you can run the commands getaccount address and getbalance again.
In the following Picture, you see that the DFI-coin amount is now increased by 2DFI. The token were converted.

New token and coin balance


Source

Daniel Zirkel: https://www.reddit.com/r/defiblockchain/comments/kb10d3/stepbystep_changing_dfitoken_to_dficoin/?utm_medium=android_app&utm_source=share </translate>