pybit 5.16.1__tar.gz → 5.17.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybit-5.16.1 → pybit-5.17.2}/CHANGELOG.md +227 -3
- {pybit-5.16.1/pybit.egg-info → pybit-5.17.2}/PKG-INFO +1 -1
- pybit-5.17.2/pybit/__init__.py +1 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_http_manager.py +3 -1
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_account.py +45 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_asset.py +30 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_crypto_loan.py +41 -1
- pybit-5.17.2/pybit/_v5_dca.py +43 -0
- pybit-5.17.2/pybit/_v5_earn.py +1347 -0
- pybit-5.17.2/pybit/_v5_fcombobot.py +86 -0
- pybit-5.17.2/pybit/_v5_fgridbot.py +93 -0
- pybit-5.17.2/pybit/_v5_fht.py +44 -0
- pybit-5.17.2/pybit/_v5_fmartingalebot.py +89 -0
- pybit-5.17.2/pybit/_v5_grid.py +115 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_institutional_loan.py +30 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_market.py +15 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_position.py +21 -0
- pybit-5.17.2/pybit/_v5_rwa.py +174 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_spot_margin_trade.py +150 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_spread.py +23 -0
- pybit-5.17.2/pybit/_v5_strategy.py +126 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_user.py +31 -0
- pybit-5.17.2/pybit/_websocket_trading.py +104 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/account.py +3 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/asset.py +2 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/crypto_loan.py +2 -0
- pybit-5.17.2/pybit/dca.py +9 -0
- pybit-5.17.2/pybit/earn.py +78 -0
- pybit-5.17.2/pybit/fcombobot.py +11 -0
- pybit-5.17.2/pybit/fgridbot.py +11 -0
- pybit-5.17.2/pybit/fht.py +9 -0
- pybit-5.17.2/pybit/fmartingalebot.py +11 -0
- pybit-5.17.2/pybit/grid.py +11 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/institutional_loan.py +3 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/market.py +1 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/position.py +1 -0
- pybit-5.17.2/pybit/rwa.py +16 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/spot_margin_trade.py +8 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/spread.py +1 -0
- pybit-5.17.2/pybit/strategy.py +12 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/unified_trading.py +45 -13
- {pybit-5.16.1 → pybit-5.17.2}/pybit/user.py +2 -0
- {pybit-5.16.1 → pybit-5.17.2/pybit.egg-info}/PKG-INFO +1 -1
- {pybit-5.16.1 → pybit-5.17.2}/pybit.egg-info/SOURCES.txt +17 -0
- pybit-5.17.2/tests/test_generated_openapi_endpoints.py +290 -0
- {pybit-5.16.1 → pybit-5.17.2}/tests/test_pybit.py +243 -2
- pybit-5.16.1/pybit/__init__.py +0 -1
- pybit-5.16.1/pybit/_v5_earn.py +0 -115
- pybit-5.16.1/pybit/_websocket_trading.py +0 -89
- pybit-5.16.1/pybit/earn.py +0 -13
- {pybit-5.16.1 → pybit-5.17.2}/LICENSE +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/MANIFEST.in +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/README.md +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/direct_session.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/http_example_explanatory.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/http_example_quickstart.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/http_example_rsa_authentication.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/p2p_example_explanatory.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/p2p_example_quickstart.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_example_explanatory.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_example_quickstart.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_example_rsa_authentication.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_http_example_spread_trading_quickstart.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_trading_example_quickstart.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/websocket_unsubscribe_example.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/examples/wrapper_class.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_helpers.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_broker.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_fiat.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_misc.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_p2p.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_pre_upgrade.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_rate_limit.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_rfq.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_spot_leverage_token.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_v5_trade.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/_websocket_stream.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/broker.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/exceptions.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/fiat.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/helpers.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/misc.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/p2p.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/pre_upgrade.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/rate_limit.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/rfq.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/spot_leverage_token.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit/trade.py +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit.egg-info/dependency_links.txt +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit.egg-info/not-zip-safe +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit.egg-info/requires.txt +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/pybit.egg-info/top_level.txt +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/setup.cfg +0 -0
- {pybit-5.16.1 → pybit-5.17.2}/setup.py +0 -0
|
@@ -1,9 +1,233 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
## [5.17.2] - 2026-10-13
|
|
5
|
+
|
|
6
|
+
### New Methods (20)
|
|
7
|
+
|
|
8
|
+
- `get_option_asset_info`
|
|
9
|
+
- `get_pay_info`
|
|
10
|
+
- `get_trade_info_for_analysis`
|
|
11
|
+
- `get_portfolio_margin`
|
|
12
|
+
- `get_total_members_assets`
|
|
13
|
+
- `list_earn_auto_savings`
|
|
14
|
+
- `edit_earn_auto_savings`
|
|
15
|
+
- `ins_loan_coin_delta_amount`
|
|
16
|
+
- `ins_loan_delay_liq_status`
|
|
17
|
+
- `get_position_symbol_info`
|
|
18
|
+
- `query_fixed_available_inventory`
|
|
19
|
+
- `account_fixed_borrow`
|
|
20
|
+
- `query_fixed_borrow_contracts`
|
|
21
|
+
- `query_fixed_borrow_orders`
|
|
22
|
+
- `query_fixed_borrow_market`
|
|
23
|
+
- `renew_fixed_borrow`
|
|
24
|
+
- `get_spot_margin_trade_flexible_available_inventory`
|
|
25
|
+
- `query_borrow_liability`
|
|
26
|
+
- `get_spread_max_qty`
|
|
27
|
+
- `query_referral_code`
|
|
28
|
+
|
|
29
|
+
### New Endpoint Keys (20)
|
|
30
|
+
|
|
31
|
+
- `Account.GET_OPTION_ASSET_INFO`
|
|
32
|
+
- `Account.GET_PAY_INFO`
|
|
33
|
+
- `Account.GET_TRADE_INFO_FOR_ANALYSIS`
|
|
34
|
+
- `Asset.GET_PORTFOLIO_MARGIN`
|
|
35
|
+
- `Asset.GET_TOTAL_MEMBERS_ASSETS`
|
|
36
|
+
- `Earn.LIST_EARN_AUTO_SAVINGS`
|
|
37
|
+
- `Earn.EDIT_EARN_AUTO_SAVINGS`
|
|
38
|
+
- `InstitutionalLoan.INS_LOAN_COIN_DELTA_AMOUNT`
|
|
39
|
+
- `InstitutionalLoan.INS_LOAN_DELAY_LIQ_STATUS`
|
|
40
|
+
- `Position.GET_POSITION_SYMBOL_INFO`
|
|
41
|
+
- `SpotMarginTrade.QUERY_FIXED_AVAILABLE_INVENTORY`
|
|
42
|
+
- `SpotMarginTrade.ACCOUNT_FIXED_BORROW`
|
|
43
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_CONTRACTS`
|
|
44
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_ORDERS`
|
|
45
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_MARKET`
|
|
46
|
+
- `SpotMarginTrade.RENEW_FIXED_BORROW`
|
|
47
|
+
- `SpotMarginTrade.GET_SPOT_MARGIN_TRADE_FLEXIBLE_AVAILABLE_INVENTORY`
|
|
48
|
+
- `SpotMarginTrade.QUERY_BORROW_LIABILITY`
|
|
49
|
+
- `Spread.GET_SPREAD_MAX_QTY`
|
|
50
|
+
- `User.QUERY_REFERRAL_CODE`
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Serialize GET list parameters as repeated query keys so signatures match the
|
|
55
|
+
transmitted URL.
|
|
56
|
+
- Correct new endpoint documentation links and parameter descriptions.
|
|
57
|
+
|
|
58
|
+
## [5.17.1] - 2026-09-30
|
|
59
|
+
|
|
60
|
+
### New Methods (40)
|
|
61
|
+
|
|
62
|
+
- `get_option_base_coins`
|
|
63
|
+
- `get_crypto_loan_fixed_available_inventory`
|
|
64
|
+
- `get_crypto_loan_flexible_available_inventory`
|
|
65
|
+
- `close_dca_bot`
|
|
66
|
+
- `create_dca_bot`
|
|
67
|
+
- `close_combo_bot`
|
|
68
|
+
- `create_combo_bot`
|
|
69
|
+
- `get_combo_detail`
|
|
70
|
+
- `get_combo_limit`
|
|
71
|
+
- `close_f_grid_bot`
|
|
72
|
+
- `create_f_grid_bot`
|
|
73
|
+
- `get_f_grid_detail`
|
|
74
|
+
- `validate_f_grid_input`
|
|
75
|
+
- `batch_create_tax_reports`
|
|
76
|
+
- `batch_query_tax_reports`
|
|
77
|
+
- `close_f_mart_bot`
|
|
78
|
+
- `create_f_mart_bot`
|
|
79
|
+
- `get_f_mart_detail`
|
|
80
|
+
- `get_f_mart_limit`
|
|
81
|
+
- `close_grid_bot`
|
|
82
|
+
- `create_grid_bot`
|
|
83
|
+
- `query_grid_detail`
|
|
84
|
+
- `validate_grid_input`
|
|
85
|
+
- `get_convert_detail`
|
|
86
|
+
- `get_convert_list`
|
|
87
|
+
- `submit_convert`
|
|
88
|
+
- `get_multiplier_list`
|
|
89
|
+
- `get_market_session`
|
|
90
|
+
- `place_stocks_order`
|
|
91
|
+
- `cancel_stocks_order`
|
|
92
|
+
- `get_stocks_order_detail`
|
|
93
|
+
- `get_stocks_positions`
|
|
94
|
+
- `create_strategy`
|
|
95
|
+
- `create_chase_order_strategy`
|
|
96
|
+
- `create_twap_strategy`
|
|
97
|
+
- `create_iceberg_strategy`
|
|
98
|
+
- `create_pov_strategy`
|
|
99
|
+
- `query_strategy_list`
|
|
100
|
+
- `query_strategy_order_list`
|
|
101
|
+
- `stop_strategy`
|
|
102
|
+
|
|
103
|
+
### New Endpoint Keys (37)
|
|
104
|
+
|
|
105
|
+
- `Market.GET_OPTION_BASE_COINS`
|
|
106
|
+
- `CryptoLoan.GET_CRYPTO_LOAN_FIXED_AVAILABLE_INVENTORY`
|
|
107
|
+
- `CryptoLoan.GET_CRYPTO_LOAN_FLEXIBLE_AVAILABLE_INVENTORY`
|
|
108
|
+
- `DCA.CLOSE_DCA_BOT`
|
|
109
|
+
- `DCA.CREATE_DCA_BOT`
|
|
110
|
+
- `FComboBot.CLOSE_COMBO_BOT`
|
|
111
|
+
- `FComboBot.CREATE_COMBO_BOT`
|
|
112
|
+
- `FComboBot.GET_COMBO_DETAIL`
|
|
113
|
+
- `FComboBot.GET_COMBO_LIMIT`
|
|
114
|
+
- `FGridBot.CLOSE_F_GRID_BOT`
|
|
115
|
+
- `FGridBot.CREATE_F_GRID_BOT`
|
|
116
|
+
- `FGridBot.GET_F_GRID_DETAIL`
|
|
117
|
+
- `FGridBot.VALIDATE_F_GRID_INPUT`
|
|
118
|
+
- `FHT.BATCH_CREATE_TAX_REPORTS`
|
|
119
|
+
- `FHT.BATCH_QUERY_TAX_REPORTS`
|
|
120
|
+
- `FMartingaleBot.CLOSE_F_MART_BOT`
|
|
121
|
+
- `FMartingaleBot.CREATE_F_MART_BOT`
|
|
122
|
+
- `FMartingaleBot.GET_F_MART_DETAIL`
|
|
123
|
+
- `FMartingaleBot.GET_F_MART_LIMIT`
|
|
124
|
+
- `Grid.CLOSE_GRID_BOT`
|
|
125
|
+
- `Grid.CREATE_GRID_BOT`
|
|
126
|
+
- `Grid.QUERY_GRID_DETAIL`
|
|
127
|
+
- `Grid.VALIDATE_GRID_INPUT`
|
|
128
|
+
- `RWA.GET_CONVERT_DETAIL`
|
|
129
|
+
- `RWA.GET_CONVERT_LIST`
|
|
130
|
+
- `RWA.SUBMIT_CONVERT`
|
|
131
|
+
- `RWA.GET_MULTIPLIER_LIST`
|
|
132
|
+
- `RWA.GET_MARKET_SESSION`
|
|
133
|
+
- `RWA.PLACE_STOCKS_ORDER`
|
|
134
|
+
- `RWA.CANCEL_STOCKS_ORDER`
|
|
135
|
+
- `RWA.GET_STOCKS_ORDER_DETAIL`
|
|
136
|
+
- `RWA.GET_STOCKS_POSITIONS`
|
|
137
|
+
- `Strategy.CREATE_STRATEGY`
|
|
138
|
+
- `Strategy.CREATE_CHASE_ORDER_STRATEGY`
|
|
139
|
+
- `Strategy.QUERY_STRATEGY_LIST`
|
|
140
|
+
- `Strategy.QUERY_STRATEGY_ORDER_LIST`
|
|
141
|
+
- `Strategy.STOP_STRATEGY`
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [5.17.0] - 2026-07-08
|
|
145
|
+
|
|
146
|
+
### Changed
|
|
147
|
+
- `WebSocketTrading.place_order` / `amend_order` / `cancel_order` and the
|
|
148
|
+
three `*_batch_order` variants now accept an optional `error_callback`
|
|
149
|
+
parameter. When provided, it is invoked for responses with
|
|
150
|
+
`retCode != 0` (previously such frames were logged at `error` and
|
|
151
|
+
silently dropped, so the success `callback` never saw them). When
|
|
152
|
+
omitted, error frames are logged at `warning` and dropped — preserving
|
|
153
|
+
the previous default behavior. User callbacks are now wrapped in
|
|
154
|
+
`try/except` so an exception inside a callback no longer tears down
|
|
155
|
+
the WS read thread. Frames whose `reqId` has no registered callback
|
|
156
|
+
(stray / duplicate / post-restart) are logged at `warning` and dropped
|
|
157
|
+
instead of raising `KeyError` on the read thread.
|
|
158
|
+
|
|
159
|
+
Migration: to observe order errors, pass `error_callback=` alongside
|
|
160
|
+
`callback=`:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
ws.place_order(callback=on_ack, error_callback=on_err, ...)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### New Methods (64)
|
|
167
|
+
- `get_affiliate_sub_list()`
|
|
168
|
+
- `add_liquidity()`
|
|
169
|
+
- `add_margin()`
|
|
170
|
+
- `claim_liquidity_interest()`
|
|
171
|
+
- `get_advance_earn_order()`
|
|
172
|
+
- `get_advance_earn_position()`
|
|
173
|
+
- `get_advance_earn_product()`
|
|
174
|
+
- `get_advance_earn_product_extra_info()`
|
|
175
|
+
- `get_double_win_leverage()`
|
|
176
|
+
- `get_earn_apr_history()`
|
|
177
|
+
- `get_fixed_term_order()`
|
|
178
|
+
- `get_fixed_term_position()`
|
|
179
|
+
- `get_fixed_term_product()`
|
|
180
|
+
- `get_hold_to_earn_product()`
|
|
181
|
+
- `get_hold_to_earn_yield_history()`
|
|
182
|
+
- `get_liquidity_mining_liquidation_records()`
|
|
183
|
+
- `get_liquidity_mining_orders()`
|
|
184
|
+
- `get_liquidity_mining_positions()`
|
|
185
|
+
- `get_liquidity_mining_products()`
|
|
186
|
+
- `get_liquidity_mining_yield_records()`
|
|
187
|
+
- `get_rwa_nav_chart()`
|
|
188
|
+
- `get_rwa_order_list()`
|
|
189
|
+
- `get_rwa_position_list()`
|
|
190
|
+
- `get_rwa_product_list()`
|
|
191
|
+
- `get_smart_leverage_redeem_est_amount_list()`
|
|
192
|
+
- `get_token_daily_yield()`
|
|
193
|
+
- `get_token_historical_apr()`
|
|
194
|
+
- `get_token_hourly_yield()`
|
|
195
|
+
- `get_token_order_list()`
|
|
196
|
+
- `get_token_position()`
|
|
197
|
+
- `get_token_product()`
|
|
198
|
+
- `list_earn_coupons()`
|
|
199
|
+
- `modify_earn_position()`
|
|
200
|
+
- `place_advance_earn_order()`
|
|
201
|
+
- `place_fixed_term_order()`
|
|
202
|
+
- `place_rwa_order()`
|
|
203
|
+
- `place_token_order()`
|
|
204
|
+
- `pwm_asset_trend()`
|
|
205
|
+
- `pwm_claim()`
|
|
206
|
+
- `pwm_create_custom_plan()`
|
|
207
|
+
- `pwm_fund_nav()`
|
|
208
|
+
- `pwm_fund_transfer()`
|
|
209
|
+
- `pwm_get_new_plan_detail()`
|
|
210
|
+
- `pwm_get_plan_detail()`
|
|
211
|
+
- `pwm_inst_create_fund()`
|
|
212
|
+
- `pwm_inst_create_investment_plan()`
|
|
213
|
+
- `pwm_inst_create_sub_account()`
|
|
214
|
+
- `pwm_inst_get_investment_plans()`
|
|
215
|
+
- `pwm_inst_list_funds()`
|
|
216
|
+
- `pwm_inst_list_orders()`
|
|
217
|
+
- `pwm_inst_manage_investment_plan()`
|
|
218
|
+
- `pwm_inst_manage_order()`
|
|
219
|
+
- `pwm_inst_settle_profit()`
|
|
220
|
+
- `pwm_invest_more()`
|
|
221
|
+
- `pwm_list_investment_plans()`
|
|
222
|
+
- `pwm_list_order()`
|
|
223
|
+
- `pwm_list_product_cards()`
|
|
224
|
+
- `pwm_query_fund_transfer_result()`
|
|
225
|
+
- `pwm_redeem()`
|
|
226
|
+
- `pwm_subscribe()`
|
|
227
|
+
- `redeem_fixed_term()`
|
|
228
|
+
- `reinvest_liquidity()`
|
|
229
|
+
- `remove_liquidity()`
|
|
230
|
+
- `set_fixed_term_auto_invest()`
|
|
7
231
|
|
|
8
232
|
## [5.16.1] - 2026-07-07
|
|
9
233
|
- *Release:* Add autoRelease
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "5.17.2"
|
|
@@ -181,9 +181,11 @@ class _V5HTTPManager:
|
|
|
181
181
|
if method == "GET":
|
|
182
182
|
payload = "&".join(
|
|
183
183
|
[
|
|
184
|
-
str(k) + "=" + str(
|
|
184
|
+
str(k) + "=" + str(item)
|
|
185
185
|
for k, v in sorted(parameters.items())
|
|
186
186
|
if v is not None
|
|
187
|
+
for item in (v if isinstance(v, list) else [v])
|
|
188
|
+
if item is not None
|
|
187
189
|
]
|
|
188
190
|
)
|
|
189
191
|
return payload
|
|
@@ -499,3 +499,48 @@ class AccountHTTP(_V5HTTPManager):
|
|
|
499
499
|
query=kwargs,
|
|
500
500
|
auth=True,
|
|
501
501
|
)
|
|
502
|
+
|
|
503
|
+
def get_option_asset_info(self, **kwargs):
|
|
504
|
+
"""Get Option Asset Info
|
|
505
|
+
Returns:
|
|
506
|
+
Request results as dictionary.
|
|
507
|
+
|
|
508
|
+
Additional information:
|
|
509
|
+
https://bybit-exchange.github.io/docs/v5/account/option-asset-info
|
|
510
|
+
"""
|
|
511
|
+
return self._submit_request(
|
|
512
|
+
method="GET",
|
|
513
|
+
path=f"{self.endpoint}{Account.GET_OPTION_ASSET_INFO}",
|
|
514
|
+
query=kwargs,
|
|
515
|
+
auth=True,
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
def get_pay_info(self, **kwargs):
|
|
519
|
+
"""Get Pay Info
|
|
520
|
+
Returns:
|
|
521
|
+
Request results as dictionary.
|
|
522
|
+
|
|
523
|
+
Additional information:
|
|
524
|
+
https://bybit-exchange.github.io/docs/v5/account/pay-info
|
|
525
|
+
"""
|
|
526
|
+
return self._submit_request(
|
|
527
|
+
method="GET",
|
|
528
|
+
path=f"{self.endpoint}{Account.GET_PAY_INFO}",
|
|
529
|
+
query=kwargs,
|
|
530
|
+
auth=True,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
def get_trade_info_for_analysis(self, **kwargs):
|
|
534
|
+
"""Get Trade Info For Analysis
|
|
535
|
+
Returns:
|
|
536
|
+
Request results as dictionary.
|
|
537
|
+
|
|
538
|
+
Additional information:
|
|
539
|
+
https://bybit-exchange.github.io/docs/v5/account/trade-info-for-analysis
|
|
540
|
+
"""
|
|
541
|
+
return self._submit_request(
|
|
542
|
+
method="GET",
|
|
543
|
+
path=f"{self.endpoint}{Account.GET_TRADE_INFO_FOR_ANALYSIS}",
|
|
544
|
+
query=kwargs,
|
|
545
|
+
auth=True,
|
|
546
|
+
)
|
|
@@ -824,3 +824,33 @@ class AssetHTTP(_V5HTTPManager):
|
|
|
824
824
|
query=kwargs,
|
|
825
825
|
auth=True,
|
|
826
826
|
)
|
|
827
|
+
|
|
828
|
+
def get_portfolio_margin(self, **kwargs):
|
|
829
|
+
"""Get Portfolio Margin Info
|
|
830
|
+
Returns:
|
|
831
|
+
Request results as dictionary.
|
|
832
|
+
|
|
833
|
+
Additional information:
|
|
834
|
+
https://bybit-exchange.github.io/docs/v5/asset/portfolio-margin
|
|
835
|
+
"""
|
|
836
|
+
return self._submit_request(
|
|
837
|
+
method="GET",
|
|
838
|
+
path=f"{self.endpoint}{Asset.GET_PORTFOLIO_MARGIN}",
|
|
839
|
+
query=kwargs,
|
|
840
|
+
auth=True,
|
|
841
|
+
)
|
|
842
|
+
|
|
843
|
+
def get_total_members_assets(self, **kwargs):
|
|
844
|
+
"""Get Total Members Assets
|
|
845
|
+
Returns:
|
|
846
|
+
Request results as dictionary.
|
|
847
|
+
|
|
848
|
+
Additional information:
|
|
849
|
+
https://bybit-exchange.github.io/docs/v5/asset/total-members-assets
|
|
850
|
+
"""
|
|
851
|
+
return self._submit_request(
|
|
852
|
+
method="GET",
|
|
853
|
+
path=f"{self.endpoint}{Asset.GET_TOTAL_MEMBERS_ASSETS}",
|
|
854
|
+
query=kwargs,
|
|
855
|
+
auth=True,
|
|
856
|
+
)
|
|
@@ -342,6 +342,25 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
342
342
|
auth=True,
|
|
343
343
|
)
|
|
344
344
|
|
|
345
|
+
def get_crypto_loan_flexible_available_inventory(self, **kwargs):
|
|
346
|
+
"""Get flexible crypto-loan available inventory.
|
|
347
|
+
|
|
348
|
+
Required args:
|
|
349
|
+
currency (string): Coin name, uppercase only
|
|
350
|
+
|
|
351
|
+
Returns:
|
|
352
|
+
Request results as dictionary.
|
|
353
|
+
|
|
354
|
+
Additional information:
|
|
355
|
+
https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/available-inventory
|
|
356
|
+
"""
|
|
357
|
+
return self._submit_request(
|
|
358
|
+
method="GET",
|
|
359
|
+
path=f"{self.endpoint}{CryptoLoan.GET_CRYPTO_LOAN_FLEXIBLE_AVAILABLE_INVENTORY}",
|
|
360
|
+
query=kwargs,
|
|
361
|
+
auth=True,
|
|
362
|
+
)
|
|
363
|
+
|
|
345
364
|
def borrow_flexible_crypto_loan(self, **kwargs):
|
|
346
365
|
"""
|
|
347
366
|
Required args:
|
|
@@ -450,6 +469,27 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
450
469
|
auth=True,
|
|
451
470
|
)
|
|
452
471
|
|
|
472
|
+
def get_crypto_loan_fixed_available_inventory(self, **kwargs):
|
|
473
|
+
"""Get fixed-term crypto-loan available inventory.
|
|
474
|
+
|
|
475
|
+
Required args:
|
|
476
|
+
currency (string): Coin name, uppercase only
|
|
477
|
+
term (string): Fixed term in days
|
|
478
|
+
annualRate (string): Annual interest rate, e.g. 0.02 means 2%
|
|
479
|
+
|
|
480
|
+
Returns:
|
|
481
|
+
Request results as dictionary.
|
|
482
|
+
|
|
483
|
+
Additional information:
|
|
484
|
+
https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/available-inventory
|
|
485
|
+
"""
|
|
486
|
+
return self._submit_request(
|
|
487
|
+
method="GET",
|
|
488
|
+
path=f"{self.endpoint}{CryptoLoan.GET_CRYPTO_LOAN_FIXED_AVAILABLE_INVENTORY}",
|
|
489
|
+
query=kwargs,
|
|
490
|
+
auth=True,
|
|
491
|
+
)
|
|
492
|
+
|
|
453
493
|
def get_lending_market_fixed_crypto_loan(self, **kwargs):
|
|
454
494
|
"""
|
|
455
495
|
If you want to lend, you can use this endpoint to check whether there
|
|
@@ -697,4 +737,4 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
697
737
|
path=f"{self.endpoint}{CryptoLoan.GET_MAX_LOAN_AMOUNT_NEW_CRYPTO_LOAN}",
|
|
698
738
|
query=kwargs,
|
|
699
739
|
auth=True,
|
|
700
|
-
)
|
|
740
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from ._http_manager import _V5HTTPManager
|
|
2
|
+
from .dca import DCA
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DCAHTTP(_V5HTTPManager):
|
|
6
|
+
def close_dca_bot(self, **kwargs):
|
|
7
|
+
"""Close a running DCA bot with a specified settlement mode.
|
|
8
|
+
|
|
9
|
+
Required args:
|
|
10
|
+
bot_id (integer): DCA bot ID to close.
|
|
11
|
+
close_mode (integer): Asset settlement mode on close.
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
Request results as dictionary.
|
|
15
|
+
|
|
16
|
+
Additional information:
|
|
17
|
+
https://bybit-exchange.github.io/docs/v5/bot/dca/close
|
|
18
|
+
"""
|
|
19
|
+
return self._submit_request(
|
|
20
|
+
method="POST",
|
|
21
|
+
path=f"{self.endpoint}{DCA.CLOSE_DCA_BOT}",
|
|
22
|
+
query=kwargs,
|
|
23
|
+
auth=True,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def create_dca_bot(self, **kwargs):
|
|
27
|
+
"""Create a new DCA (Dollar-Cost Averaging) bot with custom parameters.
|
|
28
|
+
|
|
29
|
+
Required args:
|
|
30
|
+
parameters (object): DCA bot configuration parameters.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
Request results as dictionary.
|
|
34
|
+
|
|
35
|
+
Additional information:
|
|
36
|
+
https://bybit-exchange.github.io/docs/v5/bot/dca/create
|
|
37
|
+
"""
|
|
38
|
+
return self._submit_request(
|
|
39
|
+
method="POST",
|
|
40
|
+
path=f"{self.endpoint}{DCA.CREATE_DCA_BOT}",
|
|
41
|
+
query=kwargs,
|
|
42
|
+
auth=True,
|
|
43
|
+
)
|