unofficial_tabdeal_api.constants ================================ .. py:module:: unofficial_tabdeal_api.constants .. autoapi-nested-parse:: Constants storage. Attributes ---------- .. autoapisummary:: unofficial_tabdeal_api.constants.BASE_API_URL unofficial_tabdeal_api.constants.TEST_SERVER_URL unofficial_tabdeal_api.constants.GET_ACCOUNT_PREFERENCES_URI unofficial_tabdeal_api.constants.STATUS_OK unofficial_tabdeal_api.constants.STATUS_UNAUTHORIZED unofficial_tabdeal_api.constants.STATUS_BAD_REQUEST unofficial_tabdeal_api.constants.STATUS_NOT_FOUND unofficial_tabdeal_api.constants.MARKET_NOT_FOUND_RESPONSE unofficial_tabdeal_api.constants.MARGIN_NOT_ACTIVE_RESPONSE unofficial_tabdeal_api.constants.NOT_ENOUGH_BALANCE_RESPONSE unofficial_tabdeal_api.constants.NOT_ENOUGH_CREDIT_AVAILABLE_RESPONSE unofficial_tabdeal_api.constants.ORDER_PLACED_SUCCESSFULLY_RESPONSE unofficial_tabdeal_api.constants.REQUESTED_PARAMETERS_INVALID_RESPONSE unofficial_tabdeal_api.constants.ORDER_IS_INVALID_RESPONSE unofficial_tabdeal_api.constants.TRANSFER_AMOUNT_OVER_ACCOUNT_BALANCE_RESPONSE unofficial_tabdeal_api.constants.TRANSFER_FROM_MARGIN_ASSET_TO_WALLET_NOT_POSSIBLE_RESPONSE unofficial_tabdeal_api.constants.MARGIN_POSITION_NOT_FOUND_RESPONSE unofficial_tabdeal_api.constants.GENERIC_SERVER_CONFIRMATION_RESPONSE unofficial_tabdeal_api.constants.GET_MARGIN_ASSET_DETAILS_URI unofficial_tabdeal_api.constants.GET_ALL_MARGIN_OPEN_ORDERS_URI unofficial_tabdeal_api.constants.OPEN_MARGIN_ORDER_URI unofficial_tabdeal_api.constants.MAX_ALLOWED_MARGIN_LEVEL unofficial_tabdeal_api.constants.GET_ORDERS_HISTORY_URI unofficial_tabdeal_api.constants.RETRY_SLEEP_SECONDS unofficial_tabdeal_api.constants.GET_WALLET_USDT_BALANCE_URI unofficial_tabdeal_api.constants.GET_WALLET_USDT_BALANCE_QUERY unofficial_tabdeal_api.constants.TRANSFER_USDT_TO_MARGIN_ASSET_URI unofficial_tabdeal_api.constants.TRANSFER_USDT_FROM_MARGIN_ASSET_TO_WALLET_URI unofficial_tabdeal_api.constants.SET_SL_TP_FOR_MARGIN_ORDER_URI unofficial_tabdeal_api.constants.DECIMAL_PRECISION unofficial_tabdeal_api.constants.REQUIRED_USDT_PRECISION Module Contents --------------- .. py:data:: BASE_API_URL :type: str :value: 'https://api-web.tabdeal.org' .. py:data:: TEST_SERVER_URL :type: str :value: 'http://127.0.0.1:32000' .. py:data:: GET_ACCOUNT_PREFERENCES_URI :type: str :value: '/r/preferences/' URL for getting account preferences. Used for checking authorization key validity .. py:data:: STATUS_OK :type: int :value: 200 The request succeeded .. py:data:: STATUS_UNAUTHORIZED :type: int :value: 401 Authorization token is invalid or expired .. py:data:: STATUS_BAD_REQUEST :type: int :value: 400 The server could not understand the request. .. py:data:: STATUS_NOT_FOUND :type: int :value: 404 The requested resource could not be found but may be available in the future. .. py:data:: MARKET_NOT_FOUND_RESPONSE :type: str :value: '{"error":"بازار یافت نشد."}' Response when requested market is not found on Tabdeal .. py:data:: MARGIN_NOT_ACTIVE_RESPONSE :type: str :value: '{"error":"معامله\u200cی اهرم\u200cدار فعال نیست."}' Response when requested market is not available for margin trading on Tabdeal platform .. py:data:: NOT_ENOUGH_BALANCE_RESPONSE :type: str :value: '{"error":"اعتبار کافی نیست."}' Response when asset balance is insufficient for requested order .. py:data:: NOT_ENOUGH_CREDIT_AVAILABLE_RESPONSE :type: str :value: '{"error":"شما به سقف دریافت اعتبار رسیده\u200cاید."}' Response when requested borrow amount is over available credit .. py:data:: ORDER_PLACED_SUCCESSFULLY_RESPONSE :type: str :value: 'سفارش با موفقیت ثبت شد.' Response when order is successfully placed .. py:data:: REQUESTED_PARAMETERS_INVALID_RESPONSE :type: str :value: '{"error":"پارامتر های ورود اشتباه است."}' Response when requested parameters are invalid .. py:data:: ORDER_IS_INVALID_RESPONSE :type: str :value: '{"error":"نوع سفارش اشتباه است."}' Response when order type is invalid .. py:data:: TRANSFER_AMOUNT_OVER_ACCOUNT_BALANCE_RESPONSE :type: str :value: '{"error":"مقدار واردشده، بیش از حداکثر مقدار قابل جابه\u200cجایی است."}' Response when requested transfer amount is over the account available balance .. py:data:: TRANSFER_FROM_MARGIN_ASSET_TO_WALLET_NOT_POSSIBLE_RESPONSE :type: str :value: '{"error":"امکان انتقال ارز به خارج اکانت معامله اهرم\u200cدار، امکان\u200cپذیر نیست."}' Response when for some unknown reason, It's not possible to transfer USDT out of margin asset .. py:data:: MARGIN_POSITION_NOT_FOUND_RESPONSE :type: str :value: '{"error":"پوزیشن مورد نظر یافت نشد."}' Response when server can't set SL/TP for margin order due to unknown error .. py:data:: GENERIC_SERVER_CONFIRMATION_RESPONSE :type: str :value: '"درخواست مورد نظر با موفقیت انجام شد."' Response when server receives the request, no guarantee of actually processing it!!! .. py:data:: GET_MARGIN_ASSET_DETAILS_URI :type: str :value: '/r/margin/margin-account-v2/' URL for getting margin asset details .. py:data:: GET_ALL_MARGIN_OPEN_ORDERS_URI :type: str :value: '/r/treasury/isolated_positions/' URL for getting all open margin orders. .. py:data:: OPEN_MARGIN_ORDER_URI :type: str :value: '/api/order/' URL for opening a margin order .. py:data:: MAX_ALLOWED_MARGIN_LEVEL :type: decimal.Decimal Max allowed margin level for margin orders .. py:data:: GET_ORDERS_HISTORY_URI :type: str :value: '/r/api/user_order/' URL for getting all orders history .. py:data:: RETRY_SLEEP_SECONDS :type: int :value: 10 Time to wait before retrying an operation .. py:data:: GET_WALLET_USDT_BALANCE_URI :type: str :value: '/r/api/user/' URL for getting the USDT balance of account .. py:data:: GET_WALLET_USDT_BALANCE_QUERY :type: dict[str, Any] QUERY for getting the USDT balance of account .. py:data:: TRANSFER_USDT_TO_MARGIN_ASSET_URI :type: str :value: '/margin/other-margins-transfer/' URL for transferring USDT from wallet to margin asset .. py:data:: TRANSFER_USDT_FROM_MARGIN_ASSET_TO_WALLET_URI :type: str :value: '/margin/transfer/' URL for transferring USDT from margin asset to wallet .. py:data:: SET_SL_TP_FOR_MARGIN_ORDER_URI :type: str :value: '/margin/margin-trigger-price/' URL for setting stop loss and take profit points for a margin order .. py:data:: DECIMAL_PRECISION :type: int :value: 20 Max decimal precision needed .. py:data:: REQUIRED_USDT_PRECISION :type: int :value: 8 Precision needed for USDT