
    V.jwZ                       d dl mZ d dlmZ d dlmZmZmZmZm	Z	m
Z
 d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d
dlmZmZmZ d
dlm Z m!Z!m"Z" d
dl#m$Z$  G d d      Z% G d de%      Z& G d de%      Z'y)    )	b64encode)Path)DictOptionalListTupleUnionAnyN)RSA)SHA256)pkcs1_15)
itemgetter)	urlencode   )interval_to_millisecondsconvert_ts_strget_loop)BinanceAPIExceptionBinanceRequestExceptionNotImplementedException)HistoricalKlinesTypec                   \   e Zd ZU dZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZe e!d<   dZ"dZ#dZ$dZ%dZ&dZ'dZ(d Z)d!Z*d"Z+d#Z,d$Z-d%Z.d&Z/d'Z0d(Z1d)Z2d*Z3d+Z4d,Z5d-Z6d.Z7d/Z8d0Z9d1Z:d2Z;d3Z<d4Z=d5Z>d6Z?d7Z@d8ZAd2ZBd3ZCd9ZDd:ZEd6ZFd;ZGd8ZHd<ZId=ZJd>ZKd?ZLd@ZMdAZNdBZOdCZPdDZQdEZRdFZSdGZTdHZUdIZVdJZWdKZXdLZYdMZZdNZ[dOZ\dPZ]dQZ^dRZ_dSZ`dTZadUZbdVZcdWZddXZedYZfdZZgd[d[d[d\ed]d[d[fd^ehei   d_ehei   d`ehejeiekf      daeidbeidcelddehemeienf      deehei   fdfZodgejfdhZpdi Zqdddehemeienf      deehei   fdjZrdkefdleidmeldneidgeifdoZsddleidnetdgeifdpZudleidgeifdqZvddleidnetdgeifdrZwdleidgeifdsZxddleidnetdgeifdtZyddleidnetdgeifduZzdleidgeifdvZ{dweifdxZ|dweidgeifdyZ}dzejdgeifd{Z~edzejdgeeeieif      fd|       Zddmeld}eldgejfd~Zy[)
BaseClientzhttps://api{}.binance.{}/apiz"https://testnet.binance.vision/apizhttps://api{}.binance.{}/sapizhttps://www.binance.{}zhttps://fapi.binance.{}/fapiz&https://testnet.binancefuture.com/fapiz$https://fapi.binance.{}/futures/dataz.https://testnet.binancefuture.com/futures/datazhttps://dapi.binance.{}/dapiz&https://testnet.binancefuture.com/dapiz$https://dapi.binance.{}/futures/datazhttps://eapi.binance.{}/eapiz"https://testnet.binanceops.{}/eapiv1v3v2v4 1234
   REQUEST_TIMEOUTSPOTNEWPARTIALLY_FILLEDFILLEDCANCELEDPENDING_CANCELREJECTEDEXPIRED1m3m5m15m30m1h2h4h6h8h12h1d3d1w1MBUYSELLLIMITMARKET	STOP_LOSSSTOP_LOSS_LIMITTAKE_PROFITTAKE_PROFIT_LIMITLIMIT_MAKERSTOPSTOP_MARKETTAKE_PROFIT_MARKETGTCIOCFOKACKRESULTFULLapqflTmMMAIN_C2CMAIN_UMFUTUREMAIN_CMFUTUREMAIN_MARGINMAIN_MININGC2C_MAINC2C_UMFUTURE
C2C_MININGUMFUTURE_MAINUMFUTURE_C2CUMFUTURE_MARGINCMFUTURE_MAINMARGIN_MAINMARGIN_UMFUTUREMINING_MAINMINING_UMFUTURE
MINING_C2CNcomFapi_key
api_secretrequests_paramstldbase_endpointtestnetprivate_keyprivate_key_passc	                    || _         | j                  j                  ||      | _        | j                  j                  ||      | _        | j                  j                  |      | _        | j
                  j                  |      | _        | j                  j                  |      | _        | j                  j                  |      | _        | j                  j                  |      | _        | j                  j                  |      | _	        | j                  j                  |      | _
        || _        || _        | j                  ||      | _        | j                         | _        || _        d| _        || _        d| _        y)a  Binance API Client constructor

        :param api_key: Api Key
        :type api_key: str.
        :param api_secret: Api Secret
        :type api_secret: str.
        :param requests_params: optional - Dictionary of requests params to use for all calls
        :type requests_params: dict.
        :param testnet: Use testnet environment - only available for vanilla options at the moment
        :type testnet: bool
        :param private_key: Path to private key, or string of file contents
        :type private_key: optional - str or Path
        :param private_key_pass: Password of private key
        :type private_key_pass: optional - str

        Nr   )rk   API_URLformatMARGIN_API_URLWEBSITE_URLFUTURES_URLFUTURES_DATA_URLFUTURES_COIN_URLFUTURES_COIN_DATA_URLOPTIONS_URLOPTIONS_TESTNET_URLAPI_KEY
API_SECRET_init_private_keyPRIVATE_KEY_init_sessionsession_requests_paramsresponserm   timestamp_offset)	selfrh   ri   rj   rk   rl   rm   rn   ro   s	            PC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\binance/client.py__init__zBaseClient.__init__   s?   , ||**=#>"1188L++2237++2237 $ 5 5 < <S A $ 5 5 < <S A%)%?%?%F%Fs%K"++2237#'#;#;#B#B3#G $11+?OP))+ / !    returnc                 b    ddd}| j                   r| j                   sJ | j                   |d<   |S )Nzapplication/jsonzhMozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36)Acceptz
User-AgentzX-MBX-APIKEY)r{   )r   headerss     r   _get_headerszBaseClient._get_headers   s:    ( E
 <<<<<&*llGN#r   c                     t         N)NotImplementedErrorr   s    r   r   zBaseClient._init_session   s    !!r   c                     |sy t        |t              r%t        |d      5 }|j                         }d d d        t	        j
                  ||      S # 1 sw Y    xY w)Nr)
passphrase)
isinstancer   openreadr   
import_key)r   rn   ro   rQ   s       r   r}   zBaseClient._init_private_key   sI    k4(k3'1ffh (~~k6FGG ('s   AATpathsignedversionc                     | j                   }| j                  r| j                  }|r| j                  n|}|dz   |z   dz   |z   S N/)rq   rm   API_TESTNET_URLPRIVATE_API_VERSION)r   r   r   r   urlvs         r   _create_api_urizBaseClient._create_api_uri   sD    ll<<&&C(.D$$GSy1}s"T))r   c                     | j                   | j                  | j                  | j                  d}| j                  dz   ||   z   dz   |z   S )N)r            r   )MARGIN_API_VERSIONMARGIN_API_VERSION2MARGIN_API_VERSION3MARGIN_API_VERSION4rs   )r   r   r   optionss       r   _create_margin_api_uriz!BaseClient._create_margin_api_uri   sT    &&''''''	
 ""S(77+;;cADHHr   c                 &    | j                   dz   |z   S r   )rt   )r   r   s     r   _create_website_urizBaseClient._create_website_uri   s    #%,,r   c                     | j                   }| j                  r| j                  }| j                  | j                  d}|dz   ||   z   dz   |z   S N)r   r   r   )ru   rm   FUTURES_TESTNET_URLFUTURES_API_VERSIONFUTURES_API_VERSION2r   r   r   r   r   s        r   _create_futures_api_uriz"BaseClient._create_futures_api_uri   sS    <<**C..43L3LMSy77++c1D88r   c                 Z    | j                   }| j                  r| j                  }|dz   |z   S r   )rv   rm   FUTURES_DATA_TESTNET_URLr   r   r   s      r   _create_futures_data_api_uriz'BaseClient._create_futures_data_api_uri   s.    ##<<//CSy4r   c                     | j                   }| j                  r| j                  }| j                  | j                  d}|dz   ||   z   dz   |z   S r   )rw   rm   FUTURES_COIN_TESTNET_URLr   r   r   s        r   _create_futures_coin_api_urlz'BaseClient._create_futures_coin_api_url   sS    ##<<//C..43L3LMSy77++c1D88r   c                 Z    | j                   }| j                  r| j                  }|dz   |z   S r   )rx   rm   FUTURES_COIN_DATA_TESTNET_URL)r   r   r   r   s       r   !_create_futures_coin_data_api_urlz,BaseClient._create_futures_coin_data_api_url   s.    ((<<44CSy4r   c                 z    | j                   }| j                  r| j                  }|dz   | j                  z   dz   |z   S r   )ry   rm   rz   OPTIONS_API_VERSIONr   s      r   _create_options_api_uriz"BaseClient._create_options_api_uri   s>    <<**CSy4333c9D@@r   query_stringc                     | j                   sJ t        j                  |j                  d            }t	        j                  | j                         j                  |      }t        |      j                         S )Nutf-8)r~   r   newencoder   signr   decode)r   r   h	signatures       r   _rsa_signaturezBaseClient._rsa_signature   s]    JJ|**734LL!1!1277:	#**,,r   c                     | j                   sJ d       t        j                  | j                   j                  d      |j                  d      t        j
                        }|j                         S )Nz)API Secret required for private endpointsr   )r|   hmacr   r   hashlibsha256	hexdigest)r   r   rT   s      r   _hmac_signaturezBaseClient._hmac_signature  sS    K KKHHT__++G4l6I6I'6RT[TbTbc{{}r   datac           	          | j                   }| j                  r| j                  }dj                  | j	                  |      D cg c]  }|d    d|d     c}      } ||      S c c}w )N&r   =r   )r   r~   r   join_order_params)r   r   sig_funcdr   s        r   _generate_signaturezBaseClient._generate_signature  so    ''**Hxx4;M;Md;S T;SaAaD61Q4&!1;S TU%% !Us   A&c                 4   t        t        d | j                                     } d}g }| j                         D ])  \  }}|dk(  rd}|j                  |t	        |      f       + |j                  t        d             |r|j                  d| d   f       |S )zfConvert params to list with signature as last element

        :param data:
        :return:

        c                     | d   d uS )Nr    )els    r   <lambda>z*BaseClient._order_params.<locals>.<lambda>  s    be4&7r   Fr   Tr   )key)dictfilteritemsappendstrsortr   )r   has_signatureparamsr   values        r   r   zBaseClient._order_params  s     F7FG**,JCk! $sCJ/0	 ' 	
1&MM;[(9:;r   force_paramsc                    | j                   |d<   | j                  r|j                  | j                         |j                  dd       }|r9t	        |t
              r)||d<   d|d   v r|j                  |d   d          |d   d= |rMt        t        j                         dz  | j                  z         |d   d<   | j                  |d         |d   d<   |rU| j                  |d         |d<   t        |d         D cg c]  \  }\  }}|| }	}}}t        |	      D ]  }|d   |= 
 |r(|dk(  s|r!dj                  d	 |d   D              |d
<   |d= |S c c}}}w )Ntimeoutr   rj     	timestampr   getr   c              3   6   K   | ]  }|d    d|d     yw)r   r   r   Nr   ).0r   s     r   	<genexpr>z1BaseClient._get_request_kwargs.<locals>.<genexpr>F  s      '`Q_47DG(DQ_s   r   )r$   r   updater   r   r   inttimer   r   r   	enumeratereversedr   )
r   methodr   r   kwargsr   ir   r   	null_argss
             r   _get_request_kwargszBaseClient._get_request_kwargs$  sp    !00y   MM$//0zz&$'JtT*!F6N F6N2fVn->?@6N#45*-diikD.@4CXCX.X*YF6N;'*.*B*B6&>*RF6N;' !//v?F6N2;F6N2K]2Kq,3u}2KI]i(6N1% ) Vu_"xx'`QWX^Q_'``F8v ^s   >EEr   )r   F)__name__
__module____qualname__rq   r   rs   rt   ru   r   rv   r   rw   r   rx   r   ry   rz   PUBLIC_API_VERSIONr   r   r   r   r   r   r   r   BASE_ENDPOINT_DEFAULTBASE_ENDPOINT_1BASE_ENDPOINT_2BASE_ENDPOINT_3BASE_ENDPOINT_4r$   float__annotations__SYMBOL_TYPE_SPOTORDER_STATUS_NEWORDER_STATUS_PARTIALLY_FILLEDORDER_STATUS_FILLEDORDER_STATUS_CANCELEDORDER_STATUS_PENDING_CANCELORDER_STATUS_REJECTEDORDER_STATUS_EXPIREDKLINE_INTERVAL_1MINUTEKLINE_INTERVAL_3MINUTEKLINE_INTERVAL_5MINUTEKLINE_INTERVAL_15MINUTEKLINE_INTERVAL_30MINUTEKLINE_INTERVAL_1HOURKLINE_INTERVAL_2HOURKLINE_INTERVAL_4HOURKLINE_INTERVAL_6HOURKLINE_INTERVAL_8HOURKLINE_INTERVAL_12HOURKLINE_INTERVAL_1DAYKLINE_INTERVAL_3DAYKLINE_INTERVAL_1WEEKKLINE_INTERVAL_1MONTHSIDE_BUY	SIDE_SELLORDER_TYPE_LIMITORDER_TYPE_MARKETORDER_TYPE_STOP_LOSSORDER_TYPE_STOP_LOSS_LIMITORDER_TYPE_TAKE_PROFITORDER_TYPE_TAKE_PROFIT_LIMITORDER_TYPE_LIMIT_MAKERFUTURE_ORDER_TYPE_LIMITFUTURE_ORDER_TYPE_MARKETFUTURE_ORDER_TYPE_STOPFUTURE_ORDER_TYPE_STOP_MARKETFUTURE_ORDER_TYPE_TAKE_PROFIT$FUTURE_ORDER_TYPE_TAKE_PROFIT_MARKETFUTURE_ORDER_TYPE_LIMIT_MAKERTIME_IN_FORCE_GTCTIME_IN_FORCE_IOCTIME_IN_FORCE_FOKORDER_RESP_TYPE_ACKORDER_RESP_TYPE_RESULTORDER_RESP_TYPE_FULLAGG_ID	AGG_PRICEAGG_QUANTITYAGG_FIRST_TRADE_IDAGG_LAST_TRADE_IDAGG_TIMEAGG_BUYER_MAKESAGG_BEST_MATCHSPOT_TO_FIATSPOT_TO_USDT_FUTURESPOT_TO_COIN_FUTURESPOT_TO_MARGIN_CROSSSPOT_TO_MININGFIAT_TO_SPOTFIAT_TO_USDT_FUTUREFIAT_TO_MININGUSDT_FUTURE_TO_SPOTUSDT_FUTURE_TO_FIATUSDT_FUTURE_TO_MARGIN_CROSSCOIN_FUTURE_TO_SPOTMARGIN_CROSS_TO_SPOTMARGIN_CROSS_TO_USDT_FUTUREMINING_TO_SPOTMINING_TO_USDT_FUTUREMINING_TO_FIATr   r   r   r
   boolr	   r   r   r   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   staticmethodr   r   r   r   r   r   r   r   r      s]   ,G:O4N*K0KB=O5GB$T!0K>OOOOOU$6!"&"2&$!!!##! HI &!2*#6 *%'#$1!$1!+?($1!%! FILHON L))("NL(!N)("3)("3"N-!N (,48Uavqu("}("9A#("!$sCx.1("?B("[^(" (" -5U395E,F(" bjjman("Td "HXeCI6F-G H[cdg[h H 9=M_ *C * *s *dg *I3 I IS I- - -9C 9# 9c 9     9 9s 93 9 c  C  PS  AC AC A-3 -C C 
& & & D T%S/%:  *%$ %d %ae %r   r   c                   0    e Zd Zddddej                  dddfdee   dee   deeeef      deded	e	d
ee
eef      dee   f fdZdej                  fdZdVdede	de	fdZedej$                  fd       Zdej(                  fdede	fdZdWdedefdZdVdefdZdWdefdZdWdefdZdVdefdZdWdefdZdVdefdZdej(                  fdZdej(                  fdefd Zdej(                  fdefd!Z dej(                  fdefd"Z!defd#Z"defd$Z#dee   fd%Z$defd&Z%defd'Z&de'eeef      fd(Z(defd)Z)defd*Z*defd+Z+defd,Z,defd-Z-dXd.efd/Z.defd0Z/e0jb                  fd1e0defd2Z2e0jb                  fd1e0fd3Z3ddd4e0jb                  fd1e0fd5Z4ddd4e0jb                  fd1e0fd6Z5ddd4e0jb                  fd1e0fd7Z6ddd4e0jb                  fd1e0fd8Z7d9 Z8d: Z9d; Z:d< Z;d= Z<ejz                  fd>Z>ejz                  fd?Z?ejz                  fd@Z@dA ZAdB ZBdC ZCdD ZDdE ZEdF ZFdG ZGdH ZHdI ZIdJ ZJdK ZKdL ZLdM ZMdN ZNdO ZOdP ZPdQ ZQdR ZRdS ZSdT ZTdU ZUdV ZVdW ZWdX ZXdY ZYdZ ZZd[ Z[d\ Z\d] Z]d^ Z^d_ Z_d` Z`da Zadb ZbdYdceddee   fdeZcdf Zddg Zedh Zfdi Zgdj Zhdk Zidl Zjdm Zkdn Zldo Zmdp Zndq Zodr Zpds Zqdt Zrdu Zsdv Ztdw Zudx Zvdy Zwdz Zxd{ Zyd| Zzd} Z{d~ Z|d Z}d Z~d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdÄ ZdĄ Zdń ZdƄ ZdǄ ZdȄ ZdɄ Zdʄ Zd˄ Zd̄ Zd̈́ Zd΄ Zdτ Z͐dZdЄZΐdYdфZd҄ Zdӄ ZdԄ ZdՄ Zdք Zdׄ Zd؄ Zdل Zdڄ Zdۄ Zd܄ Zd݄ Zdބ Zd߄ Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zde	fdZd Zd  Zd Zd Zd Z d Zd Zd Zd Zd Zd	 Zd
 Zd Zd Z	d Z
d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd  Zd! Zd" Zd# Z d$ Z!d% Z"d& Z#d' Z$d( Z%d) Z&d* Z'd+ Z(d, Z)d- Z*d. Z+d/ Z,d0 Z-d1 Z.d2 Z/d3 Z0d4 Z1	 d5 Z2d6 Z3d7 Z4d8 Z5d9 Z6d: Z7d; Z8d< Z9d= Z:d> Z;d? Z<d@ Z=dA Z>dB Z?dC Z@dD ZAdE ZBdF ZCdG ZDdH ZEdI ZFdJ ZGdK ZHdL ZIdM ZJdN ZKdO ZLdP ZMdQ ZNdR ZOdS ZPdT ZQdU ZR xZSS ([  ClientNrg   Frh   ri   rj   rk   rl   rm   rn   ro   c	           
      R    t         	|   ||||||||       | j                          y r   )superr   ping)
r   rh   ri   rj   rk   rl   rm   rn   ro   	__class__s
            r   r   zClient.__init__N  s.     	*osMSZ\giyz 			r   r   c                     | j                         }t        j                         }|j                  j	                  |       |S r   )r   requestsr   r   r   )r   r   r   s      r   r   zClient._init_sessionZ  s5    ##%""$w'r   urir   r   c                      | j                   |||fi |} t        | j                  |      |fi || _        | j	                  | j                        S r   r   getattrr   r   _handle_response)r   r   rZ  r   r   r   s         r   _requestzClient._requestb  sP    )))&&,Q&Q5f5cDVD$$T]]33r   r   c                     d| j                   cxk  rdk  s#n t        | | j                   | j                        	 | j                         S # t        $ r t        d| j                  z        w xY w)Internal helper for handling API responses from the Binance server.
        Raises the appropriate exceptions when necessary; otherwise, returns the
        response.
           i,  zInvalid Response: %s)status_coder   textjson
ValueErrorr   )r   s    r   r^  zClient._handle_responsei  sh     x++1c1%h0D0DhmmTT	R==?" 	R)*@8==*PQQ	Rs   A
 
"A,r   c                 R    | j                  |||      } | j                  |||fi |S r   r   r_  r   r   r   r   r   r   rZ  s          r   _request_apizClient._request_apiv  s2     ""49t}}VS&;F;;r   r   c                 R    | j                  ||      } | j                  |||dfi |S NTr   r_  ri  s          r   _request_futures_apizClient._request_futures_api|  s0    **49t}}VS&$A&AAr   c                 P    | j                  |      } | j                  |||dfi |S rl  r   r_  r   r   r   r   r   rZ  s         r   _request_futures_data_apiz Client._request_futures_data_api  s.    //5t}}VS&$A&AAr   c                 T    | j                  ||      } | j                  |||dfi |S Nr   Tr   r_  ri  s          r   _request_futures_coin_apiz Client._request_futures_coin_api  s3    //g/Ft}}VS&$A&AAr   c                 T    | j                  ||      } | j                  |||dfi |S rt  r   r_  ri  s          r   _request_futures_coin_data_apiz%Client._request_futures_coin_data_api  s3    44T74Kt}}VS&$A&AAr   c                 P    | j                  |      } | j                  |||dfi |S rl  r   r_  rq  s         r   _request_options_apizClient._request_options_api  s.    **40t}}VS&$A&AAr   c                 P    | j                  ||      } | j                  |||fi |S r   r   r_  ri  s          r   _request_margin_apizClient._request_margin_api  s.    ))$8t}}VS&;F;;r   c                 N    | j                  |      } | j                  |||fi |S r   r   r_  rq  s         r   _request_websitezClient._request_website  s,    &&t,t}}VS&;F;;r   c                 .     | j                   d|||fi |S Nr   rj  r   r   r   r   r   s        r   _getzClient._get        t  fgHHHr   c                 .     | j                   d|||fi |S Npostr  r  s        r   _postzClient._post  s      t  vwI&IIr   c                 .     | j                   d|||fi |S Nputr  r  s        r   _putzClient._put  r  r   c                 .     | j                   d|||fi |S Ndeleter  r  s        r   _deletezClient._delete  s      t  4KFKKr   c                 *    | j                  dd      }|S )zReturn list of products currently listed on Binance

        Use get_exchange_info() call instead

        :returns: list - List of product dictionaries

        :raises: BinanceRequestException, BinanceAPIException

        r   9exchange-api/v1/public/asset-service/product/get-productsr  r   productss     r   get_productszClient.get_products  s     ((0klr   c                 <    | j                  d| j                        S )a  Return rate limits and list of symbols

        :returns: list - List of product dictionaries

        .. code-block:: python

            {
                "timezone": "UTC",
                "serverTime": 1508631584636,
                "rateLimits": [
                    {
                        "rateLimitType": "REQUESTS",
                        "interval": "MINUTE",
                        "limit": 1200
                    },
                    {
                        "rateLimitType": "ORDERS",
                        "interval": "SECOND",
                        "limit": 10
                    },
                    {
                        "rateLimitType": "ORDERS",
                        "interval": "DAY",
                        "limit": 100000
                    }
                ],
                "exchangeFilters": [],
                "symbols": [
                    {
                        "symbol": "ETHBTC",
                        "status": "TRADING",
                        "baseAsset": "ETH",
                        "baseAssetPrecision": 8,
                        "quoteAsset": "BTC",
                        "quotePrecision": 8,
                        "orderTypes": ["LIMIT", "MARKET"],
                        "icebergAllowed": false,
                        "filters": [
                            {
                                "filterType": "PRICE_FILTER",
                                "minPrice": "0.00000100",
                                "maxPrice": "100000.00000000",
                                "tickSize": "0.00000100"
                            }, {
                                "filterType": "LOT_SIZE",
                                "minQty": "0.00100000",
                                "maxQty": "100000.00000000",
                                "stepSize": "0.00100000"
                            }, {
                                "filterType": "MIN_NOTIONAL",
                                "minNotional": "0.00100000"
                            }
                        ]
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        exchangeInforu  r  r   r   s    r   get_exchange_infozClient.get_exchange_info  s    | yy1I1IyJJr   c                 l    | j                         }|d   D ]  }|d   |j                         k(  s|c S  y)a  Return information about a symbol

        :param symbol: required e.g. BNBBTC
        :type symbol: str

        :returns: Dict if found, None if not

        .. code-block:: python

            {
                "symbol": "ETHBTC",
                "status": "TRADING",
                "baseAsset": "ETH",
                "baseAssetPrecision": 8,
                "quoteAsset": "BTC",
                "quotePrecision": 8,
                "orderTypes": ["LIMIT", "MARKET"],
                "icebergAllowed": false,
                "filters": [
                    {
                        "filterType": "PRICE_FILTER",
                        "minPrice": "0.00000100",
                        "maxPrice": "100000.00000000",
                        "tickSize": "0.00000100"
                    }, {
                        "filterType": "LOT_SIZE",
                        "minQty": "0.00100000",
                        "maxQty": "100000.00000000",
                        "stepSize": "0.00100000"
                    }, {
                        "filterType": "MIN_NOTIONAL",
                        "minNotional": "0.00100000"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        symbolssymbolNr  upperr   r  resitems       r   get_symbol_infozClient.get_symbol_info  s=    R $$&	NDH~/ # r   c                 <    | j                  d| j                        S )a  Test connectivity to the Rest API.

        https://binance-docs.github.io/apidocs/spot/en/#test-connectivity

        :returns: Empty array

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        rV  ru  r  r   s    r   rV  zClient.ping,  s     yy)A)AyBBr   c                 <    | j                  d| j                        S )af  Test connectivity to the Rest API and get the current server time.

        https://binance-docs.github.io/apidocs/spot/en/#check-server-time

        :returns: Current server time

        .. code-block:: python

            {
                "serverTime": 1499827319559
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   ru  r  r   s    r   get_server_timezClient.get_server_time<  s      yy)A)AyBBr   c                 <    | j                  d| j                        S )a  Latest price for all symbols.

        https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker

        :returns: List of market tickers

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "price": "4.00000200"
                },
                {
                    "symbol": "ETHBTC",
                    "price": "0.07946600"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        ticker/priceru  r  r   s    r   get_all_tickerszClient.get_all_tickersP  s    . yy1I1IyJJr   c                 t    i }d|v r	|d   |d<   nd|v r|d   |d<   | j                  d|| j                        S )a
  Best price/qty on the order book for all symbols.

        https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker

        :param symbol: optional
        :type symbol: str
        :param symbols: optional accepted format  ["BTCUSDT","BNBUSDT"] or %5B%22BTCUSDT%22,%22BNBUSDT%22%5D
        :type symbols: str

        :returns: List of order book market entries

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "bidPrice": "4.00000000",
                    "bidQty": "431.00000000",
                    "askPrice": "4.00000200",
                    "askQty": "9.00000000"
                },
                {
                    "symbol": "ETHBTC",
                    "bidPrice": "0.07946700",
                    "bidQty": "9.00000000",
                    "askPrice": "100000.00000000",
                    "askQty": "1000.00000000"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r  r  ticker/bookTickerr   r   r  r   r   r   s      r   get_orderbook_tickerszClient.get_orderbook_tickersi  sR    D v#H-DN& $Y/DOyy,4AYAYyZZr   c                 >    | j                  d|| j                        S )ak  Get the Order Book for the market

        https://binance-docs.github.io/apidocs/spot/en/#order-book

        :param symbol: required
        :type symbol: str
        :param limit:  Default 100; max 1000
        :type limit: int

        :returns: API response

        .. code-block:: python

            {
                "lastUpdateId": 1027024,
                "bids": [
                    [
                        "4.00000000",     # PRICE
                        "431.00000000",   # QTY
                        []                # Can be ignored
                    ]
                ],
                "asks": [
                    [
                        "4.00000200",
                        "12.00000000",
                        []
                    ]
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        depthr  r  r   r   s     r   get_order_bookzClient.get_order_book  s     F yyvt7O7OyPPr   c                 (    | j                  d|      S )a  Get recent trades (up to last 500).

        https://binance-docs.github.io/apidocs/spot/en/#recent-trades-list

        :param symbol: required
        :type symbol: str
        :param limit:  Default 500; max 1000.
        :type limit: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "id": 28457,
                    "price": "4.00000100",
                    "qty": "12.00000000",
                    "time": 1499865549590,
                    "isBuyerMaker": true,
                    "isBestMatch": true
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        tradesr   r  r  s     r   get_recent_tradeszClient.get_recent_trades  s    8 yyy//r   c                 >    | j                  d|| j                        S )a  Get older trades.

        https://binance-docs.github.io/apidocs/spot/en/#old-trade-lookup

        :param symbol: required
        :type symbol: str
        :param limit:  Default 500; max 1000.
        :type limit: int
        :param fromId:  TradeId to fetch from. Default gets most recent trades.
        :type fromId: str

        :returns: API response

        .. code-block:: python

            [
                {
                    "id": 28457,
                    "price": "4.00000100",
                    "qty": "12.00000000",
                    "time": 1499865549590,
                    "isBuyerMaker": true,
                    "isBestMatch": true
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        historicalTradesr  r  r  s     r   get_historical_tradeszClient.get_historical_trades  s     < yy+&$BZBZy[[r   c                 >    | j                  d|| j                        S )aD  Get compressed, aggregate trades. Trades that fill at the time,
        from the same order, with the same price will have the quantity aggregated.

        https://binance-docs.github.io/apidocs/spot/en/#compressed-aggregate-trades-list

        :param symbol: required
        :type symbol: str
        :param fromId:  ID to get aggregate trades from INCLUSIVE.
        :type fromId: str
        :param startTime: Timestamp in ms to get aggregate trades from INCLUSIVE.
        :type startTime: int
        :param endTime: Timestamp in ms to get aggregate trades until INCLUSIVE.
        :type endTime: int
        :param limit:  Default 500; max 1000.
        :type limit: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "a": 26129,         # Aggregate tradeId
                    "p": "0.01633102",  # Price
                    "q": "4.70443515",  # Quantity
                    "f": 27781,         # First tradeId
                    "l": 27781,         # Last tradeId
                    "T": 1498793709153, # Timestamp
                    "m": true,          # Was the buyer the maker?
                    "M": true           # Was the trade the best price match?
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        	aggTradesr  r  r  s     r   get_aggregate_tradeszClient.get_aggregate_trades  s     J yy64;S;SyTTr   r  c              #     K   ||t        d      ||| j                  |d      }n[t        |      }	 |dz   }| j                  |||      }t        |      dkD  rn'|t	        t        j
                         dz        kD  ry|}O|D ]  }|  |d   | j                     }	 | j                  ||      }|d	d }t        |      dk(  ry|D ]  }|  |d   | j                     }Ew)
u  Iterate over aggregate trade data from (start_time or last_id) to
        the end of the history so far.

        If start_time is specified, start with the first trade after
        start_time. Meant to initialise a local cache of trade data.

        If last_id is specified, start with the trade after it. This is meant
        for updating a pre-existing local trade data cache.

        Only allows start_str or last_id—not both. Not guaranteed to work
        right if you're running more than one of these simultaneously. You
        will probably hit your rate limit.

        See dateparser docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/

        If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"

        :param symbol: Symbol string e.g. ETHBTC
        :type symbol: str
        :param start_str: Start date string in UTC format or timestamp in milliseconds. The iterator will
        return the first trade occurring later than this time.
        :type start_str: str|int
        :param last_id: aggregate trade ID of the last known aggregate trade.
        Not a regular trade ID. See https://binance-docs.github.io/apidocs/spot/en/#compressed-aggregate-trades-list

        :returns: an iterator of JSON objects, one per trade. The format of
        each object is identical to Client.aggregate_trades().

        :type last_id: int
        N;start_time and last_id may not be simultaneously specified.r   r  fromId6 r  	startTimeendTimer   r   rf  r  r   lenr   r   r7  r   r  	start_strlast_idr  start_tsend_tsts           r   aggregate_trade_iterzClient.aggregate_trade_iter  s8    >  W%8MO O ?  22&2K
 *)4 %8F!66%"* & 7 (F 6{Q DIIK$$6 77%H   Rj-G ..fW.MF ABZF6{a Rj-G s   C&C(c                 >    | j                  d|| j                        S )a)  Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

        https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data

        :param symbol: required
        :type symbol: str
        :param interval: -
        :type interval: str
        :param limit: - Default 500; max 1000.
        :type limit: int
        :param startTime:
        :type startTime: int
        :param endTime:
        :type endTime: int

        :returns: API response

        .. code-block:: python

            [
                [
                    1499040000000,      # Open time
                    "0.01634790",       # Open
                    "0.80000000",       # High
                    "0.01575800",       # Low
                    "0.01577100",       # Close
                    "148976.11427815",  # Volume
                    1499644799999,      # Close time
                    "2434.19055334",    # Quote asset volume
                    308,                # Number of trades
                    "1756.87402397",    # Taker buy base asset volume
                    "28.46694368",      # Taker buy quote asset volume
                    "17928899.62484339" # Can be ignored
                ]
            ]

        :raises: BinanceRequestException, BinanceAPIException

        klinesr  r  r  s     r   
