Преглед на файлове

Обмен + разные фиксы

Rimmon преди 2 години
родител
ревизия
29e94f9d1a
променени са 5 файла, в които са добавени 137 реда и са изтрити 112 реда
  1. 90 55
      Models/Blockchain.cs
  2. 2 2
      Models/SmartContract.cs
  3. 14 10
      Pages/Blockchains.razor
  4. 2 2
      Pages/Blockchains.razor.cs
  5. 29 43
      Pages/ModalAssets.razor

+ 90 - 55
Models/Blockchain.cs

@@ -12,6 +12,7 @@ using System.Text.RegularExpressions;
 using QRCoder;
 using System.IO;
 using Microsoft.AspNetCore.Components;
+using System.Numerics;
 
 //0xe5D682717955d6C35d465A3485625C64655a04f4 - HCB in rinkeby
 //0xb504ba124b74333d8536db534f7fcdc174d6ee3d - system address rinkeby
@@ -55,13 +56,14 @@ namespace HyperCube.Models
             }
             set { }
         }
-        public const string MultiOwnerContractRinkeby = "0x862A2Ac8D1dB37085c786981A8F5bd54594f7162";
+        public const string MultiOwnerContractRinkeby = "0x7eca4E373De5E9ad27Be283612a75e632aCB81f2";
         public const string HCBAddress = "0xe5D682717955d6C35d465A3485625C64655a04f4";
+        public const string QNMAddress = "0xE895a91B041e8450A1AFb9F54b8362a8ae3bb3d3";
         public static string tokenName;
         public static string decimals;
         public static string symbol;
         public static string tokenBalance;
-        public static string balanceHCB;
+        public static string balanceToken;
 
         public static Dictionary<int, Blockchain> supported;
         //public static string Connected
@@ -144,8 +146,8 @@ namespace HyperCube.Models
                 transObj.data += zerofill(address, 64, true);
             //answer = await RunFunction2("eth_call", to, AccountModel.Current.GetActualAddress(this));
             answer = await RunFunction2("eth_call", transObj, "latest");
-            balanceHCB = ((double)AccountModel.ConvertBalance(ParseStringAnswer(answer)[0]) / 1000000000000000000.0).ToString();
-            return null;
+            balanceToken = ((double)AccountModel.ConvertBalance(ParseStringAnswer(answer)[0]) / 1000000000000000000.0).ToString();
+            return balanceToken;
         }
 
         public async Task<string> Initialize()
@@ -165,17 +167,27 @@ namespace HyperCube.Models
         {
             TransactionObject transObj = new TransactionObject();
             transObj.from = address;
-            transObj.to = ERC20Address;// "0xe5D682717955d6C35d465A3485625C64655a04f4";
-            transObj.gas = "9000";
+            transObj.to = ERC20Address;
             transObj.data = await compileFunction($"function transferOwnership(address newOwner)");
             var answer = await RunFunction2("eth_sendTransaction", transObj);
         }
 
+        public async Task ChangeOwnerMulti()
+        {
+            TransactionObject transObj = new TransactionObject();
+            transObj.from = address;
+            transObj.to = MultiOwnerContractRinkeby;
+            //transObj.data = zerofill(dec2hex(36), 64, true);    //36 bytes len of data. Для ремикса это не нужно, он сам вставляет длину массива
+            transObj.data += await compileFunction($"function transferOwnership(address newOwner)"); //4 bytes
+            transObj.data += zerofill("0xD3ae749f1253b320ea2b90dc235ed72c80447AFF", 64, true);  //32 bytes            
+            Console.WriteLine($"transObj.data {transObj.data}");
+            //var answer = await RunFunction2("eth_sendTransaction", transObj);
+        }
+
         public async Task Transactions(string multiOwnerContract)
         {
             TransactionObject transObj = new TransactionObject();            
-            transObj.to = multiOwnerContract;// "0xe5D682717955d6C35d465A3485625C64655a04f4";
-            transObj.gas = "9000";
+            transObj.to = multiOwnerContract;
             transObj.data = await compileFunction($"transactionCount");
             var answer = await RunFunction2("eth_call", transObj, "latest");
         }
