Ошибка FromBtcAsync - PullRequest
       10

Ошибка FromBtcAsync

0 голосов
/ 07 мая 2018

Я новичок в BlockChain и использую https://blockchain.info/api c # для проекта.

Я получаю эту ошибку One or more errors occurred. (Additional text encountered after finished reading JSON content: ,. Path '', line 1, position 1.). Когда параметр btc равен 0.1 и его значение уменьшается.

[HttpPost]
public ActionResult ConvertBTCToCurrency(decimal btc, string currency)
{
    var error = "";
    try
    {
        var btcVal = new BitcoinValue(btc);
        explorer = new ExchangeRateExplorer();
        var btcAmountResult = explorer.FromBtcAsync(btcVal, currency).Result;
        return Json(new { statusCode = 200, worthCurrency = btcAmountResult });
    }
    catch (Exception e)
    {
        Debug.WriteLine(e.Message);
        error = e.Message;
    }
    return Json(new { statusCode = 201, worthCurrency = error });
}
...