Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); gateapi-java/docs/WalletApi.md at master · gate/gateapi-java · GitHub
Skip to content

Latest commit

History

History
1725 lines (1345 loc) · 64.8 KB

File metadata and controls

1725 lines (1345 loc) · 64.8 KB

WalletApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
listCurrencyChainsGET /wallet/currency_chainsQuery chains supported for specified currency
getDepositAddressGET /wallet/deposit_addressGenerate currency deposit address
listWithdrawalsGET /wallet/withdrawalsGet withdrawal records
listDepositsGET /wallet/depositsGet deposit records
getTransferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
listSubAccountTransfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transferWithSubAccountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
subAccountToSubAccountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
getTransferOrderStatusGET /wallet/order_statusMain-Sub Account Transfer Status Query
listWithdrawStatusGET /wallet/withdraw_statusQuery withdrawal status
listSubAccountBalancesGET /wallet/sub_account_balancesQuery sub-account balance information
listSubAccountMarginBalancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
listSubAccountFuturesBalancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
listSubAccountCrossMarginBalancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
listSavedAddressGET /wallet/saved_addressQuery saved address
getTradeFeeGET /wallet/feeQuery personal trading fees
getTotalBalanceGET /wallet/total_balanceQuery personal account totals
listSmallBalanceGET /wallet/small_balanceGet list of convertible small balance currencies
convertSmallBalancePOST /wallet/small_balanceConvert small balance currency
listSmallBalanceHistoryGET /wallet/small_balance_historyGet convertible small balance currency history
listPushOrdersGET /wallet/pushGet UID transfer history
getLowCapExchangeListGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

listCurrencyChains

List<CurrencyChain> listCurrencyChains(currency)

