Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]

, '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-python/docs/WalletApi.md at master · gate/gateapi-python · GitHub
Skip to content

Latest commit

History

History
1638 lines (1235 loc) · 63.2 KB

File metadata and controls

1638 lines (1235 loc) · 63.2 KB

gate_api.WalletApi

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

MethodHTTP requestDescription
list_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
get_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
list_withdrawalsGET /wallet/withdrawalsGet withdrawal records
list_depositsGET /wallet/depositsGet deposit records
get_transferGET /wallet/transfersGet trading account transfer
transferPOST /wallet/transfersTransfer between trading accounts
list_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
transfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
sub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
get_transfer_order_statusGET /wallet/order_statusMain-Sub Account Transfer Status Query
list_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
list_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
list_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
list_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
list_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
list_saved_addressGET /wallet/saved_addressQuery saved address
get_trade_feeGET /wallet/feeQuery personal trading fees
get_total_balanceGET /wallet/total_balanceQuery personal account totals
list_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
convert_small_balancePOST /wallet/small_balanceConvert small balance currency
list_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
list_push_ordersGET /wallet/pushGet UID transfer history
get_low_cap_exchange_listGET /wallet/getLowCapExchangeListRetrieve the list of low-liquidity or low-cap tokens

list_currency_chains

list[CurrencyChain] list_currency_chains(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

from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.configuration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='GT'# str | Currency nametry:
# Query chains supported for specified currencyapi_response=api_instance.list_currency_chains(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_currency_chains: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_deposit_address

DepositAddress get_deposit_address(currency)

Generate currency deposit address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency nametry:
# Generate currency deposit addressapi_response=api_instance.get_deposit_address(currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_deposit_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdrawals

list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)

Get withdrawal records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)withdraw_id='withdraw_id_example'# str | 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 disabled (optional)asset_class='asset_class_example'# str | 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 Zone (optional)withdraw_order_id='withdraw_order_id_example'# str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get withdrawal recordsapi_response=api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdrawals: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
withdraw_idstrWithdrawal 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]
asset_classstrCurrency 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]
withdraw_order_idstrUser-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_deposits

list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)

Get deposit records

Record query time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Specify the currency. If not specified, returns all currencies (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get deposit recordsapi_response=api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_deposits: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrSpecify the currency. If not specified, returns all currencies[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of entries returned in the list, limited to 500 transactions[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer

AccountTransferDetail get_transfer(tx_id)

Get trading account transfer

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
tx_id='59636381286'# str | Transfer transaction IDtry:
# Get trading account transferapi_response=api_instance.get_transfer(tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer: %s\n"%e)

Parameters

NameTypeDescriptionNotes
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
transfer=gate_api.Transfer() # Transfer | try:
# Transfer between trading accountsapi_response=api_instance.transfer(transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_transfers

list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)_from=1602120000# int | Start time for querying records. If not specified, defaults to 7 days before current time (optional)to=1602123600# int | End timestamp for the query, defaults to current time if not specified (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)try:
# Get transfer records between main and sub accountsapi_response=api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_transfers: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before current time[optional]
tointEnd timestamp for the query, defaults to current time if not specified[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
offsetintList 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-

[Back to top][Back to API list][Back to Model list][Back to README]

transfer_with_sub_account

TransactionID transfer_with_sub_account(sub_account_transfer)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_transfer=gate_api.SubAccountTransfer() # SubAccountTransfer | try:
# Transfer between main and sub accountsapi_response=api_instance.transfer_with_sub_account(sub_account_transfer)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->transfer_with_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_transferSubAccountTransfer

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

sub_account_to_sub_account

TransactionID sub_account_to_sub_account(sub_account_to_sub_account)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_account_to_sub_account=gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | try:
# Transfer between sub-accountsapi_response=api_instance.sub_account_to_sub_account(sub_account_to_sub_account)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->sub_account_to_sub_account: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_account_to_sub_accountSubAccountToSubAccount

Return type

TransactionID

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Transfer operation successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_transfer_order_status

TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
client_order_id='da3ce7a088c8b0372b741419c7829033'# str | 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 characters (optional)tx_id='59636381286'# str | Transfer operation number, cannot be empty at the same time as client_order_id (optional)try:
# Main-Sub Account Transfer Status Queryapi_response=api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_transfer_order_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
client_order_idstrCustomer-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]
tx_idstrTransfer 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_withdraw_status

list[WithdrawStatus] list_withdraw_status(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='BTC'# str | Query by specified currency name (optional)try:
# Query withdrawal statusapi_response=api_instance.list_withdraw_status(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_withdraw_status: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_balances

list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)

Query sub-account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100)try:
# Query sub-account balance informationapi_response=api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_margin_balances

list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid)