@@ -184,18 +196,17 @@ namespace HyperCube.Models
         {
             TransactionObject transObj = new TransactionObject();
             transObj.from = owner;
-            transObj.to = tokenAddress;// "0xe5D682717955d6C35d465A3485625C64655a04f4";
-            transObj.gas = "9000";
+            transObj.to = tokenAddress;
             transObj.data = await compileFunction($"function approve(address spender, uint256 amount)");
             if (tokenAddress != null)
             {
                 transObj.data += zerofill(spender, 64, true);
-                transObj.data += zerofill(dec2hex(Convert.ToInt32(amount)), 64, true);                
+                transObj.data += zerofill(dec2hex(amount), 64, true);                
             }
             var answer = await RunFunction2("eth_sendTransaction", transObj);
         }
 
-        public async Task<string> SubmitTransaction(string owner, int tokenvalue, string receiver, string tokenAddress = HCBAddress)
+        public async Task<string> SubmitTransaction(string owner, long tokenvalue, string receiver, string tokenAddress = QNMAddress)
         {
             //"submitTransaction(address destination, uint value, address tokenAddress)"
             //var tokenAmount = float.Parse(tokenvalue, System.Globalization.CultureInfo.InvariantCulture);// * 1000000000000000000;
@@ -205,7 +216,6 @@ namespace HyperCube.Models
             TransactionObject transObj = new TransactionObject();
             transObj.from = owner;
             transObj.to = MultiOwnerContractRinkeby;
-            transObj.gas = "9000";
             transObj.data = await compileFunction($"function submitTransaction(address destination, uint256 value, address tokenAddress)");
             if (tokenvalue > 0)
             {
@@ -217,31 +227,65 @@ namespace HyperCube.Models
             return ParseStringAnswer(answer)[0];
         }
 
+        //
+        //ETHtoERC20 - шлем эфир на контракт, контракт шлет юзеру ERC20 по курсу со своего счета через transfer
+
+        //ETHtoERC20 - шлем ERC20 на контракт, получаем эфир по курсу
+        //запуск контрактом TransferFrom юзером на адрес контракта
+        //контракт шлет юзеру эфир по курсу со своего счета
 
         //нужна проверка балансов системы и юзера перед обменом
-        public async Task ChangeCurrency(string from_token_selected, string to_token_selected, string tokenAddress, string sender, string from, string to, string fi, string ti)
+        public async Task ExchangeCurrency(string from_token_selected, string to_token_selected, string tokenAddress, string senderAccountAddress, string fi, string ti)
         {
-            var val = float.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);
-            var tokenAmount = val;// * 1000000000000000000;
-            val = float.Parse(ti, System.Globalization.CultureInfo.InvariantCulture);
-            var ethAmount = val / 5;   // /5
-            //ETHtoERC20(address tokenAddress)
+            //ETHtoERC20(address tokenAddress, uint256 tokenAmount) 
             //ERC20toETH(address tokenAddress, address sender, uint256 tokenAmount, uint256 ethAmount) public payable returns(bool)
             TransactionObject transObj = new TransactionObject();
-            transObj.from = sender;
+            transObj.from = senderAccountAddress;
             transObj.to = MultiOwnerContractRinkeby;
-            transObj.gas = "9000";
-            transObj.data = await compileFunction($"function ERC20toETH(address tokenAddress, address sender, uint256 tokenAmount, uint256 ethAmount)");
-            if (tokenAddress != null && tokenAmount != null)
+            transObj.gas = dec2hex("90000");
+
+            var valFrom = decimal.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);            
+            var valTo = decimal.Parse(ti, System.Globalization.CultureInfo.InvariantCulture);
+            
+            if (to_token_selected == "qnm")
+            {                
+                transObj.data = await compileFunction($"function ETHtoERC20(address tokenAddress, uint256 tokenAmount)");
+                BigInteger tokenAmount = (BigInteger)(valTo * 1000000000000000000m);
+                BigInteger ethAmount = (BigInteger)(valFrom * 1000000000000000000m);
+                Console.WriteLine($"######################################ETHtoERC20 valTo {valTo} tokenAmount {tokenAmount} valFrom {valFrom} ethAmount {ethAmount}");
+                transObj.value = dec2hex(ethAmount);
+                if (tokenAddress != null && tokenAmount > 0)
+                {
+                    transObj.data += zerofill(tokenAddress, 64, true);
+                    transObj.data += zerofill(dec2hex(tokenAmount), 64, true);                    
+                }
+            }
+            else
             {
-                transObj.data += zerofill(tokenAddress, 64, true);
-                transObj.data += zerofill(sender, 64, true);
-                transObj.data += zerofill(dec2hex(Convert.ToInt32(tokenAmount)), 64, true);
-                transObj.data += zerofill(dec2hex(Convert.ToInt32(ethAmount)), 64, true);
+                BigInteger tokenAmount = (BigInteger)(valFrom * 1000000000000000000);
+                BigInteger ethAmount = (BigInteger)(valTo * 1000000000000000000);
+                //сначала нужен аппрув перевода!
+                //from=erc20 to=eth
+                var amount = float.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);
+                var appr = Approve(senderAccountAddress, MultiOwnerContractRinkeby, tokenAmount.ToString(), QNMAddress);
+                await Task.WhenAll(appr);
+
+                //sender возможно можно заменить на msg.sender
+                transObj.data = await compileFunction($"function ERC20toETH(address tokenAddress, address sender, uint256 tokenAmount, uint256 ethAmount)");
+                Console.WriteLine($"######################################ERC20toETH valTo {valTo} tokenAmount {tokenAmount} valFrom {valFrom} ethAmount {ethAmount}");
+                if (tokenAddress != null && tokenAmount != null)
+                {
+                    transObj.data += zerofill(tokenAddress, 64, true);
+                    transObj.data += zerofill(senderAccountAddress, 64, true);
+                    transObj.data += zerofill(dec2hex(tokenAmount), 64, true);
+                    transObj.data += zerofill(dec2hex(ethAmount), 64, true);
+                }
             }
             var answer = await RunFunction2("eth_sendTransaction", transObj);
         }
 