Query chains supported for specified currency

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "GT"; // String | Currency nametry {
List<CurrencyChain> result = apiInstance.listCurrencyChains(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listCurrencyChains");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

List<CurrencyChain>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getDepositAddress

DepositAddress getDepositAddress(currency)

Generate currency deposit address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | Currency nametry {
DepositAddressresult = apiInstance.getDepositAddress(currency);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getDepositAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency name

Return type

DepositAddress

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Address successfully generated-

listWithdrawals

List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();

Get withdrawal records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesStringwithdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabledStringassetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation ZoneStringwithdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queriedLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<WithdrawalRecord> result = apiInstance.listWithdrawals()
.currency(currency)
.withdrawId(withdrawId)
.assetClass(assetClass)
.withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawals");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
withdrawIdStringWithdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled[optional]
assetClassStringCurrency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone[optional]
withdrawOrderIdStringUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<WithdrawalRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listDeposits

List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();

Get deposit records

Record query time range cannot exceed 30 days

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Specify the currency. If not specified, returns all currenciesLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactionsIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DepositRecord> result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listDeposits");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringSpecify the currency. If not specified, returns all currencies[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<DepositRecord>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTransfer

AccountTransferDetail getTransfer(txId)

Get trading account transfer

Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringtxId = "59636381286"; // String | Transfer transaction IDtry {
AccountTransferDetailresult = apiInstance.getTransfer(txId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
txIdStringTransfer transaction ID

Return type

AccountTransferDetail

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Trading account transfer retrieved successfully-

transfer

TransactionID transfer(transfer)

Transfer between trading accounts

Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Transfertransfer = newTransfer(); // Transfer | try {
TransactionIDresult = apiInstance.transfer(transfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transfer");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
transferTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

listSubAccountTransfers

List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();

Get transfer records between main and sub accounts

Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsLongfrom = 1602120000L; // Long | Start time for querying records. If not specified, defaults to 7 days before current timeLongto = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<SubAccountTransferRecordItem> result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountTransfers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
fromLongStart time for querying records. If not specified, defaults to 7 days before current time[optional]
toLongEnd timestamp for the query, defaults to current time if not specified[optional]
limitIntegerMaximum number of records returned in a single list[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]

Return type

List<SubAccountTransferRecordItem>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

transferWithSubAccount

TransactionID transferWithSubAccount(subAccountTransfer)

Transfer between main and sub accounts

Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountTransfersubAccountTransfer = newSubAccountTransfer(); // SubAccountTransfer | try {
TransactionIDresult = apiInstance.transferWithSubAccount(subAccountTransfer);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#transferWithSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountTransferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

subAccountToSubAccount

TransactionID subAccountToSubAccount(subAccountToSubAccount)

Transfer between sub-accounts

Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
SubAccountToSubAccountsubAccountToSubAccount = newSubAccountToSubAccount(); // SubAccountToSubAccount | try {
TransactionIDresult = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subAccountToSubAccountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

getTransferOrderStatus

TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();

Main-Sub Account Transfer Status Query

Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringclientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 charactersStringtxId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_idtry {
TransferOrderStatusresult = apiInstance.getTransferOrderStatus()
.clientOrderId(clientOrderId)
.txId(txId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
clientOrderIdStringCustomer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters[optional]
txIdStringTransfer operation number, cannot be empty at the same time as client_order_id[optional]

Return type

TransferOrderStatus

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Main-Sub Account Transfer Status Retrieval Successful-

listWithdrawStatus

List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();

Query withdrawal status

API operations are not supported for tokens with low liquidity or extremely low value. Please use the Web or App interface to query and process.

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "BTC"; // String | Query by specified currency nametry {
List<WithdrawStatus> result = apiInstance.listWithdrawStatus()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listWithdrawStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringQuery by specified currency name[optional]

Return type

List<WithdrawStatus>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountBalances

List<SubAccountBalance> listSubAccountBalances().subUid(subUid).page(page).limit(limit).execute();

Query sub-account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of records returned. Default 20, max 100.try {
List<SubAccountBalance> result = apiInstance.listSubAccountBalances()
.subUid(subUid)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of records returned. Default 20, max 100.[optional] [default to 100]

Return type

List<SubAccountBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountMarginBalances

List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();

Query sub-account isolated margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountMarginBalance> result = apiInstance.listSubAccountMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountFuturesBalances

List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();

Query sub-account perpetual futures account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountsStringsettle = "usdt"; // String | Query balance of specified settlement currencytry {
List<SubAccountFuturesBalance> result = apiInstance.listSubAccountFuturesBalances()
.subUid(subUid)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settleStringQuery balance of specified settlement currency[optional]

Return type

List<SubAccountFuturesBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSubAccountCrossMarginBalances

List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();

Query sub-account cross margin account balance information

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringsubUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accountstry {
List<SubAccountCrossMarginBalance> result = apiInstance.listSubAccountCrossMarginBalances()
.subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
subUidStringSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]

Return type

List<SubAccountCrossMarginBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

listSavedAddress

List<SavedAddress> listSavedAddress().currency(currency).chain(chain).verified(verified).limit(limit).page(page).execute();

Query saved address

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "USDT"; // String | CurrencyStringchain = "\"\""; // String | Chain nameStringverified = "\"\""; // String | 1 means verified address, 0 means normal address, empty string means no limitStringlimit = "\"50\""; // String | Maximum number returned, up to 100Integerpage = 1; // Integer | page numbertry {
List<SavedAddress> result = apiInstance.listSavedAddress()
.currency(currency)
.chain(chain)
.verified(verified)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSavedAddress");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency[optional]
chainStringChain name[optional] [default to ""]
verifiedString1 means verified address, 0 means normal address, empty string means no limit[optional] [default to ""]
limitStringMaximum number returned, up to 100[optional] [default to "50"]
pageIntegerpage number[optional] [default to 1]

Return type

List<SavedAddress>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

getTradeFee

TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();

Query personal trading fees

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
StringcurrencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.Stringsettle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.try {
TradeFeeresult = apiInstance.getTradeFee()
.currencyPair(currencyPair)
.settle(settle)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTradeFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyPairStringSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settleStringSpecify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.[optional] [enum: BTC, USDT, USD]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

getTotalBalance

TotalBalance getTotalBalance().currency(currency).execute();

Query personal account totals

This query endpoint returns the total estimated value of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default valuetry {
TotalBalanceresult = apiInstance.getTotalBalance()
.currency(currency)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getTotalBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringTarget currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value[optional] [default to "USDT"]

Return type

TotalBalance

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request is valid and successfully returned-

listSmallBalance

List<SmallBalance> listSmallBalance()

Get list of convertible small balance currencies

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<SmallBalance> result = apiInstance.listSmallBalance();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<SmallBalance>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

convertSmallBalance

convertSmallBalance(convertSmallBalance)

Convert small balance currency

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
ConvertSmallBalanceconvertSmallBalance = newConvertSmallBalance(); // ConvertSmallBalance | try {
apiInstance.convertSmallBalance(convertSmallBalance);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#convertSmallBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
convertSmallBalanceConvertSmallBalance

Return type

null (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Success-

listSmallBalanceHistory

List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();

Get convertible small balance currency history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Stringcurrency = "currency_example"; // String | Currency to convertIntegerpage = 1; // Integer | Page numberIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100try {
List<SmallBalanceHistory> result = apiInstance.listSmallBalanceHistory()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
currencyStringCurrency to convert[optional]
pageIntegerPage number[optional] [default to 1]
limitIntegerMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]

Return type

List<SmallBalanceHistory>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

listPushOrders

List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();

Get UID transfer history

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
Integerid = 56; // Integer | Order IDIntegerfrom = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in secondsIntegerto = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in secondsIntegerlimit = 100; // Integer | Maximum number of items returned in the list, default value is 100Integeroffset = 0; // Integer | List offset, starting from 0StringtransactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.try {
List<UidPushOrder> result = apiInstance.listPushOrders()
.id(id)
.from(from)
.to(to)
.limit(limit)
.offset(offset)
.transactionType(transactionType)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#listPushOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

NameTypeDescriptionNotes
idIntegerOrder ID[optional]
fromIntegerStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
toIntegerEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitIntegerMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetIntegerList offset, starting from 0[optional] [default to 0]
transactionTypeStringOrder type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.[optional] [default to "withdraw"]

Return type

List<UidPushOrder>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-

getLowCapExchangeList

List<String> getLowCapExchangeList()

Retrieve the list of low-liquidity or low-cap tokens

Example

// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.WalletApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApiapiInstance = newWalletApi(defaultClient);
try {
List<String> result = apiInstance.getLowCapExchangeList();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling WalletApi#getLowCapExchangeList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

List<String>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-