get_klineszClient.get_klineso  s     P yy8P8PyQQr   klines_typec                    d|v r|d   s|d= t         j                  |k(  r | j                  di |S t         j                  |k(  r | j                  di |S t         j
                  |k(  r | j                  di |S t        |      )zGet klines of spot (get_klines) or futures (futures_klines) endpoints.

        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: klines, see get_klines

        r  r   r   r%   r  FUTURESfutures_klinesFUTURES_COINfutures_coin_klinesr   r   r  r   s      r   _klineszClient._klines  s     vi'8y!$$3"4??,V,,!))[8&4&&000!..+=+4++5f55)+66r   c                 |    | j                  |||ddt        t        j                         dz              }|d   d   S )av  Get the earliest valid open timestamp from Binance

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: first valid timestamp

        r   r   r   r  r  intervallimitr  r  r  r   r   r   r  r  r  klines        r   _get_earliest_valid_timestampz$Client._get_earliest_valid_timestamp  sI     #		d*+  
 Qx{r   r   c                 0    | j                  ||||||      S )aw  Get Historical Klines from Binance

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: optional - start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: str|int
        :param limit: Default 1000; max 1000.
        :type limit: int
        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: list of OHLCV values (Open time, Open, High, Low, Close, Volume, Close time, Quote asset volume, Number of trades, Taker buy base asset volume, Taker buy quote asset volume, Ignore)

        )r  end_strr  r  _historical_klinesr   r  r  r  r  r  r  s          r   get_historical_klineszClient.get_historical_klines  s*    ( &&H	7%]h ' 
 	
r   c                    g }t        |      }t        |      }	|	| j                  |||      }
t        |	|
      }	t        |      }|r	|	r||	k  r|S d}	 | j	                  |||||	|      }|r||z  }t        |      rt        |      |k  r	 |S |d   d   |z   }	|r|	|k\  r	 |S |dz  }|dz  dk(  rt        j                  d       r)af  Get Historical Klines from Binance (spot or futures)

        See dateparser docs for valid start and end string formats https://dateparser.readthedocs.io/en/latest/

        If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: optional - start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: None|str|int
        :param limit: Default 1000; max 1000.
        :type limit: int
        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: list of OHLCV values (Open time, Open, High, Low, Close, Volume, Close time, Quote asset volume, Number of trades, Taker buy base asset volume, Taker buy quote asset volume, Ignore)

        r   r  r  r   r   r   r   r  maxr  r  r   sleepr   r  r  r  r  r  r  output_data	timeframer  first_valid_tsr  idx	temp_datas                 r   r  zClient._historical_klines  s   2  -X6	 "), !??R]^N8^4H  (h6X#5'!" % I y( y>S^e%;  !}Q')3H (f, 	 1HCQw!|

1? r   c                 0    | j                  ||||||      S )a  Get Historical Klines generator from Binance

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: optional - Start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: str|int
        :param limit: amount of candles to return per request (default 1000)
        :type limit: int
        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: generator of OHLCV values

        )r  _historical_klines_generatorr  s          r   get_historical_klines_generatorz&Client.get_historical_klines_generator,  s$    * 009gW\ju0vvr   c              #     K   t        |      }t        |      }|| j                  |||      }	t        ||	      }t        |      }
|
r|r|
|k  ryd}	 | j	                  ||||||
      }|r|D ]  }|  t        |      rt        |      |k  ry|d   d   |z   }|
