forked from sammchardy/python-binance
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_async_client_margin.py
More file actions
418 lines (274 loc) · 14.8 KB
/
Copy pathtest_async_client_margin.py
File metadata and controls
418 lines (274 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
import pytest
pytestmark = [pytest.mark.margin, pytest.mark.asyncio]
async def test_margin__get_account_status(asyncClient):
await asyncClient.get_account_status()
async def test_margin_get_account_api_trading_status(asyncClient):
await asyncClient.get_account_api_trading_status()
async def test_margin_get_account_api_permissions(asyncClient):
await asyncClient.get_account_api_permissions()
async def test_margin_get_dust_assets(asyncClient):
await asyncClient.get_dust_assets()
async def test_margin_get_dust_log(asyncClient):
await asyncClient.test_get_dust_log()
async def test_margin_transfer_dust(asyncClient):
await asyncClient.transfer_dust()
async def test_margin_get_asset_dividend_history(asyncClient):
await asyncClient.get_asset_dividend_history()
async def test_margin_make_universal_transfer(asyncClient):
await asyncClient.make_universal_transfer()
async def test_margin_query_universal_transfer_history(asyncClient):
await asyncClient.query_universal_transfer_history()
async def test_margin_get_trade_fee(asyncClient):
await asyncClient.get_trade_fee()
async def test_margin_get_asset_details(asyncClient):
await asyncClient.get_asset_details()
async def test_margin_get_spot_delist_schedule(asyncClient):
await asyncClient.get_spot_delist_schedule()
# Withdraw Endpoints
async def test_margin_withdraw(asyncClient):
await asyncClient.withdraw()
async def test_margin_get_deposit_history(asyncClient):
await asyncClient.get_deposit_history()
async def test_margin_get_withdraw_history(asyncClient):
await asyncClient.get_withdraw_history()
async def test_margin_get_withdraw_history_id(asyncClient):
await asyncClient.get_withdraw_history_id()
async def test_margin_get_deposit_address(asyncClient):
await asyncClient.get_deposit_address()
# Margin Trading Endpoints
async def test_margin_get_margin_account(asyncClient):
await asyncClient.get_margin_account()
async def test_margin_get_isolated_margin_account(asyncClient):
await asyncClient.get_isolated_margin_account()
async def test_margin_enable_isolated_margin_account(asyncClient):
await asyncClient.enable_isolated_margin_account()
async def test_margin_disable_isolated_margin_account(asyncClient):
await asyncClient.disable_isolated_margin_account()
async def test_margin_get_enabled_isolated_margin_account_limit(asyncClient):
await asyncClient.get_enabled_isolated_margin_account_limit()
async def test_margin_get_margin_dustlog(asyncClient):
await asyncClient.get_margin_dustlog()
async def test_margin_get_margin_dust_assets(asyncClient):
await asyncClient.get_margin_dust_assets()
async def test_margin_transfer_margin_dust(asyncClient):
await asyncClient.transfer_margin_dust()
async def test_margin_get_cross_margin_collateral_ratio(asyncClient):
await asyncClient.get_cross_margin_collateral_ratio()
async def test_margin_get_small_liability_exchange_assets(asyncClient):
await asyncClient.get_small_liability_exchange_assets()
async def test_margin_exchange_small_liability_assets(asyncClient):
await asyncClient.exchange_small_liability_assets()
async def test_margin_get_small_liability_exchange_history(asyncClient):
await asyncClient.get_small_liability_exchange_history()
async def test_margin_get_future_hourly_interest_rate(asyncClient):
await asyncClient.get_future_hourly_interest_rate()
async def test_margin_get_margin_capital_flow(asyncClient):
await asyncClient.get_margin_capital_flow()
async def test_margin_get_margin_asset(asyncClient):
await asyncClient.get_margin_asset()
async def test_margin_get_margin_symbol(asyncClient):
await asyncClient.get_margin_symbol()
async def test_margin_get_margin_all_assets(asyncClient):
await asyncClient.get_margin_all_assets()
async def test_margin_get_margin_all_pairs(asyncClient):
await asyncClient.get_margin_all_pairs()
async def test_margin_create_isolated_margin_account(asyncClient):
await asyncClient.create_isolated_margin_account()
async def test_margin_get_isolated_margin_symbol(asyncClient):
await asyncClient.get_isolated_margin_symbol()
async def test_margin_get_all_isolated_margin_symbols(asyncClient):
await asyncClient.get_all_isolated_margin_symbols()
async def test_margin_get_isolated_margin_fee_data(asyncClient):
await asyncClient.get_isolated_margin_fee_data()
async def test_margin_get_isolated_margin_tier_data(asyncClient):
await asyncClient.get_isolated_margin_tier_data()
async def test_margin_margin_manual_liquidation(asyncClient):
await asyncClient.margin_manual_liquidation()
async def test_margin_toggle_bnb_burn_spot_margin(asyncClient):
await asyncClient.toggle_bnb_burn_spot_margin()
async def test_margin_get_bnb_burn_spot_margin(asyncClient):
await asyncClient.get_bnb_burn_spot_margin()
async def test_margin_get_margin_price_index(asyncClient):
await asyncClient.get_margin_price_index()
async def test_margin_transfer_margin_to_spot(asyncClient):
await asyncClient.transfer_margin_to_spot()
async def test_margin_transfer_spot_to_margin(asyncClient):
await asyncClient.transfer_spot_to_margin()
async def test_margin_transfer_isolated_margin_to_spot(asyncClient):
await asyncClient.transfer_isolated_margin_to_spot()
async def test_margin_transfer_spot_to_isolated_margin(asyncClient):
await asyncClient.transfer_spot_to_isolated_margin()
async def test_margin_get_isolated_margin_tranfer_history(asyncClient):
await asyncClient.get_isolated_margin_tranfer_history()
async def test_margin_create_margin_loan(asyncClient):
await asyncClient.create_margin_loan()
async def test_margin_repay_margin_loan(asyncClient):
await asyncClient.repay_margin_loan()
async def create_margin_ordertest_(asyncClient):
await asyncClient.create_margin_order()
async def test_margin_cancel_margin_order(asyncClient):
await asyncClient.cancel_margin_order()
async def test_margin_set_margin_max_leverage(asyncClient):
await asyncClient.set_margin_max_leverage()
async def test_margin_get_margin_transfer_history(asyncClient):
await asyncClient.get_margin_transfer_history()
async def test_margin_get_margin_loan_details(asyncClient):
await asyncClient.get_margin_loan_details()
async def test_margin_get_margin_repay_details(asyncClient):
await asyncClient.get_margin_repay_details()
async def test_margin_get_cross_margin_data(asyncClient):
await asyncClient.get_cross_margin_data()
async def test_margin_get_margin_interest_history(asyncClient):
await asyncClient.get_margin_interest_history()
async def test_margin_get_margin_force_liquidation_rec(asyncClient):
await asyncClient.get_margin_force_liquidation_rec()
async def test_margin_get_margin_order(asyncClient):
await asyncClient.get_margin_order()
async def test_margin_get_open_margin_orders(asyncClient):
await asyncClient.get_open_margin_orders()
async def test_margin_get_all_margin_orders(asyncClient):
await asyncClient.get_all_margin_orders()
async def test_margin_get_margin_trades(asyncClient):
await asyncClient.get_margin_trades()
async def test_margin_get_max_margin_loan(asyncClient):
await asyncClient.get_max_margin_loan()
async def test_margin_get_max_margin_transfer(asyncClient):
await asyncClient.get_max_margin_transfer()
async def test_margin_get_margin_delist_schedule(asyncClient):
await asyncClient.get_margin_delist_schedule()
# Margin OCO
async def test_margin_create_margin_oco_order(asyncClient):
await asyncClient.create_margin_oco_order()
async def test_margin_cancel_margin_oco_order(asyncClient):
await asyncClient.cancel_margin_oco_order()
async def test_margin_get_margin_oco_order(asyncClient):
await asyncClient.get_margin_oco_order()
async def test_margin_get_open_margin_oco_orders(asyncClient):
await asyncClient.get_open_margin_oco_orders()
# Cross-margin
async def test_margin_margin_stream_get_listen_key(asyncClient):
await asyncClient.margin_stream_get_listen_key()
async def test_margin_margin_stream_close(asyncClient):
await asyncClient.margin_stream_close()
# Isolated margin
async def test_margin_isolated_margin_stream_get_listen_key(asyncClient):
await asyncClient.isolated_margin_stream_get_listen_key()
async def test_margin_isolated_margin_stream_close(asyncClient):
await asyncClient.isolated_margin_stream_close()
# Simple Earn Endpoints
async def test_margin_get_simple_earn_flexible_product_list(asyncClient):
await asyncClient.get_simple_earn_flexible_product_list()
async def test_margin_get_simple_earn_locked_product_list(asyncClient):
await asyncClient.get_simple_earn_locked_product_list()
async def test_margin_subscribe_simple_earn_flexible_product(asyncClient):
await asyncClient.subscribe_simple_earn_flexible_product()
async def test_margin_subscribe_simple_earn_locked_product(asyncClient):
await asyncClient.subscribe_simple_earn_locked_product()
async def test_margin_redeem_simple_earn_flexible_product(asyncClient):
await asyncClient.redeem_simple_earn_flexible_product()
async def test_margin_redeem_simple_earn_locked_product(asyncClient):
await asyncClient.redeem_simple_earn_locked_product()
async def test_margin_get_simple_earn_flexible_product_position(asyncClient):
await asyncClient.get_simple_earn_flexible_product_position()
async def test_margin_get_simple_earn_locked_product_position(asyncClient):
await asyncClient.get_simple_earn_locked_product_position()
async def test_margin_get_simple_earn_account(asyncClient):
await asyncClient.get_simple_earn_account()
# Lending Endpoints
async def test_margin_get_fixed_activity_project_list(asyncClient):
await asyncClient.get_fixed_activity_project_list()
async def test_margin_change_fixed_activity_to_daily_position(asyncClient):
await asyncClient.change_fixed_activity_to_daily_position()
# Staking Endpoints
async def test_margin_get_staking_product_list(asyncClient):
await asyncClient.get_staking_product_list()
async def test_margin_purchase_staking_product(asyncClient):
await asyncClient.purchase_staking_product()
async def test_margin_redeem_staking_product(asyncClient):
await asyncClient.redeem_staking_product()
async def test_margin_get_staking_position(asyncClient):
await asyncClient.get_staking_position()
async def test_margin_get_staking_purchase_history(asyncClient):
await asyncClient.get_staking_purchase_history()
async def test_margin_set_auto_staking(asyncClient):
await asyncClient.set_auto_staking()
async def test_margin_get_personal_left_quota(asyncClient):
await asyncClient.get_personal_left_quota()
# US Staking Endpoints
async def test_margin_get_staking_asset_us(asyncClient):
await asyncClient.get_staking_asset_us()
async def test_margin_stake_asset_us(asyncClient):
await asyncClient.stake_asset_us()
async def test_margin_unstake_asset_us(asyncClient):
await asyncClient.unstake_asset_us()
async def test_margin_get_staking_balance_us(asyncClient):
await asyncClient.get_staking_balance_us()
async def test_margin_get_staking_history_us(asyncClient):
await asyncClient.get_staking_history_us()
async def test_margin_get_staking_rewards_history_us(asyncClient):
await asyncClient.get_staking_rewards_history_us()
# Sub Accounts
async def test_margin_get_sub_account_list(asyncClient):
await asyncClient.get_sub_account_list()
async def test_margin_get_sub_account_transfer_history(asyncClient):
await asyncClient.get_sub_account_transfer_history()
async def test_margin_get_sub_account_futures_transfer_history(asyncClient):
await asyncClient.get_sub_account_futures_transfer_history()
async def test_margin_create_sub_account_futures_transfer(asyncClient):
await asyncClient.create_sub_account_futures_transfer()
async def test_margin_get_sub_account_assets(asyncClient):
await asyncClient.get_sub_account_assets()
async def test_margin_query_subaccount_spot_summary(asyncClient):
await asyncClient.query_subaccount_spot_summary()
async def test_margin_get_subaccount_deposit_address(asyncClient):
await asyncClient.get_subaccount_deposit_address()
async def test_margin_get_subaccount_deposit_history(asyncClient):
await asyncClient.get_subaccount_deposit_history()
async def test_margin_get_subaccount_futures_margin_status(asyncClient):
await asyncClient.get_subaccount_futures_margin_status()
async def test_margin_enable_subaccount_margin(asyncClient):
await asyncClient.enable_subaccount_margin()
async def test_margin_get_subaccount_margin_details(asyncClient):
await asyncClient.get_subaccount_margin_details()
async def test_margin_get_subaccount_margin_summary(asyncClient):
await asyncClient.get_subaccount_margin_summary()
async def test_margin_enable_subaccount_futures(asyncClient):
await asyncClient.enable_subaccount_futures()
async def test_margin_get_subaccount_futures_details(asyncClient):
await asyncClient.get_subaccount_futures_details()
async def test_margin_get_subaccount_futures_summary(asyncClient):
await asyncClient.get_subaccount_futures_summary()
async def test_margin_get_subaccount_futures_positionrisk(asyncClient):
await asyncClient.get_subaccount_futures_positionrisk()
async def test_margin_make_subaccount_futures_transfer(asyncClient):
await asyncClient.make_subaccount_futures_transfer()
async def test_margin_make_subaccount_margin_transfer(asyncClient):
await asyncClient.make_subaccount_margin_transfer()
async def test_margin_make_subaccount_to_subaccount_transfer(asyncClient):
await asyncClient.make_subaccount_to_subaccount_transfer()
async def test_margin_make_subaccount_to_master_transfer(asyncClient):
await asyncClient.make_subaccount_to_master_transfer()
async def test_margin_get_subaccount_transfer_history(asyncClient):
await asyncClient.get_subaccount_transfer_history()
async def test_margin_make_subaccount_universal_transfer(asyncClient):
await asyncClient.make_subaccount_universal_transfer()
async def test_margin_get_universal_transfer_history(asyncClient):
await asyncClient.get_universal_transfer_history()
# Fiat Endpoints
async def test_margin_get_fiat_deposit_withdraw_history(asyncClient):
await asyncClient.get_fiat_deposit_withdraw_history()
async def test_margin_get_fiat_payments_history(asyncClient):
await asyncClient.get_fiat_payments_history()
# C2C Endpoints
async def test_margin_get_c2c_trade_history(asyncClient):
await asyncClient.get_c2c_trade_history()
# Pay Endpoints
async def test_margin_get_pay_trade_history(asyncClient):
await asyncClient.get_pay_trade_history()
# Convert Endpoints
async def test_margin_get_convert_trade_history(asyncClient):
await asyncClient.get_convert_trade_history()
async def test_margin_convert_request_quote(asyncClient):
await asyncClient.convert_request_quote()
async def test_margin_convert_accept_quote(asyncClient):
await asyncClient.convert_accept_quote()