Wallet
Installation
- Maven
- Gradle
pom.xml
<dependency>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{version}}</version>
</dependency>
build.gradle
implementation '{{groupId}}:{{artifactId}}:{{version}}'
Client instantiation
WalletClient client = new WalletClient(key, secret);
Features
Get system status
- Sync
- Async
try{
SystemStatus res = client.getSystemStatus().sync();
}catch(ApiException e){
//...
}
client.getSystemStatus().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get all coins info
- Sync
- Async
try{
CoinInformation> res = client.getAllCoinsInfo().sync();
}catch(ApiException e){
//...
}
client.getAllCoinsInfo().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get Spot account snapshot
- Default
- Framed
- Sync
- Async
try{
SpotAccountSnapshotResponse res = client.getSpotAccountSnapshot().sync();
}catch(ApiException e){
//...
}
client.getSpotAccountSnapshot().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
SpotAccountSnapshotResponse res = client.getSpotAccountSnapshot(new TimeFrame(limit)).sync();
}catch(ApiException e){
//...
}
client.getSpotAccountSnapshot(new TimeFrame(limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get Margin account snapshot
- Default
- Framed
- Sync
- Async
try{
MarginAccountSnapshotResponse res = client.getMarginAccountSnapshot().sync();
}catch(ApiException e){
//...
}
client.getMarginAccountSnapshot().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
MarginAccountSnapshotResponse res = client.getMarginAccountSnapshot(new TimeFrame(limit)).sync();
}catch(ApiException e){
//...
}
client.getMarginAccountSnapshot(new TimeFrame(limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get Futures account snapshot
- Default
- Framed
- Sync
- Async
try{
FuturesAccountSnapshotResponse res = client.getFuturesAccountSnapshot().sync();
}catch(ApiException e){
//...
}
client.getFuturesAccountSnapshot().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
FuturesAccountSnapshotResponse res = client.getFuturesAccountSnapshot(new TimeFrame(limit)).sync();
}catch(ApiException e){
//...
}
client.getFuturesAccountSnapshot(new TimeFrame(limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Enable fast withdraw switch
- Sync
- Async
try{
client.enableFastWithdrawSwitch().sync();
}catch(ApiException e){
//...
}
client.enableFastWithdrawSwitch().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Disable fast withdraw switch
- Sync
- Async
try{
client.disableFastWithdrawSwitch().sync();
}catch(ApiException e){
//...
}
client.disableFastWithdrawSwitch().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Withdraw
- Sync
- Async
try{
WithdrawResult res = client.withdraw(new WithdrawParams(amount, asset, address)).sync();
}catch(ApiException e){
//...
}
client.withdraw(new WithdrawParams(amount, asset, address)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get deposit history
- Default
- By asset
- By status
- Both
- Framed
- Sync
- Async
try{
List<DepositHistory> res = client.getDepositHistory().sync();
}catch(ApiException e){
//...
}
client.getDepositHistory().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<DepositHistory> res = client.getDepositHistory(new DepositHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getDepositHistory(new DepositHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<DepositHistory> res = client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS)).sync();
}catch(ApiException e){
//...
}
client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<DepositHistory> res = client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS, asset)).sync();
}catch(ApiException e){
//...
}
client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS, asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<DepositHistory> res = client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS, asset),new FramedPaging(page, limit)).sync();
}catch(ApiException e){
//...
}
client.getDepositHistory(new DepositHistoryParams(DepositStatus.SUCCESS, asset),new FramedPaging(page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get withdraw history
- Default
- By status
- By asset and status
- By withdraw order id
- Framed
- Sync
- Async
try{
List<WithdrawHistory> res = client.getWithdrawHistory().sync();
}catch(ApiException e){
//...
}
client.getWithdrawHistory().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<WithdrawHistory> res = client.getWithdrawHistory(new DepositHistoryParams(WithdrawStatus.COMPLETED)).sync();
}catch(ApiException e){
//...
}
client.getWithdrawHistory(new DepositHistoryParams(WithdrawStatus.COMPLETED)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<WithdrawHistory> res = client.getWithdrawHistory(new DepositHistoryParams(asset, WithdrawStatus.COMPLETED)).sync();
}catch(ApiException e){
//...
}
client.getWithdrawHistory(new DepositHistoryParams(asset, WithdrawStatus.COMPLETED)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<WithdrawHistory> res = client.getWithdrawHistory(new DepositHistoryParams(withdrawOrderId)).sync();
}catch(ApiException e){
//...
}
client.getWithdrawHistory(new DepositHistoryParams(withdrawOrderId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<WithdrawHistory> res = client.getWithdrawHistory(new DepositHistoryParams(asset, WithdrawStatus.COMPLETED), new FramedPaging(startTime, endTime, page)).sync();
}catch(ApiException e){
//...
}
client.getWithdrawHistory(new DepositHistoryParams(asset, WithdrawStatus.COMPLETED), new FramedPaging(startTime, endTime, page)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get deposit address
- Default
- By coin
- By coin and network
- Sync
- Async
try{
DepositAddress res = client.getDepositAddress().sync();
}catch(ApiException e){
//...
}
client.getDepositAddress().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
DepositAddress res = client.getDepositAddress(new DepositAddressParams(coin)).sync();
}catch(ApiException e){
//...
}
client.getDepositAddress(new DepositAddressParams(coin)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
DepositAddress res = client.getDepositAddress(new DepositAddressarams(coin, network)).sync();
}catch(ApiException e){
//...
}
client.getDepositAddress(new DepositAddressarams(coin, network)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get account status
- Sync
- Async
try{
AccountStatus res = client.getAccountstatus().sync();
}catch(ApiException e){
//...
}
client.getAccountstatus().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get API trading status
- Sync
- Async
try{
ApiTradingStatus res = client.getApiTradingStatus().sync();
}catch(ApiException e){
//...
}
client.getApiTradingStatus().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get dust log
- Default
- Framed
- Sync
- Async
try{
DustLog res = client.getDustLog().sync();
}catch(ApiException e){
//...
}
client.getDustLog().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
DustLog res = client.getDustLog(new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getDustLog(new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Do a dust transfer
- Default
- Multiple symbols
- Sync
- Async
try{
DustTransferResponse res = client.dustTransfer().sync();
}catch(ApiException e){
//...
}
client.dustTransfer().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
DustTransferResponse res = client.dustTransfer(new DustTransferParams(symbols[])).sync();
}catch(ApiException e){
//...
}
client.dustTransfer(new DustTransferParams(symbols[])).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get asset dividend record
- Default
- Specific symbol
- Specific symbol framed
- Framed
- Sync
- Async
try{
AssetDividendRecord res = client.getAssetDividendRecord().sync();
}catch(ApiException e){
//...
}
client.getAssetDividendRecord().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
AssetDividendRecord res = client.getAssetDividendRecord(new AssetDividendRecordParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getAssetDividendRecord(new AssetDividendRecordParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
AssetDividendRecord res = client.getAssetDividendRecord(new AssetDividendRecordParams(symbol), new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getAssetDividendRecord(new AssetDividendRecordParams(symbol), new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
AssetDividendRecord res = client.getAssetDividendRecord(new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getAssetDividendRecord(new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get asset detail
- Default
- Specific symbol
- Sync
- Async
try{
Map<String, AssetDetail> res = client.getAssetDetail().sync();
}catch(ApiException e){
//...
}
client.getAssetDetail().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
Map<String, AssetDetail> res = client.getAssetDetail(new AssetDetailParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getAssetDetail(new AssetDetailParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get trade fee
- Default
- Specific symbol
- Sync
- Async
try{
List<TradeFee> res = client.getTradeFee().sync();
}catch(ApiException e){
//...
}
client.getTradeFee().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<TradeFee> res = client.getTradeFee(new TradeFeeParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getTradeFee(new TradeFeeParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Make a universal transfer
- Sync
- Async
try{
WalletTransferResponse res = client.transfer(new WalletTransferParams(asset, type, amount, fromSymbol, toSymbol)).sync();
}catch(ApiException e){
//...
}
client.transfer(new WalletTransferParams(asset, type, amount, fromSymbol, toSymbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get transfer history
- Sync
- Async
try{
WalletTransferHistory res = client.getTransferHistory(new WalletTransferHistoryParams(type, fromSymbol, toSymbol)).sync();
}catch(ApiException e){
//...
}
client.getTransferHistory(new WalletTransferHistoryParams(type, fromSymbol, toSymbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
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
- Default
- Specific asset
- Sync
- Async
try{
List<FundingAsset> res = client.getFundingWallet().sync();
}catch(ApiException e){
//...
}
client.getFundingWallet().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<FundingAsset> res = client.getFundingWallet(new FundingAssetParams(asset, needBtcValuation)).sync();
}catch(ApiException e){
//...
}
client.getFundingWallet(new FundingAssetParams(asset, needBtcValuation)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get API permissions
- Sync
- Async
try{
ApiPermissions res = client.getApiPermissions().sync();
}catch(ApiException e){
//...
}
client.getApiPermissions().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});