r||
k\  ry|dz  }|dz  dk(  rt        j                  d       tw)a  Get Historical Klines generator from Binance (spot or futures)

        See dateparser docs for valid start and end string formats https://dateparser.readthedocs.io/en/latest/

        If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: optional - Start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: str|int
        :param klines_type: Historical klines type: SPOT or FUTURES
        :type klines_type: HistoricalKlinesType

        :return: generator of OHLCV values

        Nr   r  r  r   r   r  r   r  r  r  r  r  r  r  r  r  r  r  r  os                 r   r  z#Client._historical_klines_generatorC  s    0 -X6	 "), !??R]^N8^4H  (h6X#5,,'!" ' K $AG %
 {#s;'7%'? #2q)I5H (f, 1HCQw!|

1C s   CCc                 >    | j                  d|| j                        S )aK  Current average price for a symbol.

        https://binance-docs.github.io/apidocs/spot/en/#current-average-price

        :param symbol:
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "mins": 5,
                "price": "9.35751834"
            }
        avgPricer  r  r  s     r   get_avg_pricezClient.get_avg_price  s    " yy&$:R:RySSr   c                 >    | j                  d|| j                        S )a  24 hour price change statistics.

        https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics

        :param symbol:
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "priceChange": "-94.99999800",
                "priceChangePercent": "-95.960",
                "weightedAvgPrice": "0.29628482",
                "prevClosePrice": "0.10002000",
                "lastPrice": "4.00000200",
                "bidPrice": "4.00000000",
                "askPrice": "4.00000200",
                "openPrice": "99.00000000",
                "highPrice": "100.00000000",
                "lowPrice": "0.10000000",
                "volume": "8913.30000000",
                "openTime": 1499783499040,
                "closeTime": 1499869899040,
                "fristId": 28385,   # First tradeId
                "lastId": 28460,    # Last tradeId
                "count": 76         # Trade count
            }

        OR

        .. code-block:: python

            [
                {
                    "priceChange": "-94.99999800",
                    "priceChangePercent": "-95.960",
                    "weightedAvgPrice": "0.29628482",
                    "prevClosePrice": "0.10002000",
                    "lastPrice": "4.00000200",
                    "bidPrice": "4.00000000",
                    "askPrice": "4.00000200",
                    "openPrice": "99.00000000",
                    "highPrice": "100.00000000",
                    "lowPrice": "0.10000000",
                    "volume": "8913.30000000",
                    "openTime": 1499783499040,
                    "closeTime": 1499869899040,
                    "fristId": 28385,   # First tradeId
                    "lastId": 28460,    # Last tradeId
                    "count": 76         # Trade count
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        ticker/24hrr  r  r  s     r   
get_tickerzClient.get_ticker  s     v yyVT=U=UyVVr   c                 >    | j                  d|| j                        S )a  Latest price for a symbol or symbols.

        https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker

        :param symbol:
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "symbol": "LTCBTC",
                "price": "4.00000200"
            }

        OR

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "price": "4.00000200"
                },
                {
                    "symbol": "ETHBTC",
                    "price": "0.07946600"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  r  s     r   get_symbol_tickerzClient.get_symbol_ticker  s     F yyfd>V>VyWWr   c                 >    | j                  d|| j                        S )aj  Latest price for a symbol or symbols.

        https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker

        :param symbol:
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "symbol": "LTCBTC",
                "bidPrice": "4.00000000",
                "bidQty": "431.00000000",
                "askPrice": "4.00000200",
                "askQty": "9.00000000"
            }

        OR

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "bidPrice": "4.00000000",
                    "bidQty": "431.00000000",
                    "askPrice": "4.00000200",
                    "askQty": "9.00000000"
                },
                {
                    "symbol": "ETHBTC",
                    "bidPrice": "0.07946700",
                    "bidQty": "9.00000000",
                    "askPrice": "100000.00000000",
                    "askQty": "1000.00000000"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  r  s     r   get_orderbook_tickerzClient.get_orderbook_ticker  s!    X yy,64C[C[y\\r   c                 *    | j                  dd|      S )a  Send in a new order

        Any order with an icebergQty MUST have timeInForce set to GTC.

        https://binance-docs.github.io/apidocs/spot/en/#new-order-trade

        :param symbol: required
        :type symbol: str
        :param side: required
        :type side: str
        :param type: required
        :type type: str
        :param timeInForce: required if limit order
        :type timeInForce: str
        :param quantity: required
        :type quantity: decimal
        :param quoteOrderQty: amount the user wants to spend (when buying) or receive (when selling)
            of the quote asset, applicable to MARKET orders
        :type quoteOrderQty: decimal
        :param price: required
        :type price: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param icebergQty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
        :type icebergQty: decimal
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        Response ACK:

        .. code-block:: python

            {
                "symbol":"LTCBTC",
                "orderId": 1,
                "clientOrderId": "myOrder1" # Will be newClientOrderId
                "transactTime": 1499827319559
            }

        Response RESULT:

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "orderId": 28,
                "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
                "transactTime": 1507725176595,
                "price": "0.00000000",
                "origQty": "10.00000000",
                "executedQty": "10.00000000",
                "cummulativeQuoteQty": "10.00000000",
                "status": "FILLED",
                "timeInForce": "GTC",
                "type": "MARKET",
                "side": "SELL"
            }

        Response FULL:

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "orderId": 28,
                "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
                "transactTime": 1507725176595,
                "price": "0.00000000",
                "origQty": "10.00000000",
                "executedQty": "10.00000000",
                "cummulativeQuoteQty": "10.00000000",
                "status": "FILLED",
                "timeInForce": "GTC",
                "type": "MARKET",
                "side": "SELL",
                "fills": [
                    {
                        "price": "4000.00000000",
                        "qty": "1.00000000",
                        "commission": "4.00000000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3999.00000000",
                        "qty": "5.00000000",
                        "commission": "19.99500000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3998.00000000",
                        "qty": "2.00000000",
                        "commission": "7.99600000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3997.00000000",
                        "qty": "1.00000000",
                        "commission": "3.99700000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3995.00000000",
                        "qty": "1.00000000",
                        "commission": "3.99500000",
                        "commissionAsset": "USDT"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        orderTr  r  r  s     r   create_orderzClient.create_order3  s    j zz'4fz55r   c                 b    |j                  | j                  |d        | j                  di |S )a  Send in a new limit order

        Any order with an icebergQty MUST have timeInForce set to GTC.

        :param symbol: required
        :type symbol: str
        :param side: required
        :type side: str
        :param quantity: required
        :type quantity: decimal
        :param price: required
        :type price: str
        :param timeInForce: default Good till cancelled
        :type timeInForce: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param icebergQty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
        :type icebergQty: decimal
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        typetimeInForcer   r   r#  r  r   r  r   s      r   order_limitzClient.order_limit  s9    > 	))&
 	 !t  *6**r   c                 d    |j                  d| j                  i        | j                  dd|i|S )a  Send in a new limit buy order

        Any order with an icebergQty MUST have timeInForce set to GTC.

        :param symbol: required
        :type symbol: str
        :param quantity: required
        :type quantity: decimal
        :param price: required
        :type price: str
        :param timeInForce: default Good till cancelled
        :type timeInForce: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param stopPrice: Used with stop orders
        :type stopPrice: decimal
        :param icebergQty: Used with iceberg orders
        :type icebergQty: decimal
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        sider  r   r   r!  r  r  s      r   order_limit_buyzClient.order_limit_buy  s;    > 	DMM
 	  tBKB6BBr   c                 d    |j                  d| j                  i        | j                  dd|i|S )a  Send in a new limit sell order

        :param symbol: required
        :type symbol: str
        :param quantity: required
        :type quantity: decimal
        :param price: required
        :type price: str
        :param timeInForce: default Good till cancelled
        :type timeInForce: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param stopPrice: Used with stop orders
        :type stopPrice: decimal
        :param icebergQty: Used with iceberg orders
        :type icebergQty: decimal
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r  r   r   r"  r  r  s      r   order_limit_sellzClient.order_limit_sell  s;    : 	DNN
 	  tBKB6BBr   c                 `    |j                  d| j                  i        | j                  di |S )aH  Send in a new market order

        :param symbol: required
        :type symbol: str
        :param side: required
        :type side: str
        :param quantity: required
        :type quantity: decimal
        :param quoteOrderQty: amount the user wants to spend (when buying) or receive (when selling)
            of the quote asset
        :type quoteOrderQty: decimal
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r   r   r$  r  r  s     r   order_marketzClient.order_market  s8    4 	D**
 	 !t  *6**r   c                 `    |j                  d| j                  i        | j                  di |S )a  Send in a new market buy order

        :param symbol: required
        :type symbol: str
        :param quantity: required
        :type quantity: decimal
        :param quoteOrderQty: the amount the user wants to spend of the quote asset
        :type quoteOrderQty: decimal
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r   r   r!  r  r  s     r   order_market_buyzClient.order_market_buy4  s6    . 	DMM
 	 !t  *6**r   c                 `    |j                  d| j                  i        | j                  di |S )a  Send in a new market sell order

        :param symbol: required
        :type symbol: str
        :param quantity: required
        :type quantity: decimal
        :param quoteOrderQty: the amount the user wants to receive of the quote asset
        :type quoteOrderQty: decimal
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r   r   r"  r  r  s     r   order_market_sellzClient.order_market_sellP  s6    . 	DNN
 	 !t  *6**r   c                 *    | j                  dd|      S )a  Send in a new OCO order

        https://binance-docs.github.io/apidocs/spot/en/#new-oco-trade

        :param symbol: required
        :type symbol: str
        :param listClientOrderId: A unique id for the list order. Automatically generated if not sent.
        :type listClientOrderId: str
        :param side: required
        :type side: str
        :param quantity: required
        :type quantity: decimal
        :param limitClientOrderId: A unique id for the limit order. Automatically generated if not sent.
        :type limitClientOrderId: str
        :param price: required
        :type price: str
        :param limitIcebergQty: Used to make the LIMIT_MAKER leg an iceberg order.
        :type limitIcebergQty: decimal
        :param stopClientOrderId: A unique id for the stop order. Automatically generated if not sent.
        :type stopClientOrderId: str
        :param stopPrice: required
        :type stopPrice: str
        :param stopLimitPrice: If provided, stopLimitTimeInForce is required.
        :type stopLimitPrice: str
        :param stopIcebergQty: Used with STOP_LOSS_LIMIT leg to make an iceberg order.
        :type stopIcebergQty: decimal
        :param stopLimitTimeInForce: Valid values are GTC/FOK/IOC.
        :type stopLimitTimeInForce: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        Response ACK:

        .. code-block:: python

            {
            }

        Response RESULT:

        .. code-block:: python

            {
            }

        Response FULL:

        .. code-block:: python

            {
            }

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        	order/ocoTr  r  r  s     r   create_oco_orderzClient.create_oco_orderl  s    x zz+t&z99r   c                 `    |j                  d| j                  i        | j                  di |S )a  Send in a new OCO buy order

        :param symbol: required
        :type symbol: str
        :param listClientOrderId: A unique id for the list order. Automatically generated if not sent.
        :type listClientOrderId: str
        :param quantity: required
        :type quantity: decimal
        :param limitClientOrderId: A unique id for the limit order. Automatically generated if not sent.
        :type limitClientOrderId: str
        :param price: required
        :type price: str
        :param limitIcebergQty: Used to make the LIMIT_MAKER leg an iceberg order.
        :type limitIcebergQty: decimal
        :param stopClientOrderId: A unique id for the stop order. Automatically generated if not sent.
        :type stopClientOrderId: str
        :param stopPrice: required
        :type stopPrice: str
        :param stopLimitPrice: If provided, stopLimitTimeInForce is required.
        :type stopLimitPrice: str
        :param stopIcebergQty: Used with STOP_LOSS_LIMIT leg to make an iceberg order.
        :type stopIcebergQty: decimal
        :param stopLimitTimeInForce: Valid values are GTC/FOK/IOC.
        :type stopLimitTimeInForce: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See OCO order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r   r   r!  r'  r  s     r   order_oco_buyzClient.order_oco_buy  s7    J 	DMM
 	 %t$$.v..r   c                 `    |j                  d| j                  i        | j                  di |S )a  Send in a new OCO sell order

        :param symbol: required
        :type symbol: str
        :param listClientOrderId: A unique id for the list order. Automatically generated if not sent.
        :type listClientOrderId: str
        :param quantity: required
        :type quantity: decimal
        :param limitClientOrderId: A unique id for the limit order. Automatically generated if not sent.
        :type limitClientOrderId: str
        :param price: required
        :type price: str
        :param limitIcebergQty: Used to make the LIMIT_MAKER leg an iceberg order.
        :type limitIcebergQty: decimal
        :param stopClientOrderId: A unique id for the stop order. Automatically generated if not sent.
        :type stopClientOrderId: str
        :param stopPrice: required
        :type stopPrice: str
        :param stopLimitPrice: If provided, stopLimitTimeInForce is required.
        :type stopLimitPrice: str
        :param stopIcebergQty: Used with STOP_LOSS_LIMIT leg to make an iceberg order.
        :type stopIcebergQty: decimal
        :param stopLimitTimeInForce: Valid values are GTC/FOK/IOC.
        :type stopLimitTimeInForce: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        See OCO order endpoint for full response options

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException

        r  r   r   r"  r'  r  s     r   order_oco_sellzClient.order_oco_sell  s7    J 	DNN
 	 %t$$.v..r   c                 *    | j                  dd|      S )al  Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.

        https://binance-docs.github.io/apidocs/spot/en/#test-new-order-trade

        :param symbol: required
        :type symbol: str
        :param side: required
        :type side: str
        :param type: required
        :type type: str
        :param timeInForce: required if limit order
        :type timeInForce: str
        :param quantity: required
        :type quantity: decimal
        :param price: required
        :type price: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param icebergQty: Used with iceberg orders
        :type icebergQty: decimal
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param recvWindow: The number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException, BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException, BinanceOrderInactiveSymbolException


        
order/testTr  r  r  s     r   create_test_orderzClient.create_test_order  s    H zz,6z::r   c                 *    | j                  dd|      S )aK  Check an order's status. Either orderId or origClientOrderId must be sent.

        https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data

        :param symbol: required
        :type symbol: str
        :param orderId: The unique order id
        :type orderId: int
        :param origClientOrderId: optional
        :type origClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "symbol": "LTCBTC",
                "orderId": 1,
                "clientOrderId": "myOrder1",
                "price": "0.1",
                "origQty": "1.0",
                "executedQty": "0.0",
                "status": "NEW",
                "timeInForce": "GTC",
                "type": "LIMIT",
                "side": "BUY",
                "stopPrice": "0.0",
                "icebergQty": "0.0",
                "time": 1499827319559
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  Tr  r  r  s     r   	get_orderzClient.get_order$  s    J yy$Vy44r   c                 *    | j                  dd|      S )a  Get all account orders; active, canceled, or filled.

        https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data

        :param symbol: required
        :type symbol: str
        :param orderId: The unique order id
        :type orderId: int
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: Default 500; max 1000.
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "orderId": 1,
                    "clientOrderId": "myOrder1",
                    "price": "0.1",
                    "origQty": "1.0",
                    "executedQty": "0.0",
                    "status": "NEW",
                    "timeInForce": "GTC",
                    "type": "LIMIT",
                    "side": "BUY",
                    "stopPrice": "0.0",
                    "icebergQty": "0.0",
                    "time": 1499827319559
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        	allOrdersTr  r  r  s     r   get_all_orderszClient.get_all_ordersK  s    V yydy88r   c                 *    | j                  dd|      S )a  Cancel an active order. Either orderId or origClientOrderId must be sent.

        https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade

        :param symbol: required
        :type symbol: str
        :param orderId: The unique order id
        :type orderId: int
        :param origClientOrderId: optional
        :type origClientOrderId: str
        :param newClientOrderId: Used to uniquely identify this cancel. Automatically generated by default.
        :type newClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "symbol": "LTCBTC",
                "origClientOrderId": "myOrder1",
                "orderId": 1,
                "clientOrderId": "cancelMyOrder1"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  Tr  r  r  s     r   cancel_orderzClient.cancel_orderx  s    < ||GT|77r   c                 *    | j                  dd|      S )a  Get all open orders on a symbol.

        https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data

        :param symbol: optional
        :type symbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "symbol": "LTCBTC",
                    "orderId": 1,
                    "clientOrderId": "myOrder1",
                    "price": "0.1",
                    "origQty": "1.0",
                    "executedQty": "0.0",
                    "status": "NEW",
                    "timeInForce": "GTC",
                    "type": "LIMIT",
                    "side": "BUY",
                    "stopPrice": "0.0",
                    "icebergQty": "0.0",
                    "time": 1499827319559
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        
openOrdersTr  r  r  s     r   get_open_orderszClient.get_open_orders  s    F yyt&y99r   c                 *    | j                  dd|      S )a  Get all open orders on a symbol.
        https://binance-docs.github.io/apidocs/spot/en/#query-open-oco-user_data
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int
        :returns: API response
        .. code-block:: python
            [
                {
                    "orderListId": 31,
                    "contingencyType": "OCO",
                    "listStatusType": "EXEC_STARTED",
                    "listOrderStatus": "EXECUTING",
                    "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
                    "transactionTime": 1565246080644,
                    "symbol": "LTCBTC",
                    "orders": [
                        {
                            "symbol": "LTCBTC",
                            "orderId": 4,
                            "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
                        },
                        {
                            "symbol": "LTCBTC",
                            "orderId": 5,
                            "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
                        }
                    ]
                }
            ]
        :raises: BinanceRequestException, BinanceAPIException
        openOrderListTr  r  r  s     r   get_open_oco_orderszClient.get_open_oco_orders  s    @ yy$Vy<<r   c                 *    | j                  dd|      S )a0  Get current account information.

        https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data

        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "makerCommission": 15,
                "takerCommission": 15,
                "buyerCommission": 0,
                "sellerCommission": 0,
                "canTrade": true,
                "canWithdraw": true,
                "canDeposit": true,
                "balances": [
                    {
                        "asset": "BTC",
                        "free": "4723846.89208129",
                        "locked": "0.00000000"
                    },
                    {
                        "asset": "LTC",
                        "free": "4763368.68006011",
                        "locked": "0.00000000"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        accountTr  r  r  s     r   get_accountzClient.get_account  s    J yyDvy66r   c                      | j                   di |}d|v r2|d   D ]*  }|d   j                         |j                         k(  s(|c S  y)a  Get current asset balance.

        :param asset: required
        :type asset: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: dictionary or None if not found

        .. code-block:: python

            {
                "asset": "BTC",
                "free": "4723846.89208129",
                "locked": "0.00000000"
            }

        :raises: BinanceRequestException, BinanceAPIException

        balancesassetNr   rA  lowerr   rD  r   r  bals        r   get_asset_balancezClient.get_asset_balance  sT    * d((:w<%%'5;;=8J ' r   c                 *    | j                  dd|      S )a  Get trades for a specific symbol.

        https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data

        :param symbol: required
        :type symbol: str
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: Default 500; max 1000.
        :type limit: int
        :param fromId: TradeId to fetch from. Default gets most recent trades.
        :type fromId: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "id": 28457,
                    "price": "4.00000100",
                    "qty": "12.00000000",
                    "commission": "10.10000000",
                    "commissionAsset": "BNB",
                    "time": 1499865549590,
                    "isBuyer": true,
                    "isMaker": false,
                    "isBestMatch": true
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        myTradesTr  r  r  s     r   get_my_tradeszClient.get_my_trades$  s    N yyTy77r   c                 &    | j                  dd      S )a  Displays the user's current order count usage for all intervals.

        https://binance-docs.github.io/apidocs/spot/en/#query-current-order-count-usage-trade

        :returns: API response

        .. code-block:: python
            [

                {
                    "rateLimitType": "ORDERS",
                    "interval": "SECOND",
                    "intervalNum": 10,
                    "limit": 10000,
                    "count": 0
                },
                {
                    "rateLimitType": "ORDERS",
                    "interval": "DAY",
                    "intervalNum": 1,
                    "limit": 20000,
                    "count": 0
                }
            ]

        rateLimit/orderTr  r   s    r   get_current_order_countzClient.get_current_order_countM  s    6 yy*D11r   c                 *    | j                  dd|      S )a  Displays the list of orders that were expired because of STP.

        https://binance-docs.github.io/apidocs/spot/en/#query-prevented-matches-user_data

        :param symbol: required
        :type symbol: str
        :param preventedMatchId: optional
        :type preventedMatchId: int
        :param orderId: optional
        :type orderId: int
        :param fromPreventedMatchId: optional
        :type fromPreventedMatchId: int
        :param limit: optional, Default: 500; Max: 1000
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python
            [
                {
                    "symbol": "BTCUSDT",
                    "preventedMatchId": 1,
                    "takerOrderId": 5,
                    "makerOrderId": 3,
                    "tradeGroupId": 1,
                    "selfTradePreventionMode": "EXPIRE_MAKER",
                    "price": "1.100000",
                    "makerPreventedQuantity": "1.300000",
                    "transactTime": 1669101687094
                }
            ]
        myPreventedMatchesTr  r  r  s     r   get_prevented_matcheszClient.get_prevented_matchesj  s    F yy-t&yAAr   c                 *    | j                  dd|      S )a[  Retrieves allocations resulting from SOR order placement.

        https://binance-docs.github.io/apidocs/spot/en/#query-allocations-user_data

        :param symbol: required
        :type symbol: str
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param fromAllocationId: optional
        :type fromAllocationId: int
        :param orderId: optional
        :type orderId: int
        :param limit: optional, Default: 500; Max: 1000
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python
            [
                {
                    "symbol": "BTCUSDT",
                    "allocationId": 0,
                    "allocationType": "SOR",
                    "orderId": 1,
                    "orderListId": -1,
                    "price": "1.00000000",
                    "qty": "5.00000000",
                    "quoteQty": "5.00000000",
                    "commission": "0.00000000",
                    "commissionAsset": "BTC",
                    "time": 1687506878118,
                    "isBuyer": true,
                    "isMaker": false,
                    "isAllocator": false
                }
            ]
        myAllocationsTr  r  r  s     r   get_allocationszClient.get_allocations  s    T yy$Vy<<r   c                 &    | j                  dd      S )u  Get system status detail.

        https://binance-docs.github.io/apidocs/spot/en/#system-status-sapi-system

        :returns: API response

        .. code-block:: python

            {
                "status": 0,        # 0: normal，1：system maintenance
                "msg": "normal"     # normal or System maintenance.
            }

        :raises: BinanceAPIException

        r   system/statusr  r   s    r   get_system_statuszClient.get_system_status  s    " ''??r   c                 ,    | j                  ddd|      S )ag  Get account status detail.

        https://binance-docs.github.io/apidocs/spot/en/#account-status-sapi-user_data

        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "data": "Normal"
            }

        r   account/statusTr  rX  r  s     r   get_account_statuszClient.get_account_status  s    " ''/?F'SSr   c                 ,    | j                  ddd|      S )aO  Fetch account api trading status detail.

        https://binance-docs.github.io/apidocs/spot/en/#account-api-trading-status-sapi-user_data

        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "data": {          // API trading status detail
                    "isLocked": false,   // API trading function is locked or not
                    "plannedRecoverTime": 0,  // If API trading function is locked, this is the planned recover time
                    "triggerCondition": {
                            "GCR": 150,  // Number of GTC orders
                            "IFER": 150, // Number of FOK/IOC orders
                            "UFR": 300   // Number of orders
                    },
                    "indicators": {  // The indicators updated every 30 seconds
                         "BTCUSDT": [  // The symbol
                            {
                                "i": "UFR",  // Unfilled Ratio (UFR)
                                "c": 20,     // Count of all orders
                                "v": 0.05,   // Current UFR value
                                "t": 0.995   // Trigger UFR value
                            },
                            {
                                "i": "IFER", // IOC/FOK Expiration Ratio (IFER)
                                "c": 20,     // Count of FOK/IOC orders
                                "v": 0.99,   // Current IFER value
                                "t": 0.99    // Trigger IFER value
                            },
                            {
                                "i": "GCR",  // GTC Cancellation Ratio (GCR)
                                "c": 20,     // Count of GTC orders
                                "v": 0.99,   // Current GCR value
                                "t": 0.99    // Trigger GCR value
                            }
                        ],
                        "ETHUSDT": [
                            {
                                "i": "UFR",
                                "c": 20,
                                "v": 0.05,
                                "t": 0.995
                            },
                            {
                                "i": "IFER",
                                "c": 20,
                                "v": 0.99,
                                "t": 0.99
                            },
                            {
                                "i": "GCR",
                                "c": 20,
                                "v": 0.99,
                                "t": 0.99
                            }
                        ]
                    },
                    "updateTime": 1547630471725
                }
            }

        r   account/apiTradingStatusTr  rX  r  s     r   get_account_api_trading_statusz%Client.get_account_api_trading_status  s!    H ''/I4V\']]r   c                 ,    | j                  ddd|      S )a+  Fetch api key permissions.

        https://binance-docs.github.io/apidocs/spot/en/#get-api-key-permission-user_data

        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
               "ipRestrict": false,
               "createTime": 1623840271000,
               "enableWithdrawals": false,   // This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals
               "enableInternalTransfer": true,  // This option authorizes this key to transfer funds between your master account and your sub account instantly
               "permitsUniversalTransfer": true,  // Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization
               "enableVanillaOptions": false,  //  Authorizes this key to Vanilla options trading
               "enableReading": true,
               "enableFutures": false,  //  API Key created before your futures account opened does not support futures API service
               "enableMargin": false,   //  This option can be adjusted after the Cross Margin account transfer is completed
               "enableSpotAndMarginTrading": false, // Spot and margin trading
               "tradingAuthorityExpirationTime": 1628985600000  // Expiration time for spot and margin trading permission
            }

        r   account/apiRestrictionsTr  rX  r  s     r   get_account_api_permissionsz"Client.get_account_api_permissions'	  s     6 ''/H$U['\\r   c                 ,    | j                  ddd|      S )u  Get assets that can be converted into BNB

        https://binance-docs.github.io/apidocs/spot/en/#get-assets-that-can-be-converted-into-bnb-user_data

        :returns: API response

        .. code-block:: python

            {
                "details": [
                    {
                        "asset": "ADA",
                        "assetFullName": "ADA",
                        "amountFree": "6.21",   //Convertible amount
                        "toBTC": "0.00016848",  //BTC amount
                        "toBNB": "0.01777302",  //BNB amount（Not deducted commission fee）
                        "toBNBOffExchange": "0.01741756", //BNB amount（Deducted commission fee）
                        "exchange": "0.00035546" //Commission fee
                    }
                ],
                "totalTransferBtc": "0.00016848",
                "totalTransferBNB": "0.01777302",
                "dribbletPercentage": "0.02"     //Commission fee
            }

        r  asset/dust-btcTr  rX  r  s     r   get_dust_assetszClient.get_dust_assetsD	  s    6 ''0@$V'TTr   c                 ,    | j                  ddd|      S )a  Get log of small amounts exchanged for BNB.

        https://binance-docs.github.io/apidocs/spot/en/#dustlog-sapi-user_data

        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "total": 8,   //Total counts of exchange
                "userAssetDribblets": [
                    {
                        "totalTransferedAmount": "0.00132256",   // Total transfered BNB amount for this exchange.
                        "totalServiceChargeAmount": "0.00002699",    //Total service charge amount for this exchange.
                        "transId": 45178372831,
                        "userAssetDribbletDetails": [           //Details of  this exchange.
                            {
                                "transId": 4359321,
                                "serviceChargeAmount": "0.000009",
                                "amount": "0.0009",
                                "operateTime": 1615985535000,
                                "transferedAmount": "0.000441",
                                "fromAsset": "USDT"
                            },
                            {
                                "transId": 4359321,
                                "serviceChargeAmount": "0.00001799",
                                "amount": "0.0009",
                                "operateTime": "2018-05-03 17:07:04",
                                "transferedAmount": "0.00088156",
                                "fromAsset": "ETH"
                            }
                        ]
                    },
                    {
                        "operateTime":1616203180000,
                        "totalTransferedAmount": "0.00058795",
                        "totalServiceChargeAmount": "0.000012",
                        "transId": 4357015,
                        "userAssetDribbletDetails": [
                            {
                                "transId": 4357015,
                                "serviceChargeAmount": "0.00001"
                                "amount": "0.001",
                                "operateTime": 1616203180000,
                                "transferedAmount": "0.00049",
                                "fromAsset": "USDT"
                            },
                            {
                                "transId": 4357015,
                                "serviceChargeAmount": "0.000002"
                                "amount": "0.0001",
                                "operateTime": 1616203180000,
                                "transferedAmount": "0.00009795",
                                "fromAsset": "ETH"
                            }
                        ]
                    }
                ]
            }

        r   asset/dribbletTr  rX  r  s     r   get_dust_logzClient.get_dust_loga	  s     L ''/?F'SSr   c                 ,    | j                  ddd|      S )a!  Convert dust assets to BNB.

        https://binance-docs.github.io/apidocs/spot/en/#dust-transfer-user_data

        :param asset: The asset being converted. e.g: 'ONE'
        :type asset: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            result = client.transfer_dust(asset='ONE')

        :returns: API response

        .. code-block:: python

            {
                "totalServiceCharge":"0.02102542",
                "totalTransfered":"1.05127099",
                "transferResult":[
                    {
                        "amount":"0.03000000",
                        "fromAsset":"ETH",
                        "operateTime":1563368549307,
                        "serviceChargeAmount":"0.00500000",
                        "tranId":2970932918,
                        "transferedAmount":"0.25000000"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  
asset/dustTr  rX  r  s     r   transfer_dustzClient.transfer_dust	  s    H ''d'PPr   c                 ,    | j                  ddd|      S )a  Query asset dividend record.

        https://binance-docs.github.io/apidocs/spot/en/#asset-dividend-record-user_data

        :param asset: optional
        :type asset: str
        :param startTime: optional
        :type startTime: long
        :param endTime: optional
        :type endTime: long
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            result = client.get_asset_dividend_history()

        :returns: API response

        .. code-block:: python

            {
                "rows":[
                    {
                        "amount":"10.00000000",
                        "asset":"BHFT",
                        "divTime":1563189166000,
                        "enInfo":"BHFT distribution",
                        "tranId":2968885920
                    },
                    {
                        "amount":"10.00000000",
                        "asset":"BHFT",
                        "divTime":1563189165000,
                        "enInfo":"BHFT distribution",
                        "tranId":2968885920
                    }
                ],
                "total":2
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   asset/assetDividendTr  rX  r  s     r   get_asset_dividend_historyz!Client.get_asset_dividend_history	  s!    Z ''/DdQW'XXr   c                 ,    | j                  ddd|      S )a  User Universal Transfer

        https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer

        :param type: required
        :type type: str (ENUM)
        :param asset: required
        :type asset: str
        :param amount: required
        :type amount: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer_status = client.make_universal_transfer(params)

        :returns: API response

        .. code-block:: python

            {
                "tranId":13526853623
            }


        :raises: BinanceRequestException, BinanceAPIException

        r  asset/transferTr   r   rX  r  s     r   make_universal_transferzClient.make_universal_transfer	  s     < ''0@TZ'[[r   c                 ,    | j                  ddd|      S )a  Query User Universal Transfer History

        https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history

        :param type: required
        :type type: str (ENUM)
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param current: optional - Default 1
        :type current: int
        :param size: required - Default 10, Max 100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer_status = client.query_universal_transfer_history(params)

        :returns: API response

        .. code-block:: python

            {
                "total":2,
                "rows":[
                    {
                        "asset":"USDT",
                        "amount":"1",
                        "type":"MAIN_UMFUTURE"
                        "status": "CONFIRMED",
                        "tranId": 11415955596,
                        "timestamp":1544433328000
                    },
                    {
                        "asset":"USDT",
                        "amount":"2",
                        "type":"MAIN_UMFUTURE",
                        "status": "CONFIRMED",
                        "tranId": 11366865406,
                        "timestamp":1544433328000
                    }
                ]
            }


        :raises: BinanceRequestException, BinanceAPIException

        r   rp  Trq  rX  r  s     r    query_universal_transfer_historyz'Client.query_universal_transfer_history
  s!    h ''/?SY'ZZr   c                 ,    | j                  ddd|      S )a  Get trade fee.

        https://binance-docs.github.io/apidocs/spot/en/#trade-fee-sapi-user_data

        :param symbol: optional
        :type symbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "symbol": "ADABNB",
                    "makerCommission": "0.001",
                    "takerCommission": "0.001"
                },
                {
                    "symbol": "BNBBTC",
                    "makerCommission": "0.001",
                    "takerCommission": "0.001"
                }
            ]

        r   asset/tradeFeeTr  rX  r  s     r   get_trade_feezClient.get_trade_feeT
  s    8 ''/?F'SSr   c                 ,    | j                  ddd|      S )aO  Fetch details on assets.

        https://binance-docs.github.io/apidocs/spot/en/#asset-detail-sapi-user_data

        :param asset: optional
        :type asset: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                    "CTR": {
                        "minWithdrawAmount": "70.00000000", //min withdraw amount
                        "depositStatus": false,//deposit status (false if ALL of networks' are false)
                        "withdrawFee": 35, // withdraw fee
                        "withdrawStatus": true, //withdraw status (false if ALL of networks' are false)
                        "depositTip": "Delisted, Deposit Suspended" //reason
                    },
                    "SKY": {
                        "minWithdrawAmount": "0.02000000",
                        "depositStatus": true,
                        "withdrawFee": 0.01,
                        "withdrawStatus": true
                    }
            }

        r   asset/assetDetailTr  rX  r  s     r   get_asset_detailszClient.get_asset_detailsr
  s    > ''/BDv'VVr   c                 L    d|v rd|vr|d   |d<   | j                  ddd|      S )a  Submit a withdraw request.

        https://binance-docs.github.io/apidocs/spot/en/#withdraw-sapi

        Assumptions:

        - You must have Withdraw permissions enabled on your API key
        - You must have withdrawn to the address specified through the website and approved the transaction via email

        :param coin: required
        :type coin: str
        :param withdrawOrderId: optional - client id for withdraw
        :type withdrawOrderId: str
        :param network: optional
        :type network: str
        :param address: optional
        :type address: str
        :type addressTag: optional - Secondary address identifier for coins like XRP,XMR etc.
        :param amount: required
        :type amount: decimal
        :param transactionFeeFlag: required - When making internal transfer, true for returning the fee to the destination account; false for returning the fee back to the departure account. Default false.
        :type transactionFeeFlag: bool
        :param name: optional - Description of the address, default asset value passed will be used
        :type name: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "id":"7213fea8e94b4a5593d507237e5a555b"
            }

        :raises: BinanceRequestException, BinanceAPIException

        coinnamer  capital/withdraw/applyTr  rX  r  s     r   withdrawzClient.withdraw
  s=    P Vf 4#F^F6N''0H$U['\\r   c                 ,    | j                  ddd|      S )ar  Fetch deposit history.

        https://binance-docs.github.io/apidocs/spot/en/#deposit-history-supporting-network-user_data

        :param coin: optional
        :type coin: str
        :type status: optional - 0(0:pending,1:success) optional
        :type status: int
        :param startTime: optional
        :type startTime: long
        :param endTime: optional
        :type endTime: long
        :param offset: optional - default:0
        :type offset: long
        :param limit: optional
        :type limit: long
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "amount":"0.00999800",
                    "coin":"PAXG",
                    "network":"ETH",
                    "status":1,
                    "address":"0x788cabe9236ce061e5a892e1a59395a81fc8d62c",
                    "addressTag":"",
                    "txId":"0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3",
                    "insertTime":1599621997000,
                    "transferType":0,
                    "confirmTimes":"12/12"
                },
                {
                    "amount":"0.50000000",
                    "coin":"IOTA",
                    "network":"IOTA",
                    "status":1,
                    "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
                    "addressTag":"",
                    "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
                    "insertTime":1599620082000,
                    "transferType":0,
                    "confirmTimes":"1/1"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   capital/deposit/hisrecTr  rX  r  s     r   get_deposit_historyzClient.get_deposit_history
  s!    l ''/GTZ'[[r   c                 ,    | j                  ddd|      S )a3  Fetch withdraw history.

        https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data

        :param coin: optional
        :type coin: str
        :type status: 0(0:Email Sent,1:Cancelled 2:Awaiting Approval 3:Rejected 4:Processing 5:Failure 6Completed) optional
        :type status: int
        :param offset: optional - default:0
        :type offset: int
        :param limit: optional
        :type limit: int
        :param startTime: optional - Default: 90 days from current timestamp
        :type startTime: int
        :param endTime: optional - Default: present timestamp
        :type endTime: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
                    "amount": "8.91000000",
                    "applyTime": "2019-10-12 11:12:02",
                    "coin": "USDT",
                    "id": "b6ae22b3aa844210a7041aee7589627c",
                    "withdrawOrderId": "WITHDRAWtest123", // will not be returned if there's no withdrawOrderId for this withdraw.
                    "network": "ETH",
                    "transferType": 0,   // 1 for internal transfer, 0 for external transfer
                    "status": 6,
                    "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
                },
                {
                    "address": "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB",
                    "amount": "0.00150000",
                    "applyTime": "2019-09-24 12:43:45",
                    "coin": "BTC",
                    "id": "156ec387f49b41df8724fa744fa82719",
                    "network": "BTC",
                    "status": 6,
                    "txId": "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   capital/withdraw/historyTr  rX  r  s     r   get_withdraw_historyzClient.get_withdraw_history
  s!    h ''/I4V\']]r   c                 n     | j                   di |}|D ]  }d|v s|d   |k(  s|c S  t        d|      )a  Fetch withdraw history.

        https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data

        :param withdraw_id: required
        :type withdraw_id: str
        :param asset: optional
        :type asset: str
        :type status: 0(0:Email Sent,1:Cancelled 2:Awaiting Approval 3:Rejected 4:Processing 5:Failure 6Completed) optional
        :type status: int
        :param startTime: optional
        :type startTime: long
        :param endTime: optional
        :type endTime: long
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "id":"7213fea8e94b4a5593d507237e5a555b",
                "withdrawOrderId": None,
                "amount": 0.99,
                "transactionFee": 0.01,
                "address": "0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b",
                "asset": "ETH",
                "txId": "0xdf33b22bdb2b28b1f75ccd201a4a4m6e7g83jy5fc5d5a9d1340961598cfcb0a1",
                "applyTime": 1508198532000,
                "status": 4
            }

        :raises: BinanceRequestException, BinanceAPIException

        id"There is no entry with withdraw idr   r  	Exceptionr   withdraw_idr   resultentrys        r   get_withdraw_history_idzClient.get_withdraw_history_id/  sK    J +**4V4Eu}t!;  <fEEr   r|  networkc                 D    ||d<   |r||d<   | j                  ddd|      S )a  Fetch a deposit address for a symbol

        https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data

        :param coin: required
        :type coin: str
        :param network: optional
        :type network: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "address": "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv",
                "coin": "BTC",
                "tag": "",
                "url": "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r|  r  r   capital/deposit/addressTr  rX  r   r|  r  r   s       r   get_deposit_addresszClient.get_deposit_address\  s6    4 v 'F9''/H$U['\\r   c                 J    | j                  ddi | j                        }|d   S )a8  Start a new user data stream and return the listen key
        If a stream already exists it should return the same key.
        If the stream becomes invalid a new key is returned.

        Can be used to keep the user stream alive.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot

        :returns: API response

        .. code-block:: python

            {
                "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
            }

        :raises: BinanceRequestException, BinanceAPIException

        userDataStreamFr  	listenKey)r  r   r   r  s     r   stream_get_listen_keyzClient.stream_get_listen_key}  s,    ( jj)5r4C[C[j\;r   c                 H    d|i}| j                  dd|| j                        S )aQ  PING a user data stream to prevent a time out.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot

        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  Fr  )r  r   r   r  r   s      r   stream_keepalivezClient.stream_keepalive  s0    $ 
 yy)5vtG_G_y``r   c                 H    d|i}| j                  dd|| j                        S )a@  Close out a user data stream.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot

        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  Fr  )r  r   r  s      r   stream_closezClient.stream_close  s0    $ 
 ||,e&$JbJb|ccr   c                 ,    | j                  ddd|      S )a  Query cross-margin account details

        https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-account-details-user_data

        :returns: API response

        .. code-block:: python

            {
                "borrowEnabled": true,
                "marginLevel": "11.64405625",
                "totalAssetOfBtc": "6.82728457",
                "totalLiabilityOfBtc": "0.58633215",
                "totalNetAssetOfBtc": "6.24095242",
                "tradeEnabled": true,
                "transferEnabled": true,
                "userAssets": [
                    {
                        "asset": "BTC",
                        "borrowed": "0.00000000",
                        "free": "0.00499500",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00499500"
                    },
                    {
                        "asset": "BNB",
                        "borrowed": "201.66666672",
                        "free": "2346.50000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "2144.83333328"
                    },
                    {
                        "asset": "ETH",
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000"
                    },
                    {
                        "asset": "USDT",
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/accountTr  rX  r  s     r   get_margin_accountzClient.get_margin_account  s     p ''/?F'SSr   c                 ,    | j                  ddd|      S )a-  Query isolated margin account details

        https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-account-info-user_data

        :param symbols: optional up to 5 margin pairs as a comma separated string
        :type asset: str

        .. code:: python

            account_info = client.get_isolated_margin_account()
            account_info = client.get_isolated_margin_account(symbols="BTCUSDT,ETHUSDT")

        :returns: API response

        .. code-block:: python

            If "symbols" is not sent:

                {
                "assets":[
                    {
                        "baseAsset":
                        {
                        "asset": "BTC",
                        "borrowEnabled": true,
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000",
                        "netAssetOfBtc": "0.00000000",
                        "repayEnabled": true,
                        "totalAsset": "0.00000000"
                        },
                        "quoteAsset":
                        {
                        "asset": "USDT",
                        "borrowEnabled": true,
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000",
                        "netAssetOfBtc": "0.00000000",
                        "repayEnabled": true,
                        "totalAsset": "0.00000000"
                        },
                        "symbol": "BTCUSDT"
                        "isolatedCreated": true,
                        "marginLevel": "0.00000000",
                        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
                        "marginRatio": "0.00000000",
                        "indexPrice": "10000.00000000"
                        "liquidatePrice": "1000.00000000",
                        "liquidateRate": "1.00000000"
                        "tradeEnabled": true
                    }
                    ],
                    "totalAssetOfBtc": "0.00000000",
                    "totalLiabilityOfBtc": "0.00000000",
                    "totalNetAssetOfBtc": "0.00000000"
                }

            If "symbols" is sent:

                {
                "assets":[
                    {
                        "baseAsset":
                        {
                        "asset": "BTC",
                        "borrowEnabled": true,
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000",
                        "netAssetOfBtc": "0.00000000",
                        "repayEnabled": true,
                        "totalAsset": "0.00000000"
                        },
                        "quoteAsset":
                        {
                        "asset": "USDT",
                        "borrowEnabled": true,
                        "borrowed": "0.00000000",
                        "free": "0.00000000",
                        "interest": "0.00000000",
                        "locked": "0.00000000",
                        "netAsset": "0.00000000",
                        "netAssetOfBtc": "0.00000000",
                        "repayEnabled": true,
                        "totalAsset": "0.00000000"
                        },
                        "symbol": "BTCUSDT"
                        "isolatedCreated": true,
                        "marginLevel": "0.00000000",
                        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
                        "marginRatio": "0.00000000",
                        "indexPrice": "10000.00000000"
                        "liquidatePrice": "1000.00000000",
                        "liquidateRate": "1.00000000"
                        "tradeEnabled": true
                    }
                    ]
                }

        r   margin/isolated/accountTr  rX  r  s     r   get_isolated_margin_accountz"Client.get_isolated_margin_account  s!    Z ''/H$U['\\r   c                 ,    | j                  ddd|      S )am  Enable isolated margin account for a specific symbol.

        https://binance-docs.github.io/apidocs/spot/en/#enable-isolated-margin-account-trade

        :param symbol:
        :type asset: str

        :returns: API response

        .. code-block:: python

            {
              "success": true,
              "symbol": "BTCUSDT"
            }


        r  r  Tr  rX  r  s     r   enable_isolated_margin_accountz%Client.enable_isolated_margin_accountk  s     & ''0I4V\']]r   c                 ,    | j                  ddd|      S )a  Disable isolated margin account for a specific symbol. Each trading pair can only
        be deactivated once every 24 hours.

        https://binance-docs.github.io/apidocs/spot/en/#disable-isolated-margin-account-trade

        :param symbol:
        :type asset: str

        :returns: API response

        .. code-block:: python

            {
              "success": true,
              "symbol": "BTCUSDT"
            }


        r  r  Tr  rX  r  s     r   disable_isolated_margin_accountz&Client.disable_isolated_margin_account  s     ( ''2KTX^'__r   c                 *    | j                  dd|      S )a  Query cross-margin asset

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-asset-market_data

        :param asset: name of the asset
        :type asset: str

        .. code-block:: python

            asset_details = client.get_margin_asset(asset='BNB')

        :returns: API response

        .. code-block:: python

            {
                "assetFullName": "Binance Coin",
                "assetName": "BNB",
                "isBorrowable": false,
                "isMortgageable": true,
                "userMinBorrow": "0.00000000",
                "userMinRepay": "0.00000000"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/assetr  rX  r  s     r   get_margin_assetzClient.get_margin_asset  s    8 ''~F'KKr   c                 *    | j                  dd|      S )a  Query cross-margin symbol info

        https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-pair-market_data

        :param symbol: name of the symbol pair
        :type symbol: str

        .. code:: python

            pair_details = client.get_margin_symbol(symbol='BTCUSDT')

        :returns: API response

        .. code-block:: python

            {
                "id":323355778339572400,
                "symbol":"BTCUSDT",
                "base":"BTC",
                "quote":"USDT",
                "isMarginTrade":true,
                "isBuyAllowed":true,
                "isSellAllowed":true
            }


        :raises: BinanceRequestException, BinanceAPIException

        r   margin/pairr  rX  r  s     r   get_margin_symbolzClient.get_margin_symbol  s    < ''}6'JJr   c                 *    | j                  dd|      S )a  Get All Margin Assets (MARKET_DATA)

        https://binance-docs.github.io/apidocs/spot/en/#get-all-margin-assets-market_data

        .. code:: python

            margin_assets = client.get_margin_all_assets()

        :returns: API response

        .. code-block:: python

            [
                {
                    "assetFullName": "USD coin",
                    "assetName": "USDC",
                    "isBorrowable": true,
                    "isMortgageable": true,
                    "userMinBorrow": "0.00000000",
                    "userMinRepay": "0.00000000"
                },
                {
                    "assetFullName": "BNB-coin",
                    "assetName": "BNB",
                    "isBorrowable": true,
                    "isMortgageable": true,
                    "userMinBorrow": "1.00000000",
                    "userMinRepay": "0.00000000"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/allAssetsr  rX  r  s     r   get_margin_all_assetszClient.get_margin_all_assets  s    F ''/A'OOr   c                 *    | j                  dd|      S )a  Get All Cross Margin Pairs (MARKET_DATA)

        https://binance-docs.github.io/apidocs/spot/en/#get-all-cross-margin-pairs-market_data

        .. code:: python

            margin_pairs = client.get_margin_all_pairs()

        :returns: API response

        .. code-block:: python

            [
                {
                    "base": "BNB",
                    "id": 351637150141315861,
                    "isBuyAllowed": true,
                    "isMarginTrade": true,
                    "isSellAllowed": true,
                    "quote": "BTC",
                    "symbol": "BNBBTC"
                },
                {
                    "base": "TRX",
                    "id": 351637923235429141,
                    "isBuyAllowed": true,
                    "isMarginTrade": true,
                    "isSellAllowed": true,
                    "quote": "BTC",
                    "symbol": "TRXBTC"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/allPairsr  rX  r  s     r   get_margin_all_pairszClient.get_margin_all_pairs  s    J ''/@v'NNr   c                 ,    | j                  ddd|      S )ar  Create isolated margin account for symbol

        https://binance-docs.github.io/apidocs/spot/en/#create-isolated-margin-account-margin

        :param base: Base asset of symbol
        :type base: str
        :param quote: Quote asset of symbol
        :type quote: str

        .. code:: python

            pair_details = client.create_isolated_margin_account(base='USDT', quote='BTC')

        :returns: API response

        .. code-block:: python

            {
                "success": true,
                "symbol": "BTCUSDT"
            }


        :raises: BinanceRequestException, BinanceAPIException

        r  margin/isolated/createTrq  rX  r  s     r   create_isolated_margin_accountz%Client.create_isolated_margin_account   s!    6 ''0HQU\b'ccr   c                 ,    | j                  ddd|      S )a  Query isolated margin symbol info

        https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-symbol-user_data

        :param symbol: name of the symbol pair
        :type symbol: str

        .. code:: python

            pair_details = client.get_isolated_margin_symbol(symbol='BTCUSDT')

        :returns: API response

        .. code-block:: python

            {
            "symbol":"BTCUSDT",
            "base":"BTC",
            "quote":"USDT",
            "isMarginTrade":true,
            "isBuyAllowed":true,
            "isSellAllowed":true
            }


        :raises: BinanceRequestException, BinanceAPIException

        r   margin/isolated/pairTrq  rX  r  s     r   get_isolated_margin_symbolz!Client.get_isolated_margin_symbol=  s     : ''/EdY_'``r   c                 ,    | j                  ddd|      S )a  Query isolated margin symbol info for all pairs

        https://binance-docs.github.io/apidocs/spot/en/#get-all-isolated-margin-symbol-user_data

        .. code:: python

            pair_details = client.get_all_isolated_margin_symbols()

        :returns: API response

        .. code-block:: python

            [
                {
                    "base": "BNB",
                    "isBuyAllowed": true,
                    "isMarginTrade": true,
                    "isSellAllowed": true,
                    "quote": "BTC",
                    "symbol": "BNBBTC"
                },
                {
                    "base": "TRX",
                    "isBuyAllowed": true,
                    "isMarginTrade": true,
                    "isSellAllowed": true,
                    "quote": "BTC",
                    "symbol": "TRXBTC"
                }
            ]


        :raises: BinanceRequestException, BinanceAPIException

        r   margin/isolated/allPairsTrq  rX  r  s     r   get_all_isolated_margin_symbolsz&Client.get_all_isolated_margin_symbols\  s"    H ''/IRV]c'ddr   c                 ,    | j                  ddd|      S )a  Toggle BNB Burn On Spot Trade And Margin Interest

        https://binance-docs.github.io/apidocs/spot/en/#toggle-bnb-burn-on-spot-trade-and-margin-interest-user_data

        :param spotBNBBurn: Determines whether to use BNB to pay for trading fees on SPOT
        :type spotBNBBurn: bool
        :param interestBNBBurn: Determines whether to use BNB to pay for margin loan's interest
        :type interestBNBBurn: bool

        .. code:: python

            response = client.toggle_bnb_burn_spot_margin()

        :returns: API response

        .. code-block:: python

            {
               "spotBNBBurn":true,
               "interestBNBBurn": false
            }


        :raises: BinanceRequestException, BinanceAPIException

        r  bnbBurnTrq  rX  r  s     r   toggle_bnb_burn_spot_marginz"Client.toggle_bnb_burn_spot_margin  s    6 ''	$V'TTr   c                 ,    | j                  ddd|      S )a  Get BNB Burn Status

        https://binance-docs.github.io/apidocs/spot/en/#get-bnb-burn-status-user_data

        .. code:: python

            status = client.get_bnb_burn_spot_margin()

        :returns: API response

        .. code-block:: python

            {
               "spotBNBBurn":true,
               "interestBNBBurn": false
            }


        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   get_bnb_burn_spot_marginzClient.get_bnb_burn_spot_margin  s    , ''yF'SSr   c                 *    | j                  dd|      S )aF  Query margin priceIndex

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-priceindex-market_data

        :param symbol: name of the symbol pair
        :type symbol: str

        .. code:: python

            price_index_details = client.get_margin_price_index(symbol='BTCUSDT')

        :returns: API response

        .. code-block:: python

            {
                "calcTime": 1562046418000,
                "price": "0.00333930",
                "symbol": "BNBBTC"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/priceIndexr  rX  r  s     r   get_margin_price_indexzClient.get_margin_price_index  s    2 ''/B'PPr   c                 6    d|d<   | j                  ddd|      S )a  Execute transfer between cross-margin account and spot account.

        https://binance-docs.github.io/apidocs/spot/en/#cross-margin-account-transfer-margin

        :param asset: name of the asset
        :type asset: str
        :param amount: amount to transfer
        :type amount: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer = client.transfer_margin_to_spot(asset='BTC', amount='1.1')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  r  margin/transferTrq  rX  r  s     r   transfer_margin_to_spotzClient.transfer_margin_to_spot  )    6 v''0A$U['\\r   c                 6    d|d<   | j                  ddd|      S )a  Execute transfer between spot account and cross-margin account.

        https://binance-docs.github.io/apidocs/spot/en/#cross-margin-account-transfer-margin

        :param asset: name of the asset
        :type asset: str
        :param amount: amount to transfer
        :type amount: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer = client.transfer_spot_to_margin(asset='BTC', amount='1.1')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  r  r  Trq  rX  r  s     r   transfer_spot_to_marginzClient.transfer_spot_to_margin  r  r   c                 @    d|d<   d|d<   | j                  ddd|      S )	ai  Execute transfer between isolated margin account and spot account.

        https://binance-docs.github.io/apidocs/spot/en/#isolated-margin-account-transfer-margin

        :param asset: name of the asset
        :type asset: str
        :param symbol: pair symbol
        :type symbol: str
        :param amount: amount to transfer
        :type amount: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer = client.transfer_isolated_margin_to_spot(asset='BTC',
                                                                symbol='ETHBTC', amount='1.1')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        ISOLATED_MARGIN	transFromr%   transTor  margin/isolated/transferTrq  rX  r  s     r    transfer_isolated_margin_to_spotz'Client.transfer_isolated_margin_to_spot  s5    < 0{"y''0JSW^d'eer   c                 @    d|d<   d|d<   | j                  ddd|      S )	ai  Execute transfer between spot account and isolated margin account.

        https://binance-docs.github.io/apidocs/spot/en/#isolated-margin-account-transfer-margin

        :param asset: name of the asset
        :type asset: str
        :param symbol: pair symbol
        :type symbol: str
        :param amount: amount to transfer
        :type amount: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer = client.transfer_spot_to_isolated_margin(asset='BTC',
                                                                symbol='ETHBTC', amount='1.1')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        r%   r  r  r  r  r  Trq  rX  r  s     r    transfer_spot_to_isolated_marginz'Client.transfer_spot_to_isolated_margin0  s5    < %{-y''0JSW^d'eer   c                 ,    | j                  ddd|      S )a*  Get transfers to isolated margin account.

        https://binance-docs.github.io/apidocs/spot/en/#get-isolated-margin-transfer-history-user_data

        :param asset: name of the asset
        :type asset: str
        :param symbol: pair required
        :type symbol: str
        :param transFrom: optional SPOT, ISOLATED_MARGIN
        :param transFrom: str SPOT, ISOLATED_MARGIN
        :param transTo: optional
        :param transTo: str
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transfer = client.transfer_spot_to_isolated_margin(symbol='ETHBTC')

        :returns: API response

        .. code-block:: python

            {
              "rows": [
                {
                  "amount": "0.10000000",
                  "asset": "BNB",
                  "status": "CONFIRMED",
                  "timestamp": 1566898617000,
                  "txId": 5240372201,
                  "transFrom": "SPOT",
                  "transTo": "ISOLATED_MARGIN"
                },
                {
                  "amount": "5.00000000",
                  "asset": "USDT",
                  "status": "CONFIRMED",
                  "timestamp": 1566888436123,
                  "txId": 5239810406,
                  "transFrom": "ISOLATED_MARGIN",
                  "transTo": "SPOT"
                }
              ],
              "total": 2
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   #get_isolated_margin_tranfer_historyz*Client.get_isolated_margin_tranfer_historyR  s"    v ''/IRV]c'ddr   c                 ,    | j                  ddd|      S )a=  Apply for a loan in cross-margin or isolated-margin account.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin

        :param asset: name of the asset
        :type asset: str
        :param amount: amount to transfer
        :type amount: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param symbol: Isolated margin symbol (default blank for cross-margin)
        :type symbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transaction = client.margin_create_loan(asset='BTC', amount='1.1')

            transaction = client.margin_create_loan(asset='BTC', amount='1.1',
                                                    isIsolated='TRUE', symbol='ETHBTC')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  margin/loanTrq  rX  r  s     r   create_margin_loanzClient.create_margin_loan  s     D ''dQW'XXr   c                 ,    | j                  ddd|      S )a  Repay loan in cross-margin or isolated-margin account.

        If amount is more than the amount borrowed, the full loan will be repaid.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin

        :param asset: name of the asset
        :type asset: str
        :param amount: amount to transfer
        :type amount: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param symbol: Isolated margin symbol (default blank for cross-margin)
        :type symbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        .. code-block:: python

            transaction = client.margin_repay_loan(asset='BTC', amount='1.1')

            transaction = client.margin_repay_loan(asset='BTC', amount='1.1',
                                                    isIsolated='TRUE', symbol='ETHBTC')

        :returns: API response

        .. code-block:: python

            {
                "tranId": 100000001
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  margin/repayTrq  rX  r  s     r   repay_margin_loanzClient.repay_margin_loan  s     H ''tRX'YYr   c                 ,    | j                  ddd|      S )a  Post a new order for margin account.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-order-trade

        :param symbol: required
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param side: required
        :type side: str
        :param type: required
        :type type: str
        :param quantity: required
        :type quantity: decimal
        :param price: required
        :type price: str
        :param stopPrice: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
        :type stopPrice: str
        :param timeInForce: required if limit order GTC,IOC,FOK
        :type timeInForce: str
        :param newClientOrderId: A unique id for the order. Automatically generated if not sent.
        :type newClientOrderId: str
        :param icebergQty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
        :type icebergQty: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to
            FULL, all other orders default to ACK.
        :type newOrderRespType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        Response ACK:

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "orderId": 28,
                "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
                "transactTime": 1507725176595
            }

        Response RESULT:

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "orderId": 28,
                "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
                "transactTime": 1507725176595,
                "price": "1.00000000",
                "origQty": "10.00000000",
                "executedQty": "10.00000000",
                "cummulativeQuoteQty": "10.00000000",
                "status": "FILLED",
                "timeInForce": "GTC",
                "type": "MARKET",
                "side": "SELL"
            }

        Response FULL:

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "orderId": 28,
                "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
                "transactTime": 1507725176595,
                "price": "1.00000000",
                "origQty": "10.00000000",
                "executedQty": "10.00000000",
                "cummulativeQuoteQty": "10.00000000",
                "status": "FILLED",
                "timeInForce": "GTC",
                "type": "MARKET",
                "side": "SELL",
                "fills": [
                    {
                        "price": "4000.00000000",
                        "qty": "1.00000000",
                        "commission": "4.00000000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3999.00000000",
                        "qty": "5.00000000",
                        "commission": "19.99500000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3998.00000000",
                        "qty": "2.00000000",
                        "commission": "7.99600000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3997.00000000",
                        "qty": "1.00000000",
                        "commission": "3.99700000",
                        "commissionAsset": "USDT"
                    },
                    {
                        "price": "3995.00000000",
                        "qty": "1.00000000",
                        "commission": "3.99500000",
                        "commissionAsset": "USDT"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException,
            BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException,
            BinanceOrderInactiveSymbolException

        r  margin/orderTrq  rX  r  s     r   create_margin_orderzClient.create_margin_order  s     n ''tRX'YYr   c                 ,    | j                  ddd|      S )az  Cancel an active order for margin account.

        Either orderId or origClientOrderId must be sent.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade

        :param symbol: required
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param orderId:
        :type orderId: str
        :param origClientOrderId:
        :type origClientOrderId: str
        :param newClientOrderId: Used to uniquely identify this cancel. Automatically generated by default.
        :type newClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "symbol": "LTCBTC",
                "orderId": 28,
                "origClientOrderId": "myOrder1",
                "clientOrderId": "cancelMyOrder1",
                "transactTime": 1507725176595,
                "price": "1.00000000",
                "origQty": "10.00000000",
                "executedQty": "8.00000000",
                "cummulativeQuoteQty": "8.00000000",
                "status": "CANCELED",
                "timeInForce": "GTC",
                "type": "LIMIT",
                "side": "SELL"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  r  Trq  rX  r  s     r   cancel_margin_orderzClient.cancel_margin_orderR  s     R ''.TZ'[[r   c                 ,    | j                  ddd|      S )u  Adjust cross margin max leverage

        https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-margin-max-leverage-user_data

        :param maxLeverage: required Can only adjust 3 or 5，Example: maxLeverage=3
        :type maxLeverage: int

        :returns: API response

            {
                "success": true
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  margin/max-leverageTrq  rX  r  s     r   set_margin_max_leveragezClient.set_margin_max_leverage}  s     " ''0EdY_'``r   c                 ,    | j                  ddd|      S )a   Query margin transfer history

        https://binance-docs.github.io/apidocs/spot/en/#get-cross-margin-transfer-history-user_data

        :param asset: optional
        :type asset: str
        :param type: optional Transfer Type: ROLL_IN, ROLL_OUT
        :type type: str
        :param archived: optional Default: false. Set to true for archived data from 6 months ago
        :type archived: str
        :param startTime: earliest timestamp to filter transactions
        :type startTime: str
        :param endTime: Used to uniquely identify this cancel. Automatically generated by default.
        :type endTime: str
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "rows": [
                    {
                        "amount": "0.10000000",
                        "asset": "BNB",
                        "status": "CONFIRMED",
                        "timestamp": 1566898617,
                        "txId": 5240372201,
                        "type": "ROLL_IN"
                    },
                    {
                        "amount": "5.00000000",
                        "asset": "USDT",
                        "status": "CONFIRMED",
                        "timestamp": 1566888436,
                        "txId": 5239810406,
                        "type": "ROLL_OUT"
                    },
                    {
                        "amount": "1.00000000",
                        "asset": "EOS",
                        "status": "CONFIRMED",
                        "timestamp": 1566888403,
                        "txId": 5239808703,
                        "type": "ROLL_IN"
                    }
                ],
                "total": 3
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   get_margin_transfer_historyz"Client.get_margin_transfer_history  s!    r ''/@TZ'[[r   c                 ,    | j                  ddd|      S )a  Query loan record

        txId or startTime must be sent. txId takes precedence.

        https://binance-docs.github.io/apidocs/spot/en/#query-loan-record-user_data

        :param asset: required
        :type asset: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param txId: the tranId in of the created loan
        :type txId: str
        :param startTime: earliest timestamp to filter transactions
        :type startTime: str
        :param endTime: Used to uniquely identify this cancel. Automatically generated by default.
        :type endTime: str
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "rows": [
                    {
                        "asset": "BNB",
                        "principal": "0.84624403",
                        "timestamp": 1555056425000,
                        //one of PENDING (pending to execution), CONFIRMED (successfully loaned), FAILED (execution failed, nothing happened to your account);
                        "status": "CONFIRMED"
                    }
                ],
                "total": 1
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   get_margin_loan_detailszClient.get_margin_loan_details  s     T ''}TPV'WWr   c                 ,    | j                  ddd|      S )a  Query repay record

        txId or startTime must be sent. txId takes precedence.

        https://binance-docs.github.io/apidocs/spot/en/#query-repay-record-user_data

        :param asset: required
        :type asset: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param txId: the tranId in of the created loan
        :type txId: str
        :param startTime:
        :type startTime: str
        :param endTime: Used to uniquely identify this cancel. Automatically generated by default.
        :type endTime: str
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "rows": [
                    {
                        //Total amount repaid
                        "amount": "14.00000000",
                        "asset": "BNB",
                        //Interest repaid
                        "interest": "0.01866667",
                        //Principal repaid
                        "principal": "13.98133333",
                        //one of PENDING (pending to execution), CONFIRMED (successfully loaned), FAILED (execution failed, nothing happened to your account);
                        "status": "CONFIRMED",
                        "timestamp": 1563438204000,
                        "txId": 2970933056
                    }
                ],
                "total": 1
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   get_margin_repay_detailszClient.get_margin_repay_details  s     ` ''~dQW'XXr   c                 ,    | j                  ddd|      S )a  Query Cross Margin Fee Data (USER_DATA)

        https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-fee-data-user_data
        :param vipLevel: User's current specific margin data will be returned if vipLevel is omitted
        :type vipLevel: int
        :param coin
        :type coin: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int
        :returns: API response (example):
            [
                {
                    "vipLevel": 0,
                    "coin": "BTC",
                    "transferIn": true,
                    "borrowable": true,
                    "dailyInterest": "0.00026125",
                    "yearlyInterest": "0.0953",
                    "borrowLimit": "180",
                    "marginablePairs": [
                        "BNBBTC",
                        "TRXBTC",
                        "ETHBTC",
                        "BTCUSDT"
                    ]
                }
            ]
        r   margin/crossMarginDataTrq  rX  r  s     r   get_cross_margin_datazClient.get_cross_margin_data)  s!    : ''/GPT[a'bbr   c                 ,    | j                  ddd|      S )ab  Get Interest History (USER_DATA)

        https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data

        :param asset:
        :type asset: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param startTime:
        :type startTime: str
        :param endTime:
        :type endTime: str
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param archived: Default: false. Set to true for archived data from 6 months ago
        :type archived: bool
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "rows":[
                    {
                        "isolatedSymbol": "BNBUSDT", // isolated symbol, will not be returned for crossed margin
                        "asset": "BNB",
                        "interest": "0.02414667",
                        "interestAccuredTime": 1566813600000,
                        "interestRate": "0.01600000",
                        "principal": "36.22000000",
                        "type": "ON_BORROW"
                    }
                ],
                "total": 1
            }


        r   margin/interestHistoryTrq  rX  r  s     r   get_margin_interest_historyz"Client.get_margin_interest_historyH  s"    R ''/GPT[a'bbr   c                 ,    | j                  ddd|      S )a  Get Force Liquidation Record (USER_DATA)

        https://binance-docs.github.io/apidocs/spot/en/#get-force-liquidation-record-user_data

        :param startTime:
        :type startTime: str
        :param endTime:
        :type endTime: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param current: Currently querying page. Start from 1. Default:1
        :type current: str
        :param size: Default:10 Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "rows": [
                    {
                        "avgPrice": "0.00388359",
                        "executedQty": "31.39000000",
                        "orderId": 180015097,
                        "price": "0.00388110",
                        "qty": "31.39000000",
                        "side": "SELL",
                        "symbol": "BNBBTC",
                        "timeInForce": "GTC",
                        "isIsolated": true,
                        "updatedTime": 1558941374745
                    }
                ],
                "total": 1
            }

        r   margin/forceLiquidationRecTrq  rX  r  s     r    get_margin_force_liquidation_recz'Client.get_margin_force_liquidation_recs  s"    N ''/KTX_e'ffr   c                 ,    | j                  ddd|      S )a  Query margin accounts order

        Either orderId or origClientOrderId must be sent.

        For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data

        :param symbol: required
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param orderId:
        :type orderId: str
        :param origClientOrderId:
        :type origClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "clientOrderId": "ZwfQzuDIGpceVhKW5DvCmO",
                "cummulativeQuoteQty": "0.00000000",
                "executedQty": "0.00000000",
                "icebergQty": "0.00000000",
                "isWorking": true,
                "orderId": 213205622,
                "origQty": "0.30000000",
                "price": "0.00493630",
                "side": "SELL",
                "status": "NEW",
                "stopPrice": "0.00000000",
                "symbol": "BNBBTC",
                "time": 1562133008725,
                "timeInForce": "GTC",
                "type": "LIMIT",
                "updateTime": 1562133008725
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Trq  rX  r  s     r   get_margin_orderzClient.get_margin_order  s     X ''~dQW'XXr   c                 ,    | j                  ddd|      S )a  Query margin accounts open orders

        If the symbol is not sent, orders for all symbols will be returned in an array (cross-margin only).

        If querying isolated margin orders, both the isIsolated='TRUE' and symbol=symbol_name must be set.

        When all symbols are returned, the number of requests counted against the rate limiter is equal to the number
        of symbols currently trading on the exchange.

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-order-user_data

        :param symbol: optional
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            [
                {
                    "clientOrderId": "qhcZw71gAkCCTv0t0k8LUK",
                    "cummulativeQuoteQty": "0.00000000",
                    "executedQty": "0.00000000",
                    "icebergQty": "0.00000000",
                    "isWorking": true,
                    "orderId": 211842552,
                    "origQty": "0.30000000",
                    "price": "0.00475010",
                    "side": "SELL",
                    "status": "NEW",
                    "stopPrice": "0.00000000",
                    "symbol": "BNBBTC",
                    "time": 1562040170089,
                    "timeInForce": "GTC",
                    "type": "LIMIT",
                    "updateTime": 1562040170089
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/openOrdersTrq  rX  r  s     r   get_open_margin_orderszClient.get_open_margin_orders  s!    Z ''/B4V\']]r   c                 ,    | j                  ddd|      S )aW  Query all margin accounts orders

        If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.

        For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-order-user_data

        :param symbol: required
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param orderId: optional
        :type orderId: str
        :param startTime: optional
        :type startTime: str
        :param endTime: optional
        :type endTime: str
        :param limit: Default 500; max 1000
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            [
                {
                    "id": 43123876,
                    "price": "0.00395740",
                    "qty": "4.06000000",
                    "quoteQty": "0.01606704",
                    "symbol": "BNBBTC",
                    "time": 1556089977693
                },
                {
                    "id": 43123877,
                    "price": "0.00395740",
                    "qty": "0.77000000",
                    "quoteQty": "0.00304719",
                    "symbol": "BNBBTC",
                    "time": 1556089977693
                },
                {
                    "id": 43253549,
                    "price": "0.00428930",
                    "qty": "23.30000000",
                    "quoteQty": "0.09994069",
                    "symbol": "BNBBTC",
                    "time": 1556163963504
                }
            ]


        :raises: BinanceRequestException, BinanceAPIException

        r   margin/allOrdersTrq  rX  r  s     r   get_all_margin_orderszClient.get_all_margin_orders  s!    r ''/A$U['\\r   c                 ,    | j                  ddd|      S )a6  Query margin accounts trades

        If fromId is set, it will get orders >= that fromId. Otherwise most recent orders are returned.

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data

        :param symbol: required
        :type symbol: str
        :param isIsolated: set to 'TRUE' for isolated margin (default 'FALSE')
        :type isIsolated: str
        :param fromId: optional
        :type fromId: str
        :param startTime: optional
        :type startTime: str
        :param endTime: optional
        :type endTime: str
        :param limit: Default 500; max 1000
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            [
                {
                    "commission": "0.00006000",
                    "commissionAsset": "BTC",
                    "id": 34,
                    "isBestMatch": true,
                    "isBuyer": false,
                    "isMaker": false,
                    "orderId": 39324,
                    "price": "0.02000000",
                    "qty": "3.00000000",
                    "symbol": "BNBBTC",
                    "time": 1561973357171
                }, {
                    "commission": "0.00002950",
                    "commissionAsset": "BTC",
                    "id": 32,
                    "isBestMatch": true,
                    "isBuyer": false,
                    "isMaker": true,
                    "orderId": 39319,
                    "price": "0.00590000",
                    "qty": "5.00000000",
                    "symbol": "BNBBTC",
                    "time": 1561964645345
                }
            ]


        :raises: BinanceRequestException, BinanceAPIException

        r   margin/myTradesTrq  rX  r  s     r   get_margin_tradeszClient.get_margin_trades4  s!    p ''/@TZ'[[r   c                 ,    | j                  ddd|      S )a:  Query max borrow amount for an asset

        https://binance-docs.github.io/apidocs/spot/en/#query-max-borrow-user_data

        :param asset: required
        :type asset: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "amount": "1.69248805"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/maxBorrowableTrq  rX  r  s     r   get_max_margin_loanzClient.get_max_margin_loann  s     * ''/EdY_'``r   c                 ,    | j                  ddd|      S )a@  Query max transfer-out amount

        https://binance-docs.github.io/apidocs/spot/en/#query-max-transfer-out-amount-user_data

        :param asset: required
        :type asset: str
        :param isolatedSymbol: isolated symbol (if querying isolated margin)
        :type isolatedSymbol: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "amount": "3.59498107"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   margin/maxTransferableTrq  rX  r  s     r   get_max_margin_transferzClient.get_max_margin_transfer  s!    * ''/GPT[a'bbr   c                 ,    | j                  ddd|      S )u   Post a new OCO trade for margin account.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-oco-trade


        :param symbol: required
        :type symbol: str
        :param isIsolated: for isolated margin or not, "TRUE", "FALSE"，default "FALSE"
        :type symbol: str
        :param listClientOrderId: A unique id for the list order. Automatically generated if not sent.
        :type listClientOrderId: str
        :param side: required
        :type side: str
        :param quantity: required
        :type quantity: decimal
        :param limitClientOrderId: A unique id for the limit order. Automatically generated if not sent.
        :type limitClientOrderId: str
        :param price: required
        :type price: str
        :param limitIcebergQty: Used to make the LIMIT_MAKER leg an iceberg order.
        :type limitIcebergQty: decimal
        :param stopClientOrderId: A unique Id for the stop loss/stop loss limit leg. Automatically generated if not sent.
        :type stopClientOrderId: str
        :param stopPrice: required
        :type stopPrice: str
        :param stopLimitPrice: If provided, stopLimitTimeInForce is required.
        :type stopLimitPrice: str
        :param stopIcebergQty: Used with STOP_LOSS_LIMIT leg to make an iceberg order.
        :type stopIcebergQty: decimal
        :param stopLimitTimeInForce: Valid values are GTC/FOK/IOC.
        :type stopLimitTimeInForce: str
        :param newOrderRespType: Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
        :type newOrderRespType: str
        :param sideEffectType: NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY; default NO_SIDE_EFFECT.
        :type sideEffectType: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "orderListId": 0,
                "contingencyType": "OCO",
                "listStatusType": "EXEC_STARTED",
                "listOrderStatus": "EXECUTING",
                "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
                "transactionTime": 1563417480525,
                "symbol": "LTCBTC",
                "marginBuyBorrowAmount": "5",       // will not return if no margin trade happens
                "marginBuyBorrowAsset": "BTC",    // will not return if no margin trade happens
                "isIsolated": false,       // if isolated margin
                "orders": [
                    {
                        "symbol": "LTCBTC",
                        "orderId": 2,
                        "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
                    },
                    {
                        "symbol": "LTCBTC",
                        "orderId": 3,
                        "clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
                    }
                ],
                "orderReports": [
                    {
                        "symbol": "LTCBTC",
                        "orderId": 2,
                        "orderListId": 0,
                        "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
                        "transactTime": 1563417480525,
                        "price": "0.000000",
                        "origQty": "0.624363",
                        "executedQty": "0.000000",
                        "cummulativeQuoteQty": "0.000000",
                        "status": "NEW",
                        "timeInForce": "GTC",
                        "type": "STOP_LOSS",
                        "side": "BUY",
                        "stopPrice": "0.960664"
                    },
                    {
                        "symbol": "LTCBTC",
                        "orderId": 3,
                        "orderListId": 0,
                        "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
                        "transactTime": 1563417480525,
                        "price": "0.036435",
                        "origQty": "0.624363",
                        "executedQty": "0.000000",
                        "cummulativeQuoteQty": "0.000000",
                        "status": "NEW",
                        "timeInForce": "GTC",
                        "type": "LIMIT_MAKER",
                        "side": "BUY"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException, BinanceOrderException, BinanceOrderMinAmountException,
            BinanceOrderMinPriceException, BinanceOrderMinTotalException, BinanceOrderUnknownSymbolException,
            BinanceOrderInactiveSymbolException

        r  margin/order/ocoTrq  rX  r  s     r   create_margin_oco_orderzClient.create_margin_oco_order  s!    T ''0B4V\']]r   c                 ,    | j                  ddd|      S )u  Cancel an entire Order List for a margin account.

        https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-oco-trade

        :param symbol: required
        :type symbol: str
        :param isIsolated: for isolated margin or not, "TRUE", "FALSE"，default "FALSE"
        :type symbol: str
        :param orderListId: Either orderListId or listClientOrderId must be provided
        :type orderListId: int
        :param listClientOrderId: Either orderListId or listClientOrderId must be provided
        :type listClientOrderId: str
        :param newClientOrderId: Used to uniquely identify this cancel. Automatically generated by default.
        :type newClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "orderListId": 0,
                "contingencyType": "OCO",
                "listStatusType": "ALL_DONE",
                "listOrderStatus": "ALL_DONE",
                "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
                "transactionTime": 1574040868128,
                "symbol": "LTCBTC",
                "isIsolated": false,       // if isolated margin
                "orders": [
                    {
                        "symbol": "LTCBTC",
                        "orderId": 2,
                        "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
                    },
                    {
                        "symbol": "LTCBTC",
                        "orderId": 3,
                        "clientOrderId": "TXOvglzXuaubXAaENpaRCB"
                    }
                ],
                "orderReports": [
                    {
                        "symbol": "LTCBTC",
                        "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
                        "orderId": 2,
                        "orderListId": 0,
                        "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
                        "price": "1.00000000",
                        "origQty": "10.00000000",
                        "executedQty": "0.00000000",
                        "cummulativeQuoteQty": "0.00000000",
                        "status": "CANCELED",
                        "timeInForce": "GTC",
                        "type": "STOP_LOSS_LIMIT",
                        "side": "SELL",
                        "stopPrice": "1.00000000"
                    },
                    {
                        "symbol": "LTCBTC",
                        "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
                        "orderId": 3,
                        "orderListId": 0,
                        "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
                        "price": "3.00000000",
                        "origQty": "10.00000000",
                        "executedQty": "0.00000000",
                        "cummulativeQuoteQty": "0.00000000",
                        "status": "CANCELED",
                        "timeInForce": "GTC",
                        "type": "LIMIT_MAKER",
                        "side": "SELL"
                    }
                ]
            }

    r  margin/orderListTrq  rX  r  s     r   cancel_margin_oco_orderzClient.cancel_margin_oco_order
  s!    ^ ''2DTX^'__r   c                 ,    | j                  ddd|      S )uZ  Retrieves a specific OCO based on provided optional parameters

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-oco-user_data

        :param isIsolated: for isolated margin or not, "TRUE", "FALSE"，default "FALSE"
        :type symbol: str
        :param symbol: mandatory for isolated margin, not supported for cross margin
        :type symbol: str
        :param orderListId: Either orderListId or listClientOrderId must be provided
        :type orderListId: int
        :param listClientOrderId: Either orderListId or listClientOrderId must be provided
        :type listClientOrderId: str
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            {
                "orderListId": 27,
                "contingencyType": "OCO",
                "listStatusType": "EXEC_STARTED",
                "listOrderStatus": "EXECUTING",
                "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
                "transactionTime": 1565245656253,
                "symbol": "LTCBTC",
                "isIsolated": false,       // if isolated margin
                "orders": [
                    {
                        "symbol": "LTCBTC",
                        "orderId": 4,
                        "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
                    },
                    {
                        "symbol": "LTCBTC",
                        "orderId": 5,
                        "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
                    }
                ]
            }

    r   r  Trq  rX  r  s     r   get_margin_oco_orderzClient.get_margin_oco_order[  s!    T ''/A$U['\\r   c                 ,    | j                  ddd|      S )u`
  Retrieves open OCO trades

        https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-oco-user_data

        :param isIsolated: for isolated margin or not, "TRUE", "FALSE"，default "FALSE"
        :type symbol: str
        :param symbol: mandatory for isolated margin, not supported for cross margin
        :type symbol: str
        :param fromId: If supplied, neither startTime or endTime can be provided
        :type fromId: int
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: optional Default Value: 500; Max Value: 1000
        :type limit: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

            [
                {
                    "orderListId": 29,
                    "contingencyType": "OCO",
                    "listStatusType": "EXEC_STARTED",
                    "listOrderStatus": "EXECUTING",
                    "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
                    "transactionTime": 1565245913483,
                    "symbol": "LTCBTC",
                    "isIsolated": true,       // if isolated margin
                    "orders": [
                        {
                            "symbol": "LTCBTC",
                            "orderId": 4,
                            "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
                        },
                        {
                            "symbol": "LTCBTC",
                            "orderId": 5,
                            "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
                        }
                    ]
                },
                {
                    "orderListId": 28,
                    "contingencyType": "OCO",
                    "listStatusType": "EXEC_STARTED",
                    "listOrderStatus": "EXECUTING",
                    "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
                    "transactionTime": 1565245913407,
                    "symbol": "LTCBTC",
                    "orders": [
                        {
                            "symbol": "LTCBTC",
                            "orderId": 2,
                            "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
                        },
                        {
                            "symbol": "LTCBTC",
                            "orderId": 3,
                            "clientOrderId": "z0KCjOdditiLS5ekAFtK81"
                        }
                    ]
                }
            ]

    r   margin/allOrderListTrq  rX  r  s     r   get_open_margin_oco_ordersz!Client.get_open_margin_oco_orders  s!    J ''/DTX^'__r   c                 6    | j                  dddi       }|d   S )a=  Start a new cross-margin data stream and return the listen key
        If a stream already exists it should return the same key.
        If the stream becomes invalid a new key is returned.

        Can be used to keep the stream alive.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin

        :returns: API response

        .. code-block:: python

            {
                "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  r  Frq  r  rX  r  s     r   margin_stream_get_listen_keyz#Client.margin_stream_get_listen_key  s*    ( &&v/?TV&W;r   c                 4    d|i}| j                  ddd|      S )a[  PING a cross-margin data stream to prevent a time out.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin

        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  Frq  rX  r  s      r   margin_stream_keepalivezClient.margin_stream_keepalive  s.    $ 
 ''/?TZ'[[r   c                 4    d|i}| j                  ddd|      S )aJ  Close out a cross-margin data stream.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin

        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  Frq  rX  r  s      r   margin_stream_closezClient.margin_stream_close  s.    $ 
 ''2B5W]'^^r   c                 >    d|i}| j                  ddd|      }|d   S )a  Start a new isolated margin data stream and return the listen key
        If a stream already exists it should return the same key.
        If the stream becomes invalid a new key is returned.

        Can be used to keep the stream alive.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin

        :param symbol: required - symbol for the isolated margin account
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  r  userDataStream/isolatedFrq  r  rX  r   r  r   r  s       r   %isolated_margin_stream_get_listen_keyz,Client.isolated_margin_stream_get_listen_key  s9    0 f
 &&v/HQV]c&d;r   c                 6    ||d}| j                  ddd|      S )a  PING an isolated margin data stream to prevent a time out.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin

        :param symbol: required - symbol for the isolated margin account
        :type symbol: str
        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  r  Frq  rX  r   r  r  r   s       r    isolated_margin_stream_keepalivez'Client.isolated_margin_stream_keepalive2  s0    ( "
 ''/HQV]c'ddr   c                 6    ||d}| j                  ddd|      S )a  Close out an isolated margin data stream.

        https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin

        :param symbol: required - symbol for the isolated margin account
        :type symbol: str
        :param listenKey: required
        :type listenKey: str

        :returns: API response

        .. code-block:: python

            {}

        :raises: BinanceRequestException, BinanceAPIException

        r  r  r  Frq  rX  r  s       r   isolated_margin_stream_closez#Client.isolated_margin_stream_closeK  s0    ( "
 ''2KTY`f'ggr   c                 ,    | j                  ddd|      S )zGet Lending Product List

        https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-list-user_data

        r   lending/daily/product/listTrq  rX  r  s     r   get_lending_product_listzClient.get_lending_product_listf  s!     ''/KTX_e'ffr   c                 ,    | j                  ddd|      S )zGet Left Daily Purchase Quota of Flexible Product.

        https://binance-docs.github.io/apidocs/spot/en/#get-left-daily-purchase-quota-of-flexible-product-user_data

        r   lending/daily/userLeftQuotaTrq  rX  r  s     r   get_lending_daily_quota_leftz#Client.get_lending_daily_quota_leftn  s!     ''/LUY`f'ggr   c                 ,    | j                  ddd|      S )zPurchase Flexible Product

        https://binance-docs.github.io/apidocs/spot/en/#purchase-flexible-product-user_data

        r  lending/daily/purchaseTrq  rX  r  s     r   purchase_lending_productzClient.purchase_lending_productv  !     ''0HQU\b'ccr   c                 ,    | j                  ddd|      S )zGet Left Daily Redemption Quota of Flexible Product

        https://binance-docs.github.io/apidocs/spot/en/#get-left-daily-redemption-quota-of-flexible-product-user_data

        r   !lending/daily/userRedemptionQuotaTrq  rX  r  s     r   "get_lending_daily_redemption_quotaz)Client.get_lending_daily_redemption_quota~  s!     ''/R[_fl'mmr   c                 ,    | j                  ddd|      S )z|Redeem Flexible Product

        https://binance-docs.github.io/apidocs/spot/en/#redeem-flexible-product-user_data

        r  lending/daily/redeemTrq  rX  r  s     r   redeem_lending_productzClient.redeem_lending_product  s      ''0FtZ`'aar   c                 ,    | j                  ddd|      S )zGet Flexible Product Position

        https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-position-user_data

        r   lending/daily/token/positionTrq  rX  r  s     r   get_lending_positionzClient.get_lending_position  !     ''/MVZag'hhr   c                 ,    | j                  ddd|      S )a  Get Fixed and Activity Project List

        https://binance-docs.github.io/apidocs/spot/en/#get-fixed-and-activity-project-list-user_data

        :param asset: optional
        :type asset: str
        :param type: required - "ACTIVITY", "CUSTOMIZED_FIXED"
        :type type: str
        :param status: optional - "ALL", "SUBSCRIBABLE", "UNSUBSCRIBABLE"; default "ALL"
        :type status: str
        :param sortBy: optional - "START_TIME", "LOT_SIZE", "INTEREST_RATE", "DURATION"; default "START_TIME"
        :type sortBy: str
        :param current: optional - Currently querying page. Start from 1. Default:1
        :type current: int
        :param size: optional - Default:10, Max:100
        :type size: int
        :param recvWindow: the number of milliseconds the request is valid for
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "asset": "USDT",
                    "displayPriority": 1,
                    "duration": 90,
                    "interestPerLot": "1.35810000",
                    "interestRate": "0.05510000",
                    "lotSize": "100.00000000",
                    "lotsLowLimit": 1,
                    "lotsPurchased": 74155,
                    "lotsUpLimit": 80000,
                    "maxLotsPerUser": 2000,
                    "needKyc": False,
                    "projectId": "CUSDT90DAYSS001",
                    "projectName": "USDT",
                    "status": "PURCHASING",
                    "type": "CUSTOMIZED_FIXED",
                    "withAreaLimitation": False
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   lending/project/listTrq  rX  r  s     r   get_fixed_activity_project_listz&Client.get_fixed_activity_project_list  s!    ` ''/EdY_'``r   c                 ,    | j                  ddd|      S )zxGet Lending Account Details

        https://binance-docs.github.io/apidocs/spot/en/#lending-account-user_data

        r   lending/union/accountTrq  rX  r  s     r   get_lending_accountzClient.get_lending_account  s      ''/FtZ`'aar   c                 ,    | j                  ddd|      S )z}Get Lending Purchase History

        https://binance-docs.github.io/apidocs/spot/en/#get-purchase-record-user_data

        r   lending/union/purchaseRecordTrq  rX  r  s     r   get_lending_purchase_historyz#Client.get_lending_purchase_history  r2  r   c                 ,    | j                  ddd|      S )zGet Lending Redemption History

        https://binance-docs.github.io/apidocs/spot/en/#get-redemption-record-user_data

        r   lending/union/redemptionRecordTrq  rX  r  s     r   get_lending_redemption_historyz%Client.get_lending_redemption_history  s!     ''/OX\ci'jjr   c                 ,    | j                  ddd|      S )zGet Lending Interest History

        https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data-2

        r   lending/union/interestHistoryTrq  rX  r  s     r   get_lending_interest_historyz#Client.get_lending_interest_history  s!     ''/NW[bh'iir   c                 ,    | j                  ddd|      S )zChange Fixed/Activity Position to Daily Position

        https://binance-docs.github.io/apidocs/spot/en/#change-fixed-activity-position-to-daily-position-user_data

        r  lending/positionChangedTrq  rX  r  s     r   'change_fixed_activity_to_daily_positionz.Client.change_fixed_activity_to_daily_position  s!     ''0IRV]c'ddr   c                 ,    | j                  ddd|      S )z~Get Staking Product List

        https://binance-docs.github.io/apidocs/spot/en/#get-staking-product-list-user_data

        r   staking/productListTrq  rX  r  s     r   get_staking_product_listzClient.get_staking_product_list  s      ''/DTX^'__r   c                 ,    | j                  ddd|      S )z~Purchase Staking Product

        https://binance-docs.github.io/apidocs/spot/en/#purchase-staking-product-user_data

        r  staking/purchaseTrq  rX  r  s     r   purchase_staking_productzClient.purchase_staking_product  s      ''0B4V\']]r   c                 ,    | j                  ddd|      S )zzRedeem Staking Product

        https://binance-docs.github.io/apidocs/spot/en/#redeem-staking-product-user_data

        r  staking/redeemTrq  rX  r  s     r   redeem_staking_productzClient.redeem_staking_product  s      ''0@TZ'[[r   c                 ,    | j                  ddd|      S )zGet Staking Product Position

        https://binance-docs.github.io/apidocs/spot/en/#get-staking-product-position-user_data

        r   staking/positionTrq  rX  r  s     r   get_staking_positionzClient.get_staking_position
  s      ''/A$U['\\r   c                 ,    | j                  ddd|      S )z}Get Staking Purchase History

        https://binance-docs.github.io/apidocs/spot/en/#get-staking-history-user_data

        r   staking/purchaseRecordTrq  rX  r  s     r   get_staking_purchase_historyz#Client.get_staking_purchase_history  s!     ''/GPT[a'bbr   c                 ,    | j                  ddd|      S )zSet Auto Staking on Locked Staking or Locked DeFi Staking

        https://binance-docs.github.io/apidocs/spot/en/#set-auto-staking-user_data

        r  staking/setAutoStakingTrq  rX  r  s     r   set_auto_stakingzClient.set_auto_staking  r(  r   c                 ,    | j                  ddd|      S )zGet Personal Left Quota of Staking Product

        https://binance-docs.github.io/apidocs/spot/en/#get-personal-left-quota-of-staking-product-user_data

        r   staking/personalLeftQuotaTrq  rX  r  s     r   get_personal_left_quotazClient.get_personal_left_quota"  s!     ''/JSW^d'eer   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zGet staking information for a supported asset (or assets)

        https://docs.binance.us/#get-staking-asset-information

        us%Endpoint only available on binance.usr   staking/assetTr  rk   r  r  s     r   get_staking_asset_uszClient.get_staking_asset_us,  s6     xx4H!HH''6'RRr   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zPStake a supported asset.

        https://docs.binance.us/#stake-asset

        r[  r\  r  staking/stakeTr  r^  r  s     r   stake_asset_uszClient.stake_asset_us5  s6     xx4H!HH''F'SSr   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zPUnstake a staked asset

        https://docs.binance.us/#unstake-asset

        r[  r\  r  staking/unstakeTr  r^  r  s     r   unstake_asset_uszClient.unstake_asset_us>  s7     xx4H!HH''0A4f'UUr   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zSGet staking balance

        https://docs.binance.us/#get-staking-balance

        r[  r\  r   staking/stakingBalanceTr  r^  r  s     r   get_staking_balance_uszClient.get_staking_balance_usG  s8     xx4H!HH''/GTZ'[[r   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zSGet staking history

        https://docs.binance.us/#get-staking-history

        r[  r\  r   staking/historyTr  r^  r  s     r   get_staking_history_uszClient.get_staking_history_usP  s7     xx4H!HH''/@$V'TTr   c                 X    | j                   dk(  sJ d       | j                  ddd|      S )zGet staking rewards history for an asset(or assets) within a given time range.

        https://docs.binance.us/#get-staking-rewards-history

        r[  r\  r   staking/stakingRewardsHistoryTr  r^  r  s     r   get_staking_rewards_history_usz%Client.get_staking_rewards_history_usY  s9     xx4H!HH''/NPT[a'bbr   c                 ,    | j                  ddd|      S )aO  Query Sub-account List.

        https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-list-sapi-for-master-account

        :param email: optional - Sub-account email
        :type email: str
        :param isFreeze: optional
        :type isFreeze: str
        :param page: optional - Default value: 1
        :type page: int
        :param limit: optional - Default value: 1, Max value: 200
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "subAccounts":[
                    {
                        "email":"testsub@gmail.com",
                        "isFreeze":false,
                        "createTime":1544433328000
                    },
                    {
                        "email":"virtual@oxebmvfonoemail.com",
                        "isFreeze":false,
                        "createTime":1544433328000
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/listTr  rX  r  s     r   get_sub_account_listzClient.get_sub_account_listd  s     L ''/A4f'UUr   c                 ,    | j                  ddd|      S )a  Query Sub-account Transfer History.

        https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-asset-transfer-history-sapi-for-master-account

        :param fromEmail: optional
        :type fromEmail: str
        :param toEmail: optional
        :type toEmail: str
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param page: optional - Default value: 1
        :type page: int
        :param limit: optional - Default value: 500
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "from":"aaa@test.com",
                    "to":"bbb@test.com",
                    "asset":"BTC",
                    "qty":"10",
                    "status": "SUCCESS",
                    "tranId": 6489943656,
                    "time":1544433328000
                },
                {
                    "from":"bbb@test.com",
                    "to":"ccc@test.com",
                    "asset":"ETH",
                    "qty":"2",
                    "status": "SUCCESS",
                    "tranId": 6489938713,
                    "time":1544433328000
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r    sub-account/sub/transfer/historyTr  rX  r  s     r    get_sub_account_transfer_historyz'Client.get_sub_account_transfer_history  s"    ` ''/QSW^d'eer   c                 ,    | j                  ddd|      S )ah  Query Sub-account Futures Transfer History.

        https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-futures-asset-transfer-history-for-master-account

        :param email: required
        :type email: str
        :param futuresType: required
        :type futuresType: int
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param page: optional
        :type page: int
        :param limit: optional
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "success":true,
                "futuresType": 2,
                "transfers":[
                    {
                        "from":"aaa@test.com",
                        "to":"bbb@test.com",
                        "asset":"BTC",
                        "qty":"1",
                        "time":1544433328000
                    },
                    {
                        "from":"bbb@test.com",
                        "to":"ccc@test.com",
                        "asset":"ETH",
                        "qty":"2",
                        "time":1544433328000
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   $sub-account/futures/internalTransferTr  rX  r  s     r   (get_sub_account_futures_transfer_historyz/Client.get_sub_account_futures_transfer_history  s"    ` ''/UW[bh'iir   c                 ,    | j                  ddd|      S )aP  Execute sub-account Futures transfer

        https://github.com/binance-exchange/binance-official-api-docs/blob/9dbe0e961b80557bb19708a707c7fad08842b28e/wapi-api.md#sub-account-transferfor-master-account

        :param fromEmail: required - Sender email
        :type fromEmail: str
        :param toEmail: required - Recipient email
        :type toEmail: str
        :param futuresType: required
        :type futuresType: int
        :param asset: required
        :type asset: str
        :param amount: required
        :type amount: decimal
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           {
                "success":true,
                "txnId":"2934662589"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  rv  Tr  rX  r  s     r   #create_sub_account_futures_transferz*Client.create_sub_account_futures_transfer  s!    < ''0VX\ci'jjr   c                 .    | j                  ddd|d      S )a  Fetch sub-account assets

        https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-assets-sapi-for-master-account

        :param email: required
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "balances":[
                    {
                        "asset":"ADA",
                        "free":10000,
                        "locked":0
                    },
                    {
                        "asset":"BNB",
                        "free":10003,
                        "locked":0
                    },
                    {
                        "asset":"BTC",
                        "free":11467.6399,
                        "locked":0
                    },
                    {
                        "asset":"ETH",
                        "free":10004.995,
                        "locked":0
                    },
                    {
                        "asset":"USDT",
                        "free":11652.14213,
                        "locked":0
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/assetsTr   r  rX  r  s     r   get_sub_account_assetszClient.get_sub_account_assets  s$    ^ ''/CTPV`a'bbr   c                 ,    | j                  ddd|      S )a-  Query Sub-account Spot Assets Summary (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-assets-summary-for-master-account

        :param email: optional - Sub account email
        :type email: str
        :param page: optional - default 1
        :type page: int
        :param size: optional - default 10, max 20
        :type size: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           {
                "totalCount":2,
                "masterAccountTotalAsset": "0.23231201",
                "spotSubUserAssetBtcVoList":[
                    {
                        "email":"sub123@test.com",
                        "totalAsset":"9999.00000000"
                    },
                    {
                        "email":"test456@test.com",
                        "totalAsset":"0.00000000"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/spotSummaryTr  rX  r  s     r   query_subaccount_spot_summaryz$Client.query_subaccount_spot_summaryA  s!    H ''/H$U['\\r   c                 ,    | j                  ddd|      S )a  Get Sub-account Deposit Address (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-address-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param coin: required
        :type coin: str
        :param network: optional
        :type network: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           {
                "address":"TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV",
                "coin":"USDT",
                "tag":"",
                "url":"https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   capital/deposit/subAddressTr  rX  r  s     r   get_subaccount_deposit_addressz%Client.get_subaccount_deposit_addressg  s     8 ''/KTX^'__r   c                 ,    | j                  ddd|      S )a  Get Sub-account Deposit History (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-address-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param coin: optional
        :type coin: str
        :param status: optional - (0:pending,6: credited but cannot withdraw, 1:success)
        :type status: int
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: optional
        :type limit: int
        :param offset: optional - default:0
        :type offset: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           [
                {
                    "amount":"0.00999800",
                    "coin":"PAXG",
                    "network":"ETH",
                    "status":1,
                    "address":"0x788cabe9236ce061e5a892e1a59395a81fc8d62c",
                    "addressTag":"",
                    "txId":"0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3",
                    "insertTime":1599621997000,
                    "transferType":0,
                    "confirmTimes":"12/12"
                },
                {
                    "amount":"0.50000000",
                    "coin":"IOTA",
                    "network":"IOTA",
                    "status":1,
                    "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
                    "addressTag":"",
                    "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
                    "insertTime":1599620082000,
                    "transferType":0,
                    "confirmTimes":"1/1"
                }
           ]

        :raises: BinanceRequestException, BinanceAPIException

        r   capital/deposit/subHisrecTr  rX  r  s     r   get_subaccount_deposit_historyz%Client.get_subaccount_deposit_history  s!    p ''/JDW]'^^r   c                 ,    | j                  ddd|      S )a  Get Sub-account's Status on Margin/Futures (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-39-s-status-on-margin-futures-for-master-account

        :param email: optional - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           [
                {
                    "email":"123@test.com",      // user email
                    "isSubUserEnabled": true,    // true or false
                    "isUserActive": true,        // true or false
                    "insertTime": 1570791523523  // sub account create time
                    "isMarginEnabled": true,     // true or false for margin
                    "isFutureEnabled": true      // true or false for futures.
                    "mobile": 1570791523523      // user mobile number
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/statusTr  rX  r  s     r   $get_subaccount_futures_margin_statusz+Client.get_subaccount_futures_margin_status  s     : ''/CTPV'WWr   c                 ,    | j                  ddd|      S )a#  Enable Margin for Sub-account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#enable-margin-for-sub-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

           {

                "email":"123@test.com",

                "isMarginEnabled": true

            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/margin/enableTr  rX  r  s     r   enable_subaccount_marginzClient.enable_subaccount_margin  s     2 ''0KTX^'__r   c                 ,    | j                  ddd|      S )a
  Get Detail on Sub-account's Margin Account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-margin-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                  "email":"123@test.com",
                  "marginLevel": "11.64405625",
                  "totalAssetOfBtc": "6.82728457",
                  "totalLiabilityOfBtc": "0.58633215",
                  "totalNetAssetOfBtc": "6.24095242",
                  "marginTradeCoeffVo":
                        {
                            "forceLiquidationBar": "1.10000000",  // Liquidation margin ratio
                            "marginCallBar": "1.50000000",        // Margin call margin ratio
                            "normalBar": "2.00000000"             // Initial margin ratio
                        },
                  "marginUserAssetVoList": [
                      {
                          "asset": "BTC",
                          "borrowed": "0.00000000",
                          "free": "0.00499500",
                          "interest": "0.00000000",
                          "locked": "0.00000000",
                          "netAsset": "0.00499500"
                      },
                      {
                          "asset": "BNB",
                          "borrowed": "201.66666672",
                          "free": "2346.50000000",
                          "interest": "0.00000000",
                          "locked": "0.00000000",
                          "netAsset": "2144.83333328"
                      },
                      {
                          "asset": "ETH",
                          "borrowed": "0.00000000",
                          "free": "0.00000000",
                          "interest": "0.00000000",
                          "locked": "0.00000000",
                          "netAsset": "0.00000000"
                      },
                      {
                          "asset": "USDT",
                          "borrowed": "0.00000000",
                          "free": "0.00000000",
                          "interest": "0.00000000",
                          "locked": "0.00000000",
                          "netAsset": "0.00000000"
                      }
                  ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/margin/accountTr  rX  r  s     r   get_subaccount_margin_detailsz$Client.get_subaccount_margin_details  s!    B ''/KTX^'__r   c                 ,    | j                  ddd|      S )a  Get Summary of Sub-account's Margin Account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-margin-account-for-master-account

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "totalAssetOfBtc": "4.33333333",
                "totalLiabilityOfBtc": "2.11111112",
                "totalNetAssetOfBtc": "2.22222221",
                "subAccountList":[
                    {
                        "email":"123@test.com",
                        "totalAssetOfBtc": "2.11111111",
                        "totalLiabilityOfBtc": "1.11111111",
                        "totalNetAssetOfBtc": "1.00000000"
                    },
                    {
                        "email":"345@test.com",
                        "totalAssetOfBtc": "2.22222222",
                        "totalLiabilityOfBtc": "1.00000001",
                        "totalNetAssetOfBtc": "1.22222221"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   !sub-account/margin/accountSummaryTr  rX  r  s     r   get_subaccount_margin_summaryz$Client.get_subaccount_margin_summary<  s"    F ''/RTX_e'ffr   c                 ,    | j                  ddd|      S )a9  Enable Futures for Sub-account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#enable-futures-for-sub-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {

                "email":"123@test.com",

                "isFuturesEnabled": true  // true or false

            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/futures/enableTr  rX  r  s     r   enable_subaccount_futuresz Client.enable_subaccount_futuresa  s     2 ''0LdY_'``r   c                 .    | j                  ddd|d      S )a  Get Detail on Sub-account's Futures Account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "email": "abc@test.com",
                "asset": "USDT",
                "assets":[
                    {
                        "asset": "USDT",
                        "initialMargin": "0.00000000",
                        "maintenanceMargin": "0.00000000",
                        "marginBalance": "0.88308000",
                        "maxWithdrawAmount": "0.88308000",
                        "openOrderInitialMargin": "0.00000000",
                        "positionInitialMargin": "0.00000000",
                        "unrealizedProfit": "0.00000000",
                        "walletBalance": "0.88308000"
                     }
                ],
                "canDeposit": true,
                "canTrade": true,
                "canWithdraw": true,
                "feeTier": 2,
                "maxWithdrawAmount": "0.88308000",
                "totalInitialMargin": "0.00000000",
                "totalMaintenanceMargin": "0.00000000",
                "totalMarginBalance": "0.88308000",
                "totalOpenOrderInitialMargin": "0.00000000",
                "totalPositionInitialMargin": "0.00000000",
                "totalUnrealizedProfit": "0.00000000",
                "totalWalletBalance": "0.88308000",
                "updateTime": 1576756674610
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/futures/accountTr   r  rX  r  s     r   get_subaccount_futures_detailsz%Client.get_subaccount_futures_details|  s$    ` ''/LdY_ij'kkr   c                 .    | j                  ddd|d      S )a  Get Summary of Sub-account's Futures Account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-for-master-account

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "totalInitialMargin": "9.83137400",
                "totalMaintenanceMargin": "0.41568700",
                "totalMarginBalance": "23.03235621",
                "totalOpenOrderInitialMargin": "9.00000000",
                "totalPositionInitialMargin": "0.83137400",
                "totalUnrealizedProfit": "0.03219710",
                "totalWalletBalance": "22.15879444",
                "asset": "USDT",
                "subAccountList":[
                    {
                        "email": "123@test.com",
                        "totalInitialMargin": "9.00000000",
                        "totalMaintenanceMargin": "0.00000000",
                        "totalMarginBalance": "22.12659734",
                        "totalOpenOrderInitialMargin": "9.00000000",
                        "totalPositionInitialMargin": "0.00000000",
                        "totalUnrealizedProfit": "0.00000000",
                        "totalWalletBalance": "22.12659734",
                        "asset": "USDT"
                    },
                    {
                        "email": "345@test.com",
                        "totalInitialMargin": "0.83137400",
                        "totalMaintenanceMargin": "0.41568700",
                        "totalMarginBalance": "0.90575887",
                        "totalOpenOrderInitialMargin": "0.00000000",
                        "totalPositionInitialMargin": "0.83137400",
                        "totalUnrealizedProfit": "0.03219710",
                        "totalWalletBalance": "0.87356177",
                        "asset": "USDT"
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   "sub-account/futures/accountSummaryTr   r  rX  r  s     r   get_subaccount_futures_summaryz%Client.get_subaccount_futures_summary  s%    d ''/SUY`fpq'rrr   c                 .    | j                  ddd|d      S )a  Get Futures Position-Risk of Sub-account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#get-futures-position-risk-of-sub-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
                {
                    "entryPrice": "9975.12000",
                    "leverage": "50",              // current initial leverage
                    "maxNotional": "1000000",      // notional value limit of current initial leverage
                    "liquidationPrice": "7963.54",
                    "markPrice": "9973.50770517",
                    "positionAmount": "0.010",
                    "symbol": "BTCUSDT",
                    "unrealizedProfit": "-0.01612295"
                }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r    sub-account/futures/positionRiskTr   r  rX  r  s     r   #get_subaccount_futures_positionriskz*Client.get_subaccount_futures_positionrisk  s$    < ''/QSW^dno'ppr   c                 ,    | j                  ddd|      S )aO  Futures Transfer for Sub-account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#futures-transfer-for-sub-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param amount: required - The amount to be transferred
        :type amount: float
        :param type: required - 1: transfer from subaccount's spot account to its USDT-margined futures account
                                2: transfer from subaccount's USDT-margined futures account to its spot account
                                3: transfer from subaccount's spot account to its COIN-margined futures account
                                4: transfer from subaccount's COIN-margined futures account to its spot account
        :type type: int

        :returns: API response

        .. code-block:: python

            {
                "txnId":"2966662589"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/futures/transferTr  rX  r  s     r    make_subaccount_futures_transferz'Client.make_subaccount_futures_transfer  s!    8 ''0NPT[a'bbr   c                 ,    | j                  ddd|      S )aK  Margin Transfer for Sub-account (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#margin-transfer-for-sub-account-for-master-account

        :param email: required - Sub account email
        :type email: str
        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param amount: required - The amount to be transferred
        :type amount: float
        :param type: required - 1: transfer from subaccount's spot account to margin account
                                2: transfer from subaccount's margin account to its spot account
        :type type: int

        :returns: API response

        .. code-block:: python

            {
                "txnId":"2966662589"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/margin/transferTr  rX  r  s     r   make_subaccount_margin_transferz&Client.make_subaccount_margin_transfer   s     4 ''0MtZ`'aar   c                 ,    | j                  ddd|      S )a  Transfer to Sub-account of Same Master (For Sub-account)

        https://binance-docs.github.io/apidocs/spot/en/#transfer-to-sub-account-of-same-master-for-sub-account

        :param toEmail: required - Sub account email
        :type toEmail: str
        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param amount: required - The amount to be transferred
        :type amount: float
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "txnId":"2966662589"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/transfer/subToSubTr  rX  r  s     r   &make_subaccount_to_subaccount_transferz-Client.make_subaccount_to_subaccount_transfer<  s!    2 ''0OQU\b'ccr   c                 ,    | j                  ddd|      S )aK  Transfer to Master (For Sub-account)

        https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account

        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param amount: required - The amount to be transferred
        :type amount: float
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "txnId":"2966662589"
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   sub-account/transfer/subToMasterTr  rX  r  s     r   "make_subaccount_to_master_transferz)Client.make_subaccount_to_master_transferW  s!    . ''0RTX_e'ffr   c                 ,    | j                  ddd|      S )a  Sub-account Transfer History (For Sub-account)

        https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account

        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param type: optional - 1: transfer in, 2: transfer out
        :type type: int
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: optional - Default 500
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
              {
                "counterParty":"master",
                "email":"master@test.com",
                "type":1,  // 1 for transfer in, 2 for transfer out
                "asset":"BTC",
                "qty":"1",
                "status":"SUCCESS",
                "tranId":11798835829,
                "time":1544433325000
              },
              {
                "counterParty":"subAccount",
                "email":"sub2@test.com",
                "type":2,
                "asset":"ETH",
                "qty":"2",
                "status":"SUCCESS",
                "tranId":11798829519,
                "time":1544433326000
              }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   #sub-account/transfer/subUserHistoryTr  rX  r  s     r   get_subaccount_transfer_historyz&Client.get_subaccount_transfer_historyp  s"    ` ''/TVZag'hhr   c                 ,    | j                  ddd|      S )a  Universal Transfer (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#universal-transfer-for-master-account

        :param fromEmail: optional
        :type fromEmail: str
        :param toEmail: optional
        :type toEmail: str
        :param fromAccountType: required - "SPOT","USDT_FUTURE","COIN_FUTURE"
        :type fromAccountType: str
        :param toAccountType: required - "SPOT","USDT_FUTURE","COIN_FUTURE"
        :type toAccountType: str
        :param asset: required - The asset being transferred, e.g., USDT
        :type asset: str
        :param amount: required
        :type amount: float
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "tranId":11945860693
            }

        :raises: BinanceRequestException, BinanceAPIException

        r  sub-account/universalTransferTr  rX  r  s     r   "make_subaccount_universal_transferz)Client.make_subaccount_universal_transfer  s!    > ''0OQU\b'ccr   c                 ,    | j                  ddd|      S )a  Universal Transfer (For Master Account)

        https://binance-docs.github.io/apidocs/spot/en/#query-universal-transfer-history

        :param fromEmail: optional
        :type fromEmail: str
        :param toEmail: optional
        :type toEmail: str
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param page: optional
        :type page: int
        :param limit: optional
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            [
              {
                "tranId":11945860693,
                "fromEmail":"master@test.com",
                "toEmail":"subaccount1@test.com",
                "asset":"BTC",
                "amount":"0.1",
                "fromAccountType":"SPOT",
                "toAccountType":"COIN_FUTURE",
                "status":"SUCCESS",
                "createTimeStamp":1544433325000
              },
              {
                "tranId":11945857955,
                "fromEmail":"master@test.com",
                "toEmail":"subaccount2@test.com",
                "asset":"ETH",
                "amount":"0.2",
                "fromAccountType":"SPOT",
                "toAccountType":"USDT_FUTURE",
                "status":"SUCCESS",
                "createTimeStamp":1544433326000
              }
            ]

        :raises: BinanceRequestException, BinanceAPIException

        r   r  Tr  rX  r  s     r   get_universal_transfer_historyz%Client.get_universal_transfer_history  s"    h ''/NPT[a'bbr   c                 &    | j                  dd      S )zyTest connectivity to the Rest API

        https://binance-docs.github.io/apidocs/futures/en/#test-connectivity

        r   rV  rn  r   s    r   futures_pingzClient.futures_ping       ((77r   c                 &    | j                  dd      S )zTest connectivity to the Rest API and get the current server time.

        https://binance-docs.github.io/apidocs/futures/en/#check-server-time

        r   r   r  r   s    r   futures_timezClient.futures_time  r  r   c                 &    | j                  dd      S )zCurrent exchange trading rules and symbol information

        https://binance-docs.github.io/apidocs/futures/en/#exchange-information-market_data

        r   r  r  r   s    r   futures_exchange_infozClient.futures_exchange_info       ((??r   c                 *    | j                  dd|      S )z~Get the Order Book for the market

        https://binance-docs.github.io/apidocs/futures/en/#order-book-market_data

        r   r  r  r  r  s     r   futures_order_bookzClient.futures_order_book  s     ((f(EEr   c                 *    | j                  dd|      S )zGet recent trades (up to last 500).

        https://binance-docs.github.io/apidocs/futures/en/#recent-trades-list-market_data

        r   r  r  r  r  s     r   futures_recent_tradeszClient.futures_recent_trades       ((v(FFr   c                 *    | j                  dd|      S )zGet older market historical trades.

        https://binance-docs.github.io/apidocs/futures/en/#old-trades-lookup-market_data

        r   r  r  r  r  s     r   futures_historical_tradesz Client.futures_historical_trades#       ((0B(PPr   c                 *    | j                  dd|      S )a  Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same
        price will have the quantity aggregated.

        https://binance-docs.github.io/apidocs/futures/en/#compressed-aggregate-trades-list-market_data

        r   r  r  r  r  s     r   futures_aggregate_tradeszClient.futures_aggregate_trades+  s     ((&(IIr   c                 *    | j                  dd|      S )zKline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

        https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data-market_data

        r   r  r  r  r  s     r   r  zClient.futures_klines4  r  r   c                 *    | j                  dd|      S )zKline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.

        https://binance-docs.github.io/apidocs/futures/en/#continuous-contract-kline-candlestick-data

        r   continuousKlinesr  r  r  s     r   futures_continous_klineszClient.futures_continous_klines<  r  r   c                 L    | j                  |||||t        j                        S )a  Get historical futures klines from Binance

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: Start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: str|int
        :param limit: Default 500; max 1000.
        :type limit: int

        :return: list of OHLCV values (Open time, Open, High, Low, Close, Volume, Close time, Quote asset volume, Number of trades, Taker buy base asset volume, Taker buy quote asset volume, Ignore)

        r  r  r  r  r   r  r   r  r  r  r  r  s         r   futures_historical_klinesz Client.futures_historical_klinesD  s<    " &&vxG[`  oC  oK  oK&  L  	Lr   c                 J    | j                  ||||t        j                        S )a'  Get historical futures klines generator from Binance

        :param symbol: Name of symbol pair e.g. BNBBTC
        :type symbol: str
        :param interval: Binance Kline interval
        :type interval: str
        :param start_str: Start date string in UTC format or timestamp in milliseconds
        :type start_str: str|int
        :param end_str: optional - end date string in UTC format or timestamp in milliseconds (default will fetch everything up to now)
        :type end_str: str|int

        :return: generator of OHLCV values

        r  r  r  r   r  r   r  r  r  r  s        r   #futures_historical_klines_generatorz*Client.futures_historical_klines_generatorW  s6      009V]k  lH  lH0  I  	Ir   c                 *    | j                  dd|      S )z|Get Mark Price and Funding Rate

        https://binance-docs.github.io/apidocs/futures/en/#mark-price-market_data

        r   premiumIndexr  r  r  s     r   futures_mark_pricezClient.futures_mark_pricei       ((V(LLr   c                 *    | j                  dd|      S )zGet funding rate history

        https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history-market_data

        r   fundingRater  r  r  s     r   futures_funding_ratezClient.futures_funding_rateq       ((F(KKr   c                 *    | j                  dd|      S )zGet present long to short ratio for top accounts of a specific symbol.

        https://binance-docs.github.io/apidocs/futures/en/#top-trader-long-short-ratio-accounts-market_data
        r   topLongShortAccountRatior  rr  r  s     r   #futures_top_longshort_account_ratioz*Client.futures_top_longshort_account_ratioy  s    
 --e5OV\-]]r   c                 *    | j                  dd|      S )zGet present long to short ratio for top positions of a specific symbol.

        https://binance-docs.github.io/apidocs/futures/en/#top-trader-long-short-ratio-positions
        r   topLongShortPositionRatior  r  r  s     r   $futures_top_longshort_position_ratioz+Client.futures_top_longshort_position_ratio  s    
 --e5PW]-^^r   c                 *    | j                  dd|      S )zGet present global long to short ratio of a specific symbol.

        https://binance-docs.github.io/apidocs/futures/en/#long-short-ratio
        r   globalLongShortAccountRatior  r  r  s     r   futures_global_longshort_ratioz%Client.futures_global_longshort_ratio  s    
 --e5RY_-``r   c                 *    | j                  dd|      S )z24 hour rolling window price change statistics.

        https://binance-docs.github.io/apidocs/futures/en/#24hr-ticker-price-change-statistics-market_data

        r   r  r  r  r  s     r   futures_tickerzClient.futures_ticker  r  r   c                 *    | j                  dd|      S )zLatest price for a symbol or symbols.

        https://binance-docs.github.io/apidocs/futures/en/#symbol-price-ticker-market_data

        r   r  r  r  r  s     r   futures_symbol_tickerzClient.futures_symbol_ticker  r  r   c                 *    | j                  dd|      S )zBest price/qty on the order book for a symbol or symbols.

        https://binance-docs.github.io/apidocs/futures/en/#symbol-order-book-ticker-market_data

        r   r  r  r  r  s     r   futures_orderbook_tickerzClient.futures_orderbook_ticker  s     ((0C&(QQr   c                 ,    | j                  ddd|      S )zGet all liquidation orders

        https://binance-docs.github.io/apidocs/futures/en/#get-all-liquidation-orders-market_data

        r   forceOrdersTrq  r  r  s     r   futures_liquidation_ordersz!Client.futures_liquidation_orders       ((dQW(XXr   c                 ,    | j                  ddd|      S )aZ  Get Position ADL Quantile Estimate

        https://binance-docs.github.io/apidocs/futures/en/#futures-trading-quantitative-rules-indicators-user_data

        :param symbol: optional
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "indicators": { // indicator: quantitative rules indicators, value: user's indicators value, triggerValue: trigger indicator value threshold of quantitative rules.
                    "BTCUSDT": [
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "UFR",  // Unfilled Ratio (UFR)
                            "value": 0.05,  // Current value
                            "triggerValue": 0.995  // Trigger value
                        },
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "IFER",  // IOC/FOK Expiration Ratio (IFER)
                            "value": 0.99,  // Current value
                            "triggerValue": 0.99  // Trigger value
                        },
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "GCR",  // GTC Cancellation Ratio (GCR)
                            "value": 0.99,  // Current value
                            "triggerValue": 0.99  // Trigger value
                        },
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "DR",  // Dust Ratio (DR)
                            "value": 0.99,  // Current value
                            "triggerValue": 0.99  // Trigger value
                        }
                    ],
                    "ETHUSDT": [
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "UFR",
                            "value": 0.05,
                            "triggerValue": 0.995
                        },
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "IFER",
                            "value": 0.99,
                            "triggerValue": 0.99
                        },
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "GCR",
                            "value": 0.99,
                            "triggerValue": 0.99
                        }
                        {
                            "isLocked": true,
                            "plannedRecoverTime": 1545741270000,
                            "indicator": "DR",
                            "value": 0.99,
                            "triggerValue": 0.99
                        }
                    ]
                },
                "updateTime": 1545741270000
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   apiTradingStatusTrq  r  r  s     r   futures_api_trading_statusz!Client.futures_api_trading_status  s!    b ((0B4V\(]]r   c                 ,    | j                  ddd|      S )a  Get Futures commission rate

        https://binance-docs.github.io/apidocs/futures/en/#user-commission-rate-user_data

        :param symbol: required
        :type symbol: str

        :returns: API response

        .. code-block:: python

            {
                "symbol": "BTCUSDT",
                "makerCommissionRate": "0.0002",  // 0.02%
                "takerCommissionRate": "0.0004"   // 0.04%
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   commissionRateTrq  r  r  s     r   futures_comission_ratezClient.futures_comission_rate  s     * ((0@TZ([[r   c                 ,    | j                  ddd|      S )zGet Position ADL Quantile Estimate

        https://binance-docs.github.io/apidocs/futures/en/#position-adl-quantile-estimation-user_data

        r   adlQuantileTrq  r  r  s     r   futures_adl_quantile_estimatez$Client.futures_adl_quantile_estimate  r  r   c                 *    | j                  dd|      S )zGet present open interest of a specific symbol.

        https://binance-docs.github.io/apidocs/futures/en/#open-interest

        r   openInterestr  r  r  s     r   futures_open_interestzClient.futures_open_interest   r  r   c                 *    | j                  dd|      S )z^Get index_info

        https://binance-docs.github.io/apidocs/futures/en/#indexInfo

        r   	indexInfor  r  r  s     r   futures_index_infozClient.futures_index_info(  s     ((&(IIr   c                 *    | j                  dd|      S )zGet open interest statistics of a specific symbol.

        https://binance-docs.github.io/apidocs/futures/en/#open-interest-statistics

        r   openInterestHistr  r  r  s     r   futures_open_interest_histz!Client.futures_open_interest_hist0       --e5Gf-UUr   c                 ,    | j                  ddd|      S )zNotional and Leverage Brackets

        https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-market_data

        r   leverageBracketTr  r  r  s     r   futures_leverage_bracketzClient.futures_leverage_bracket8  s     ((0A4f(UUr   c                 ,    | j                  ddd|      S )zExecute transfer between spot account and futures account.

        https://binance-docs.github.io/apidocs/futures/en/#new-future-account-transfer

        r  futures/transferTr  rX  r  s     r   futures_account_transferzClient.futures_account_transfer@  s     ''0BDv'VVr   c                 ,    | j                  ddd|      S )zGet future account transaction history list

        https://binance-docs.github.io/apidocs/futures/en/#get-future-account-transaction-history-list-user_data

        r   r  Tr  rX  r  s     r   transfer_historyzClient.transfer_historyH  s     ''/A4f'UUr   c                 ,    | j                  ddd|      S Nr   zfutures/loan/borrow/historyTr  rX  r  s     r   futures_loan_borrow_historyz"Client.futures_loan_borrow_historyP  s    ''/LdY_'``r   c                 ,    | j                  ddd|      S Nr   zfutures/loan/repay/historyTr  rX  r  s     r   futures_loan_repay_historyz!Client.futures_loan_repay_historyS  s    ''/KTX^'__r   c                 .    | j                  ddd|d      S Nr   zfutures/loan/walletTr   r  rX  r  s     r   futures_loan_walletzClient.futures_loan_walletV  s!    ''/DdQWab'ccr   c                 ,    | j                  ddd|      S Nr   z%futures/loan/adjustCollateral/historyTr  rX  r  s     r   'futures_cross_collateral_adjust_historyz.Client.futures_cross_collateral_adjust_historyY  s    ''/VX\ci'jjr   c                 ,    | j                  ddd|      S Nr   zfutures/loan/liquidationHistoryTr  rX  r  s     r   ,futures_cross_collateral_liquidation_historyz3Client.futures_cross_collateral_liquidation_history\  s    ''/PRV]c'ddr   c                 ,    | j                  ddd|      S Nr   zfutures/loan/interestHistoryTr  rX  r  s     r   futures_loan_interest_historyz$Client.futures_loan_interest_history_  s    ''/MtZ`'aar   c                 ,    | j                  ddd|      S )zjSend in a new order.

        https://binance-docs.github.io/apidocs/futures/en/#new-order-trade

        r  r  Tr  r  r  s     r   futures_create_orderzClient.futures_create_orderb  s     (($V(LLr   c                 v    t        |      }|j                  dd      }|dd |d<   | j                  ddd|      S )	a,  Send in new orders.

        https://binance-docs.github.io/apidocs/futures/en/#place-multiple-orders-trade

        To avoid modifying the existing signature generation and parameter order logic,
        the url encoding is done on the special query param, batchOrders, in the early stage.

        %27%22   NbatchOrdersr  Tr  r   replacern  r   r   r   s      r   futures_place_batch_orderz Client.futures_place_batch_orderj  sK     !(#++E59 ,RS 1}((6(RRr   c                 ,    | j                  ddd|      S )ztCheck an order's status.

        https://binance-docs.github.io/apidocs/futures/en/#query-order-user_data

        r   r  Tr  r  r  s     r   futures_get_orderzClient.futures_get_orderx  s     ((F(KKr   c                 ,    | j                  ddd|      S )zGet all open orders on a symbol.

        https://binance-docs.github.io/apidocs/futures/en/#current-open-orders-user_data

        r   r:  Tr  r  r  s     r   futures_get_open_orderszClient.futures_get_open_orders       ((d(PPr   c                 ,    | j                  ddd|      S )zGet all futures account orders; active, canceled, or filled.

        https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data

        r   r4  Tr  r  r  s     r   futures_get_all_orderszClient.futures_get_all_orders  s     ((T(OOr   c                 ,    | j                  ddd|      S )zxCancel an active futures order.

        https://binance-docs.github.io/apidocs/futures/en/#cancel-order-trade

        r  r  Tr  r  r  s     r   futures_cancel_orderzClient.futures_cancel_order  s     ((7Dv(NNr   c                 ,    | j                  ddd|      S )zCancel all open futures orders

        https://binance-docs.github.io/apidocs/futures/en/#cancel-all-open-orders-trade

        r  allOpenOrdersTr  r  r  s     r   futures_cancel_all_open_ordersz%Client.futures_cancel_all_open_orders  s     ((?Dv(VVr   c                 ,    | j                  ddd|      S )zCancel multiple futures orders

        https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade

        r  r"  Tr  r  r  s     r   futures_cancel_orderszClient.futures_cancel_orders  s     ((=$V(TTr   c                 .    | j                  dddd|      S )zGet futures account balance

        https://binance-docs.github.io/apidocs/futures/en/#future-account-balance-user_data

        r   balanceTr   r  r  r  s     r   futures_account_balancezClient.futures_account_balance        ((	4(PPr   c                 .    | j                  dddd|      S )zGet current account information.

        https://binance-docs.github.io/apidocs/futures/en/#account-information-user_data

        r   r@  Tr   r  r  r  s     r   futures_accountzClient.futures_account  r8  r   c                 ,    | j                  ddd|      S )zChange user's initial leverage of specific symbol market

        https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade

        r  leverageTr  r  r  s     r   futures_change_leveragezClient.futures_change_leverage  s     ((T(OOr   c                 ,    | j                  ddd|      S )zChange the margin type for a symbol

        https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade

        r  
marginTypeTr  r  r  s     r   futures_change_margin_typez!Client.futures_change_margin_type  s     ((t&(QQr   c                 ,    | j                  ddd|      S )zChange the position margin for a symbol

        https://binance-docs.github.io/apidocs/futures/en/#modify-isolated-position-margin-trade

        r  positionMarginTr  r  r  s     r   futures_change_position_marginz%Client.futures_change_position_margin  s     ((1A4f(UUr   c                 ,    | j                  ddd|      S )zGet position margin change history

        https://binance-docs.github.io/apidocs/futures/en/#get-postion-margin-change-history-trade

        r   positionMargin/historyTr  r  r  s     r   futures_position_margin_historyz&Client.futures_position_margin_history  s      ((0H$U[(\\r   c                 .    | j                  dddd|      S )z}Get position information

        https://binance-docs.github.io/apidocs/futures/en/#position-information-user_data

        r   positionRiskTr   r  r  r  s     r   futures_position_informationz#Client.futures_position_information  s      ((af(UUr   c                 ,    | j                  ddd|      S )zGet trades for the authenticated account and symbol.

        https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data

        r   
userTradesTr  r  r  s     r   futures_account_tradeszClient.futures_account_trades  r+  r   c                 ,    | j                  ddd|      S )zGet income history for authenticated account

        https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data

        r   incomeTr  r  r  s     r   futures_income_historyzClient.futures_income_history  s     (($V(LLr   c                 ,    | j                  ddd|      S )zChange position mode for authenticated account

        https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade

        r  positionSide/dualTr  r  r  s     r   futures_change_position_modez#Client.futures_change_position_mode  s      ((1DdQW(XXr   c                 ,    | j                  ddd|      S )zGet position mode for authenticated account

        https://binance-docs.github.io/apidocs/futures/en/#get-current-position-mode-user_data

        r   rQ  Tr  r  r  s     r   futures_get_position_modez Client.futures_get_position_mode  s      ((0CTPV(WWr   multiAssetsMarginc                 <    d|rdndi}| j                  ddd|      S )zChange user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol

        https://binance-docs.github.io/apidocs/futures/en/#change-multi-assets-mode-trade

        rU  truefalser  Tr  r  r   rU  r   s      r    futures_change_multi_assets_modez'Client.futures_change_multi_assets_mode   s3      +<'
 ((1DdQW(XXr   c                 ,    | j                  dddi       S )zGet user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol

        https://binance-docs.github.io/apidocs/futures/en/#get-current-multi-assets-mode-user_data

        r   rU  Tr  r  r   s    r   futures_get_multi_assets_modez$Client.futures_get_multi_assets_mode  s      ((0CTPR(SSr   c                 6    | j                  dddi       }|d   S Nr  r  Frq  r  r  s     r   futures_stream_get_listen_keyz$Client.futures_stream_get_listen_key  s'    ''EPR'S;r   c                 4    d|i}| j                  ddd|      S Nr  r  Frq  r  r  s      r   futures_stream_keepalivezClient.futures_stream_keepalive  s+    
 ((EPV(WWr   c                 4    d|i}| j                  ddd|      S Nr  r  Frq  r  r  s      r   futures_stream_closezClient.futures_stream_close  s+    
 ((;uSY(ZZr   c                 &    | j                  dd      S )zzTest connectivity to the Rest API

        https://binance-docs.github.io/apidocs/delivery/en/#test-connectivity

        r   rV  rw  r   s    r   futures_coin_pingzClient.futures_coin_ping$       --eV<<r   c                 &    | j                  dd      S )zTest connectivity to the Rest API and get the current server time.

        https://binance-docs.github.io/apidocs/delivery/en/#check-server-time

        r   r   rg  r   s    r   futures_coin_timezClient.futures_coin_time,  ri  r   c                 &    | j                  dd      S )zCurrent exchange trading rules and symbol information

        https://binance-docs.github.io/apidocs/delivery/en/#exchange-information

        r   r  rg  r   s    r   futures_coin_exchange_infoz!Client.futures_coin_exchange_info4  s     --e^DDr   c                 *    | j                  dd|      S )zsGet the Order Book for the market

        https://binance-docs.github.io/apidocs/delivery/en/#order-book

        r   r  r  rg  r  s     r   futures_coin_order_bookzClient.futures_coin_order_book<  s     --eW6-JJr   c                 *    | j                  dd|      S )z}Get recent trades (up to last 500).

        https://binance-docs.github.io/apidocs/delivery/en/#recent-trades-list

        r   r  r  rg  r  s     r   futures_coin_recent_tradesz!Client.futures_coin_recent_tradesD       --eXF-KKr   c                 *    | j                  dd|      S )zGet older market historical trades.

        https://binance-docs.github.io/apidocs/delivery/en/#old-trades-lookup-market_data

        r   r  r  rg  r  s     r   futures_coin_historical_tradesz%Client.futures_coin_historical_tradesL  r  r   c                 *    | j                  dd|      S )zGet compressed, aggregate trades. Trades that fill at the time, from the same order, with the same
        price will have the quantity aggregated.

        https://binance-docs.github.io/apidocs/delivery/en/#compressed-aggregate-trades-list

        r   r  r  rg  r  s     r   futures_coin_aggregate_tradesz$Client.futures_coin_aggregate_tradesT  s     --e[v-NNr   c                 *    | j                  dd|      S )zKline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

        https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data

        r   r  r  rg  r  s     r   r  zClient.futures_coin_klines]  rr  r   c                 *    | j                  dd|      S )zKline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.

        https://binance-docs.github.io/apidocs/delivery/en/#continuous-contract-kline-candlestick-data

        r   r  r  rg  r  s     r   futures_coin_continous_klinesz$Client.futures_coin_continous_klinese  r  r   c                 *    | j                  dd|      S )zKline/candlestick bars for the index price of a pair..

        https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data

        r   indexPriceKlinesr  rg  r  s     r   futures_coin_index_price_klinesz&Client.futures_coin_index_price_klinesm  r  r   c                 *    | j                  dd|      S )zKline/candlestick bars for the index price of a pair..

        https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data

        r   markPriceKlinesr  rg  r  s     r   futures_coin_mark_price_klinesz%Client.futures_coin_mark_price_klinesu  s     --e5FV-TTr   c                 *    | j                  dd|      S )zGet Mark Price and Funding Rate

        https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price

        r   r  r  rg  r  s     r   futures_coin_mark_pricezClient.futures_coin_mark_price}       --e^&-QQr   c                 *    | j                  dd|      S )zGet funding rate history

        https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures

        r   r  r  rg  r  s     r   futures_coin_funding_ratez Client.futures_coin_funding_rate       --e]-PPr   c                 *    | j                  dd|      S )z24 hour rolling window price change statistics.

        https://binance-docs.github.io/apidocs/delivery/en/#24hr-ticker-price-change-statistics

        r   r  r  rg  r  s     r   futures_coin_tickerzClient.futures_coin_ticker  r  r   c                 *    | j                  dd|      S )zLatest price for a symbol or symbols.

        https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-ticker

        r   r  r  rg  r  s     r   futures_coin_symbol_tickerz!Client.futures_coin_symbol_ticker  r  r   c                 *    | j                  dd|      S )zBest price/qty on the order book for a symbol or symbols.

        https://binance-docs.github.io/apidocs/delivery/en/#symbol-order-book-ticker

        r   r  r  rg  r  s     r   futures_coin_orderbook_tickerz$Client.futures_coin_orderbook_ticker  s     --e5Hv-VVr   c                 ,    | j                  ddd|      S )zGet all liquidation orders

        https://binance-docs.github.io/apidocs/delivery/en/#user-39-s-force-orders-user_data

        r   r  Trq  rg  r  s     r   futures_coin_liquidation_ordersz&Client.futures_coin_liquidation_orders  s     --e]4V\-]]r   c                 *    | j                  dd|      S )zGet present open interest of a specific symbol.

        https://binance-docs.github.io/apidocs/delivery/en/#open-interest

        r   r  r  rg  r  s     r   futures_coin_open_interestz!Client.futures_coin_open_interest  r  r   c                 *    | j                  dd|      S )zGet open interest statistics of a specific symbol.

        https://binance-docs.github.io/apidocs/delivery/en/#open-interest-statistics-market-data

        r   r  r  rz  r  s     r   futures_coin_open_interest_histz&Client.futures_coin_open_interest_hist  s     225:LSY2ZZr   c                 .    | j                  dddd|      S )zNotional and Leverage Brackets

        https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-pair-user_data

        r   r  r   Tr   r   r   rg  r  s     r   futures_coin_leverage_bracketz$Client.futures_coin_leverage_bracket  s(     --$a6 . 
 	
r   c                 ,    | j                  ddd|      S )zGet future account transaction history list

        https://binance-docs.github.io/apidocs/delivery/en/#new-future-account-transfer

        r   rp  Tr  rX  r  s     r   new_transfer_historyzClient.new_transfer_history  s     ''/?F'SSr   c                 ,    | j                  ddd|      S Nr  zasset/get-funding-assetTr  rX  r  s     r   funding_walletzClient.funding_wallet  s    ''0I4V\']]r   c                 .    | j                  ddd|d      S Nr  zasset/getUserAssetTr   r  rX  r  s     r   get_user_assetzClient.get_user_asset  s!    ''0DdQWab'ccr   c                 ,    | j                  ddd|      S )zUnviversal transfer api accross different binance account types

        https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer
        r  rp  Trq  rX  r  s     r   universal_transferzClient.universal_transfer  s&    
 ''$T ( 
 	
r   c                 ,    | j                  ddd|      S )zkSend in a new order.

        https://binance-docs.github.io/apidocs/delivery/en/#new-order-trade

        r  r  Tr  rg  r  s     r   futures_coin_create_orderz Client.futures_coin_create_order  s     --fgt&-QQr   c                 v    t        |      }|j                  dd      }|dd |d<   | j                  ddd|      S )	a-  Send in new orders.

        https://binance-docs.github.io/apidocs/delivery/en/#place-multiple-orders-trade

        To avoid modifying the existing signature generation and parameter order logic,
        the url encoding is done on the special query param, batchOrders, in the early stage.

        r  r   r!  Nr"  r  Tr  r   r$  rw  r%  s      r   futures_coin_place_batch_orderz%Client.futures_coin_place_batch_order  sL     !(#++E59 ,RS 1}--fmTPV-WWr   c                 ,    | j                  ddd|      S )zuCheck an order's status.

        https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data

        r   r  Tr  rg  r  s     r   futures_coin_get_orderzClient.futures_coin_get_order  s     --eWd-PPr   c                 ,    | j                  ddd|      S )zGet all open orders on a symbol.

        https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data

        r   r:  Tr  rg  r  s     r   futures_coin_get_open_ordersz#Client.futures_coin_get_open_orders       --e\4f-UUr   c                 ,    | j                  ddd|      S )zGet all futures account orders; active, canceled, or filled.

        https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data

        r   r4  Trq  rg  r  s     r   futures_coin_get_all_ordersz"Client.futures_coin_get_all_orders  s%     --;t& . 
 	
r   c                 ,    | j                  ddd|      S )zyCancel an active futures order.

        https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade

        r  r  Trq  rg  r  s     r   futures_coin_cancel_orderz Client.futures_coin_cancel_order  s%     --gd . 
 	
r   c                 ,    | j                  ddd|      S )zCancel all open futures orders

        https://binance-docs.github.io/apidocs/delivery/en/#cancel-all-open-orders-trade

        r  r1  Trq  rg  r  s     r   #futures_coin_cancel_all_open_ordersz*Client.futures_coin_cancel_all_open_orders  s%     --od . 
 	
r   c                 ,    | j                  ddd|      S )zCancel multiple futures orders

        https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade

        r  r"  Tr  rg  r  s     r   futures_coin_cancel_ordersz!Client.futures_coin_cancel_orders#  s%     --mT . 
 	
r   c                 ,    | j                  ddd|      S )zGet futures account balance

        https://binance-docs.github.io/apidocs/delivery/en/#futures-account-balance-user_data

        r   r6  Trq  rg  r  s     r   futures_coin_account_balancez#Client.futures_coin_account_balance-  %     --9T . 
 	
r   c                 ,    | j                  ddd|      S )zGet current account information.

        https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data

        r   r@  Trq  rg  r  s     r   futures_coin_accountzClient.futures_coin_account7  r  r   c                 ,    | j                  ddd|      S )zChange user's initial leverage of specific symbol market

        https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade

        r  r<  Trq  rg  r  s     r   futures_coin_change_leveragez#Client.futures_coin_change_leverageA  s%     --Jt& . 
 	
r   c                 ,    | j                  ddd|      S )zChange the margin type for a symbol

        https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade

        r  r?  Trq  rg  r  s     r   futures_coin_change_margin_typez&Client.futures_coin_change_margin_typeK  s%     --LF . 
 	
r   c                 ,    | j                  ddd|      S )zChange the position margin for a symbol

        https://binance-docs.github.io/apidocs/delivery/en/#modify-isolated-position-margin-trade

        r  rB  Tr  rg  r  s     r   #futures_coin_change_position_marginz*Client.futures_coin_change_position_marginU  s&     --$d . 
 	
r   c                 ,    | j                  ddd|      S )zGet position margin change history

        https://binance-docs.github.io/apidocs/delivery/en/#get-position-margin-change-history-trade

        r   rE  Tr  rg  r  s     r   $futures_coin_position_margin_historyz+Client.futures_coin_position_margin_history_  s&     --+T . 
 	
r   c                 ,    | j                  ddd|      S )z~Get position information

        https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data

        r   rH  Tr  rg  r  s     r   !futures_coin_position_informationz(Client.futures_coin_position_informationi  s     --e^TPV-WWr   c                 ,    | j                  ddd|      S )zGet trades for the authenticated account and symbol.

        https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data

        r   rK  Tr  rg  r  s     r   futures_coin_account_tradesz"Client.futures_coin_account_tradesq  r  r   c                 ,    | j                  ddd|      S )zGet income history for authenticated account

        https://binance-docs.github.io/apidocs/delivery/en/#get-income-history-user_data

        r   rN  Tr  rg  r  s     r   futures_coin_income_historyz"Client.futures_coin_income_historyy  s     --eXt&-QQr   c                 ,    | j                  ddd|      S )zChange user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol

        https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
        r  rQ  Tr  rg  r  s     r   !futures_coin_change_position_modez(Client.futures_coin_change_position_mode  s     
 --f6I4V\-]]r   c                 ,    | j                  ddd|      S )zGet user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol

        https://binance-docs.github.io/apidocs/delivery/en/#get-current-position-mode-user_data

        r   rQ  Tr  rg  r  s     r   futures_coin_get_position_modez%Client.futures_coin_get_position_mode  s      --e5H$U[-\\r   c                 6    | j                  dddi       }|d   S r^  rg  r  s     r   "futures_coin_stream_get_listen_keyz)Client.futures_coin_stream_get_listen_key  s'    ,,V[UW,X;r   c                 4    d|i}| j                  ddd|      S ra  rg  r  s      r   futures_coin_stream_keepalivez$Client.futures_coin_stream_keepalive  s+    
 --e[U[-\\r   c                 4    d|i}| j                  ddd|      S rd  rg  r  s      r   futures_coin_stream_closez Client.futures_coin_stream_close  s+    
 --hEX^-__r   c                 ,    | j                  ddd|      S )a  Get information of coins (available for deposit and withdraw) for user.

        https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
                "coin": "BTC",
                "depositAllEnable": true,
                "withdrawAllEnable": true,
                "name": "Bitcoin",
                "free": "0",
                "locked": "0",
                "freeze": "0",
                "withdrawing": "0",
                "ipoing": "0",
                "ipoable": "0",
                "storage": "0",
                "isLegalMoney": false,
                "trading": true,
                "networkList": [
                    {
                        "network": "BNB",
                        "coin": "BTC",
                        "withdrawIntegerMultiple": "0.00000001",
                        "isDefault": false,
                        "depositEnable": true,
                        "withdrawEnable": true,
                        "depositDesc": "",
                        "withdrawDesc": "",
                        "specialTips": "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance.",
                        "name": "BEP2",
                        "resetAddressStatus": false,
                        "addressRegex": "^(bnb1)[0-9a-z]{38}$",
                        "memoRegex": "^[0-9A-Za-z-_]{1,120}$",
                        "withdrawFee": "0.0000026",
                        "withdrawMin": "0.0000052",
                        "withdrawMax": "0",
                        "minConfirm": 1,
                        "unLockConfirm": 0
                    },
                    {
                        "network": "BTC",
                        "coin": "BTC",
                        "withdrawIntegerMultiple": "0.00000001",
                        "isDefault": true,
                        "depositEnable": true,
                        "withdrawEnable": true,
                        "depositDesc": "",
                        "withdrawDesc": "",
                        "specialTips": "",
                        "name": "BTC",
                        "resetAddressStatus": false,
                        "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
                        "memoRegex": "",
                        "withdrawFee": "0.0005",
                        "withdrawMin": "0.001",
                        "withdrawMax": "0",
                        "minConfirm": 1,
                        "unLockConfirm": 2
                    }
                ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   capital/config/getallTr  rX  r  s     r   get_all_coins_infozClient.get_all_coins_info  s!    R ''/FSY'ZZr   c                 ,    | j                  ddd|      S )az  Get daily account snapshot of specific type.

        https://binance-docs.github.io/apidocs/spot/en/#daily-account-snapshot-user_data

        :param type: required. Valid values are SPOT/MARGIN/FUTURES.
        :type type: string
        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: optional
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        .. code-block:: python

            {
               "code":200, // 200 for success; others are error codes
               "msg":"", // error message
               "snapshotVos":[
                  {
                     "data":{
                        "balances":[
                           {
                              "asset":"BTC",
                              "free":"0.09905021",
                              "locked":"0.00000000"
                           },
                           {
                              "asset":"USDT",
                              "free":"1.89109409",
                              "locked":"0.00000000"
                           }
                        ],
                        "totalAssetOfBtc":"0.09942700"
                     },
                     "type":"spot",
                     "updateTime":1576281599000
                  }
               ]
            }

        OR

        .. code-block:: python

            {
               "code":200, // 200 for success; others are error codes
               "msg":"", // error message
               "snapshotVos":[
                  {
                     "data":{
                        "marginLevel":"2748.02909813",
                        "totalAssetOfBtc":"0.00274803",
                        "totalLiabilityOfBtc":"0.00000100",
                        "totalNetAssetOfBtc":"0.00274750",
                        "userAssets":[
                           {
                              "asset":"XRP",
                              "borrowed":"0.00000000",
                              "free":"1.00000000",
                              "interest":"0.00000000",
                              "locked":"0.00000000",
                              "netAsset":"1.00000000"
                           }
                        ]
                     },
                     "type":"margin",
                     "updateTime":1576281599000
                  }
               ]
            }

        OR

        .. code-block:: python

            {
               "code":200, // 200 for success; others are error codes
               "msg":"", // error message
               "snapshotVos":[
                  {
                     "data":{
                        "assets":[
                           {
                              "asset":"USDT",
                              "marginBalance":"118.99782335",
                              "walletBalance":"120.23811389"
                           }
                        ],
                        "position":[
                           {
                              "entryPrice":"7130.41000000",
                              "markPrice":"7257.66239673",
                              "positionAmt":"0.01000000",
                              "symbol":"BTCUSDT",
                              "unRealizedProfit":"1.24029054"
                           }
                        ]
                     },
                     "type":"futures",
                     "updateTime":1576281599000
                  }
               ]
            }

        :raises: BinanceRequestException, BinanceAPIException

        r   accountSnapshotTr  rX  r  s     r   get_account_snapshotzClient.get_account_snapshot  s     b ''/@$V'TTr   c                 ,    | j                  ddd|      S )a(  Disable Fast Withdraw Switch

        https://binance-docs.github.io/apidocs/spot/en/#disable-fast-withdraw-switch-user_data

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        :raises: BinanceRequestException, BinanceAPIException

        r  disableFastWithdrawSwitchTr  rX  r  s     r   disable_fast_withdraw_switchz#Client.disable_fast_withdraw_switch^  s      ''0KTX^'__r   c                 ,    | j                  ddd|      S )a&  Enable Fast Withdraw Switch

        https://binance-docs.github.io/apidocs/spot/en/#enable-fast-withdraw-switch-user_data

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        :raises: BinanceRequestException, BinanceAPIException

        r  enableFastWithdrawSwitchTr  rX  r  s     r   enable_fast_withdraw_switchz"Client.enable_fast_withdraw_switchm  s      ''0JDW]'^^r   c                 &    | j                  dd      S )zjTest connectivity

        https://binance-docs.github.io/apidocs/voptions/en/#test-connectivity

        r   rV  r}  r   s    r   options_pingzClient.options_ping  r  r   c                 &    | j                  dd      S )zfGet server time

        https://binance-docs.github.io/apidocs/voptions/en/#get-server-time

        r   r   r  r   s    r   options_timezClient.options_time  r  r   c                 &    | j                  dd      S )zGet current trading pair info

        https://binance-docs.github.io/apidocs/voptions/en/#get-current-trading-pair-info

        r   