Query sub-account isolated margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account isolated margin account balance informationapi_response=api_instance.list_sub_account_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_futures_balances

list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)

Query sub-account perpetual futures account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)settle='usdt'# str | Query balance of specified settlement currency (optional)try:
# Query sub-account perpetual futures account balance informationapi_response=api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts[optional]
settlestrQuery 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_sub_account_cross_margin_balances

list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)

Query sub-account cross margin account balance information

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
sub_uid='10003'# str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional)try:
# Query sub-account cross margin account balance informationapi_response=api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n"%e)

Parameters

NameTypeDescriptionNotes
sub_uidstrSub-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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_saved_address

list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)

Query saved address

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Currency (optional)chain=''# str | Chain name (optional) (default to '')verified=''# str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '')limit='50'# str | Maximum number returned, up to 100 (optional) (default to '50')page=1# int | page number (optional) (default to 1)try:
# Query saved addressapi_response=api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_saved_address: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency[optional]
chainstrChain name[optional] [default to '']
verifiedstr1 means verified address, 0 means normal address, empty string means no limit[optional] [default to '']
limitstrMaximum number returned, up to 100[optional] [default to '50']
pageintpage 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_trade_fee

TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle)

Query personal trading fees

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency_pair='BTC_USDT'# str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional)settle='BTC'# str | 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. (optional)try:
# Query personal trading feesapi_response=api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_trade_fee: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currency_pairstrSpecify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.[optional]
settlestrSpecify 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]

Return type

TradeFee

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

get_total_balance

TotalBalance get_total_balance(currency=currency)

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

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='USDT'# str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT')try:
# Query personal account totalsapi_response=api_instance.get_total_balance(currency=currency)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_total_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrTarget 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance

list[SmallBalance] list_small_balance()

Get list of convertible small balance currencies

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Get list of convertible small balance currenciesapi_response=api_instance.list_small_balance()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance: %s\n"%e)

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-

[Back to top][Back to API list][Back to Model list][Back to README]

convert_small_balance

convert_small_balance(convert_small_balance)

Convert small balance currency

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
convert_small_balance=gate_api.ConvertSmallBalance() # ConvertSmallBalance | try:
# Convert small balance currencyapi_instance.convert_small_balance(convert_small_balance)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->convert_small_balance: %s\n"%e)

Parameters

NameTypeDescriptionNotes
convert_small_balanceConvertSmallBalance

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-

[Back to top][Back to API list][Back to Model list][Back to README]

list_small_balance_history

list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit)

Get convertible small balance currency history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
currency='currency_example'# str | Currency to convert (optional)page=1# int | Page number (optional) (default to 1)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)try:
# Get convertible small balance currency historyapi_response=api_instance.list_small_balance_history(currency=currency, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_small_balance_history: %s\n"%e)

Parameters

NameTypeDescriptionNotes
currencystrCurrency to convert[optional]
pageintPage number[optional] [default to 1]
limitintMaximum 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-

[Back to top][Back to API list][Back to Model list][Back to README]

list_push_orders

list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)

Get UID transfer history

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
id=56# int | Order ID (optional)_from=56# int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional)to=56# int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional)limit=100# int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100)offset=0# int | List offset, starting from 0 (optional) (default to 0)transaction_type='withdraw'# str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw')try:
# Get UID transfer historyapi_response=api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->list_push_orders: %s\n"%e)

Parameters

NameTypeDescriptionNotes
idintOrder ID[optional]
_fromintStart time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds[optional]
tointEnd time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds[optional]
limitintMaximum number of items returned in the list, default value is 100[optional] [default to 100]
offsetintList offset, starting from 0[optional] [default to 0]
transaction_typestrOrder 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-

[Back to top][Back to API list][Back to Model list][Back to README]

get_low_cap_exchange_list

list[str] get_low_cap_exchange_list()

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

Example

  • Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, GateApiException# Defining the host is optional and defaults to https://api.gateio.ws/api/v4# See configuration.py for a list of all supported configuration parameters.# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure APIv4 key authorizationconfiguration=gate_api.Configuration(
host="https://api.gateio.ws/api/v4",
key="YOU_API_KEY",
secret="YOUR_API_SECRET"
)
api_client=gate_api.ApiClient(configuration)
# Create an instance of the API classapi_instance=gate_api.WalletApi(api_client)
try:
# Retrieve the list of low-liquidity or low-cap tokensapi_response=api_instance.get_low_cap_exchange_list()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling WalletApi->get_low_cap_exchange_list: %s\n"%e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Returns a string array on success-

[Back to top][Back to API list][Back to Model list][Back to README]