You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
// First, we obtain a listenKey which is required to interact with the user data stream
String listenKey = client.startUserDataStream();
// Then, we open a new web socket client, and provide a callback that is called on every update
BinanceApiWebSocketClient webSocketClient = factory.newWebSocketClient();
// Listen for changes in the account
webSocketClient.onUserDataUpdateEvent(listenKey, response -> {
if (response.getEventType() == UserDataUpdateEventType.ACCOUNT_POSITION_UPDATE) {
AccountUpdateEvent accountUpdateEvent = response.getOutboundAccountPositionUpdateEvent();
// Print new balances of every available asset
System.out.println(accountUpdateEvent.getBalances());
} else {
OrderTradeUpdateEvent orderTradeUpdateEvent = response.getOrderTradeUpdateEvent();
// Print details about an order/trade
System.out.println(orderTradeUpdateEvent);
// Print original quantity
System.out.println(orderTradeUpdateEvent.getOriginalQuantity());
// Or price
System.out.println(orderTradeUpdateEvent.getPrice());
}
});
System.out.println("Waiting for events...");
}
}
`
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
can some body help me?
I post a new order, change balances and ... but it's not append?
`package com.binance.api.examples;
import com.binance.api.client.BinanceApiClientFactory;
import com.binance.api.client.BinanceApiRestClient;
import com.binance.api.client.BinanceApiWebSocketClient;
import com.binance.api.client.domain.account.AssetBalance;
import com.binance.api.client.domain.account.Order;
import com.binance.api.client.domain.account.request.OrderRequest;
import com.binance.api.client.domain.event.AccountUpdateEvent;
import com.binance.api.client.domain.event.OrderTradeUpdateEvent;
import com.binance.api.client.domain.event.UserDataUpdateEvent.UserDataUpdateEventType;
import java.util.List;
/**
User data stream endpoints examples.
It illustrates how to create a stream to obtain updates on a user account,
as well as update on trades/orders on a user account.
*/
public class UserDataStreamExample {
public static void main(String[] args) {
BinanceApiClientFactory factory = BinanceApiClientFactory.newInstance("*****",
"****");
BinanceApiRestClient client = factory.newRestClient();
}
}
`
The text was updated successfully, but these errors were encountered: