Wallet
Description
Binance4j-wallet is a Java connector for the wallet endpoints of the Binance REST API.
Installation
- Maven
- Gradle
<dependency>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{version}}</version>
</dependency>
implementation '{{groupId}}:{{artifactId}}:{{version}}'
Dependencies
- binance4j-core : The core of every binance4j artifact
- Lombok : Prevent boilerplate code.
- OkHttp : HTTP && Websocket clients
- Retrofit : Map API endpoints with annotations.
- Jackson : Payload deserialization
- Apache Common Codecs : Encode/decode urls
Get system status
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
SystemStatus response = client.getSystemStatus().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getSystemStatus().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getSystemStatus().then(new ApiCallback<SystemStatus>() {
@Override
public void onResponse(SystemStatus response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get all coins info
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
List<CoinInformation> response = client.getAllCoinsInfo().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getAllCoinsInfo().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getAllCoinsInfo().then(new ApiCallback<List<CoinInformation>>() {
@Override
public void onResponse(List<CoinInformation> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get Account snapshot
- SPOT
- MARGIN
- FUTURES
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
SpotAccountSnapshotResponse response = client.getSpotAccountSnapshot().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getSpotAccountSnapshot().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getSpotAccountSnapshot().then(new ApiCallback<SpotAccountSnapshotResponse>() {
@Override
public void onResponse(SpotAccountSnapshotResponse response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
MarginAccountSnapshotResponse response = client.getMarginAccountSnapshot().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getMarginAccountSnapshot().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getMarginAccountSnapshot().then(new ApiCallback<MarginAccountSnapshotResponse>() {
@Override
public void onResponse(MarginAccountSnapshotResponse response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
FuturesAccountSnapshotResponse response = client.getFuturesAccountSnapshot().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getFuturesAccountSnapshot().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getFuturesAccountSnapshot().then(new ApiCallback<FuturesAccountSnapshotResponse>() {
@Override
public void onResponse(FuturesAccountSnapshotResponse response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Enable fast withdraw switch
Enables fast withdraw switch under your account.
You need to enable trade
option for the api key which requests this endpoint.
When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly.
There is no on-chain transaction, no transaction ID and no withdrawal fee.
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
client.enableFastWithdrawSwitch().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.enableFastWithdrawSwitch().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.enableFastWithdrawSwitch().then(new ApiCallback<Void>() {
@Override
public void onResponse() {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Disable fast withdraw switch
Disables fast withdraw switch under your account.
You need to enable trade
option for the api key which requests this endpoint.
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
client.disableFastWithdrawSwitch().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.disableFastWithdrawSwitch().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.disableFastWithdrawSwitch().then(new ApiCallback<Void>() {
@Override
public void onResponse() {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Withdraw
If network not send, return with default network of the coin.
You can get network
and isDefault
in networkList of a coin in the response of getAllCoinsInfo
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawRequest request = new WithdrawRequest(new BigDecimal(1), "BTC", "0x00000000000000");
try{
WithdrawResult response = client.withdraw(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawRequest request = new WithdrawRequest(new BigDecimal(1), "BTC", "0x00000000000000");
client.withdraw(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawRequest request = new WithdrawRequest(new BigDecimal(1), "BTC", "0x00000000000000");
client.withdraw().then(new ApiCallback<WithdrawResult>() {
@Override
public void onResponse(WithdrawResult response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get deposit history
Fetches the deposit history of one or multiple coins.
- All coins
- Specific coin
- By status (DepositStatus)
- By status (int)
- By coin and status
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
List<DepositHistory> response = client.getDepositHistory().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getDepositHistory().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getDepositHistory().then(new ApiCallback<List<DepositHistory>>() {
@Override
public void onResponse(List<DepositHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC");
try{
List<DepositHistory> response = client.getDepositHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC");
client.getDepositHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC");
client.getDepositHistory().then(new ApiCallback<List<DepositHistory>>() {
@Override
public void onResponse(List<DepositHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(DepositStatus.SUCCESS);
try{
List<DepositHistory> response = client.getDepositHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(DepositStatus.SUCCESS);
client.getDepositHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(DepositStatus.SUCCESS);
client.getDepositHistory().then(new ApiCallback<List<DepositHistory>>() {
@Override
public void onResponse(List<DepositHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(1);
try{
List<DepositHistory> response = client.getDepositHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(1);
client.getDepositHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest(1);
client.getDepositHistory().then(new ApiCallback<List<DepositHistory>>() {
@Override
public void onResponse(List<DepositHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC", DepositStatus.SUCCESS);
try{
List<DepositHistory> response = client.getDepositHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC", DepositStatus.SUCCESS);
client.getDepositHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
DepositHistoryRequest request = new DepositHistoryRequest("BTC", DepositStatus.SUCCESS);
client.getDepositHistory().then(new ApiCallback<List<DepositHistory>>() {
@Override
public void onResponse(List<DepositHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Please notice the default startTime
and endTime
to make sure that time interval is within 0-90
days.
If both startTime
and endTime
are sent, time between startTime
and endTime
must be
less than 90 days.
Get withdraw history
Fetches the withdraw history of one or multiple coins.
- All coins
- Specific coin
- By status (WithdrawStatus)
- By status (int)
- By coin and status
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
List<WithdrawHistory> response = client.getWithdrawHistory().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getWithdrawHistory().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getWithdrawHistory().then(new ApiCallback<List<WithdrawHistory>>() {
@Override
public void onResponse(List<WithdrawHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC");
try{
List<WithdrawHistory> response = client.getWithdrawHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC");
client.getWithdrawHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC");
client.getWithdrawHistory().then(new ApiCallback<List<WithdrawHistory>>() {
@Override
public void onResponse(List<WithdrawHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(WithdrawStatus.SUCCESS);
try{
List<WithdrawHistory> response = client.getWithdrawHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(WithdrawStatus.SUCCESS);
client.getWithdrawHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(WithdrawStatus.SUCCESS);
client.getWithdrawHistory().then(new ApiCallback<List<WithdrawHistory>>() {
@Override
public void onResponse(List<WithdrawHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(6);
try{
List<WithdrawHistory> response = client.getWithdrawHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(6);
client.getWithdrawHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest(6);
client.getWithdrawHistory().then(new ApiCallback<List<WithdrawHistory>>() {
@Override
public void onResponse(List<WithdrawHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC", WithdrawStatus.COMPLETED);
try{
List<WithdrawHistory> response = client.getWithdrawHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC", WithdrawStatus.COMPLETED);
client.getWithdrawHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawHistoryRequest request = new WithdrawHistoryRequest("BTC", WithdrawStatus.COMPLETED);
client.getWithdrawHistory().then(new ApiCallback<List<WithdrawHistory>>() {
@Override
public void onResponse(List<WithdrawHistory> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Network may not be in the response for old withdraw.
Please notice the default startTime
and endTime
to make sure that time interval is within 0-90 days.
If both startTime
and endTime
are sent, time between startTime and endTime
must be less than 90 days.
If withdrawOrderId
is sent, time between startTime
and endTime
must be less than 7 days.
If withdrawOrderId
is sent, startTime
and endTime
are not sent, will return last 7 days records by default.
Get deposit address
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WithdrawRequesDepositAddressRequest request = new WithdrawRequesDepositAddressRequest("BNB");
try{
DepositAddress response = client.getDepositAddress(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WithdrawRequesDepositAddressRequest request = new WithdrawRequesDepositAddressRequest("BNB");
client.getDepositAddress(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WithdrawRequesDepositAddressRequest request = new WithdrawRequesDepositAddressRequest("BNB");
client.getDepositAddress().then(new ApiCallback<DepositAddress>() {
@Override
public void onResponse(DepositAddress response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
You can get network
and isDefault
in networkList
in the response of getAllCoinsInfo
If network
is not sent, return with default network of the coin.
Get account status
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
AccountStatus response = client.getAccountstatus().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getAccountstatus().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getAccountstatus().then(new ApiCallback<AccountStatus>() {
@Override
public void onResponse(AccountStatus response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get API trading status
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
ApiTradingStatus response = client.getApiTradingStatus().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getApiTradingStatus().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getApiTradingStatus().then(new ApiCallback<ApiTradingStatus>() {
@Override
public void onResponse(ApiTradingStatus response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get dust log
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
DustLog response = client.getDustLog().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getDustLog().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getDustLog().then(new ApiCallback<DustLog>() {
@Override
public void onResponse(DustLog response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Do a dust transfer
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
DustTransferRequest request = new DustTransferRequest(List.of("BTC","SHIB","DOGE"));
try{
DustTransferResponse response = client.dustTransfer(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
DustTransferRequest request = new DustTransferRequest(List.of("BTC","SHIB","DOGE"));
client.dustTransfer(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
DustTransferRequest request = new DustTransferRequest(List.of("BTC","SHIB","DOGE"));
client.dustTransfer().then(new ApiCallback<DustTransferResponse>() {
@Override
public void onResponse(DustTransferResponse response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get asset dividend record
- Last 20 (default)
- Specific coin last 20
- Last 500 records
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
AssetDividendRecord response = client.getAssetDividendRecord().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getAssetDividendRecord().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getAssetDividendRecord().then(new ApiCallback<AssetDividendRecord>() {
@Override
public void onResponse(AssetDividendRecord response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC");
try{
AssetDividendRecord response = client.getAssetDividendRecord(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC");
client.getAssetDividendRecord(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC");
client.getAssetDividendRecord().then(new ApiCallback<AssetDividendRecord>() {
@Override
public void onResponse(AssetDividendRecord response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC", 500);
try{
AssetDividendRecord response = client.getAssetDividendRecord(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC", 500);
client.getAssetDividendRecord(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
AssetDividendRecordRequest request = new AssetDividendRecordRequest("BTC", 500);
client.getAssetDividendRecord().then(new ApiCallback<AssetDividendRecord>() {
@Override
public void onResponse(AssetDividendRecord response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get asset detail
Get the details of all assets supported by Binance
- All assets
- One asset
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
Map<String, AssetDetail> response = client.getAssetDetail().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getAssetDetail().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getAssetDetail().then(new ApiCallback<Map<String, AssetDetail>>() {
@Override
public void onResponse(Map<String, AssetDetail> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
AssetDetailRequest request = new AssetDetailRequest("BTC");
try{
Map<String, AssetDetail> response = client.getAssetDetail(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
AssetDetailRequest request = new AssetDetailRequest("BTC");
client.getAssetDetail(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
AssetDetailRequest request = new AssetDetailRequest("BTC");
client.getAssetDetail().then(new ApiCallback<Map<String, AssetDetail>>() {
@Override
public void onResponse(Map<String, AssetDetail> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get trade fee
- All pairs
- One pair
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
List<TradeFee> response = client.getTradeFee().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getTradeFee().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getTradeFee().then(new ApiCallback<List<TradeFee>>() {
@Override
public void onResponse(List<TradeFee> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
undefined client = new undefined(key, secret);
TradeFeeRequest request = new TradeFeeRequest("BNBBTC");
try{
List<TradeFee> response = client.getTradeFee(request).execute();
}catch(ApiException e){
//...
}
undefined client = new undefined(key, secret);
TradeFeeRequest request = new TradeFeeRequest("BNBBTC");
client.getTradeFee(request).then(response->{
//...
});
undefined client = new undefined(key, secret);
TradeFeeRequest request = new TradeFeeRequest("BNBBTC");
client.getTradeFee().then(new ApiCallback<List<TradeFee>>() {
@Override
public void onResponse(List<TradeFee> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Make a universal transfer
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WalletTransferRequest request = new WalletTransferRequest(new BigDecimal("100"), "BNB", WalletTransferType.MAIN_MARGIN);
try{
WalletTransferResponse response = client.transfer(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WalletTransferRequest request = new WalletTransferRequest(new BigDecimal("100"), "BNB", WalletTransferType.MAIN_MARGIN);
client.transfer(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WalletTransferRequest request = new WalletTransferRequest(new BigDecimal("100"), "BNB", WalletTransferType.MAIN_MARGIN);
client.transfer().then(new ApiCallback<WalletTransferResponse>() {
@Override
public void onResponse(WalletTransferResponse response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get transfer history
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
WalletTransferHistoryRequest request = new WalletTransferHistoryRequest(WalletTransferType.MAIN_MARGIN);
try{
WalletTransferHistory response = client.getTransferHistory(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
WalletTransferHistoryRequest request = new WalletTransferHistoryRequest(WalletTransferType.MAIN_MARGIN);
client.getTransferHistory(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
WalletTransferHistoryRequest request = new WalletTransferHistoryRequest(WalletTransferType.MAIN_MARGIN);
client.getTransferHistory().then(new ApiCallback<WalletTransferHistory>() {
@Override
public void onResponse(WalletTransferHistory response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get funding asset
Fetches the funding wallet asset balance
Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token
- All balances
- Specific
- SAdd BTC valuation
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
List<FundingAsset> response = client.getFundingWallet().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getFundingWallet().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getFundingWallet().then(new ApiCallback<List<FundingAsset>>() {
@Override
public void onResponse(List<FundingAsset> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB");
try{
List<FundingAsset> response = client.getFundingWallet(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB");
client.getFundingWallet(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB");
client.getFundingWallet().then(new ApiCallback<List<FundingAsset>>() {
@Override
public void onResponse(List<FundingAsset> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB", true);
try{
List<FundingAsset> response = client.getFundingWallet(request).execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB", true);
client.getFundingWallet(request).then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
FundingAssetRequest request = new FundingAssetRequest("BNB", true);
client.getFundingWallet().then(new ApiCallback<List<FundingAsset>>() {
@Override
public void onResponse(List<FundingAsset> response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});
Get API permissions
- Sync
- Async (lambda)
- Async (ApiCallback)
WalletClient client = new WalletClient(key, secret);
try{
ApiPermissions response = client.getApiPermissions().execute();
}catch(ApiException e){
//...
}
WalletClient client = new WalletClient(key, secret);
client.getApiPermissions().then(response->{
//...
});
WalletClient client = new WalletClient(key, secret);
client.getApiPermissions().then(new ApiCallback<ApiPermissions>() {
@Override
public void onResponse(ApiPermissions response) {
//...
}
@Override
public void onFailure(ApiException exception) {
//...
}
});