Skip to content

Commit

Permalink
Remove BCH Asset and Symbol redirections
Browse files Browse the repository at this point in the history
For issue #106. Update static assets and symbols.
  • Loading branch information
sonvister committed Nov 18, 2018
1 parent 1d94ad4 commit 12d5bb9
Show file tree
Hide file tree
Showing 10 changed files with 440 additions and 497 deletions.
4 changes: 2 additions & 2 deletions samples/Binance24HourStatistics/CombinedStreamsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static void AdvancedExampleMain()
// Unsubscribe a symbol.
client.Unsubscribe(symbols[0]);

// Subscribe to the real Bitcoin :D
client.Subscribe(Symbol.BCH_USDT); // a.k.a. BCC.
// Subscribe to XRP.
client.Subscribe(Symbol.XRP_USDT); // drink the kool-aid.

// Set stream URI using client subscribed streams.
webSocket.Uri = BinanceWebSocketStream.CreateUri(client);
Expand Down
15 changes: 0 additions & 15 deletions samples/BinanceCodeGenerator/Asset.template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>

// <<insert assets>>

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
public static Asset BCH => BCC;

#endregion Public Constants

#region Implicit Operators
Expand Down Expand Up @@ -71,8 +68,6 @@ static Asset()
new[] {
// <<insert asset definitions>>
});

