unofficial_tabdeal_api.constants

Constants storage.

Attributes

BASE_API_URL

TEST_SERVER_URL

GET_ACCOUNT_PREFERENCES_URI

URL for getting account preferences. Used for checking authorization key validity

STATUS_OK

The request succeeded

STATUS_UNAUTHORIZED

Authorization token is invalid or expired

STATUS_BAD_REQUEST

The server could not understand the request.

STATUS_NOT_FOUND

The requested resource could not be found but may be available in the future.

MARKET_NOT_FOUND_RESPONSE

Response when requested market is not found on Tabdeal

MARGIN_NOT_ACTIVE_RESPONSE

Response when requested market is not available for margin trading on Tabdeal platform

NOT_ENOUGH_BALANCE_RESPONSE

Response when asset balance is insufficient for requested order

NOT_ENOUGH_CREDIT_AVAILABLE_RESPONSE

Response when requested borrow amount is over available credit

ORDER_PLACED_SUCCESSFULLY_RESPONSE

Response when order is successfully placed

REQUESTED_PARAMETERS_INVALID_RESPONSE

Response when requested parameters are invalid

ORDER_IS_INVALID_RESPONSE

Response when order type is invalid

TRANSFER_AMOUNT_OVER_ACCOUNT_BALANCE_RESPONSE

Response when requested transfer amount is over the account available balance

TRANSFER_FROM_MARGIN_ASSET_TO_WALLET_NOT_POSSIBLE_RESPONSE

Response when for some unknown reason,

MARGIN_POSITION_NOT_FOUND_RESPONSE

Response when server can't set SL/TP for margin order due to unknown error

GENERIC_SERVER_CONFIRMATION_RESPONSE

Response when server receives the request, no guarantee of actually processing it!!!

GET_MARGIN_ASSET_DETAILS_URI

URL for getting margin asset details

GET_ALL_MARGIN_OPEN_ORDERS_URI

URL for getting all open margin orders.

OPEN_MARGIN_ORDER_URI

URL for opening a margin order

MAX_ALLOWED_MARGIN_LEVEL

Max allowed margin level for margin orders

GET_ORDERS_HISTORY_URI

URL for getting all orders history

RETRY_SLEEP_SECONDS

Time to wait before retrying an operation

GET_WALLET_USDT_BALANCE_URI

URL for getting the USDT balance of account

GET_WALLET_USDT_BALANCE_QUERY

QUERY for getting the USDT balance of account

TRANSFER_USDT_TO_MARGIN_ASSET_URI

URL for transferring USDT from wallet to margin asset

TRANSFER_USDT_FROM_MARGIN_ASSET_TO_WALLET_URI

URL for transferring USDT from margin asset to wallet

SET_SL_TP_FOR_MARGIN_ORDER_URI

URL for setting stop loss and take profit points for a margin order

DECIMAL_PRECISION

Max decimal precision needed

REQUIRED_USDT_PRECISION

Precision needed for USDT

Module Contents

unofficial_tabdeal_api.constants.BASE_API_URL: str = 'https://api-web.tabdeal.org'
unofficial_tabdeal_api.constants.TEST_SERVER_URL: str = 'http://127.0.0.1:32000'
unofficial_tabdeal_api.constants.GET_ACCOUNT_PREFERENCES_URI: str = '/r/preferences/'

URL for getting account preferences. Used for checking authorization key validity

unofficial_tabdeal_api.constants.STATUS_OK: int = 200

The request succeeded

unofficial_tabdeal_api.constants.STATUS_UNAUTHORIZED: int = 401

Authorization token is invalid or expired

unofficial_tabdeal_api.constants.STATUS_BAD_REQUEST: int = 400

The server could not understand the request.

unofficial_tabdeal_api.constants.STATUS_NOT_FOUND: int = 404

The requested resource could not be found but may be available in the future.

unofficial_tabdeal_api.constants.MARKET_NOT_FOUND_RESPONSE: str = '{"error":"بازار یافت نشد."}'

Response when requested market is not found on Tabdeal

unofficial_tabdeal_api.constants.MARGIN_NOT_ACTIVE_RESPONSE: str = '{"error":"معامله\u200cی اهرم\u200cدار فعال نیست."}'

Response when requested market is not available for margin trading on Tabdeal platform

