Class BinanceAccountService
java.lang.Object
org.knowm.xchange.service.BaseExchangeService<BinanceExchange>
org.knowm.xchange.service.BaseResilientExchangeService<BinanceExchange>
org.knowm.xchange.binance.service.BinanceBaseService
org.knowm.xchange.binance.service.BinanceAccountServiceRaw
org.knowm.xchange.binance.service.BinanceAccountService
- All Implemented Interfaces:
AccountService,BaseService
- Direct Known Subclasses:
BinanceUsAccountService
-
Field Summary
Fields inherited from class org.knowm.xchange.binance.service.BinanceBaseService
apiKey, binance, binanceFutures, inverseBinanceFutures, LOG, signatureCreatorFields inherited from class org.knowm.xchange.service.BaseResilientExchangeService
resilienceRegistriesFields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange -
Constructor Summary
ConstructorsConstructorDescriptionBinanceAccountService(BinanceExchange exchange, ResilienceRegistries resilienceRegistries) -
Method Summary
Modifier and TypeMethodDescriptionCreateTradeHistoryParamsobject specific to this exchange.Get account infogetCommissionRateByInstrument(Instrument instrument) getDynamicTradingFeesByInstrument(String... category) Results based on ExchangeSpecificParametersItem(EXCHANGE_TYPE)getFlexiblePositions(String asset, String productId, Long current, Long size) getFundingHistory(TradeHistoryParams params) requestDepositAddress(Currency currency, String... args) Request a digital currency address to fund this account.requestDepositAddress(RequestDepositAddressParams requestDepositAddressParams) Request a digital currency address to fund this account.requestDepositAddressData(Currency currency, String... args) Request a digital currency address to fund this account.requestDepositAddressData(RequestDepositAddressParams requestDepositAddressParams) Request a digital currency address to fund this account.booleansetLeverage(Instrument instrument, int leverage, Object... args) Change user's initial leverage of specific symbol market.withdrawFunds(Currency currency, BigDecimal amount, String address) Convenience method, typically just delegates to withdrawFunds(WithdrawFundsParams params)withdrawFunds(Currency currency, BigDecimal amount, AddressWithTag address) Convenience method, typically just delegates to withdrawFunds(WithdrawFundsParams params)withdrawFunds(WithdrawFundsParams params) Withdraw funds from this account.Methods inherited from class org.knowm.xchange.binance.service.BinanceAccountServiceRaw
account, currencyInfos, depositHistory, futuresAccount, futuresAccount, getAssetDividend, getAssetDividend, getCommissionRate, getCurrencyInfo, getCurrencyInfoCached, getFiatOrders, getFlexiblePositionsRaw, getLockedPositionsRaw, getSubUserHistory, getTradeFee, getTransferHistory, requestAssetDetail, requestDepositAddress, requestDepositAddressWithNetwork, setDualSidePosition, setLeverageRaw, setMarginType, withdraw, withdraw, withdrawHistoryMethods inherited from class org.knowm.xchange.binance.service.BinanceBaseService
getRecvWindow, getSystemStatus, getTimestampFactoryMethods inherited from class org.knowm.xchange.service.BaseResilientExchangeService
decorateApiCall, rateLimiter, rateLimiter, retry, retryMethods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrder
-
Constructor Details
-
BinanceAccountService
-
-
Method Details
-
getAccountInfo
Description copied from interface:AccountServiceGet account info- Specified by:
getAccountInfoin interfaceAccountService- Returns:
- the AccountInfo object, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
getDynamicTradingFeesByInstrument
Results based on ExchangeSpecificParametersItem(EXCHANGE_TYPE)- Specified by:
getDynamicTradingFeesByInstrumentin interfaceAccountService- Parameters:
category- Optional arguments - instrument category. Exchange-specific (SPOT, SWAP, etc...)- Returns:
- map between currency pairs and their fees at the time of invocation.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
getCommissionRateByInstrument
- Throws:
IOException
-
withdrawFunds
public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException Description copied from interface:AccountServiceConvenience method, typically just delegates to withdrawFunds(WithdrawFundsParams params)- Specified by:
withdrawFundsin interfaceAccountService- Parameters:
currency- The currency to withdrawamount- The amount to withdrawaddress- The destination address- Returns:
- The result of the withdrawal (usually a transaction ID)
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
withdrawFunds
public String withdrawFunds(Currency currency, BigDecimal amount, AddressWithTag address) throws IOException Description copied from interface:AccountServiceConvenience method, typically just delegates to withdrawFunds(WithdrawFundsParams params)- Specified by:
withdrawFundsin interfaceAccountService- Parameters:
currency- The currency to withdrawamount- The amount to withdrawaddress- The destination address- Returns:
- The result of the withdrawal (usually a transaction ID)
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
withdrawFunds
Description copied from interface:AccountServiceWithdraw funds from this account. Allows to withdraw digital currency funds from the exchange account to an external address- Specified by:
withdrawFundsin interfaceAccountService- Parameters:
params- The withdrawl details- Returns:
- The result of the withdrawal (usually a transaction ID)
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
requestDepositAddress
Description copied from interface:AccountServiceRequest a digital currency address to fund this account. Allows to fund the exchange account with digital currency from an external address- Specified by:
requestDepositAddressin interfaceAccountService- Parameters:
currency- The digital currency that corresponds to the desired deposit address.args- Necessary argument(s) as aString- Returns:
- the internal deposit address to send funds to
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
requestDepositAddressData
public AddressWithTag requestDepositAddressData(Currency currency, String... args) throws IOException Description copied from interface:AccountServiceRequest a digital currency address to fund this account. Allows to fund the exchange account with digital currency from an external address- Specified by:
requestDepositAddressDatain interfaceAccountService- Parameters:
currency- The digital currency that corresponds to the desired deposit address.- Returns:
- the internal deposit address to send funds to
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
requestDepositAddressData
public AddressWithTag requestDepositAddressData(RequestDepositAddressParams requestDepositAddressParams) throws IOException Description copied from interface:AccountServiceRequest a digital currency address to fund this account. Allows to fund the exchange account with digital currency from an external address- Specified by:
requestDepositAddressDatain interfaceAccountService- Parameters:
requestDepositAddressParams- The deposit address request parameters- Returns:
- the internal deposit address to send funds to
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
requestDepositAddress
public String requestDepositAddress(RequestDepositAddressParams requestDepositAddressParams) throws IOException Description copied from interface:AccountServiceRequest a digital currency address to fund this account. Allows to fund the exchange account with digital currency from an external address- Specified by:
requestDepositAddressin interfaceAccountService- Parameters:
requestDepositAddressParams- The deposit address request parameters- Returns:
- the internal deposit address to send funds to
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
getAssetDetails
- Throws:
IOException
-
createFundingHistoryParams
Description copied from interface:AccountServiceCreateTradeHistoryParamsobject specific to this exchange. Object created by this method may be used to discover supported and requiredAccountService.getFundingHistory(TradeHistoryParams)parameters and should be passed only to the method in the same class as the createFundingHistoryParams that created the object.- Specified by:
createFundingHistoryParamsin interfaceAccountService
-
getFundingHistory
- Specified by:
getFundingHistoryin interfaceAccountService- Returns:
- list of funding history if available or an empty list otherwise. This should never return null.
- Throws:
IOException- - Indication that a networking error occurred while fetching JSON data
-
setLeverage
Description copied from interface:AccountServiceChange user's initial leverage of specific symbol market.- Specified by:
setLeveragein interfaceAccountService- Parameters:
instrument- symbol to change leverageleverage- leverage- Returns:
- true, if success
- Throws:
IOException
-
getSimpleAccount
- Overrides:
getSimpleAccountin classBinanceAccountServiceRaw- Throws:
IOException
-
getFlexiblePositions
public List<BinanceFlexiblePosition> getFlexiblePositions(String asset, String productId, Long current, Long size) throws IOException - Throws:
IOException
-
getLockedPositions
public List<BinanceLockedPosition> getLockedPositions(String asset, Long positionId, String projectId, Long current, Long size) throws IOException - Throws:
IOException
-