+
+        //ETHtoERC20(address tokenAddress, uint256 tokenAmount) 
         public async Task<string> Verify(AccountModel verifier, ArticleModel article)
         {
             Console.WriteLine($"Verify starting");
@@ -266,9 +310,17 @@ namespace HyperCube.Models
             return "Verify failed";
         }
 
-        public static string dec2hex(int decValue, bool prefix = true)
+        public static string dec2hex(BigInteger decValue, bool prefix = true)
+        {
+            var hexValue = decValue.ToString("X");
+            if (prefix)
+                hexValue = "0x" + hexValue;
+            return hexValue;
+        }
+
+        public static string dec2hex(string decValue, bool prefix = true)
         {
-            string hexValue = decValue.ToString("X");
+            var hexValue = BigInteger.Parse(decValue, System.Globalization.CultureInfo.InvariantCulture).ToString("X");            
             if (prefix)
                 hexValue = "0x" + hexValue;
             return hexValue;
@@ -432,9 +484,9 @@ namespace HyperCube.Models
         {
             var ret = await RunFunction("eth_getBalance", $"\"{address}\",\"latest\"");
             var balanceWei = AccountModel.ConvertBalance(ret);
-            var balanceToken = Math.Round((double)balanceWei / 1000000000000000000.0, 4);
-            Console.WriteLine($"GetBalance balanceToken {balanceToken}");
-            balance = balanceToken.ToString();
+            var balanceEth = Math.Round((double)balanceWei / 1000000000000000000.0, 4);
+            Console.WriteLine($"GetBalance balanceEth {balanceEth}");
+            balance = balanceEth.ToString();
             return balance;
         }
         
@@ -460,6 +512,10 @@ namespace HyperCube.Models
                 paramDict["from"] = to.from;
             if (to.to != null)
                 paramDict["to"] = to.to;
+            if (to.gas != null)
+                paramDict["gas"] = to.gas;
+            if (to.value != null)
+                paramDict["value"] = to.value;
             if (to.data != null)
             {
                 paramDict["data"] = "0x"+to.data;
@@ -668,32 +724,13 @@ namespace HyperCube.Models
             //mint(address to, uint256 amount) 
             TransactionObject transObj = new TransactionObject();
             transObj.from = address;
-            transObj.to = "0xe5D682717955d6C35d465A3485625C64655a04f4";
+            transObj.to = QNMAddress;
             transObj.gas = "9000";
-            transObj.value = tokenAmount;
             transObj.data = await compileFunction($"function mint(address to, uint256 amount)");
             if (addressTo != null && tokenAmount != null)
             {
                 transObj.data += zerofill(addressTo, 64, true);
-                transObj.data += zerofill(dec2hex(Convert.ToInt32(tokenAmount)), 64, true);
-            }
-            var answer = await RunFunction2("eth_sendTransaction", transObj);
-        }
-
-
-        //approve transfer amount from sender by contract to any address: approve(address spender, uint256 amount)
-        public async Task ApproveExchange(string tokenContract, AccountModel owner, AccountModel spender, string tokenAmount)
-        {
-            TransactionObject transObj = new TransactionObject();
-            transObj.from = owner.GetActualAddress(this);
-            transObj.to = tokenContract;
-            transObj.gas = "9000";
-            transObj.value = tokenAmount;   //тут должен быть эфир!
-            transObj.data = await compileFunction($"function approve(address spender, uint256 amount)");
-            if (tokenContract != null && tokenAmount != null)
-            {
-                transObj.data += zerofill(spender.GetActualAddress(this), 64, true);
-                transObj.data += zerofill(dec2hex(Convert.ToInt32(tokenAmount)), 64, true);
+                transObj.data += zerofill(dec2hex(tokenAmount), 64, true);
             }
             var answer = await RunFunction2("eth_sendTransaction", transObj);
         }
@@ -704,8 +741,6 @@ namespace HyperCube.Models
             TransactionObject transObj = new TransactionObject();
             transObj.from = sender;
             transObj.to = tokenContract;
-            transObj.gas = "9000";
-            transObj.value = tokenAmount;   //тут должен быть эфир!
             transObj.data = await compileFunction($"function transfer(address recipient, uint256 amount)");
             if (addressTo != null && tokenAmount != null)
             {

+ 2 - 2
Models/SmartContract.cs

@@ -153,8 +153,8 @@ namespace HyperCube.Models
 
                 //GetRatingExpert - ???
                 //GetRatingProspector - ???
-                var expert_value = article_value * verifier.GetRatingExpert() * edits*1000000;
-                var initiator_value = article_value * initiator.GetRatingProspector() * 1000000;
+                long expert_value = article_value * verifier.GetRatingExpert() * edits*1000000000000000;
+                long initiator_value = article_value * initiator.GetRatingProspector() * 1000000000000000;
 
                 Console.WriteLine($"article_value {article_value} expert_value {expert_value} initiator_value {initiator_value} CharCount {newArticle.CharCount} Keywords count {newArticle.Keywords.Split(",").Length} ");
                 var tid1 = await bc.SubmitTransaction("0xD3ae749f1253b320ea2b90dc235ed72c80447AFF", expert_value, verifier_address);

+ 14 - 10
Pages/Blockchains.razor

@@ -26,7 +26,7 @@
     string function1 = "";
     string function_processed = "";
     string contractAddDisabled = "";
-    string tokenContract = "0xe5D682717955d6C35d465A3485625C64655a04f4";
+    string tokenContract = Blockchain.QNMAddress;
 
     string tokenName
     {
@@ -84,9 +84,7 @@
     </select>
     <p><b>@bcMain.url:@bcMain.port </b><br /> <b>Address:</b> @bcMain.address<br /> <b>Balance:</b> @bcMain.balance</p>
     <br>
-
-    @*<p></p>
-    <p style="visibility:@hidecontr">
+    @*<p style="visibility:@hidecontr">
         Add smart contract:
     <p><input id="newname" @bind="newname" placeholder="Имя нового контракта" /></p>
     <p><input id="newcode" size="100" @bind="newcode" name="code" type="text" placeholder="Исходный код" /></p>
@@ -115,12 +113,13 @@
     <p><input id="tc" size="100" @bind="tokenAmount" name="code" type="text" placeholder="Количество" /></p>
     <p><input id="tn" size="100" @bind="addressTo" name="code" type="text" placeholder="Адрес получателя" /></p>
 </div>
-<div>
-    <button @onclick="Transactions">Transactions</button>    
+@*<div>    
+    <button @onclick="Transactions">Transactions</button>
+    <button @onclick="COMulti">COMulti</button>
 </div>
 <div>
     <p><input id="tn" size="100" @bind="tid" name="code" type="text" placeholder="Адрес транзакции" /></p>
-</div>
+</div>*@
     @*<p>
         <select @bind="contrtest">
             <option value="0">[Select Contract]</option>
@@ -166,7 +165,7 @@
         <button @onclick="Transfer50">Transfer 50</button>
         <button @onclick="Unlock">Unlock</button>
         <div>Wallet:@myWallet</div>
-        <div>Token balance:@balanceHCB</div>
+        <div>Token balance:@balanceToken</div>
         <br><br>
         @*<button @onclick="EstimateGas">EstimateGas</button>*@
     <p>Export address:</p>
@@ -193,6 +192,11 @@
     string contractAddress = "";
     string gas = "";
 
+    async Task COMulti()
+    {
+        await bcMain.ChangeOwnerMulti();
+    }
+
     async Task Transactions()
     {
         //bcMain.Transactions("0x862A2Ac8D1dB37085c786981A8F5bd54594f7162");
@@ -283,7 +287,7 @@
 
     async Task TransferToken()
     {
-        await bcMain.TransferToken(bcMain.address, tokenContract, addressTo, tokenAmount);
+        await bcMain.TransferToken(Blockchain.MultiOwnerContractRinkeby, tokenContract, addressTo, tokenAmount);
     }
 
     async Task EstimateGas()
@@ -429,7 +433,7 @@
             myWallet = bcMain.address;
             balance = await bcMain.GetBalance();
         }
-        await bcMain.GetBalanceToken("0xe5D682717955d6C35d465A3485625C64655a04f4", myWallet);
+        await bcMain.GetBalanceToken(Blockchain.QNMAddress, myWallet);
     }
 
     //private async Task CreateBlockchainAccount(Blockchain bc, string pass)

+ 2 - 2
Pages/Blockchains.razor.cs

@@ -15,9 +15,9 @@ namespace HyperCube.Pages
         public int Smart { get; set; }
         public string answer;
         public string myWallet;
-        public string balanceHCB
+        public string balanceToken
         {
-            get { return HyperCube.Models.Blockchain.balanceHCB; }
+            get { return HyperCube.Models.Blockchain.balanceToken; }
             set { }
         }
         //public partial class Blocchains

+ 29 - 43
Pages/ModalAssets.razor

@@ -25,13 +25,13 @@
                         </div>
                         <div class="modal__body__calc__balance__numbers__value">
                             <div class="modal__body__calc__balance__numbers__value__item">
-                                <p>---</p>
+                                <p>@systemEth</p>
                                 <p>ETH</p>
 
                             </div>
                             <div class="modal__body__calc__balance__numbers__value__item">
-                                <p>---</p>
-                                <p>HCB</p>
+                                <p>@systemToken</p>
+                                <p>QNM</p>
                             </div>
                         </div>
                     </div>
@@ -47,7 +47,7 @@
                             </div>
                             <div class="modal__body__calc__balance__numbers__value__item">
                                 <p>@tokenBalance</p>
-                                <p>HCB</p>
+                                <p>QNM</p>
                             </div>
                         </div>
                     </div>
@@ -63,13 +63,13 @@
                             <input @bind=fromInput @bind:event="oninput" type="text" class="modal__input">
                             <select @bind="from_token_selected" type="select" class="modal__select">
                                 <option value="eth">ETH</option>
-                                <option value="hcb">HCB</option>
+                                <option value="qnm">QNM</option>
                             </select>
                         </div>
                         <div class="modal__input__box" place="To" balanc=@chosenBalanceTo>
                             <input @bind=toInput @bind:event="oninput" type="text" class="modal__input">
                             <select @bind="to_token_selected"  type="select" class="modal__select">
-                                <option value="hcb">HCB</option>
+                                <option value="qnm">QNM</option>
                                 <option value="eth">ETH</option>
                             </select>
                         </div>
@@ -103,30 +103,14 @@
     string fi;
     string ti;
     long lastInput = 0;
-
-    bool counter = false;
-    void cfi(string val)
-    {
-        if (!counter)
-            fi = val;
-        else
-            counter = false;
-    }
+    string systemEth;
+    string systemToken;
 
     string fromInput
     {
-
         get { return fi;
         }
         set { fi = value;
-            //\s = пробел
-            //\S = любой символ, кроме пробельного
-            //+ одно или более вхождений
-            //. любой сивол, кроме перевода строки
-            //* ноль или более вхождений «а»
-            //скобки без экранирования = группы
-            //function transfer(address recipient, uint256 amount) 
-            string pattern = @".*\.+0";
             System.Threading.Thread.Sleep(1);
             var now = DateTimeOffset.Now.ToUnixTimeSeconds();
             if (now - lastInput > 0)
@@ -135,15 +119,12 @@
                 {
                     var val = float.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);
                     //var val = System.Convert.ToSingle(fi);
-                    val *= 5f;
-
-                    var matches = System.Text.RegularExpressions.Regex.Matches(value, pattern);
+                    if (to_token_selected == "qnm")
+                        val *= 1000f;
+                    else
+                        val /= 1000f;
 
-                    if (matches.Count > 0)
-                    {
-                        counter = true;
-                    }
-                    toInput = val.ToString();
+                    ti = val.ToString();
                 }
                 catch (Exception e)
                 {
@@ -159,6 +140,7 @@
     {
         get { return ti; }
         set { ti = value;
+            lastInput = DateTimeOffset.Now.ToUnixTimeSeconds();
             System.Threading.Thread.Sleep(1);
             var now = DateTimeOffset.Now.ToUnixTimeSeconds();
             if (now - lastInput > 0)
@@ -166,8 +148,11 @@
                 try
                 {
                     var val = float.Parse(ti, System.Globalization.CultureInfo.InvariantCulture);
-                    val /= 5f;
-                    cfi(val.ToString());    //prevent overflow
+                    if (to_token_selected == "eth")
+                        val *= 1000f;
+                    else
+                        val /= 1000f;
+                    fi = val.ToString();
                 }
                 catch (Exception e)
                 {
@@ -175,7 +160,6 @@
                     Console.WriteLine(e.Message);
                 }
             }
-            lastInput = DateTimeOffset.Now.ToUnixTimeSeconds();
         }
     }
     string ft;
@@ -187,7 +171,7 @@
         set {
             if (value == "eth")
             {
-                to_token_selected = "hcb";
+                to_token_selected = "qnm";
                 chosenBalanceFrom = ethBalance;
                 chosenBalanceTo = tokenBalance;
             }
@@ -200,7 +184,7 @@
             ft = value;
         }
     }
-    string to_token_selected;
+    string to_token_selected = "qnm";
 
     string elementid = "modal_assets";
 
@@ -214,7 +198,12 @@
         var bc = await _account.GetSelectedBlockChain();
         bc_selected = bc.name;
         if (bc.port == 8666)
-            tokenBalance = await bc.BalanceOf("0xe5D682717955d6C35d465A3485625C64655a04f4", _account.GetActualAddress(bc));
+        {
+            tokenBalance = await bc.BalanceOf(Blockchain.QNMAddress, _account.GetActualAddress(bc));
+            systemEth = await bc.GetBalance(Blockchain.MultiOwnerContractRinkeby);
+            systemToken = await bc.GetBalanceToken(Blockchain.QNMAddress, Blockchain.MultiOwnerContractRinkeby);
+            Console.WriteLine($"systemToken {systemToken}");
+        }
         else
             tokenBalance = "0";
     }
@@ -233,12 +222,8 @@
         {
             Console.WriteLine("true");
             var bc = await _account.GetSelectedBlockChain();
-            //сначала нужен аппрув перевода!
-            //from=erc20 to=eth
-            var amount = float.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);
-            bc.Approve(_account.GetActualAddress(bc), Blockchain.MultiOwnerContractRinkeby, fi, "0xe5D682717955d6C35d465A3485625C64655a04f4");
 
-            await bc.ChangeCurrency(from_token_selected, to_token_selected, "0xe5D682717955d6C35d465A3485625C64655a04f4", _account.GetActualAddress(bc), chosenBalanceFrom, chosenBalanceTo, fi, ti);
+            await bc.ExchangeCurrency(from_token_selected, to_token_selected, Blockchain.QNMAddress, _account.GetActualAddress(bc), fi, ti);
             //run change - recalculate balances
         }
         else
@@ -246,6 +231,7 @@
             Console.WriteLine("false");
             //cancel
         }
+        await Balances();
     }
 
     public void Close()