asset_pairs = HashMap for TradingAPI
This commit is contained in:
parent
1f07ccd611
commit
6194018dbb
@ -50,8 +50,7 @@ public class Exchange implements Configurable, GetJson {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private final HashMap<String, AssetPair> asset_pairs;
|
private final HashMap<AssetPair, TradingAPI> asset_pairs = new HashMap<>();
|
||||||
private final HashMap<AssetPair, TradingEnv> asset_pairs = new HashMap<>();
|
|
||||||
|
|
||||||
Exchange(World world, String symbol) {
|
Exchange(World world, String symbol) {
|
||||||
|
|
||||||
@ -88,12 +87,6 @@ public class Exchange implements Configurable, GetJson {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Order> getOrderBook(AssetPair a) {
|
|
||||||
TradingEnv e = asset_pairs.get(a);
|
|
||||||
SortedSet<Order> ob = e.order_books.get(Order.Type.BUYLIMIT);
|
|
||||||
return Collections.unmodifiableCollection(ob);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getConfig() {
|
public JSONObject getConfig() {
|
||||||
JSONObject cfg = new JSONObject();
|
JSONObject cfg = new JSONObject();
|
||||||
@ -142,8 +135,6 @@ public class Exchange implements Configurable, GetJson {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TradingAPI add(AssetPair p) {
|
private TradingAPI add(AssetPair p) {
|
||||||
|
Loading…
Reference in New Issue
Block a user