optionInfor  r   s    r   options_infozClient.options_info  s     ((==r   c                 &    | j                  dd      S )zGet current limit info and trading pair info

        https://binance-docs.github.io/apidocs/voptions/en/#get-current-limit-info-and-trading-pair-info

        r   r  r  r   s    r   options_exchange_infozClient.options_exchange_info  r  r   c                 *    | j                  dd|      S )u   Get the spot index price

        https://binance-docs.github.io/apidocs/voptions/en/#get-the-spot-index-price

        :param underlying: required - Spot pair（Option contract underlying asset）- BTCUSDT
        :type underlying: str

        r   indexr  r  r  s     r   options_index_pricezClient.options_index_price  s     ((f(EEr   c                 *    | j                  dd|      S )zGet the latest price

        https://binance-docs.github.io/apidocs/voptions/en/#get-the-latest-price

        :param symbol: optional - Option trading pair - BTC-200730-9000-C
        :type symbol: str

        r   tickerr  r  r  s     r   options_pricezClient.options_price  s     ((v(FFr   c                 *    | j                  dd|      S )zGet the latest mark price

        https://binance-docs.github.io/apidocs/voptions/en/#get-the-latest-mark-price

        :param symbol: optional - Option trading pair - BTC-200730-9000-C
        :type symbol: str

        r   markr  r  r  s     r   options_mark_pricezClient.options_mark_price  s     ((V(DDr   c                 *    | j                  dd|      S )aP  Depth information

        https://binance-docs.github.io/apidocs/voptions/en/#depth-information

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param limit: optional - Default:100 Max:1000.Optional value:[10, 20, 50, 100, 500, 1000] - 100
        :type limit: int

        r   r  r  r  r  s     r   options_order_bookzClient.options_order_book  s     ((f(EEr   c                 *    | j                  dd|      S )a1  Candle data

        https://binance-docs.github.io/apidocs/voptions/en/#candle-data

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param interval: required - Time interval - 5m
        :type interval: str
        :param startTime: optional - Start Time - 1592317127349
        :type startTime: int
        :param endTime: optional - End Time - 1592317127349
        :type endTime: int
        :param limit: optional - Number of records Default:500 Max:1500 - 500
        :type limit: int

        r   r  r  r  r  s     r   options_klineszClient.options_klines  s    " ((v(FFr   c                 *    | j                  dd|      S )aS  Recently completed Option trades

        https://binance-docs.github.io/apidocs/voptions/en/#recently-completed-option-trades

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param limit: optional - Number of records Default:100 Max:500 - 100
        :type limit: int

        r   r  r  r  r  s     r   options_recent_tradeszClient.options_recent_trades  s     ((v(FFr   c                 *    | j                  dd|      S )a  Query trade history

        https://binance-docs.github.io/apidocs/voptions/en/#query-trade-history

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param fromId: optional - The deal ID from which to return. The latest deal record is returned by default - 1592317127349
        :type fromId: int
        :param limit: optional - Number of records Default:100 Max:500 - 100
        :type limit: int

        r   r  r  r  r  s     r   options_historical_tradesz Client.options_historical_trades  s     ((0B(PPr   c                 ,    | j                  ddd|      S )zAccount asset info (USER_DATA)

        https://binance-docs.github.io/apidocs/voptions/en/#account-asset-info-user_data

        :param recvWindow: optional
        :type recvWindow: int

        r   r@  Trq  r  r  s     r   options_account_infozClient.options_account_info  s     ((	$V(TTr   c                 ,    | j                  ddd|      S )a  Funds transfer (USER_DATA)

        https://binance-docs.github.io/apidocs/voptions/en/#funds-transfer-user_data

        :param currency: required - Asset type - USDT
        :type currency: str
        :param type: required - IN: Transfer from spot account to option account OUT: Transfer from option account to spot account - IN
        :type type: str (ENUM)
        :param amount: required - Amount - 10000
        :type amount: float
        :param recvWindow: optional
        :type recvWindow: int

        r  transferTrq  r  r  s     r   options_funds_transferzClient.options_funds_transfer  s     ((Dv(VVr   c                 ,    | j                  ddd|      S )a-  Option holdings info (USER_DATA)

        https://binance-docs.github.io/apidocs/voptions/en/#option-holdings-info-user_data

        :param symbol: optional - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param recvWindow: optional
        :type recvWindow: int

        r   positionTrq  r  r  s     r   options_positionszClient.options_positions  s     ((
4f(UUr   c                 ,    | j                  ddd|      S )a  Account funding flow (USER_DATA)

        https://binance-docs.github.io/apidocs/voptions/en/#account-funding-flow-user_data

        :param currency: required - Asset type - USDT
        :type currency: str
        :param recordId: optional - Return the recordId and subsequent data, the latest data is returned by default - 100000
        :type recordId: int
        :param startTime: optional - Start Time - 1593511200000
        :type startTime: int
        :param endTime: optional - End Time - 1593511200000
        :type endTime: int
        :param limit: optional - Number of result sets returned Default:100 Max:1000 - 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        r  billTrq  r  r  s     r   options_billzClient.options_bill+  s    & ((6(RRr   c                 ,    | j                  ddd|      S )u  Option order (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#option-order-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param side: required - Buy/sell direction: SELL, BUY - BUY
        :type side: str (ENUM)
        :param type: required - Order Type: LIMIT, MARKET - LIMIT
        :type type: str (ENUM)
        :param quantity: required - Order Quantity - 3
        :type quantity: float
        :param price: optional - Order Price - 1000
        :type price: float
        :param timeInForce: optional - Time in force method（Default GTC) - GTC
        :type timeInForce: str (ENUM)
        :param reduceOnly: optional - Reduce Only (Default false) - false
        :type reduceOnly: bool
        :param postOnly: optional - Post Only (Default false) - false
        :type postOnly: bool
        :param newOrderRespType: optional - "ACK", "RESULT", Default "ACK" - ACK
        :type newOrderRespType: str (ENUM)
        :param clientOrderId: optional - User-defined order ID cannot be repeated in pending orders - 10000
        :type clientOrderId: str
        :param recvWindow: optional
        :type recvWindow: int

        r  r  Trq  r  r  s     r   options_place_orderzClient.options_place_order@  s    : ((F(SSr   c                 ,    | j                  ddd|      S )a  Place Multiple Option orders (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#place-multiple-option-orders-trade

        :param orders: required - order list. Max 5 orders - [{"symbol":"BTC-210115-35000-C","price":"100","quantity":"0.0001","side":"BUY","type":"LIMIT"}]
        :type orders: list
        :param recvWindow: optional
        :type recvWindow: int

        r  r"  Trq  r  r  s     r   options_place_batch_orderz Client.options_place_batch_order_  s     ((tRX(YYr   c                 ,    | j                  ddd|      S )a  Cancel Option order (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#cancel-option-order-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param orderId: optional - Order ID - 4611875134427365377
        :type orderId: str
        :param clientOrderId: optional - User-defined order ID - 10000
        :type clientOrderId: str
        :param recvWindow: optional
        :type recvWindow: int

        r  r  Trq  r  r  s     r   options_cancel_orderzClient.options_cancel_orderl  s     ((74f(UUr   c                 ,    | j                  ddd|      S )a'  Cancel Multiple Option orders (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#cancel-multiple-option-orders-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param orderIds: optional - Order ID - [4611875134427365377,4611875134427365378]
        :type orderId: list
        :param clientOrderIds: optional - User-defined order ID - ["my_id_1","my_id_2"]
        :type clientOrderIds: list
        :param recvWindow: optional
        :type recvWindow: int

        r  r"  Trq  r  r  s     r   options_cancel_batch_orderz!Client.options_cancel_batch_order}  s     ((=TZ([[r   c                 ,    | j                  ddd|      S )a-  Cancel all Option orders (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#cancel-all-option-orders-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param recvWindow: optional
        :type recvWindow: int

        r  r1  Trq  r  r  s     r   options_cancel_all_ordersz Client.options_cancel_all_orders  s     ((?4V\(]]r   c                 ,    | j                  ddd|      S )a  Query Option order (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param orderId: optional - Order ID - 4611875134427365377
        :type orderId: str
        :param clientOrderId: optional - User-defined order ID - 10000
        :type clientOrderId: str
        :param recvWindow: optional
        :type recvWindow: int

        r   r  Trq  r  r  s     r   options_query_orderzClient.options_query_order  s     ((6(RRr   c                 ,    | j                  ddd|      S )a
  Query current pending Option orders (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#query-current-pending-option-orders-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param orderId: optional - Returns the orderId and subsequent orders, the most recent order is returned by default - 100000
        :type orderId: str
        :param startTime: optional - Start Time - 1593511200000
        :type startTime: int
        :param endTime: optional - End Time - 1593511200000
        :type endTime: int
        :param limit: optional - Number of result sets returned Default:100 Max:1000 - 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        r   r:  Trq  r  r  s     r   options_query_pending_ordersz#Client.options_query_pending_orders      & ((TPV(WWr   c                 ,    | j                  ddd|      S )a  Query Option order history (TRADE)

        https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param orderId: optional - Returns the orderId and subsequent orders, the most recent order is returned by default - 100000
        :type orderId: str
        :param startTime: optional - Start Time - 1593511200000
        :type startTime: int
        :param endTime: optional - End Time - 1593511200000
        :type endTime: int
        :param limit: optional - Number of result sets returned Default:100 Max:1000 - 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        r   historyOrdersTrq  r  r  s     r   options_query_order_historyz"Client.options_query_order_history  s    & ((SY(ZZr   c                 ,    | j                  ddd|      S )a  Option Trade List (USER_DATA)

        https://binance-docs.github.io/apidocs/voptions/en/#option-trade-list-user_data

        :param symbol: required - Option trading pair - BTC-200730-9000-C
        :type symbol: str
        :param fromId: optional - Trade id to fetch from. Default gets most recent trades. - 4611875134427365376
        :type fromId: int
        :param startTime: optional - Start Time - 1593511200000
        :type startTime: int
        :param endTime: optional - End Time - 1593511200000
        :type endTime: int
        :param limit: optional - Number of result sets returned Default:100 Max:1000 - 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        r   rK  Trq  r  r  s     r   options_user_tradeszClient.options_user_trades  r  r   c                 ,    | j                  ddd|      S )aA  Get Fiat Deposit/Withdraw History

        https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data

        :param transactionType: required - 0-deposit,1-withdraw
        :type transactionType: str
        :param beginTime: optional
        :type beginTime: int
        :param endTime: optional
        :type endTime: int
        :param page: optional - default 1
        :type page: int
        :param rows: optional - default 100, max 500
        :type rows: int
        :param recvWindow: optional
        :type recvWindow: int

        r   fiat/ordersTrq  rX  r  s     r   !get_fiat_deposit_withdraw_historyz(Client.get_fiat_deposit_withdraw_history  s    & ''}TPV'WWr   c                 ,    | j                  ddd|      S )a)  Get Fiat Payments History

        https://binance-docs.github.io/apidocs/spot/en/#get-fiat-payments-history-user_data

        :param transactionType: required - 0-buy,1-sell
        :type transactionType: str
        :param beginTime: optional
        :type beginTime: int
        :param endTime: optional
        :type endTime: int
        :param page: optional - default 1
        :type page: int
        :param rows: optional - default 100, max 500
        :type rows: int
        :param recvWindow: optional
        :type recvWindow: int

        r   fiat/paymentsTrq  rX  r  s     r   get_fiat_payments_historyz Client.get_fiat_payments_history  s    & ''tRX'YYr   c                 ,    | j                  ddd|      S )u  Get C2C Trade History

        https://binance-docs.github.io/apidocs/spot/en/#get-c2c-trade-history-user_data

        :param tradeType: required - BUY, SELL
        :type tradeType: str
        :param startTimestamp: optional
        :type startTime: int
        :param endTimestamp: optional
        :type endTimestamp: int
        :param page: optional - default 1
        :type page: int
        :param rows: optional - default 100, max 100
        :type rows: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

            {
                "code": "000000",
                "message": "success",
                "data": [
                    {
                        "orderNumber":"20219644646554779648",
                        "advNo": "11218246497340923904",
                        "tradeType": "SELL",
                        "asset": "BUSD",
                        "fiat": "CNY",
                        "fiatSymbol": "￥",
                        "amount": "5000.00000000",  // Quantity (in Crypto)
                        "totalPrice": "33400.00000000",
                        "unitPrice": "6.68", // Unit Price (in Fiat)
                        "orderStatus": "COMPLETED",  // PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM
                        "createTime": 1619361369000,
                        "commission": "0",   // Transaction Fee (in Crypto)
                        "counterPartNickName": "ab***",
                        "advertisementRole": "TAKER"
                    }
                ],
                "total": 1,
                "success": true
            }

        r   #c2c/orderMatch/listUserOrderHistoryTrq  rX  r  s     r   get_c2c_trade_historyzClient.get_c2c_trade_history  s"    \ ''/T]ahn'oor   c                 ,    | j                  ddd|      S )a  Get C2C Trade History

        https://binance-docs.github.io/apidocs/spot/en/#pay-endpoints

        :param startTime: optional
        :type startTime: int
        :param endTime: optional
        :type endTime: int
        :param limit: optional - default 100, max 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        r   pay/transactionsTrq  rX  r  s     r   get_pay_trade_historyzClient.get_pay_trade_historyK  s     " ''/A$U['\\r   c                 ,    | j                  ddd|      S )a  Get C2C Trade History

        https://binance-docs.github.io/apidocs/spot/en/#pay-endpoints

        :param startTime: required - Start Time - 1593511200000
        :type startTime: int
        :param endTime: required - End Time - 1593511200000
        :type endTime: int
        :param limit: optional - default 100, max 100
        :type limit: int
        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        r   convert/tradeFlowTrq  rX  r  s     r   get_convert_trade_historyz Client.get_convert_trade_history`  s     " ''/B4V\']]r   c                 ,    | j                  ddd|      S )a  Request a quote for the requested token pairs

        https://binance-docs.github.io/apidocs/spot/en/#send-quote-request-user_data

        :param fromAsset: required - Asset to convert from - BUSD
        :type fromAsset: str
        :param toAsset: required - Asset to convert to - BTC
        :type toAsset: str
        :param fromAmount: EITHER - When specified, it is the amount you will be debited after the conversion
        :type fromAmount: decimal
        :param toAmount: EITHER - When specified, it is the amount you will be credited after the conversion
        :type toAmount: decimal

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        r  convert/getQuoteTrq  rX  r  s     r   convert_request_quotezClient.convert_request_quotes  s     ( ''0B4V\']]r   c                 ,    | j                  ddd|      S )a-  Accept the offered quote by quote ID.

        https://binance-docs.github.io/apidocs/spot/en/#accept-quote-trade

        :param quoteId: required - 457235734584567
        :type quoteId: str

        :param recvWindow: optional
        :type recvWindow: int

        :returns: API response

        r  convert/acceptQuoteTrq  rX  r  s     r   convert_accept_quotezClient.convert_accept_quote  s      ''0EdY_'``r   c                 R    | j                   r| j                   j                          y y r   r   closer   s    r   close_connectionzClient.close_connection  s    <<LL  r   c                 $    | j                          y r   )r-  r   s    r   __del__zClient.__del__  s    r   r   Fr   NNr   Ni  (T  r   r   r  r   r  r   r   r   r
   rP  r	   r   r   rY  Sessionr   r_  rQ  Responser^  r  rj  r   rn  rr  rw  rz  r}  r  r  r  r  r  r  r  r  r  rV  r  r   r  r  r  r  r  r  r  r  r   r%   r  r  r  r  r  r  r  r  r  r	  r  r1  r  r  r  r  r!  r$  r'  r*  r-  r0  r2  r5  r8  r;  r>  rA  rI  rL  rO  rR  rU  rY  r\  r_  rb  re  rh  rk  rn  rr  rt  rw  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r	  r  r  r  r  r  r  r  r  r!  r$  r'  r+  r.  r1  r5  r8  r;  r>  rA  rD  rG  rJ  rM  rP  rS  rV  rY  r_  rb  re  rh  rk  rn  rq  rt  rw  ry  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r	  r  r  r  r  r  r  r  r&  r(  r*  r-  r/  r2  r4  r7  r:  r=  r@  rC  rF  rI  rL  rO  rR  rT  rZ  r\  r_  rb  re  rh  rk  rm  ro  rq  rt  rv  r  ry  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r
  r  r  r  r  r  r  r  r   r#  r&  r)  r-  r/  __classcell__rW  s   @r   rS  rS  L  s
    (,48U'==u26Z^	
}
9A#
!$sCx.1
?B
 
 IM
 eCI./	
 KSSV-	
x// 4C 4 4T 4 
R8#4#4 
R 
R 16z?\?\<<)-<B B^b B
BQU B
B\` B
Bae B
BD B
<VZ <
< < !&z/L/L I "'
0M0M J\` J !&z/L/L I[_ I $)*2O2O L^b L
d >K4 >K@/$ /fCd C C C(Kd38n!5 K2'[ '[R#Q$ #QJ0T 0<\ \@%U %UNQ.3 Q.f(Rd (RT ;O:S:S 7#7 7bf 7* cwb{b{ K_ . AEdZ^BVB[B[
+?
0 >B4W[?S?X?XM(<M^ KOX\dhL`LeLew5Iw. HLUYaeI]IbIbI2FIVT&;Wz#XJ,]`u6n '1&B&B #+J +5*F*F "CH ,6+G+G  CD+>+8+8<:|(/T(/T$;L%5N+9Z8@#:J =F%7N:'8R2:#BJ*=X@&T&D^L]:U:FTP$QL-Y^\@4[lT<WF*]X6\p4^l+FZ] ]hsm ]B .a,d08Ttm]^^*`,L<K@#PJ%ONd:a>$eLU:T0Q6]<]< fD fD;ez"YH$ZLwZr)\Va&9\v*XX0Ydc>)cV'gR,Y\-^^9]v8\ta.c2j^XO`b*]XE`R .\,_0 :e2h6ghdnbi0adbikje`^\]cdfSTV\Uc&VP0fd0jdk@/cb$]L`<8_tX>`6A`F#gJa60ld2shq@c<b8d6g20iddB4cp88@FGQJGQL&I$ML^_aLMRYQ^f\.YMJVVWVa`dkebMSLQPOWUQQPRV]VQMYX	Y$ 	YT X[==EKLVOLVVURQQRW^R[
T^d
RXQV









XVR^] ]`I[VqUf`_88>@	F	G	EFG&GQ"	UW"VS*T>ZV"\"^S"X*[*X.X*Z..pd]*^&^,a !   r   rS  c                   !    e Zd Zddddej                  dddddf
dee   dee   deeeef      deded	e	d
eeeef      dee
eef      dee   f fdZeddddej                  dddfdee   dee   deeeef      deded	e	d
eeeef      fd       Zdej                   fdZd ZdTdede	de	fdZdej(                  fdZdej,                  fdZdUdefdZdTdefdZdUdefdZdUdefdZdTdefdZdUdefdZdTdefdZdej,                  fd Zdej,                  fdefd!Z dej,                  fdefd"Z!dej,                  fdefd#Z"defd$Z#e$jF                  jJ                  e#_%        defd%Z&e$jL                  jJ                  e&_%        dee   fd&Z'e$jN                  jJ                  e'_%        defd'Z(e$jP                  jJ                  e(_%        defd(Z)e$jR                  jJ                  e)_%        dVd)ee   de*eeef      fd*Z+e$jV                  jJ                  e+_%        defd+Z,e$jX                  jJ                  e,_%        defd,Z-e$jZ                  jJ                  e-_%        defd-Z.e$j\                  jJ                  e._%        defd.Z/e$j^                  jJ                  e/_%        defd/Z0e$j`                  jJ                  e0_%        dWd0Z1e$jb                  jJ                  e1_%        defd1Z2e$jd                  jJ                  e2_%        e3jh                  fd2e3defd3Z5e$jj                  jJ                  e5_%        e3jh                  fd2e3fd4Z6e$jl                  jJ                  e6_%        ddd5e3jh                  fd2e3fd6Z7e$jn                  jJ                  e7_%        ddd5e3jh                  fd2e3fd7Z8e$jp                  jJ                  e8_%        ddd5e3jh                  fd2e3fd8Z9e$jr                  jJ                  e9_%        ddd5e3jh                  fd2e3fd9Z:e$jt                  jJ                  e:_%        d: Z;e$jv                  jJ                  e;_%        d; Z<e$jx                  jJ                  e<_%        d< Z=e$jz                  jJ                  e=_%        d= Z>e$j|                  jJ                  e>_%        d> Z?e$j~                  jJ                  e?_%        ej                  fd?ZAe$j                  jJ                  eA_%        ej                  fd@ZBe$j                  jJ                  eB_%        ej                  fdAZCe$j                  jJ                  eC_%        dB ZDe$j                  jJ                  eD_%        dC ZEe$j                  jJ                  eE_%        dD ZFe$j                  jJ                  eF_%        dE ZGe$j                  jJ                  eG_%        dF ZHe$j                  jJ                  eH_%        dG ZIe$j                  jJ                  eI_%        dH ZJe$j                  jJ                  eJ_%        dI ZKe$j                  jJ                  eK_%        dJ ZLe$j                  jJ                  eL_%        dK ZMe$j                  jJ                  eM_%        dL ZNe$j                  jJ                  eN_%        dM ZOe$j                  jJ                  eO_%        dN ZPe$j                  jJ                  eP_%        dO ZQe$j                  jJ                  eQ_%        dP ZRe$j                  jJ                  eR_%        dQ ZSe$j                  jJ                  eS_%        dR ZTe$j                  jJ                  eT_%        dS ZUe$j                  jJ                  eU_%        dT ZVe$j                  jJ                  eV_%        dU ZWe$j                  jJ                  eW_%        dV ZXe$j                  jJ                  eX_%        dW ZYe$j                  jJ                  eY_%        dX ZZe$j                  jJ                  eZ_%        dY Z[e$j                  jJ                  e[_%        dZ Z\e$j                  jJ                  e\_%        d[ Z]e$j                  jJ                  e]_%        d\ Z^e$j                  jJ                  e^_%        d] Z_e$j                  jJ                  e__%        d^ Z`e$j                  jJ                  e`_%        d_ Zae$j                  jJ                  ea_%        d` Zbe$j                  jJ                  eb_%        da Zce$j                  jJ                  ec_%        db Zde$j                  jJ                  ed_%        dc Zee$j                  jJ                  ee_%        dVddedeee   fdfZfe$j                  jJ                  ef_%        dg Zge$j                  jJ                  eg_%        dh Zhe$j                  jJ                  eh_%        di Zie$j                  jJ                  ei_%        dj Zje$j                  jJ                  ej_%        dk Zke$j                  jJ                  ek_%        dl Zle$j                  jJ                  el_%        dm Zme$j                  jJ                  em_%        dn Zne$j                  jJ                  en_%        do Zoe$j                  jJ                  eo_%        dp Zpe$j                  jJ                  ep_%        dq Zqe$j                  jJ                  eq_%        dr Zre$j                  jJ                  er_%        ds Zse$j                  jJ                  es_%        dt Zte$j                  jJ                  et_%        du Zue$j                  jJ                  eu_%        dv Zve$j                  jJ                  ev_%        dw Zwe$j                  jJ                  ew_%        dx Zxe$j                  jJ                  ex_%        dy Zye$j                  jJ                  ey_%        dz Zze$j                  jJ                  ez_%        d{ Z{e$j                  jJ                  e{_%        d| Z|e$j                  jJ                  e|_%        d} Z}e$j                  jJ                  e}_%        d~ Z~e$j                  jJ                  e~_%        d Ze$j                  jJ                  e_%        d Ze$j                   jJ                  e_%        d Ze$j                  jJ                  e_%        d Ze$j                  jJ                  e_%        d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Ze$jT                  jJ                  e_%        d Ze$jV                  jJ                  e_%        d Ze$jX                  jJ                  e_%        d Ze$jZ                  jJ                  e_%        d Ze$j\                  jJ                  e_%        d Ze$j^                  jJ                  e_%        d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdÄ ZdĄ Zdń ZdƄ ZdǄ ZdȄ ZdɄ Zdʄ Zd˄ Zd̄ Zd̈́ Zd΄ Zdτ ZϐdXdЄZАdVdфZd҄ Zdӄ ZdԄ ZdՄ Zdք Zdׄ Zd؄ Zdل Zdڄ Zdۄ Zd܄ Zd݄ Zdބ Zd߄ Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zde	fdZd Zd  Zd Z d Zd Zd Zd Zd Zd Zd Zd	 Zd
 Z	d Z
d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd  Zd! Z d" Z!d# Z"d$ Z#d% Z$d& Z%d' Z&d( Z'd) Z(d* Z)d+ Z*d, Z+d- Z,d. Z-d/ Z.d0 Z/d1 Z0d2 Z1d3 Z2d4 Z3	 d5 Z4d6 Z5d7 Z6d8 Z7d9 Z8d: Z9d; Z:d< Z;d= Z<d> Z=d? Z>d@ Z?dA Z@dB ZAdC ZBdD ZCdE ZDdF ZEdG ZFdH ZGdI ZHdJ ZIdK ZJdL ZKdM ZLdN ZMdO ZNdP ZOe$j                  jJ                  eO_%        dQ ZPe$j                  jJ                  eP_%        dR ZQe$j                  jJ                  eQ_%        dS ZRe$j                  jJ                  eR_%         xZSS (Y  AsyncClientNrg   Frh   ri   rj   rk   rl   rm   session_paramsrn   ro   c           
      n    |xs
 t               | _        |xs i | _        t        |   |||||||	|
       y r   )r   loop_session_paramsrU  r   )r   rh   ri   rj   rk   rl   rm   r;  r9  rn   ro   rW  s              r   r   zAsyncClient.__init__  s>     &HJ	/=/C*osMSZ\giyzr   c	           
      :  K    | ||||||||      }		 |	j                          d {    |	j                          d {   }
|
d   t        t        j                         dz        z
  |	_        |	S 7 I7 3# t
        $ r |	j                          d {  7    w xY ww)N
serverTimer   )rV  r  r   r   r   r  r-  )clsrh   ri   rj   rk   rl   rm   r;  r9  r   r  s              r   createzAsyncClient.create  s      7JmWVZ\jk	))+ ,,..C$'$5DIIK$<N8O$OD!K  /  	 '')))		sH   BA4 A0A4 A20A4 /B0A4 2A4 4BBBBr   c                 z    t        j                  d| j                  | j                         d| j                  }|S )N)r;  r   r   )aiohttpClientSessionr;  r   r<  )r   r   s     r   r   zAsyncClient._init_session  sA    '' 
%%'
 ""

 r   c                    K   | j                   r1| j                   sJ | j                   j                          d {    y y 7 wr   r+  r   s    r   r-  zAsyncClient.close_connection  s7     <<<<<,,$$&&& &s   8AAArZ  r   r   c                   K    | j                   |||fi |} t        | j                  |      |fi |4 d {   }|| _        | j	                  |       d {   cd d d       d {    S 7 57 7 	# 1 d {  7  sw Y   y xY wwr   r\  )r   r   rZ  r   r   r   r   s          r   r_  zAsyncClient._request  sy     )))&&,Q&Q074<<0???8$DM..x88 @??8 @???sV   7B
A/B
A5A1A5B
)A3*B
1A53B
5B;A><BB
r   c                 N  K   t        |j                        j                  d      s-t        ||j                  |j	                          d{         	 |j                          d{   S 7 !7 # t        $ r( |j	                          d{  7  }t        d|       w xY ww)ra  r    NzInvalid Response: )r   status
startswithr   rd  re  rf  r   )r   r   txts      r   r^  zAsyncClient._handle_response  s     
 8??#..s3%hx}}AVWW	F!(( BW( 	F ''C),>se*DEE	FsH   A	B%A-B%A1 (A/)A1 ,B%/A1 1B"BB""B%c                 n   K   | j                  |||      } | j                  |||fi | d {   S 7 wr   rh  ri  s          r   rj  zAsyncClient._request_api  s:     ""49"T]]63A&AAAAs   ,535c                 p   K   | j                  ||      } | j                  |||dfi | d {   S 7 wrt  rm  ri  s          r   rn  z AsyncClient._request_futures_api  s=     **4*A"T]]63GGGGG   -646c                 l   K   | j                  |      } | j                  |||dfi | d {   S 7 wrl  rp  rq  s         r   rr  z%AsyncClient._request_futures_data_api  s8     //5"T]]63GGGGG   +424c                 p   K   | j                  ||      } | j                  |||dfi | d {   S 7 wrt  rv  ri  s          r   rw  z%AsyncClient._request_futures_coin_api  s=     //g/F"T]]63GGGGGrL  c                 p   K   | j                  ||      } | j                  |||dfi | d {   S 7 wrt  ry  ri  s          r   rz  z*AsyncClient._request_futures_coin_data_api  s=     44T74K"T]]63GGGGGrL  c                 l   K   | j                  |      } | j                  |||dfi | d {   S 7 wrl  r|  rq  s         r   r}  z AsyncClient._request_options_api  s8     **40"T]]63GGGGGrN  c                 l   K   | j                  ||      } | j                  |||fi | d {   S 7 wr   r  ri  s          r   r  zAsyncClient._request_margin_api  s8     ))$8"T]]63A&AAAArN  c                 j   K   | j                  |      } | j                  |||fi | d {   S 7 wr   r  rq  s         r   r  zAsyncClient._request_website  s6     &&t,"T]]63A&AAAAs   *313c                 J   K    | j                   d|||fi | d {   S 7 wr  r  r  s        r   r  zAsyncClient._get  *     &T&&udFGNvNNNN   #!#c                 J   K    | j                   d|||fi | d {   S 7 wr  r  r  s        r   r  zAsyncClient._post  s*     &T&&vtVWOOOOOrV  c                 J   K    | j                   d|||fi | d {   S 7 wr  r  r  s        r   r  zAsyncClient._put  rU  rV  c                 J   K    | j                   d|||fi | d {   S 7 wr  r  r  s        r   r  zAsyncClient._delete  s*     &T&&xvwQ&QQQQrV  c                 F   K   | j                  dd       d {   }|S 7 w)Nr   r  r  r  s     r   r  zAsyncClient.get_products  s'     ..u6qrr ss   !!c                 X   K   | j                  d| j                         d {   S 7 w)Nr  ru  r  r   s    r   r  zAsyncClient.get_exchange_info#  s%     YY~t7O7OYPPPP   !*(*c                    K   | j                          d {   }|d   D ]  }|d   |j                         k(  s|c S  y 7 )w)Nr  r  r  r  s       r   r  zAsyncClient.get_symbol_info'  sF     **,,	NDH~/ #  -s   AA "AAc                 X   K   | j                  d| j                         d {   S 7 w)NrV  ru  r  r   s    r   rV  zAsyncClient.ping3  %     YYvt/G/GYHHHHr\  c                 X   K   | j                  d| j                         d {   S 7 w)Nr   ru  r  r   s    r   r  zAsyncClient.get_server_time7  r_  r\  r  c                 l   K   i }|r||d<   | j                  d| j                  |       d {   S 7 w)Nr  r  r   r   r  )r   r  r   s      r   r  zAsyncClient.get_all_tickers=  s:     %F8YY~t7O7OV\Y]]]]rN  c                    K   i }d|v r	|d   |d<   nd|v r|d   |d<   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  r  r  s      r   r  z!AsyncClient.get_orderbook_tickersD  sY     v#H-DN& $Y/DOYY2tG_G_Y````s   =AA Ac                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_order_bookM  s'     YYwVT=U=UYVVVV   "+)+c                 D   K   | j                  d|       d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_recent_tradesQ  s     YYxfY5555s     c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  z!AsyncClient.get_historical_tradesU  s(     YY1H`H`Yaaaare  c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  z AsyncClient.get_aggregate_tradesY  s'     YY{AYAYYZZZZre  c                  K   ||t        d      ||| j                  |d       d {   }nct        |      }	 |dz   }| j                  |||       d {   }t        |      dkD  rn'|t	        t        j
                         dz        kD  ry |}W|D ]  }| 	 |d   | j                     }	 | j                  ||       d {   }|dd  }t        |      dk(  ry |D ]  }| 	 |d   | j                     }N7 7 7 ;w)	Nr  r   r  r  r  r   r  r   r  r  s           r   r  z AsyncClient.aggregate_trade_iter]  sT     W%8MO O ?  #88q8QQ
 *)4 %8F#'#<#<%"* & $= $( (F 6{Q DIIK$$6 77%H   Rj-G  44F74SSF ABZF6{a Rj-G 5 R(, Ts4   *DD-DDA/D
D8DDDc                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_klines  s'     YYxfd>V>VYWWWWre  r  c                 R  K   d|v r|d   s|d= t         j                  |k(  r | j                  di | d {   S t         j                  |k(  r | j                  di | d {   S t         j
                  |k(  r | j                  di | d {   S t        |      7 i7 >7 w)Nr  r   r  r  s      r   r  zAsyncClient._klines  s     vi'8y!$$3(26222!))[8,,,6v666!..+=111;F;;;)+66 36;s3   5B'B!,B'$B#%,B'B%B'#B'%B'c                    K   | j                  |||ddt        t        j                         dz               d {   }|d   d   S 7 w)Nr   r   r   r  r  r  s        r   r  z)AsyncClient._get_earliest_valid_timestamp  sU     ll#		d*+ # 
 
 Qx{
s   9A
AA
r   c                 L   K   | j                  ||||||       d {   S 7 wNr  r  r  s          r   r  z!AsyncClient.get_historical_klines  s9     ,,VXyRYaft,  A  A  	A  As   $"$c                   K   g }t        |      }t        |      }	|	'| j                  |||       d {   }
t        |	|
      }	t        |      }|r	|	r||	k  r|S d}	 | j	                  |||||	|       d {   }|r||z  }t        |      rt        |      |k  r	 |S |d   d   |z   }	|r|	|k\  r	 |S |dz  }|dz  dk(  rt        j                  d       d {    7 7 i7 	wNr   r  r  r   r   r   r   r  r  r  r  asyncior  r  s                 r   r  zAsyncClient._historical_klines  s9      -X6	 "),#'#E#EfhXc#ddN8^4H  (h6X#5"ll'!" +  I y( y>S^e%;  !}Q')3H (f, 	 1HCQw!|mmA&&&A  e< 's5   1C%CAC%7C!8A!C%C#C%!C%#C%c                 8   K   | j                  ||||||      S wrn  r  r  s          r   r  z+AsyncClient.get_historical_klines_generator  s,     00HiS^ 1 
 	
s   c                  K   t        |      }t        |      }|'| j                  |||       d {   }	t        ||	      }t        |      }
|
r|r|
|k  ry d}	 | j	                  ||||||
       d {   }|r|D ]  }| 	 t        |      rt        |      |k  ry |d   d   |z   }|
r||
k\  ry |dz  }|dz  dk(  rt        j                  d       d {    7 7 l7 	wrp  rq  r  s                 r   r  z(AsyncClient._historical_klines_generator  s(     -X6	 "), #'#E#EfhXc#ddN8^4H  (h6X#5 $'!" !- ! K $AG %
 {#s;'7%'? #2q)I5H (f, 1HCQw!|mmA&&&A  e< 's5   /C%CAC%4C!5A$C%C#C%!C%#C%c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_avg_price.   s'     YYz@X@XYYYYYre  c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_ticker2   s'     YY}64C[C[Y\\\\re  c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r  zAsyncClient.get_symbol_ticker6   s'     YY~FDD\D\Y]]]]re  c                 Z   K   | j                  d|| j                         d {   S 7 w)Nr  r  r  r  s     r   r	  z AsyncClient.get_orderbook_ticker:   s(     YY2IaIaYbbbbre  c                 F   K   | j                  dd|       d {   S 7 wNr  Tr  r  r  s     r   r  zAsyncClient.create_order@   s!     ZZFZ;;;;   !!c                 ~   K   |j                  | j                  |d        | j                  di | d {   S 7 w)Nr  r   r  r  s      r   r  zAsyncClient.order_limitD   sA     ))&
 	 'T&&00000s   4=;=c                    K   |j                  d| j                  i        | j                  dd|i| d {   S 7 wNr  r  r   r  r  s      r   r  zAsyncClient.order_limit_buyL   sC     DMM
 	 &T%%H+HHHHH   5><>c                    K   |j                  d| j                  i        | j                  dd|i| d {   S 7 wr~  r  r  s      r   r  zAsyncClient.order_limit_sellS   sC     DNN
 	 &T%%H+HHHHHr  c                 |   K   |j                  d| j                  i        | j                  di | d {   S 7 w)Nr  r   r  r  s     r   r  zAsyncClient.order_marketZ   s@     D**
 	 'T&&00000   3<:<c                 |   K   |j                  d| j                  i        | j                  di | d {   S 7 wNr  r   r   r  s     r   r!  zAsyncClient.order_market_buya   s>     DMM
 	 'T&&00000r  c                 |   K   |j                  d| j                  i        | j                  di | d {   S 7 wr  r#  r  s     r   r$  zAsyncClient.order_market_sellh   s>     DNN
 	 'T&&00000r  c                 F   K   | j                  dd|       d {   S 7 w)Nr&  Tr  r  r  s     r   r'  zAsyncClient.create_oco_ordero   s!     ZZTZ????r{  c                 |   K   |j                  d| j                  i        | j                  di | d {   S 7 wr  r)  r  s     r   r*  zAsyncClient.order_oco_buys   s>     DMM
 	 +T**4V4444r  c                 |   K   |j                  d| j                  i        | j                  di | d {   S 7 wr  r,  r  s     r   r-  zAsyncClient.order_oco_sellz   s>     DNN
 	 +T**4V4444r  c                 F   K   | j                  dd|       d {   S 7 w)Nr/  Tr  r  r  s     r   r0  zAsyncClient.create_test_order   s!     ZZdZ@@@@r{  c                 F   K   | j                  dd|       d {   S 7 wrz  r  r  s     r   r2  zAsyncClient.get_order   s!     YYw6Y::::r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr4  Tr  r  r  s     r   r5  zAsyncClient.get_all_orders   s!     YY{DvY>>>>r{  c                 F   K   | j                  dd|       d {   S 7 wrz  r7  r  s     r   r8  zAsyncClient.cancel_order   s!     \\'4f\====r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr:  Tr  r  r  s     r   r;  zAsyncClient.get_open_orders   s!     YY|TY????r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr=  Tr  r  r  s     r   r>  zAsyncClient.get_open_oco_orders   !     YY6YBBBBr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr@  Tr  r  r  s     r   rA  zAsyncClient.get_account   s!     YYy$VY<<<<r{  c                    K    | j                   di | d {   }d|v r2|d   D ]*  }|d   j                         |j                         k(  s(|c S  y 7 ;w)NrC  rD  r   rE  rG  s        r   rI  zAsyncClient.get_asset_balance   s^     $D$$.v..:w<%%'5;;=8J '  /s   AA4AAc                 F   K   | j                  dd|       d {   S 7 w)NrK  Tr  r  r  s     r   rL  zAsyncClient.get_my_trades   s!     YYz4fY====r{  c                 B   K   | j                  dd       d {   S 7 w)NrN  Tr  r   s    r   rO  z#AsyncClient.get_current_order_count   s     YY0$7777   c                 F   K   | j                  dd|       d {   S 7 w)NrQ  Tr  r  r  s     r   rR  z!AsyncClient.get_prevented_matches   s"     YY3TYGGGGr{  c                 F   K   | j                  dd|       d {   S 7 w)NrT  Tr  r  r  s     r   rU  zAsyncClient.get_allocations   r  r{  c                 B   K   | j                  dd       d {   S 7 w)Nr   rW  rX  r   s    r   rY  zAsyncClient.get_system_status   s     --e_EEEEr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r[  Tr  rX  r  s     r   r\  zAsyncClient.get_account_status   (     --e5EtRX-YYYY   " "c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r^  Tr  rX  r  s     r   r_  z*AsyncClient.get_account_api_trading_status   )     --e5OQU\b-ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   ra  Tr  rX  r  s     r   rb  z'AsyncClient.get_account_api_permissions   )     --e5NPT[a-bbbbr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rd  Tr  rX  r  s     r   re  zAsyncClient.get_dust_assets   s(     --f6FSY-ZZZZr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rg  Tr  rX  r  s     r   rh  zAsyncClient.get_dust_log   r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rj  Tr  rX  r  s     r   rk  zAsyncClient.transfer_dust   s&     --flDv-VVVVr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rm  Tr  rX  r  s     r   rn  z&AsyncClient.get_asset_dividend_history   s(     --e5JDW]-^^^^r  c                 H   K   | j                  ddd|       d {   S 7 wNr  rp  Trq  rX  r  s     r   rr  z#AsyncClient.make_universal_transfer   (     --f6FtZ`-aaaar  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rp  Trq  rX  r  s     r   rt  z,AsyncClient.query_universal_transfer_history   s(     --e5EdY_-````r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rv  Tr  rX  r  s     r   rw  zAsyncClient.get_trade_fee   r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   ry  Tr  rX  r  s     r   rz  zAsyncClient.get_asset_details   s(     --e5H$U[-\\\\r  c                 h   K   d|v rd|vr|d   |d<   | j                  ddd|       d {   S 7 w)Nr|  r}  r  r~  Tr  rX  r  s     r   r  zAsyncClient.withdraw   sE     Vf 4#F^F6N--f6NPT[a-bbbb   )202c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  zAsyncClient.get_deposit_history   s(     --e5MtZ`-aaaar  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z AsyncClient.get_withdraw_history   r  r  c                    K    | j                   di | d {   }|D ]  }d|v s|d   |k(  s|c S  t        d|      7 (w)Nr  r  r   r  r  s        r   r  z#AsyncClient.get_withdraw_history_id   sT     0t00:6::Eu}t!;  <fEE ;s   AAAAAr|  r  c                 `   K   ||d<   |r||d<   | j                  ddd|       d {   S 7 w)Nr|  r  r   r  Tr  rX  r  s       r   r  zAsyncClient.get_deposit_address!  s?     v 'F9--e5NPT[a-bbbbs   %.,.c                 P   K   | j                  ddi        d {   }|d   S 7 	w)Nr  Fr  r  r  r  s     r   r  z!AsyncClient.stream_get_listen_key!  s/     JJ/RJ@@; As   &$
&c                 N   K   d|i}| j                  dd|       d {   S 7 wNr  r  Fr  )r  r  s      r   r  zAsyncClient.stream_keepalive!  s0     
 YY/VYDDDD   %#%c                 N   K   d|i}| j                  dd|       d {   S 7 wr  r7  r  s      r   r  zAsyncClient.stream_close!  s0     
 \\"2E\GGGGr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  zAsyncClient.get_margin_account !  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z'AsyncClient.get_isolated_margin_account$!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z*AsyncClient.enable_isolated_margin_account(!  )     --f6OQU\b-ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z+AsyncClient.disable_isolated_margin_account,!  s)     --h8QSW^d-eeeer  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  rX  r  s     r   r  zAsyncClient.get_margin_asset0!  s$     --e^&-QQQQr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  rX  r  s     r   r  zAsyncClient.get_margin_symbol4!  s$     --e]-PPPPr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  rX  r  s     r   r  z!AsyncClient.get_margin_all_assets8!  s%     --e5Gf-UUUUr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  rX  r  s     r   r  z AsyncClient.get_margin_all_pairs<!  s%     --e5FV-TTTTr{  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  z*AsyncClient.create_isolated_margin_account@!  )     --f6NW[bh-iiiir  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z&AsyncClient.get_isolated_margin_symbolD!  )     --e5KTX_e-ffffr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z+AsyncClient.get_all_isolated_margin_symbolsH!  s)     --e5OX\ci-jjjjr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  z'AsyncClient.toggle_bnb_burn_spot_marginL!  s'     --fiSY-ZZZZr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z$AsyncClient.get_bnb_burn_spot_marginP!  s'     --eYtRX-YYYYr  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  rX  r  s     r   r  z"AsyncClient.get_margin_price_indexT!  s%     --e5Hv-VVVVr{  c                 R   K   d|d<   | j                  ddd|       d {   S 7 w)Nr   r  r  r  Trq  rX  r  s     r   r  z#AsyncClient.transfer_margin_to_spotX!  2     v--f6GPT[a-bbbb   '%'c                 R   K   d|d<   | j                  ddd|       d {   S 7 w)Nr   r  r  r  Trq  rX  r  s     r   r  z#AsyncClient.transfer_spot_to_margin]!  r  r  c                 \   K   d|d<   d|d<   | j                  ddd|       d {   S 7 w)	Nr  r  r%   r  r  r  Trq  rX  r  s     r   r  z,AsyncClient.transfer_isolated_margin_to_spotb!  s=     /{"y--f6PY]dj-kkkk   #,*,c                 \   K   d|d<   d|d<   | j                  ddd|       d {   S 7 w)	Nr%   r  r  r  r  r  Trq  rX  r  s     r   r  z,AsyncClient.transfer_spot_to_isolated_marginh!  s=     ${-y--f6PY]dj-kkkkr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  zAsyncClient.create_margin_loann!  s'     --fmDW]-^^^^r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  zAsyncClient.repay_margin_loanr!  '     --fnTX^-____r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  zAsyncClient.create_margin_orderv!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  zAsyncClient.cancel_margin_orderz!  s'     --htZ`-aaaar  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  z#AsyncClient.set_margin_max_leverage~!  )     --f6KTX_e-ffffr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z'AsyncClient.get_margin_transfer_history!  (     --e5FtZ`-aaaar  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z#AsyncClient.get_margin_loan_details!  '     --e]4V\-]]]]r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z$AsyncClient.get_margin_repay_details!  '     --e^DW]-^^^^r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z!AsyncClient.get_cross_margin_data!  )     --e5MVZag-hhhhr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z'AsyncClient.get_margin_interest_history!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z,AsyncClient.get_margin_force_liquidation_rec!  )     --e5QZ^ek-llllr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  zAsyncClient.get_margin_order!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z"AsyncClient.get_open_margin_orders!  )     --e5HQU\b-ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z!AsyncClient.get_all_margin_orders!  )     --e5GPT[a-bbbbr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  zAsyncClient.get_margin_trades!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r   zAsyncClient.get_max_margin_loan!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z#AsyncClient.get_max_margin_transfer!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r  z#AsyncClient.create_margin_oco_order!  )     --f6HQU\b-ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  rX  r  s     r   r	  z#AsyncClient.cancel_margin_oco_order!  s)     --h8JSW^d-eeeer  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z AsyncClient.get_margin_oco_order!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z&AsyncClient.get_open_margin_oco_orders!  )     --e5JSW^d-eeeer  c                 R   K   | j                  dddi        d {   }|d   S 7 	w)Nr  r  Frq  r  rX  r  s     r   r  z(AsyncClient.margin_stream_get_listen_key!  s5     ,,V5EeZ\,]]; ^   '%
'c                 P   K   d|i}| j                  ddd|       d {   S 7 w)Nr  r  r  Frq  rX  r  s      r   r  z#AsyncClient.margin_stream_keepalive!  s6     
 --e5EeZ`-aaaa   &$&c                 P   K   d|i}| j                  ddd|       d {   S 7 w)Nr  r  r  Frq  rX  r  s      r   r  zAsyncClient.margin_stream_close!  s7     
 --h8HQV]c-ddddr  c                 Z   K   d|i}| j                  ddd|       d {   }|d   S 7 	w)Nr  r  r  Frq  r  rX  r  s       r   r  z1AsyncClient.isolated_margin_stream_get_listen_key!  sD     f
 ,,V5NW\ci,jj; ks   +)
+c                 R   K   ||d}| j                  ddd|       d {   S 7 w)Nr  r  r  Frq  rX  r  s       r   r  z,AsyncClient.isolated_margin_stream_keepalive!  s8     "
 --e5NW\ci-jjjjr  c                 R   K   ||d}| j                  ddd|       d {   S 7 w)Nr  r  r  Frq  rX  r  s       r   r  z(AsyncClient.isolated_margin_stream_close!  s8     "
 --h8QZ_fl-mmmmr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r   Trq  rX  r  s     r   r!  z$AsyncClient.get_lending_product_list!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r#  Trq  rX  r  s     r   r$  z(AsyncClient.get_lending_daily_quota_left!  s)     --e5R[_fl-mmmmr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r&  Trq  rX  r  s     r   r'  z$AsyncClient.purchase_lending_product!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r*  Trq  rX  r  s     r   r+  z.AsyncClient.get_lending_daily_redemption_quota!  s)     --e5Xaelr-ssssr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r-  Trq  rX  r  s     r   r.  z"AsyncClient.redeem_lending_product!  s)     --f6LUY`f-ggggr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r0  Trq  rX  r  s     r   r1  z AsyncClient.get_lending_position!  )     --e5S\`gm-nnnnr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r4  Trq  rX  r  s     r   r5  z+AsyncClient.get_fixed_activity_project_list!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r7  Trq  rX  r  s     r   r8  zAsyncClient.get_lending_account!  s)     --e5LUY`f-ggggr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r:  Trq  rX  r  s     r   r;  z(AsyncClient.get_lending_purchase_history!  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r=  Trq  rX  r  s     r   r>  z*AsyncClient.get_lending_redemption_history!  s)     --e5U^bio-ppppr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r@  Trq  rX  r  s     r   rA  z(AsyncClient.get_lending_interest_history!  s)     --e5T]ahn-oooor  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rC  Trq  rX  r  s     r   rD  z3AsyncClient.change_fixed_activity_to_daily_position"  s)     --f6OX\ci-jjjjr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rF  Trq  rX  r  s     r   rG  z$AsyncClient.get_staking_product_list"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rI  Trq  rX  r  s     r   rJ  z$AsyncClient.purchase_staking_product
"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rL  Trq  rX  r  s     r   rM  z"AsyncClient.redeem_staking_product"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rO  Trq  rX  r  s     r   rP  z AsyncClient.get_staking_position"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rR  Trq  rX  r  s     r   rS  z(AsyncClient.get_staking_purchase_history"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rU  Trq  rX  r  s     r   rV  zAsyncClient.set_auto_staking"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rX  Trq  rX  r  s     r   rY  z#AsyncClient.get_personal_left_quota"  s)     --e5PY]dj-kkkkr  c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r   r]  Tr  r^  r  s     r   r_  z AsyncClient.get_staking_asset_us"  s?     xx4H!HH--e_dQW-XXXX   /868c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r  ra  Tr  r^  r  s     r   rb  zAsyncClient.stake_asset_us#"  s?     xx4H!HH--fotRX-YYYYr	  c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r  rd  Tr  r^  r  s     r   re  zAsyncClient.unstake_asset_us("  s@     xx4H!HH--f6GTZ-[[[[r	  c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r   rg  Tr  r^  r  s     r   rh  z"AsyncClient.get_staking_balance_us-"  s@     xx4H!HH--e5MtZ`-aaaar	  c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r   rj  Tr  r^  r  s     r   rk  z"AsyncClient.get_staking_history_us2"  s@     xx4H!HH--e5FSY-ZZZZr	  c                 t   K   | j                   dk(  sJ d       | j                  ddd|       d {   S 7 w)Nr[  r\  r   rm  Tr  r^  r  s     r   rn  z*AsyncClient.get_staking_rewards_history_us7"  sA     xx4H!HH--e5TVZag-hhhhr	  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rp  Tr  rX  r  s     r   rq  z AsyncClient.get_sub_account_list>"  (     --e5GTZ-[[[[r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rs  Tr  rX  r  s     r   rt  z,AsyncClient.get_sub_account_transfer_historyA"  s)     --e5WY]dj-kkkkr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rv  Tr  rX  r  s     r   rw  z4AsyncClient.get_sub_account_futures_transfer_historyD"  s)     --e5[]ahn-oooor  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  rv  Tr  rX  r  s     r   ry  z/AsyncClient.create_sub_account_futures_transferG"  s)     --f6\^bio-ppppr  c                 J   K   | j                  ddd|d       d {   S 7 w)Nr   r{  Tr   r  rX  r  s     r   r|  z"AsyncClient.get_sub_account_assetsJ"  s+     --e5I4V\fg-hhhhrV  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r~  Tr  rX  r  s     r   r  z)AsyncClient.query_subaccount_spot_summaryM"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z*AsyncClient.get_subaccount_deposit_addressP"  )     --e5QSW^d-eeeer  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z*AsyncClient.get_subaccount_deposit_historyS"  s)     --e5PRV]c-ddddr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z0AsyncClient.get_subaccount_futures_margin_statusV"  s(     --e5I4V\-]]]]r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z$AsyncClient.enable_subaccount_marginY"  )     --f6QSW^d-eeeer  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z)AsyncClient.get_subaccount_margin_details\"  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z)AsyncClient.get_subaccount_margin_summary_"  s)     --e5XZ^ek-llllr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z%AsyncClient.enable_subaccount_futuresb"  s)     --f6RTX_e-ffffr  c                 J   K   | j                  ddd|d       d {   S 7 w)Nr   r  Tr   r  rX  r  s     r   r  z*AsyncClient.get_subaccount_futures_detailse"  s,     --e5RTX_eop-qqqqrV  c                 J   K   | j                  ddd|d       d {   S 7 w)Nr   r  Tr   r  rX  r  s     r   r  z*AsyncClient.get_subaccount_futures_summaryh"  s,     --e5Y[_flvw-xxxxrV  c                 J   K   | j                  ddd|d       d {   S 7 w)Nr   r  Tr   r  rX  r  s     r   r  z/AsyncClient.get_subaccount_futures_positionriskk"  s,     --e5WY]djtu-vvvvrV  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z,AsyncClient.make_subaccount_futures_transfern"  s)     --f6TVZag-hhhhr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z+AsyncClient.make_subaccount_margin_transferq"  s)     --f6SUY`f-ggggr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z2AsyncClient.make_subaccount_to_subaccount_transfert"  )     --f6UW[bh-iiiir  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z.AsyncClient.make_subaccount_to_master_transferw"  s)     --f6XZ^ek-llllr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z+AsyncClient.get_subaccount_transfer_historyz"  s)     --e5Z\`gm-nnnnr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z.AsyncClient.make_subaccount_universal_transfer}"  r%  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z*AsyncClient.get_universal_transfer_history"  s)     --e5TVZag-hhhhr  c                 B   K   | j                  dd       d {   S 7 wNr   rV  r  r   s    r   r  zAsyncClient.futures_ping"       ..uf====r  c                 B   K   | j                  dd       d {   S 7 wNr   r   r  r   s    r   r  zAsyncClient.futures_time"  r,  r  c                 B   K   | j                  dd       d {   S 7 wNr   r  r  r   s    r   r  z!AsyncClient.futures_exchange_info"       ..unEEEEr  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  zAsyncClient.futures_order_book"  $     ..ugF.KKKKr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z!AsyncClient.futures_recent_trades"  $     ..uhV.LLLLr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z%AsyncClient.futures_historical_trades"  %     ..u6Hv.VVVVr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z$AsyncClient.futures_aggregate_trades"  $     ..uk.OOOOr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  zAsyncClient.futures_klines"  r7  r{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z$AsyncClient.futures_continous_klines"  r:  r{  c                 h   K   | j                  |||||t        j                         d {   S 7 wrn  r  r  s         r   r  z%AsyncClient.futures_historical_klines"  sK     ,,VXyRYaf  uI  uQ  uQ,  R  R  	R  Rr  c                 R   K   | j                  ||||t        j                        S w)Nr  r  r  s        r   r  z/AsyncClient.futures_historical_klines_generator"  s8     009V]k  lH  lH0  I  	Is   %'c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  zAsyncClient.futures_mark_price"  $     ..un6.RRRRr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z AsyncClient.futures_funding_rate"  $     ..um&.QQQQr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  z/AsyncClient.futures_top_longshort_account_ratio"  s&     33E;U\b3ccccr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  z0AsyncClient.futures_top_longshort_position_ratio"  s&     33E;V]c3ddddr{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  z*AsyncClient.futures_global_longshort_ratio"  s&     33E;X_e3ffffr{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  zAsyncClient.futures_ticker"  rI  r{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z!AsyncClient.futures_symbol_ticker"  rF  r{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z$AsyncClient.futures_orderbook_ticker"  s&     ..u6IPV.WWWWr{  c                 H   K   | j                  ddd|       d {   S 7 wNr   r  Trq  r  r  s     r   r  z&AsyncClient.futures_liquidation_orders"  '     ..umDW].^^^^r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  z&AsyncClient.futures_api_trading_status"  s)     ..u6HQU\b.ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  z"AsyncClient.futures_comission_rate"  s(     ..u6FtZ`.aaaar  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  z)AsyncClient.futures_adl_quantile_estimate"  rU  r  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r  z!AsyncClient.futures_open_interest"  rF  r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  zAsyncClient.futures_index_info"  r=  r{  c                 F   K   | j                  dd|       d {   S 7 wNr   r  r  r  r  s     r   r   z&AsyncClient.futures_open_interest_hist"  &     33E;MTZ3[[[[r{  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  r  r  s     r   r  z$AsyncClient.futures_leverage_bracket"  s(     ..u6GTZ.[[[[r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z$AsyncClient.futures_account_transfer"  s(     --f6H$U[-\\\\r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r	  zAsyncClient.transfer_history"  r  r  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  z'AsyncClient.futures_loan_borrow_history"  s)     --e5RTX_e-ffffr  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  z&AsyncClient.futures_loan_repay_history"  r  r  c                 J   K   | j                  ddd|d       d {   S 7 wr  rX  r  s     r   r  zAsyncClient.futures_loan_wallet"  s+     --e5JDW]gh-iiiirV  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  z3AsyncClient.futures_cross_collateral_adjust_history"  s)     --e5\^bio-ppppr  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  z8AsyncClient.futures_cross_collateral_liquidation_history"  s)     --e5VX\ci-jjjjr  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  z)AsyncClient.futures_loan_interest_history"  s)     --e5SUY`f-ggggr  c                 H   K   | j                  ddd|       d {   S 7 wNr  r  Tr  r  r  s     r   r  z AsyncClient.futures_create_order"  s&     ..vw6.RRRRr  c                    K   t        |      }|j                  dd      }|dd  |d<   | j                  ddd|       d {   S 7 wNr  r   r!  r"  r  Tr  r#  r%  s      r   r&  z%AsyncClient.futures_place_batch_order"  sT      (#++E59 ,RS 1}..v}dQW.XXXX   >A AAc                 H   K   | j                  ddd|       d {   S 7 wNr   r  Tr  r  r  s     r   r(  zAsyncClient.futures_get_order"  s&     ..ugt&.QQQQr  c                 H   K   | j                  ddd|       d {   S 7 wNr   r:  Tr  r  r  s     r   r*  z#AsyncClient.futures_get_open_orders"  &     ..ulDv.VVVVr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r4  Tr  r  r  s     r   r-  z"AsyncClient.futures_get_all_orders"  s&     ..uk4f.UUUUr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  r  r  s     r   r/  z AsyncClient.futures_cancel_order #  s&     ..x$V.TTTTr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r1  Tr  r  r  s     r   r2  z*AsyncClient.futures_cancel_all_open_orders#  s'     ..x$U[.\\\\r  c                 H   K   | j                  ddd|       d {   S 7 wNr  r"  Tr  r  r  s     r   r4  z!AsyncClient.futures_cancel_orders#  s'     ..xSY.ZZZZr  c                 J   K   | j                  dddd|       d {   S 7 w)Nr   r6  Tr   rb  r  r  s     r   r7  z#AsyncClient.futures_account_balance	#  )     ..uiqW].^^^^rV  c                 J   K   | j                  dddd|       d {   S 7 w)Nr   r@  Tr   rb  r  r  s     r   r:  zAsyncClient.futures_account#  rx  rV  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r<  Tr  r  r  s     r   r=  z#AsyncClient.futures_change_leverage#  s&     ..vz4f.UUUUr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r?  Tr  r  r  s     r   r@  z&AsyncClient.futures_change_margin_type#  s'     ..v|TPV.WWWWr  c                 H   K   | j                  ddd|       d {   S 7 wNr  rB  Tr  r  r  s     r   rC  z*AsyncClient.futures_change_position_margin#  s(     ..v7GTZ.[[[[r  c                 H   K   | j                  ddd|       d {   S 7 wNr   rE  Tr  r  r  s     r   rF  z+AsyncClient.futures_position_margin_history#  s)     ..u6NPT[a.bbbbr  c                 J   K   | j                  dddd|       d {   S 7 w)Nr   rH  Tr   rb  r  r  s     r   rI  z(AsyncClient.futures_position_information#  s*     ..undTU\b.ccccrV  c                 H   K   | j                  ddd|       d {   S 7 wNr   rK  Tr  r  r  s     r   rL  z"AsyncClient.futures_account_trades#  rq  r  c                 H   K   | j                  ddd|       d {   S 7 wNr   rN  Tr  r  r  s     r   rO  z"AsyncClient.futures_income_history!#  s&     ..uh6.RRRRr  c                 H   K   | j                  ddd|       d {   S 7 wNr  rQ  Tr  r  r  s     r   rR  z(AsyncClient.futures_change_position_mode$#  s(     ..v7JDW].^^^^r  c                 H   K   | j                  ddd|       d {   S 7 wNr   rQ  Tr  r  r  s     r   rT  z%AsyncClient.futures_get_position_mode'#  s(     ..u6I4V\.]]]]r  rU  c                 X   K   d|rdndi}| j                  ddd|       d {   S 7 w)NrU  rW  rX  r  Tr  r  rY  s      r   rZ  z,AsyncClient.futures_change_multi_assets_mode*#  s;     +<'
 ..v7JDW].^^^^r\  c                 H   K   | j                  dddi        d {   S 7 w)Nr   rU  Tr  r  r   s    r   r\  z)AsyncClient.futures_get_multi_assets_mode0#  s(     ..u6I4VX.YYYYr  c                 R   K   | j                  dddi        d {   }|d   S 7 	wr^  r  r  s     r   r_  z)AsyncClient.futures_stream_get_listen_key3#  s4     --fk%VX-YY; Zr  c                 P   K   d|i}| j                  ddd|       d {   S 7 wra  r  r  s      r   rb  z$AsyncClient.futures_stream_keepalive7#  s5     
 ..uk%V\.]]]]r  c                 P   K   d|i}| j                  ddd|       d {   S 7 wrd  r  r  s      r   re  z AsyncClient.futures_stream_close=#  s5     
 ..xUY_.````r  c                 B   K   | j                  dd       d {   S 7 wr+  rg  r   s    r   rh  zAsyncClient.futures_coin_pingE#       33E6BBBBr  c                 B   K   | j                  dd       d {   S 7 wr.  rg  r   s    r   rk  zAsyncClient.futures_coin_timeH#  r  r  c                 B   K   | j                  dd       d {   S 7 wr0  rg  r   s    r   rm  z&AsyncClient.futures_coin_exchange_infoK#  s     33E>JJJJr  c                 F   K   | j                  dd|       d {   S 7 wr3  rg  r  s     r   ro  z#AsyncClient.futures_coin_order_bookN#  s$     33E73PPPPr{  c                 F   K   | j                  dd|       d {   S 7 wr6  rg  r  s     r   rq  z&AsyncClient.futures_coin_recent_tradesQ#  $     33E8&3QQQQr{  c                 F   K   | j                  dd|       d {   S 7 wr9  rg  r  s     r   rt  z*AsyncClient.futures_coin_historical_tradesT#  r^  r{  c                 F   K   | j                  dd|       d {   S 7 wr<  rg  r  s     r   rv  z)AsyncClient.futures_coin_aggregate_tradesW#  s$     33E;V3TTTTr{  c                 F   K   | j                  dd|       d {   S 7 wr?  rg  r  s     r   r  zAsyncClient.futures_coin_klinesZ#  r  r{  c                 F   K   | j                  dd|       d {   S 7 wrA  rg  r  s     r   ry  z)AsyncClient.futures_coin_continous_klines]#  r^  r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r{  r  rg  r  s     r   r|  z+AsyncClient.futures_coin_index_price_klines`#  r^  r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r~  r  rg  r  s     r   r  z*AsyncClient.futures_coin_mark_price_klinesc#  s&     33E;LSY3ZZZZr{  c                 F   K   | j                  dd|       d {   S 7 wrE  rg  r  s     r   r  z#AsyncClient.futures_coin_mark_pricef#  %     33E>PV3WWWWr{  c                 F   K   | j                  dd|       d {   S 7 wrH  rg  r  s     r   r  z%AsyncClient.futures_coin_funding_ratei#  $     33E=v3VVVVr{  c                 F   K   | j                  dd|       d {   S 7 wrN  rg  r  s     r   r  zAsyncClient.futures_coin_tickerl#  r  r{  c                 F   K   | j                  dd|       d {   S 7 wrP  rg  r  s     r   r  z&AsyncClient.futures_coin_symbol_tickero#  r  r{  c                 F   K   | j                  dd|       d {   S 7 wrR  rg  r  s     r   r  z)AsyncClient.futures_coin_orderbook_tickerr#  s&     33E;NU[3\\\\r{  c                 H   K   | j                  ddd|       d {   S 7 wrT  rg  r  s     r   r  z+AsyncClient.futures_coin_liquidation_ordersu#  s(     33E=QU\b3ccccr  c                 F   K   | j                  dd|       d {   S 7 wrZ  rg  r  s     r   r  z&AsyncClient.futures_coin_open_interestx#  r  r{  c                 F   K   | j                  dd|       d {   S 7 wr]  r  r  s     r   r  z+AsyncClient.futures_coin_open_interest_hist{#  s&     88@RY_8````r{  c                 J   K   | j                  dddd|       d {   S 7 w)Nr   r  r   Tr  rg  r  s     r   r  z)AsyncClient.futures_coin_leverage_bracket~#  s4     33$a6 4 
 
 	
 
rV  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rp  Tr  rX  r  s     r   r  z AsyncClient.new_transfer_history#  r  r  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  zAsyncClient.funding_wallet#  r  r  c                 J   K   | j                  ddd|d       d {   S 7 wr  rX  r  s     r   r  zAsyncClient.get_user_asset#  s+     --f6JDW]gh-iiiirV  c                 H   K   | j                  ddd|       d {   S 7 wr  rX  r  s     r   r  zAsyncClient.universal_transfer#  s2     --$T . 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wri  rg  r  s     r   r  z%AsyncClient.futures_coin_create_order#  s'     33FGTPV3WWWWr  c                    K   t        |      }|j                  dd      }|dd  |d<   | j                  ddd|       d {   S 7 wrk  r  r%  s      r   r  z*AsyncClient.futures_coin_place_batch_order#  sT      (#++E59 ,RS 1}33FM4V\3]]]]rl  c                 H   K   | j                  ddd|       d {   S 7 wrn  rg  r  s     r   r  z"AsyncClient.futures_coin_get_order#  s&     33E7Dv3VVVVr  c                 H   K   | j                  ddd|       d {   S 7 wrp  rg  r  s     r   r  z(AsyncClient.futures_coin_get_open_orders#  '     33E<TZ3[[[[r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r4  Trq  rg  r  s     r   r  z'AsyncClient.futures_coin_get_all_orders#  s1     33;t& 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wNr  r  Trq  rg  r  s     r   r  z%AsyncClient.futures_coin_cancel_order#  s1     33gd 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wNr  r1  Trq  rg  r  s     r   r  z/AsyncClient.futures_coin_cancel_all_open_orders#  s1     33od 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wrv  rg  r  s     r   r  z&AsyncClient.futures_coin_cancel_orders#  s1     33mT 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r6  Trq  rg  r  s     r   r  z(AsyncClient.futures_coin_account_balance#  1     339T 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wNr   r@  Trq  rg  r  s     r   r  z AsyncClient.futures_coin_account#  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r<  Trq  rg  r  s     r   r  z(AsyncClient.futures_coin_change_leverage#  s1     33Jt& 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r?  Trq  rg  r  s     r   r  z+AsyncClient.futures_coin_change_margin_type#  s1     33LF 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wr}  rg  r  s     r   r  z/AsyncClient.futures_coin_change_position_margin#  s2     33$d 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 wr  rg  r  s     r   r  z0AsyncClient.futures_coin_position_margin_history#  s2     33+T 4 
 
 	
 
r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rH  Tr  rg  r  s     r   r  z-AsyncClient.futures_coin_position_information#  s'     33E>4V\3]]]]r  c                 H   K   | j                  ddd|       d {   S 7 wr  rg  r  s     r   r  z'AsyncClient.futures_coin_account_trades#  r  r  c                 H   K   | j                  ddd|       d {   S 7 wr  rg  r  s     r   r  z'AsyncClient.futures_coin_income_history#  s'     33E8TPV3WWWWr  c                 H   K   | j                  ddd|       d {   S 7 wr  rg  r  s     r   r  z-AsyncClient.futures_coin_change_position_mode#  s)     33F<OQU\b3ccccr  c                 H   K   | j                  ddd|       d {   S 7 wr  rg  r  s     r   r  z*AsyncClient.futures_coin_get_position_mode#  s)     33E;NPT[a3bbbbr  c                 R   K   | j                  dddi        d {   }|d   S 7 	wr^  rg  r  s     r   r  z.AsyncClient.futures_coin_stream_get_listen_key#  s4     226;u[]2^^; _r  c                 P   K   d|i}| j                  ddd|       d {   S 7 wra  rg  r  s      r   r  z)AsyncClient.futures_coin_stream_keepalive#  s5     
 33E;u[a3bbbbr  c                 P   K   d|i}| j                  ddd|       d {   S 7 wrd  rg  r  s      r   r  z%AsyncClient.futures_coin_stream_close#  s6     
 33HkRW^d3eeeer  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  zAsyncClient.get_all_coins_info#  s(     --e5LdY_-````r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Tr  rX  r  s     r   r  z AsyncClient.get_account_snapshot#  s(     --e5FSY-ZZZZr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z(AsyncClient.disable_fast_withdraw_switch#  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Tr  rX  r  s     r   r  z'AsyncClient.enable_fast_withdraw_switch#  s)     --f6PRV]c-ddddr  c                 B   K   | j                  dd       d {   S 7 wr+  r  r   s    r   r  zAsyncClient.options_ping$  r,  r  c                 B   K   | j                  dd       d {   S 7 wr.  r  r   s    r   r  zAsyncClient.options_time	$  r,  r  c                 B   K   | j                  dd       d {   S 7 w)Nr   r  r  r   s    r   r  zAsyncClient.options_info$  s     ..ulCCCCr  c                 B   K   | j                  dd       d {   S 7 wr0  r  r   s    r   r  z!AsyncClient.options_exchange_info$  r1  r  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  zAsyncClient.options_index_price$  r4  r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  zAsyncClient.options_price$  r7  r{  c                 F   K   | j                  dd|       d {   S 7 w)Nr   r  r  r  r  s     r   r  zAsyncClient.options_mark_price$  s$     ..uf6.JJJJr{  c                 F   K   | j                  dd|       d {   S 7 wr3  r  r  s     r   r  zAsyncClient.options_order_book$  r4  r{  c                 F   K   | j                  dd|       d {   S 7 wr?  r  r  s     r   r  zAsyncClient.options_klines$  r7  r{  c                 F   K   | j                  dd|       d {   S 7 wr6  r  r  s     r   r  z!AsyncClient.options_recent_trades!$  r7  r{  c                 F   K   | j                  dd|       d {   S 7 wr9  r  r  s     r   r  z%AsyncClient.options_historical_trades$$  r:  r{  c                 H   K   | j                  ddd|       d {   S 7 wr  r  r  s     r   r  z AsyncClient.options_account_info)$  s'     ..uiSY.ZZZZr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  r  r  s     r   r  z"AsyncClient.options_funds_transfer,$  s'     ..vz$U[.\\\\r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  zAsyncClient.options_positions/$  s'     ..ujTZ.[[[[r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  r  r  s     r   r   zAsyncClient.options_bill2$  s'     ..vvdQW.XXXXr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r  Trq  r  r  s     r   r  zAsyncClient.options_place_order5$  s'     ..vwtRX.YYYYr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r"  Trq  r  r  s     r   r  z%AsyncClient.options_place_batch_order8$  s'     ..v}TX^.____r  c                 H   K   | j                  ddd|       d {   S 7 wr  r  r  s     r   r  z AsyncClient.options_cancel_order;$  s'     ..xTZ.[[[[r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r"  Trq  r  r  s     r   r  z&AsyncClient.options_cancel_batch_order>$  s'     ..xtZ`.aaaar  c                 H   K   | j                  ddd|       d {   S 7 wr  r  r  s     r   r
  z%AsyncClient.options_cancel_all_ordersA$  s(     ..xQU\b.ccccr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  zAsyncClient.options_query_orderD$  s'     ..ugdQW.XXXXr  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r:  Trq  r  r  s     r   r  z(AsyncClient.options_query_pending_ordersG$  '     ..ul4V\.]]]]r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  r  r  s     r   r  z'AsyncClient.options_query_order_historyJ$  s'     ..uodY_.````r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   rK  Trq  r  r  s     r   r  zAsyncClient.options_user_tradesM$  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z-AsyncClient.get_fiat_deposit_withdraw_historyR$  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z%AsyncClient.get_fiat_payments_historyU$  s'     --e_TX^-____r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r  z!AsyncClient.get_c2c_trade_historyZ$  s)     --e5Zcgnt-uuuur  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r  Trq  rX  r  s     r   r   z!AsyncClient.get_pay_trade_history_$  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr   r"  Trq  rX  r  s     r   r#  z%AsyncClient.get_convert_trade_historye$  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r%  Trq  rX  r  s     r   r&  z!AsyncClient.convert_request_quotei$  r  r  c                 H   K   | j                  ddd|       d {   S 7 w)Nr  r(  Trq  rX  r  s     r   r)  z AsyncClient.convert_accept_quotem$  r  r  r   r0  r   r1  r2  (T  r   r   r  r   r  r   r   r   r
   rP  r	   r   r   classmethodr@  rB  rC  r   r-  r_  ClientResponser^  r  rj  rn  rr  rw  rz  r}  r  r  r  r  r  r  r  rS  __doc__r  r  rV  r  r   r  r  r  r  r  r  r  r  r   r%   r  r  r  r  r  r  r  r  r  r	  r  r1  r  r  r  r  r!  r$  r'  r*  r-  r0  r2  r5  r8  r;  r>  rA  rI  rL  rO  rR  rU  rY  r\  r_  rb  re  rh  rk  rn  rr  rt  rw  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r	  r  r  r  r  r  r  r  r  r!  r$  r'  r+  r.  r1  r5  r8  r;  r>  rA  rD  rG  rJ  rM  rP  rS  rV  rY  r_  rb  re  rh  rk  rn  rq  rt  rw  ry  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r	  r  r  r  r  r  r  r  r&  r(  r*  r-  r/  r2  r4  r7  r:  r=  r@  rC  rF  rI  rL  rO  rR  rT  rZ  r\  r_  rb  re  rh  rk  rm  ro  rq  rt  rv  r  ry  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r
  r  r  r  r  r  r  r  r   r#  r&  r)  r5  r6  s   @r   r8  r8    s    (,48U'==DUY26Z^
{}
{9A#
{!$sCx.1
{?B
{ 
{ 	
{ ;C4S>:R	
{
 eCI./
{
 KSSV-
{ &*48U'==DUY	sm8@!$sCx.1?B  	 ;C4S>:R	 .w44 '
9# 9t 94 9Fw/E/E F 7<ZEbEb BH]a H
HW[ H
Hbf H
Hgk H
HRV H
B\` B
Bd B ',Z5R5R O (-j6S6S Pbf P ',Z5R5R Oae O */
8U8U Rdh R
D  "..66LQ Q & 8 8 @ @x~  %44<<OID I;;&&DLIt I$44<<O^HSM ^T$sTWx.EY ^
 %44<<Oat a %+$@$@$H$H!W W#22::N64 6 & 8 8 @ @bt b$*$@$@$H$H![d [#)#>#>#F#F 3.h $*#>#>#F#F XD X**22J@T@Y@Y 
7)= 
7hl 
7 nn,,GO QePiPi
9M
 -3,P,P,X,X!)FJTX`dH\HaHaA1EA %+$@$@$H$H!CGQU]aEYE^E^7.B7p "(!:!:!B!BPT^bjnRfRkRk
;O

 /5.T.T.\.\#+MQ[_gkOcOhOh4'8L4'j ,2+N+N+V+V (Z"0088M]**22J^ & 8 8 @ @c#)#>#>#F#F <!..66L,6,H,H 1 !,,44K0:0L0L I
 %44<<O1;1M1M I
  &66>>1
 "..66L1
  &66>>1
 !' 8 8 @ @@%66>>5
 #0088M5
 $22::NA & 8 8 @ @;((00I?#22::N>!..66L@$44<<OC"("<"<"D"D= ,,44K !' 8 8 @ @>"0088M8&,&D&D&L&L#H$*$@$@$H$H!C$44<<OF & 8 8 @ @Z!'!:!:!B!Bd-3-R-R-Z-Z"*c*0*L*L*T*T'[$44<<OZ!..66LW"0088M_)/)J)J)R)R&b&,&D&D&L&L#a/5/V/V/^/^$,Z"0088M] & 8 8 @ @c
 ..Hb"("<"<"D"Dd#)#>#>#F#F F '-&D&D&L&L#cc cHSM c
 #)"<"<"D"D  %+$@$@$H$H!E
  &66>>H
 "..66LZ!'!:!:!B!Bc*0*L*L*T*T'd-3-R-R-Z-Z"*f.4.T.T.\.\#+R%66>>Q & 8 8 @ @V$*$@$@$H$H!U#)#>#>#F#F j-3-R-R-Z-Z"*g)/)J)J)R)R&k.4.T.T.\.\#+[*0*L*L*T*T'Z'-'F'F'N'N$W%+%B%B%J%J"c '-&D&D&L&L#c '-&D&D&L&L#l 06/V/V/^/^$,l 06/V/V/^/^$,_!'!:!:!B!B` & 8 8 @ @`"("<"<"D"Db"("<"<"D"Dg&,&D&D&L&L#b*0*L*L*T*T'^&,&D&D&L&L#_iim_dcbgi
dfcf
 be knmnjthoghoqpk
fdbcijl
Y $*#>#>#F#F Z $22::N\  &66>>b &,%B%B%J%J"[ &,%B%B%J%J"i .4-R-R-Z-Z"*\lpqicfe^ffmgrywihjmoji
>>FLMWPMWRISRdegRSX_db_SP\\]\gfjqkhSYRWVU][__VX\cdWS_^_ _Z ^aCCKQR\UR\\[XWWX]dXa

Zdj

X^W\



















^\Xdc cfa[fe>>DFLMKLMMW
[]\YZ`\bdY^a^
^`
v
c$*$@$@$H$H!d(.(H(H(P(P%d$*$@$@$H$H!g#)#>#>#F#F  r   r8  )(base64r   pathlibr   typingr   r   r   r   r	   r
   rB  rr  r   r   rY  r   Crypto.PublicKeyr   Crypto.Hashr   Crypto.Signaturer   operatorr   urllib.parser   helpersr   r   r   
exceptionsr   r   r   enumsr   r   rS  r8  r   r   r   <module>r     sp      : :          %  " G G ] ] 's sl	Ru Z Ru jjNG* NGr   