Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast fixed #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PoloniexApi.Net/TradingTools/Trading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private IList<IOrder> GetOpenOrders(CurrencyPair currencyPair)
};

var data = PostData<IList<Order>>("returnOpenOrders", postData);
return data.Any() ? data.ToList<IOrder>() : new List<IOrder>();
return data.Any() ? data.Select(x => (IOrder)x).ToList() : new List<IOrder>();
}

private IList<ITrade> GetTrades(CurrencyPair currencyPair, DateTime startTime, DateTime endTime)
Expand Down
4 changes: 3 additions & 1 deletion PoloniexApi.Net/WalletTools/Wallet.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

Expand All @@ -19,7 +20,8 @@ private IDictionary<string, IBalance> GetBalances()
var postData = new Dictionary<string, object>();

var data = PostData<IDictionary<string, IBalance>>("returnCompleteBalances", postData);
return data;
var result = data.ToDictionary(k => k.Key, v => v.Value as IBalance);
return result;
}

private IDictionary<string, string> GetDepositAddresses()
Expand Down