unofficial_tabdeal_api.constants.NOT_ENOUGH_BALANCE_RESPONSE: str = '{"error":"اعتبار کافی نیست."}'

Response when asset balance is insufficient for requested order

unofficial_tabdeal_api.constants.NOT_ENOUGH_CREDIT_AVAILABLE_RESPONSE: str = '{"error":"شما به سقف دریافت اعتبار رسیده\u200cاید."}'

Response when requested borrow amount is over available credit

unofficial_tabdeal_api.constants.ORDER_PLACED_SUCCESSFULLY_RESPONSE: str = 'سفارش با موفقیت ثبت شد.'

Response when order is successfully placed

unofficial_tabdeal_api.constants.REQUESTED_PARAMETERS_INVALID_RESPONSE: str = '{"error":"پارامتر های ورود اشتباه است."}'

Response when requested parameters are invalid

unofficial_tabdeal_api.constants.ORDER_IS_INVALID_RESPONSE: str = '{"error":"نوع سفارش اشتباه است."}'

Response when order type is invalid

unofficial_tabdeal_api.constants.TRANSFER_AMOUNT_OVER_ACCOUNT_BALANCE_RESPONSE: str = '{"error":"مقدار واردشده، بیش از حداکثر مقدار قابل جابه\u200cجایی است."}'

Response when requested transfer amount is over the account available balance

unofficial_tabdeal_api.constants.TRANSFER_FROM_MARGIN_ASSET_TO_WALLET_NOT_POSSIBLE_RESPONSE: str = '{"error":"امکان انتقال ارز به خارج اکانت معامله اهرم\u200cدار، امکان\u200cپذیر نیست."}'

Response when for some unknown reason, It’s not possible to transfer USDT out of margin asset

unofficial_tabdeal_api.constants.MARGIN_POSITION_NOT_FOUND_RESPONSE: str = '{"error":"پوزیشن مورد نظر یافت نشد."}'

Response when server can’t set SL/TP for margin order due to unknown error

unofficial_tabdeal_api.constants.GENERIC_SERVER_CONFIRMATION_RESPONSE: str = '"درخواست مورد نظر با موفقیت انجام شد."'

Response when server receives the request, no guarantee of actually processing it!!!

unofficial_tabdeal_api.constants.GET_MARGIN_ASSET_DETAILS_URI: str = '/r/margin/margin-account-v2/'

URL for getting margin asset details

unofficial_tabdeal_api.constants.GET_ALL_MARGIN_OPEN_ORDERS_URI: str = '/r/treasury/isolated_positions/'

URL for getting all open margin orders.

unofficial_tabdeal_api.constants.OPEN_MARGIN_ORDER_URI: str = '/api/order/'

URL for opening a margin order

unofficial_tabdeal_api.constants.MAX_ALLOWED_MARGIN_LEVEL: decimal.Decimal

Max allowed margin level for margin orders

unofficial_tabdeal_api.constants.GET_ORDERS_HISTORY_URI: str = '/r/api/user_order/'

URL for getting all orders history

unofficial_tabdeal_api.constants.RETRY_SLEEP_SECONDS: int = 10

Time to wait before retrying an operation

unofficial_tabdeal_api.constants.GET_WALLET_USDT_BALANCE_URI: str = '/r/api/user/'

URL for getting the USDT balance of account

unofficial_tabdeal_api.constants.GET_WALLET_USDT_BALANCE_QUERY: dict[str, Any]

QUERY for getting the USDT balance of account

unofficial_tabdeal_api.constants.TRANSFER_USDT_TO_MARGIN_ASSET_URI: str = '/margin/other-margins-transfer/'

URL for transferring USDT from wallet to margin asset

unofficial_tabdeal_api.constants.TRANSFER_USDT_FROM_MARGIN_ASSET_TO_WALLET_URI: str = '/margin/transfer/'

URL for transferring USDT from margin asset to wallet

unofficial_tabdeal_api.constants.SET_SL_TP_FOR_MARGIN_ORDER_URI: str = '/margin/margin-trigger-price/'

URL for setting stop loss and take profit points for a margin order

unofficial_tabdeal_api.constants.DECIMAL_PRECISION: int = 20

Max decimal precision needed

unofficial_tabdeal_api.constants.REQUIRED_USDT_PRECISION: int = 8

Precision needed for USDT