print balance

This commit is contained in:
c9s 2020-12-28 16:24:49 +08:00
parent 2932230fdb
commit 638fd1bb99

View File

@ -95,6 +95,14 @@ var rootCmd = &cobra.Command{
stream := max.NewStream(key, secret)
stream.Subscribe(types.BookChannel, symbol, types.SubscribeOptions{})
stream.OnOrderUpdate(func(order types.Order) {
log.Infof("order: %+v", order)
})
stream.OnBalanceSnapshot(func(balances types.BalanceMap) {
log.Infof("balances: %+v",balances)
})
streambook := types.NewStreamBook(symbol)
streambook.BindStream(stream)