Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public Object getWalletBalance(AccountDataRequest walletBalanceRequest) {
));
}

@Override
public Object getTransferableAmount(AccountDataRequest transferableAmountRequest) {
return executeSync(bybitApiService.getWithdrawal(transferableAmountRequest.getCoin()));
}

@Override
public Object upgradeAccountToUTA() {
return executeSync(bybitApiService.upgradeAccountToUTA());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public void getWalletBalance(AccountDataRequest walletBalanceRequest, BybitApiCa
).enqueue(new BybitApiCallbackAdapter<>(callback));
}

@Override
public void getTransferableAmount(AccountDataRequest transferableAmountRequest, BybitApiCallback<Object> callback) {
bybitApiService.getWithdrawal(transferableAmountRequest.getCoin())
.enqueue(new BybitApiCallbackAdapter<>(callback));
}

@Override
public void upgradeAccountToUTA(BybitApiCallback<Object> callback) {
bybitApiService.upgradeAccountToUTA().enqueue(new BybitApiCallbackAdapter<>(callback));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public interface BybitApiAccountRestClient {
// Account endpoints
Object getWalletBalance(AccountDataRequest walletBalanceRequest);
Object getTransferableAmount(AccountDataRequest transferableAmountRequest);
Object upgradeAccountToUTA();
Object getAccountBorrowHistory(AccountDataRequest borrowHistoryRequest);
Object setAccountCollateralCoin(AccountDataRequest setCollateralCoinRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public interface BybitApiAsyncAccountRestClient {
// Account endpoints
void getWalletBalance(AccountDataRequest walletBalanceRequest, BybitApiCallback<Object> callback);
void getTransferableAmount(AccountDataRequest transferableAmountRequest, BybitApiCallback<Object> callback);
void upgradeAccountToUTA(BybitApiCallback<Object> callback);
void getAccountBorrowHistory(AccountDataRequest borrowHistoryRequest, BybitApiCallback<Object> callback);
void setAccountCollateralCoin(AccountDataRequest setCollateralCoinRequest, BybitApiCallback<Object> callback);
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/bybit/api/client/restApi/BybitApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,17 @@ Call<Object> getPreUpgradeUsdcSettlement(@Query("category") String category,
Call<Object> getWalletBalance(@Query("accountType") String accountType,
@Query("coin") String coin);

/**
* Query the available amount to transfer of a specific coin in the Unified wallet.
* @param coin true string Coin name, uppercase only
* @return Response Parameters
* Parameter Type Comments
* &gt; availableWithdrawal String Transferable amount
*/
@Headers(BybitApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER)
@GET("/v5/account/withdrawal")
Call<Object> getWithdrawal(@Query("coinName") String coin);

/**
* Upgrade to Unified Account
* Upgrade Unified Account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.bybit.api.client.config.BybitApiConfig;
import com.bybit.api.client.domain.account.AccountType;
import com.bybit.api.client.domain.account.SpotHedgingMode;
import com.bybit.api.client.domain.account.request.AccountDataRequest;
import com.bybit.api.client.restApi.BybitApiAccountRestClient;
import com.bybit.api.client.service.BybitApiClientFactory;
Expand All @@ -17,4 +16,11 @@ public void Test_GetAccountBalance() {
var result = client.getWalletBalance(unifyWalletBalanceRequest);
System.out.println(result);
}

@Test
public void Test_GetCoinTransferableAmount() {
var getTransferableAmountRequest = AccountDataRequest.builder().coin("USDT").build();
var result = client.getTransferableAmount(getTransferableAmountRequest);
System.out.println(result);
}
}