public void SubscribingToUserStream_Should_TriggerWhenAccountUpdateStreamMessageIsReceived() { // arrange var socket = new TestSocket(); var client = TestHelpers.CreateSocketClient(socket); BinanceStreamBalanceUpdate result = null; client.Spot.SubscribeToUserDataUpdates("test", null, null, null, (test) => result = test); var data = new BinanceStreamBalanceUpdate() { Event = "balanceUpdate", EventTime = new DateTime(2017, 1, 1), Asset = "BTC", BalanceDelta = 1, ClearTime = new DateTime(2018, 1, 1), }; // act socket.InvokeMessage(data); // assert Assert.IsNotNull(result); Assert.IsTrue(TestHelpers.AreEqual(data, result)); }
public static Transaction FromBinanceStreamBalanceUpdate(BinanceStreamBalanceUpdate update) { Transaction t = new Transaction(); t.Asset = update.Asset; t.Amount = update.BalanceDelta; t.Timestamp = update.EventTime; return(t); }
private void UpdateAccountBalance(BinanceStreamBalanceUpdate balUpdate) { Console.WriteLine("Binance UpdateAccountBalance"); }
public BalanceUpdate(BinanceStreamBalanceUpdate update) { Timestamp = update.EventTime; Asset = update.Asset; Amount = update.BalanceDelta; }