Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitgetLimited
GitHub Repository: BitgetLimited/V3-bitget-api-sdk
Path: blob/master/bitget-python-sdk-api/bitget/__pycache__/lever_api.cpython-38.pyc
732 views
U

��_��@s(ddlmZddlTGdd�de�ZdS)�)�Client)�*c@s�eZdZd/dd�Zdd�Zdd�Zd0d	d
�Zdd�Zd
d�Zd1dd�Z	d2dd�Z
dd�Zd3dd�Zd4dd�Z
dd�Zd5dd�Zdd�Zd6d d!�Zd7d"d#�Zd8d$d%�Zd9d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.S):�LeverAPIFcCst�|||||�dS�N)r�__init__)�self�api_key�api_secret_key�
passphrase�use_server_time�r�R/Users/larry/PycharmProjects/V3-Open-API-SDK/okex-python-sdk-api/okex/lever_api.pyrszLeverAPI.__init__cCs|�tt�Sr)�_request_without_params�GET�
LEVER_ACCOUNT�rrrr
�get_account_infoszLeverAPI.get_account_infocCs|�ttt|��Sr)rr�LEVER_COIN_ACCOUNT�str�r�
instrument_idrrr
�get_specific_accountszLeverAPI.get_specific_account�cCsRi}|r||d<|r||d<|r(||d<|r4||d<|jttt|�d|dd�S)N�after�before�limit�typez/ledgerT��cursor)�_request_with_paramsr�LEVER_LEDGER_RECORDr)rrrrrr�paramsrrr
�get_ledger_recordszLeverAPI.get_ledger_recordcCs|�tt�Sr)rr�LEVER_CONFIGrrrr
�get_config_info szLeverAPI.get_config_infocCs|�ttt|�d�S)Nz
/availability)rr�LEVER_SPECIFIC_CONFIGrrrrr
�get_specific_config_info$sz!LeverAPI.get_specific_config_infocCs ||||d�}|jtt|dd�S)N��statusrrrTr)rr�LEVER_BORROW_RECORD)rr(rrrr!rrr
�get_borrow_coin'szLeverAPI.get_borrow_coincCs,||||d�}|jttt|�d|dd�S)Nr'z	/borrowedTr)rrr%r)rrr(rrrr!rrr
�get_specific_borrow_coin+sz!LeverAPI.get_specific_borrow_coincCs|||d�}|�tt|�S)N�r�currency�amount)r�POST�LEVER_BORROW_COIN)rrr-r.r!rrr
�borrow_coin0szLeverAPI.borrow_coincCs&|||d�}|r||d<|�tt|�S)Nr,�	borrow_id)rr/�LEVER_REPAYMENT_COIN)rrr-r.r2r!rrr
�repayment_coin5szLeverAPI.repayment_coin�0c

Cs&|||||||||	d�	}
|�tt|
�S)N)	r�side�margin_trading�
client_oidr�
order_type�price�size�notional)rr/�LEVER_ORDER)rrr6r7r8rr9r:r;r<r!rrr
�
take_order<szLeverAPI.take_ordercCs|�tt|�Sr)rr/�LEVER_ORDERS�rr!rrr
�take_orders@szLeverAPI.take_orderscCs@d|i}|r"|�ttt|�|�S|r<|�ttt|�|�SdS�Nr)rr/�LEVER_REVOKE_ORDERr�rr�order_idr8r!rrr
�revoke_orderDs
zLeverAPI.revoke_ordercCs|�tt|�Sr)rr/�LEVER_REVOKE_ORDERSr@rrr
�
revoke_ordersKszLeverAPI.revoke_orderscCs"|||||d�}|jtt|dd�S)N)r�staterrrTr)rr�LEVER_ORDER_LIST)rrrIrrrr!rrr
�get_order_listOszLeverAPI.get_order_listcCs>d|i}|r||d<|r ||d<|r,||d<|jtt|dd�S)Nrr�torTr)rr�LEVEL_ORDERS_PENDING)rrrrLrr!rrr
�get_order_pendingSszLeverAPI.get_order_pendingcCs@d|i}|r"|�ttt|�|�S|r<|�ttt|�|�SdSrB)rr�LEVER_ORDER_INFOrrDrrr
�get_order_info^s
zLeverAPI.get_order_infocCs"|||||d�}|jtt|dd�S)N)rrErrLrTr)rr�LEVER_FILLS)rrrErrLrr!rrr
�	get_fillseszLeverAPI.get_fillscCs|�ttt|�d�S)N�	/leverage)rrr rrrrr
�get_leverageiszLeverAPI.get_leveragecCs"d|i}|�ttt|�d|�S)N�leveragerS)rr/r r)rrrUr!rrr
�set_leveragelszLeverAPI.set_leveragecCs|�ttt|�d�S)Nz/mark_price)rr�LEVER_MARK_PRICErrrrr
�get_mark_pricepszLeverAPI.get_mark_priceN)F)rrrr)rrrr)rrrr)r)rrr5rrr)rr)rrr)rrr)rr)rrrr)�__name__�
__module__�__qualname__rrrr"r$r&r*r+r1r4r>rArFrHrKrNrPrRrTrVrXrrrr
rs*











rN)�clientr�constsrrrrr
�<module>s