AddCacheRedirections();
}
catch (Exception e)
{
Expand Down Expand Up @@ -138,16 +133,6 @@ public override string ToString()

#endregion Public Methods

#region Internal Methods

internal static void AddCacheRedirections()
{
// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
Cache.Set("BCH", Cache.Get("BCC"));
}

#endregion Internal Methods

#region IComparable<Asset>

public int CompareTo(Asset other)
Expand Down
27 changes: 0 additions & 27 deletions samples/BinanceCodeGenerator/Symbol.template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public sealed class Symbol : IComparable<Symbol>, IEquatable<Symbol>

// <<insert symbols>>

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
public static Symbol BCH_USDT => BCC_USDT;
public static Symbol BCH_BNB => BCC_BNB;
public static Symbol BCH_BTC => BCC_BTC;
public static Symbol BCH_ETH => BCC_ETH;

#endregion Public Constants

#region Implicit Operators
Expand Down Expand Up @@ -109,12 +103,6 @@ static Symbol()
new[] {
// <<insert symbol definitions>>
});

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
Cache.Set("BCHUSDT", Cache.Get("BCCUSDT"));
Cache.Set("BCHBNB", Cache.Get("BCCBNB"));
Cache.Set("BCHBTC", Cache.Get("BCCBTC"));
Cache.Set("BCHETH", Cache.Get("BCCETH"));
}
catch (Exception e)
{
Expand Down Expand Up @@ -189,7 +177,6 @@ public static async Task UpdateCacheAsync(IBinanceApi api, CancellationToken tok

Cache.Clear();
Cache.Set(symbols);
AddCacheRedirections();

var assets = new List<Asset>();

Expand All @@ -204,7 +191,6 @@ public static async Task UpdateCacheAsync(IBinanceApi api, CancellationToken tok

Asset.Cache.Clear();
Asset.Cache.Set(assets);
Asset.AddCacheRedirections();
}

public override string ToString()
Expand All @@ -231,19 +217,6 @@ public override int GetHashCode()

#endregion Public Methods

#region Private Methods

private static void AddCacheRedirections()
{
// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
Cache.Set("BCH_USDT", Cache.Get("BCC_USDT"));
Cache.Set("BCH_BNB", Cache.Get("BCC_BNB"));
Cache.Set("BCH_BTC", Cache.Get("BCC_BTC"));
Cache.Set("BCH_ETH", Cache.Get("BCC_ETH"));
}

#endregion Private Methods

#region IComparable<Symbol>

public int CompareTo(Symbol other)
Expand Down
4 changes: 2 additions & 2 deletions samples/BinanceMarketDepth/CombinedStreamsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public static async Task AdvancedExampleMain()
// Unsubscribe a symbol.
client.Unsubscribe(symbols[0], limit);

// Subscribe to the real Bitcoin :D
client.Subscribe(Symbol.BCH_USDT, limit); // a.k.a. BCC.
// Subscribe to XRP.
client.Subscribe(Symbol.XRP_USDT, limit); // drink the kool-aid.

// Set stream URI using cache subscribed streams.
webSocket.Uri = BinanceWebSocketStream.CreateUri(client);
Expand Down
4 changes: 2 additions & 2 deletions samples/BinancePriceChart/CombinedStreamsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public static void AdvancedExampleMain()
// Unsubscribe a symbol.
client.Unsubscribe(symbols[0], interval);

// Subscribe to the real Bitcoin :D
client.Subscribe(Symbol.BCH_USDT, interval); // a.k.a. BCC.
// Subscribe to XRP.
client.Subscribe(Symbol.XRP_USDT, interval); // drink the kool-aid.

// Set stream URI using client subscribed streams.
webSocket.Uri = BinanceWebSocketStream.CreateUri(client);
Expand Down
4 changes: 2 additions & 2 deletions samples/BinanceTradeHistory/CombinedStreamsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static void AdvancedExampleMain()
// Unsubscribe a symbol.
client.Unsubscribe(symbols[0]);

// Subscribe to the real Bitcoin :D
client.Subscribe(Symbol.BCH_USDT); // a.k.a. BCC.
// Subscribe to XRP.
client.Subscribe(Symbol.XRP_USDT); // drink the kool-aid.

// Set stream URI using client subscribed streams.
webSocket.Uri = BinanceWebSocketStream.CreateUri(client);
Expand Down
33 changes: 15 additions & 18 deletions src/Binance/Asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
/// <summary>
/// When the assets were last updated.
/// </summary>
public static readonly long LastUpdateAt = 1538198581399;
public static readonly long LastUpdateAt = 1542548896815;

public static Asset ADA => Cache.Get("ADA");
public static Asset ADX => Cache.Get("ADX");
Expand All @@ -29,8 +29,9 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset ARN => Cache.Get("ARN");
public static Asset AST => Cache.Get("AST");
public static Asset BAT => Cache.Get("BAT");
public static Asset BCC => Cache.Get("BCC");
public static Asset BCD => Cache.Get("BCD");
public static Asset BCHABC => Cache.Get("BCHABC");
public static Asset BCHSV => Cache.Get("BCHSV");
public static Asset BCN => Cache.Get("BCN");
public static Asset BCPT => Cache.Get("BCPT");
public static Asset BLZ => Cache.Get("BLZ");
Expand All @@ -49,6 +50,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset CVC => Cache.Get("CVC");
public static Asset DASH => Cache.Get("DASH");
public static Asset DATA => Cache.Get("DATA");
public static Asset DCR => Cache.Get("DCR");
public static Asset DENT => Cache.Get("DENT");
public static Asset DGD => Cache.Get("DGD");
public static Asset DLT => Cache.Get("DLT");
Expand Down Expand Up @@ -94,6 +96,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset MCO => Cache.Get("MCO");
public static Asset MDA => Cache.Get("MDA");
public static Asset MFT => Cache.Get("MFT");
public static Asset MITH => Cache.Get("MITH");
public static Asset MOD => Cache.Get("MOD");
public static Asset MTH => Cache.Get("MTH");
public static Asset MTL => Cache.Get("MTL");
Expand All @@ -110,6 +113,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset OMG => Cache.Get("OMG");
public static Asset ONT => Cache.Get("ONT");
public static Asset OST => Cache.Get("OST");
public static Asset PAX => Cache.Get("PAX");
public static Asset PHX => Cache.Get("PHX");
public static Asset PIVX => Cache.Get("PIVX");
public static Asset POA => Cache.Get("POA");
Expand All @@ -127,6 +131,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset REQ => Cache.Get("REQ");
public static Asset RLC => Cache.Get("RLC");
public static Asset RPX => Cache.Get("RPX");
public static Asset RVN => Cache.Get("RVN");
public static Asset SALT => Cache.Get("SALT");
public static Asset SC => Cache.Get("SC");
public static Asset SKY => Cache.Get("SKY");
Expand All @@ -145,6 +150,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset TRIG => Cache.Get("TRIG");
public static Asset TRX => Cache.Get("TRX");
public static Asset TUSD => Cache.Get("TUSD");
public static Asset USDC => Cache.Get("USDC");
public static Asset USDT => Cache.Get("USDT");
public static Asset VEN => Cache.Get("VEN");
public static Asset VET => Cache.Get("VET");
Expand All @@ -169,9 +175,6 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static Asset ZIL => Cache.Get("ZIL");
public static Asset ZRX => Cache.Get("ZRX");

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
public static Asset BCH => BCC;

#endregion Public Constants

#region Implicit Operators
Expand Down Expand Up @@ -231,8 +234,9 @@ static Asset()
new Asset("ARN", 8),
new Asset("AST", 8),
new Asset("BAT", 8),
new Asset("BCC", 8),
new Asset("BCD", 8),
new Asset("BCHABC", 8),
new Asset("BCHSV", 8),
new Asset("BCN", 8),
new Asset("BCPT", 8),
new Asset("BLZ", 8),
Expand All @@ -251,6 +255,7 @@ static Asset()
new Asset("CVC", 8),
new Asset("DASH", 8),
new Asset("DATA", 8),
new Asset("DCR", 8),
new Asset("DENT", 8),
new Asset("DGD", 8),
new Asset("DLT", 8),
Expand Down Expand Up @@ -296,6 +301,7 @@ static Asset()
new Asset("MCO", 8),
new Asset("MDA", 8),
new Asset("MFT", 8),
new Asset("MITH", 8),
new Asset("MOD", 8),
new Asset("MTH", 8),
new Asset("MTL", 8),
Expand All @@ -312,6 +318,7 @@ static Asset()
new Asset("OMG", 8),
new Asset("ONT", 8),
new Asset("OST", 8),
new Asset("PAX", 8),
new Asset("PHX", 8),
new Asset("PIVX", 8),
new Asset("POA", 8),
Expand All @@ -329,6 +336,7 @@ static Asset()
new Asset("REQ", 8),
new Asset("RLC", 8),
new Asset("RPX", 8),
new Asset("RVN", 8),
new Asset("SALT", 8),
new Asset("SC", 8),
new Asset("SKY", 8),
Expand All @@ -347,6 +355,7 @@ static Asset()
new Asset("TRIG", 8),
new Asset("TRX", 8),
new Asset("TUSD", 8),
new Asset("USDC", 8),
new Asset("USDT", 8),
new Asset("VEN", 8),
new Asset("VET", 8),
Expand All @@ -371,8 +380,6 @@ static Asset()
new Asset("ZIL", 8),
new Asset("ZRX", 8),
});

AddCacheRedirections();
}
catch (Exception e)
{
Expand Down Expand Up @@ -438,16 +445,6 @@ public override string ToString()

#endregion Public Methods

#region Internal Methods

internal static void AddCacheRedirections()
{
// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
Cache.Set("BCH", Cache.Get("BCC"));
}

#endregion Internal Methods

#region IComparable<Asset>

public int CompareTo(Asset other)
Expand Down
Loading

0 comments on commit 12d5bb9

Please sign in to comment.