public class AccountAPIAdapter extends AuthRetrofitAPIImpl<AccountAPIRetrofit> implements AccountAPI
apiKey, apiKeyVersion, baseUrl, passPhrase, secret| 构造器和说明 |
|---|
AccountAPIAdapter(String baseUrl,
String apiKey,
String secret,
String passPhrase,
Integer apiKeyVersion) |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,String> |
createAccount(String currency,
String type)
Create an account.
|
SubApiKeyResponse |
createSubApiKey(String subName,
String passphrase,
String remark,
String permission,
String ipWhitelist,
String expire)
This endpoint can be used to create Spot APIs for sub-accounts.
|
SubUserCreateResponse |
createSubUser(String subName,
String password,
String access,
String remarks)
This endpoint can be used to create sub-accounts.
|
SubApiKeyResponse |
deleteSubApiKey(String subName,
String apiKey,
String passphrase)
This endpoint can be used to delete sub-account Spot APIs.
|
AccountBalanceResponse |
getAccount(String accountId)
Information for a single account.
|
Pagination<AccountDetailResponse> |
getAccountLedgers(String currency,
String direction,
String bizType,
long startAt,
long endAt,
int currentPage,
int pageSize)
List account activity.
|
List<AccountDetailResponse> |
getHFAccountLedgers(String currency,
String direction,
String bizType,
Long lastId,
Integer limit,
Long startAt,
Long endAt)
This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries.
|
SubAccountBalanceResponse |
getSubAccount(String subUserId)
Get info for a single sub-account.
|
Pagination<SubAccountBalanceResponse> |
getSubAccountPageList(int currentPage,
int pageSize)
This endpoint can be used to get paginated sub-account information.
|
List<SubApiKeyResponse> |
getSubApiKey(String subName,
String apiKey)
This endpoint can be used to obtain a list of Spot APIs pertaining to a sub-account.
|
UserSummaryInfoResponse |
getUserSummaryInfo()
This endpoint can be used to obtain account summary information.
|
Map<String,String> |
innerTransfer2(AccountTransferV2Request request)
The inner transfer interface is used for assets transfer among the accounts of a user and is free of charges on the platform.
|
List<AccountBalancesResponse> |
listAccounts(String currency,
String type)
Get a list of accounts.
|
List<SubAccountBalanceResponse> |
listSubAccounts()
Get a list of sub-accounts.
|
TransferableBalanceResponse |
transferable(String currency,
String type,
String tag)
This endpoint returns the transferable balance of a specified account.
|
Map<String,String> |
transferBetweenSubAndMasterV2(String clientOid,
String currency,
BigDecimal amount,
String direction,
String subUserId,
String subAccountType,
String accountType)
Transfer the assets between the master user and the sub-user and only supports main account.
|
List<AccountBalancesResponse> |
transferToHFAccount(String clientOid,
String currency,
String from,
BigDecimal amount)
transfer to the high-frequency account
|
SubApiKeyResponse |
updateSubApiKey(String subName,
String apiKey,
String passphrase,
String permission,
String ipWhitelist,
String expire)
This endpoint can be used to modify sub-account Spot APIs.
|
getAPIImplexecuteSync, getApiKey, getBaseUrl, getErrorResponse, getPassPhrase, getSecret, setApiKey, setBaseUrl, setPassPhrase, setSecretpublic List<AccountBalancesResponse> listAccounts(String currency, String type) throws IOException
AccountAPIYour accounts are separate from your KuCoin accounts. See the Deposits section for documentation on how to deposit funds to begin trading.
listAccounts 在接口中 AccountAPIcurrency - The code of the currencytype - Account type:,"main" or "trade" or "trade_hf"IOException - on socket errors.public AccountBalanceResponse getAccount(String accountId) throws IOException
AccountAPIgetAccount 在接口中 AccountAPIaccountId - id of the accountIOException - on socket errors.public Map<String,String> createAccount(String currency, String type) throws IOException
AccountAPIcreateAccount 在接口中 AccountAPIcurrency - the code of the currencytype - Account type ,"main" or "trade"IOException - on socket errors.public Pagination<AccountDetailResponse> getAccountLedgers(String currency, String direction, String bizType, long startAt, long endAt, int currentPage, int pageSize) throws IOException
AccountAPIgetAccountLedgers 在接口中 AccountAPIcurrency - Id of the accountdirection - [Optional] Side: in - Receive, out - SendbizType - [Optional] Business type: DEPOSIT, WITHDRAW, TRANSFER, SUB_TRANSFER,TRADE_EXCHANGE, MARGIN_EXCHANGE, KUCOIN_BONUS.startAt - Start time. unix timestamp calculated in seconds, the creation time queried shall posterior to the start timeendAt - End time. unix timestamp calculated in seconds, the creation time queried shall prior to the end time.currentPage - The page to fetchpageSize - The page size.IOException - on socket errors.public Map<String,String> innerTransfer2(AccountTransferV2Request request) throws IOException
AccountAPIinnerTransfer2 在接口中 AccountAPIIOExceptionpublic List<SubAccountBalanceResponse> listSubAccounts() throws IOException
AccountAPIYou need to create the account by using the API-KEY of sub user firstly if the account of sub user is not exist. Attention only trade account can be used for trading
listSubAccounts 在接口中 AccountAPIIOException - on socket errors.public SubAccountBalanceResponse getSubAccount(String subUserId) throws IOException
AccountAPIgetSubAccount 在接口中 AccountAPIsubUserId - id of the sub userIOException - on socket errors.public Map<String,String> transferBetweenSubAndMasterV2(String clientOid, String currency, BigDecimal amount, String direction, String subUserId, String subAccountType, String accountType) throws IOException
AccountAPItransferBetweenSubAndMasterV2 在接口中 AccountAPIclientOid - Request idcurrency - currency codeamount - Transfer amount, a multiple and positive number of the amount precision.direction - OUT — the master user to sub user;IN — the sub user to the master user.subUserId - id of the sub usersubAccountType - The account type of the sub user: MAIN or TRADEaccountType - The account type of the user: MAIN or TRADEIOException - on socket errors.public TransferableBalanceResponse transferable(String currency, String type, String tag) throws IOException
AccountAPItransferable 在接口中 AccountAPItype - The account type: MAIN, TRADE, TRADE_HF, MARGIN or POOLtag - [Optional] Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDTIOExceptionpublic UserSummaryInfoResponse getUserSummaryInfo() throws IOException
AccountAPIgetUserSummaryInfo 在接口中 AccountAPIIOException - on socket errors.public SubUserCreateResponse createSubUser(String subName, String password, String access, String remarks) throws IOException
AccountAPIcreateSubUser 在接口中 AccountAPIsubName - Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces)password - Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters)access - Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination)remarks - [Optional] Remarks(1~24 characters)IOException - on socket errors.public List<SubApiKeyResponse> getSubApiKey(String subName, String apiKey) throws IOException
AccountAPIgetSubApiKey 在接口中 AccountAPIsubName - Sub-account nameapiKey - [Optional] API-Key.IOException - on socket errors.public SubApiKeyResponse createSubApiKey(String subName, String passphrase, String remark, String permission, String ipWhitelist, String expire) throws IOException
AccountAPIcreateSubApiKey 在接口中 AccountAPIsubName - Sub-account name, create sub account name of API Keypassphrase - Password(Must contain 7-32 characters. Cannot contain any spaces.)remark - Remarks(1~24 characters)permission - [Optional] Permissions(Only "General" and "Trade" permissions can be set, such as "General, Trade". The default is "General")ipWhitelist - [Optional] IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)expire - [Optional] API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360IOException - on socket errors.public SubApiKeyResponse updateSubApiKey(String subName, String apiKey, String passphrase, String permission, String ipWhitelist, String expire) throws IOException
AccountAPIupdateSubApiKey 在接口中 AccountAPIsubName - Sub-account name, create sub account name of API KeyapiKey - API-Key(Sub-account APIKey)passphrase - Password(Must contain 7-32 characters. Cannot contain any spaces.)permission - [Optional] Permissions(Only "General" and "Trade" permissions can be set, such as "General, Trade". The default is "General")ipWhitelist - [Optional] IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)expire - [Optional] API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360IOException - on socket errors.public SubApiKeyResponse deleteSubApiKey(String subName, String apiKey, String passphrase) throws IOException
AccountAPIdeleteSubApiKey 在接口中 AccountAPIsubName - Sub-account name, create sub account name of API KeyapiKey - API-Key(Sub-account APIKey)passphrase - Password(Must contain 7-32 characters. Cannot contain any spaces.)IOException - on socket errors.public Pagination<SubAccountBalanceResponse> getSubAccountPageList(int currentPage, int pageSize) throws IOException
AccountAPIgetSubAccountPageList 在接口中 AccountAPIcurrentPage - Sub-account name, create sub account name of API KeypageSize - Password(Must contain 7-32 characters. Cannot contain any spaces)IOException - on socket errors.public List<AccountBalancesResponse> transferToHFAccount(String clientOid, String currency, String from, BigDecimal amount) throws IOException
AccountAPItransferToHFAccount 在接口中 AccountAPIclientOid - Client Order Id,a unique identifier created by the user, using UUID is recommendedcurrency - currencyfrom - Payment account type: main(main account), trade(trading account), trade_hf(high-frequency trading account)amount - Transfer amount, the precision is the precision of the currency multiplied by a positive integerIOExceptionpublic List<AccountDetailResponse> getHFAccountLedgers(String currency, String direction, String bizType, Long lastId, Integer limit, Long startAt, Long endAt) throws IOException
AccountAPIgetHFAccountLedgers 在接口中 AccountAPIcurrency - [Optional] Id of the accountdirection - [Optional] Side: in - Receive, out - SendbizType - [Optional] Business type: DEPOSIT, WITHDRAW, TRANSFER, SUB_TRANSFER,TRADE_EXCHANGE, MARGIN_EXCHANGE, KUCOIN_BONUS.lastId - [Optional] The id of the last set of data from the previous batch of data. By default, the latest information is given.limit - [Optional] Default100,Max200startAt - [Optional] Start time. unix timestamp calculated in seconds, the creation time queried shall posterior to the start timeendAt - [Optional] End time. unix timestamp calculated in seconds, the creation time queried shall prior to the end time.IOException - on socket errors.Copyright © 2023. All rights reserved.