pkg/exchange: use balance update instead of snapshot event

This commit is contained in:
Edwin 2023-09-26 16:07:54 +08:00
parent 70884538bc
commit 9f83165032
2 changed files with 3 additions and 3 deletions

View File

@ -385,7 +385,7 @@ func (s *Stream) handleMarketTradeEvent(events []MarketTradeEvent) {
}
func (s *Stream) handleWalletEvent(events []bybitapi.WalletBalances) {
s.StandardStream.EmitBalanceSnapshot(toGlobalBalanceMap(events))
s.StandardStream.EmitBalanceUpdate(toGlobalBalanceMap(events))
}
func (s *Stream) handleOrderEvent(events []OrderEvent) {

View File

@ -135,8 +135,8 @@ func TestStream(t *testing.T) {
err := s.Connect(context.Background())
assert.NoError(t, err)
s.OnBalanceSnapshot(func(balances types.BalanceMap) {
t.Log("got snapshot", balances)
s.OnBalanceUpdate(func(balances types.BalanceMap) {
t.Log("got update", balances)
})
c := make(chan struct{})
<-c