bitmex-api 0.0.15__py3-none-any.whl → 0.0.17__py3-none-any.whl
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.
@@ -0,0 +1,267 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: bitmex-api
|
3
|
+
Version: 0.0.17
|
4
|
+
Summary: bitmex crypto exchange api client
|
5
|
+
Project-URL: Homepage, https://github.com/ccxt/ccxt
|
6
|
+
Project-URL: Issues, https://github.com/ccxt/ccxt
|
7
|
+
Author-email: CCXT <info@ccxt.trade>
|
8
|
+
License: MIT
|
9
|
+
Classifier: Intended Audience :: Developers
|
10
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
11
|
+
Classifier: Intended Audience :: Information Technology
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
16
|
+
Classifier: Topic :: Software Development :: Build Tools
|
17
|
+
Requires-Python: >=3.8
|
18
|
+
Description-Content-Type: text/markdown
|
19
|
+
|
20
|
+
# bitmex-python
|
21
|
+
Python SDK (sync and async) for Bitmex cryptocurrency exchange with Rest and WS capabilities.
|
22
|
+
|
23
|
+
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/bitmex)
|
24
|
+
You can check Bitmex's docs here: [Docs](https://ccxt.com)
|
25
|
+
|
26
|
+
|
27
|
+
## Installation
|
28
|
+
|
29
|
+
```
|
30
|
+
pip install bitmex-api
|
31
|
+
```
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
### Sync
|
36
|
+
|
37
|
+
```Python
|
38
|
+
from bitmex import BitmexSync
|
39
|
+
|
40
|
+
def main():
|
41
|
+
instance = BitmexSync({})
|
42
|
+
ob = instance.fetch_order_book("BTC/USDC")
|
43
|
+
print(ob)
|
44
|
+
#
|
45
|
+
# balance = instance.fetch_balance()
|
46
|
+
# order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
|
47
|
+
```
|
48
|
+
|
49
|
+
### Async
|
50
|
+
|
51
|
+
```Python
|
52
|
+
import asyncio
|
53
|
+
from bitmex import BitmexAsync
|
54
|
+
|
55
|
+
async def main():
|
56
|
+
instance = BitmexAsync({})
|
57
|
+
ob = await instance.fetch_order_book("BTC/USDC")
|
58
|
+
print(ob)
|
59
|
+
#
|
60
|
+
# balance = await instance.fetch_balance()
|
61
|
+
# order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
|
62
|
+
|
63
|
+
asyncio.run(main())
|
64
|
+
```
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
### Websockets
|
69
|
+
|
70
|
+
```Python
|
71
|
+
from bitmex import BitmexWs
|
72
|
+
|
73
|
+
async def main():
|
74
|
+
instance = BitmexWs({})
|
75
|
+
while True:
|
76
|
+
ob = await instance.watch_order_book("BTC/USDC")
|
77
|
+
print(ob)
|
78
|
+
# orders = await instance.watch_orders("BTC/USDC")
|
79
|
+
```
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
#### Raw call
|
86
|
+
|
87
|
+
You can also construct custom requests to available "implicit" endpoints
|
88
|
+
|
89
|
+
```Python
|
90
|
+
request = {
|
91
|
+
'type': 'candleSnapshot',
|
92
|
+
'req': {
|
93
|
+
'coin': coin,
|
94
|
+
'interval': tf,
|
95
|
+
'startTime': since,
|
96
|
+
'endTime': until,
|
97
|
+
},
|
98
|
+
}
|
99
|
+
response = await instance.public_post_info(request)
|
100
|
+
```
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
## Available methods
|
106
|
+
|
107
|
+
### REST Unified
|
108
|
+
|
109
|
+
- `create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`
|
110
|
+
- `fetch_balance(self, params={})`
|
111
|
+
- `fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
112
|
+
- `fetch_currencies(self, params={})`
|
113
|
+
- `fetch_deposit_address(self, code: str, params={})`
|
114
|
+
- `fetch_deposit_withdraw_fees(self, codes: Strings = None, params={})`
|
115
|
+
- `fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
116
|
+
- `fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
117
|
+
- `fetch_funding_rates(self, symbols: Strings = None, params={})`
|
118
|
+
- `fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
119
|
+
- `fetch_leverages(self, symbols: Strings = None, params={})`
|
120
|
+
- `fetch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
121
|
+
- `fetch_markets(self, params={})`
|
122
|
+
- `fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
123
|
+
- `fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`
|
124
|
+
- `fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
125
|
+
- `fetch_order_book(self, symbol: str, limit: Int = None, params={})`
|
126
|
+
- `fetch_order(self, id: str, symbol: Str = None, params={})`
|
127
|
+
- `fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
128
|
+
- `fetch_positions(self, symbols: Strings = None, params={})`
|
129
|
+
- `fetch_ticker(self, symbol: str, params={})`
|
130
|
+
- `fetch_tickers(self, symbols: Strings = None, params={})`
|
131
|
+
- `fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
132
|
+
- `amount_to_precision(self, symbol, amount)`
|
133
|
+
- `calculate_rate_limiter_cost(self, api, method, path, params, config={})`
|
134
|
+
- `cancel_all_orders_after(self, timeout: Int, params={})`
|
135
|
+
- `cancel_all_orders(self, symbol: Str = None, params={})`
|
136
|
+
- `cancel_order(self, id: str, symbol: Str = None, params={})`
|
137
|
+
- `cancel_orders(self, ids, symbol: Str = None, params={})`
|
138
|
+
- `convert_from_raw_cost(self, symbol, rawQuantity)`
|
139
|
+
- `convert_from_raw_quantity(self, symbol, rawQuantity, currencySide='base')`
|
140
|
+
- `convert_from_real_amount(self, code, amount)`
|
141
|
+
- `convert_to_real_amount(self, code: Str, amount: Str)`
|
142
|
+
- `describe(self)`
|
143
|
+
- `edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
|
144
|
+
- `nonce(self)`
|
145
|
+
- `set_leverage(self, leverage: Int, symbol: Str = None, params={})`
|
146
|
+
- `set_margin_mode(self, marginMode: str, symbol: Str = None, params={})`
|
147
|
+
- `withdraw(self, code: str, amount: float, address: str, tag=None, params={})`
|
148
|
+
|
149
|
+
### REST Raw
|
150
|
+
|
151
|
+
- `public_get_announcement(request)`
|
152
|
+
- `public_get_announcement_urgent(request)`
|
153
|
+
- `public_get_chat(request)`
|
154
|
+
- `public_get_chat_channels(request)`
|
155
|
+
- `public_get_chat_connected(request)`
|
156
|
+
- `public_get_chat_pinned(request)`
|
157
|
+
- `public_get_funding(request)`
|
158
|
+
- `public_get_guild(request)`
|
159
|
+
- `public_get_instrument(request)`
|
160
|
+
- `public_get_instrument_active(request)`
|
161
|
+
- `public_get_instrument_activeandindices(request)`
|
162
|
+
- `public_get_instrument_activeintervals(request)`
|
163
|
+
- `public_get_instrument_compositeindex(request)`
|
164
|
+
- `public_get_instrument_indices(request)`
|
165
|
+
- `public_get_instrument_usdvolume(request)`
|
166
|
+
- `public_get_insurance(request)`
|
167
|
+
- `public_get_leaderboard(request)`
|
168
|
+
- `public_get_liquidation(request)`
|
169
|
+
- `public_get_orderbook_l2(request)`
|
170
|
+
- `public_get_porl_nonce(request)`
|
171
|
+
- `public_get_quote(request)`
|
172
|
+
- `public_get_quote_bucketed(request)`
|
173
|
+
- `public_get_schema(request)`
|
174
|
+
- `public_get_schema_websockethelp(request)`
|
175
|
+
- `public_get_settlement(request)`
|
176
|
+
- `public_get_stats(request)`
|
177
|
+
- `public_get_stats_history(request)`
|
178
|
+
- `public_get_stats_historyusd(request)`
|
179
|
+
- `public_get_trade(request)`
|
180
|
+
- `public_get_trade_bucketed(request)`
|
181
|
+
- `public_get_wallet_assets(request)`
|
182
|
+
- `public_get_wallet_networks(request)`
|
183
|
+
- `private_get_address(request)`
|
184
|
+
- `private_get_apikey(request)`
|
185
|
+
- `private_get_execution(request)`
|
186
|
+
- `private_get_execution_tradehistory(request)`
|
187
|
+
- `private_get_globalnotification(request)`
|
188
|
+
- `private_get_leaderboard_name(request)`
|
189
|
+
- `private_get_order(request)`
|
190
|
+
- `private_get_porl_snapshots(request)`
|
191
|
+
- `private_get_position(request)`
|
192
|
+
- `private_get_user(request)`
|
193
|
+
- `private_get_user_affiliatestatus(request)`
|
194
|
+
- `private_get_user_checkreferralcode(request)`
|
195
|
+
- `private_get_user_commission(request)`
|
196
|
+
- `private_get_user_csa(request)`
|
197
|
+
- `private_get_user_depositaddress(request)`
|
198
|
+
- `private_get_user_executionhistory(request)`
|
199
|
+
- `private_get_user_getwallettransferaccounts(request)`
|
200
|
+
- `private_get_user_margin(request)`
|
201
|
+
- `private_get_user_quotefillratio(request)`
|
202
|
+
- `private_get_user_quotevalueratio(request)`
|
203
|
+
- `private_get_user_staking(request)`
|
204
|
+
- `private_get_user_staking_instruments(request)`
|
205
|
+
- `private_get_user_staking_tiers(request)`
|
206
|
+
- `private_get_user_tradingvolume(request)`
|
207
|
+
- `private_get_user_unstakingrequests(request)`
|
208
|
+
- `private_get_user_wallet(request)`
|
209
|
+
- `private_get_user_wallethistory(request)`
|
210
|
+
- `private_get_user_walletsummary(request)`
|
211
|
+
- `private_get_useraffiliates(request)`
|
212
|
+
- `private_get_userevent(request)`
|
213
|
+
- `private_post_address(request)`
|
214
|
+
- `private_post_chat(request)`
|
215
|
+
- `private_post_guild(request)`
|
216
|
+
- `private_post_guild_archive(request)`
|
217
|
+
- `private_post_guild_join(request)`
|
218
|
+
- `private_post_guild_kick(request)`
|
219
|
+
- `private_post_guild_leave(request)`
|
220
|
+
- `private_post_guild_sharestrades(request)`
|
221
|
+
- `private_post_order(request)`
|
222
|
+
- `private_post_order_cancelallafter(request)`
|
223
|
+
- `private_post_order_closeposition(request)`
|
224
|
+
- `private_post_position_isolate(request)`
|
225
|
+
- `private_post_position_leverage(request)`
|
226
|
+
- `private_post_position_risklimit(request)`
|
227
|
+
- `private_post_position_transfermargin(request)`
|
228
|
+
- `private_post_user_addsubaccount(request)`
|
229
|
+
- `private_post_user_cancelwithdrawal(request)`
|
230
|
+
- `private_post_user_communicationtoken(request)`
|
231
|
+
- `private_post_user_confirmemail(request)`
|
232
|
+
- `private_post_user_confirmwithdrawal(request)`
|
233
|
+
- `private_post_user_logout(request)`
|
234
|
+
- `private_post_user_preferences(request)`
|
235
|
+
- `private_post_user_requestwithdrawal(request)`
|
236
|
+
- `private_post_user_unstakingrequests(request)`
|
237
|
+
- `private_post_user_updatesubaccount(request)`
|
238
|
+
- `private_post_user_wallettransfer(request)`
|
239
|
+
- `private_put_guild(request)`
|
240
|
+
- `private_put_order(request)`
|
241
|
+
- `private_delete_order(request)`
|
242
|
+
- `private_delete_order_all(request)`
|
243
|
+
- `private_delete_user_unstakingrequests(request)`
|
244
|
+
|
245
|
+
### WS Unified
|
246
|
+
|
247
|
+
- `describe(self)`
|
248
|
+
- `watch_ticker(self, symbol: str, params={})`
|
249
|
+
- `watch_tickers(self, symbols: Strings = None, params={})`
|
250
|
+
- `watch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
251
|
+
- `watch_liquidations_for_symbols(self, symbols: List[str] = None, since: Int = None, limit: Int = None, params={})`
|
252
|
+
- `watch_balance(self, params={})`
|
253
|
+
- `watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
254
|
+
- `authenticate(self, params={})`
|
255
|
+
- `watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={})`
|
256
|
+
- `watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
257
|
+
- `watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
258
|
+
- `watch_order_book(self, symbol: str, limit: Int = None, params={})`
|
259
|
+
- `watch_order_book_for_symbols(self, symbols: List[str], limit: Int = None, params={})`
|
260
|
+
- `watch_trades_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={})`
|
261
|
+
- `watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`
|
262
|
+
- `watch_heartbeat(self, params={})`
|
263
|
+
|
264
|
+
## Contribution
|
265
|
+
- Give us a star :star:
|
266
|
+
- Fork and Clone! Awesome
|
267
|
+
- Select existing issues or create a new issue.
|
@@ -283,6 +283,6 @@ bitmex/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
|
|
283
283
|
bitmex/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
|
284
284
|
bitmex/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
285
285
|
bitmex/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
|
286
|
-
bitmex_api-0.0.
|
287
|
-
bitmex_api-0.0.
|
288
|
-
bitmex_api-0.0.
|
286
|
+
bitmex_api-0.0.17.dist-info/METADATA,sha256=x0gxjDOUo6lcYLS-4TLU16G7rR0h82_VR1GjQJIcTwg,10184
|
287
|
+
bitmex_api-0.0.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
288
|
+
bitmex_api-0.0.17.dist-info/RECORD,,
|
@@ -1,79 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: bitmex-api
|
3
|
-
Version: 0.0.15
|
4
|
-
Summary: bitmex crypto exchange api client
|
5
|
-
Project-URL: Homepage, https://github.com/ccxt/ccxt
|
6
|
-
Project-URL: Issues, https://github.com/ccxt/ccxt
|
7
|
-
Author-email: CCXT <info@ccxt.trade>
|
8
|
-
License: MIT
|
9
|
-
Classifier: Intended Audience :: Developers
|
10
|
-
Classifier: Intended Audience :: Financial and Insurance Industry
|
11
|
-
Classifier: Intended Audience :: Information Technology
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
13
|
-
Classifier: Operating System :: OS Independent
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Topic :: Office/Business :: Financial :: Investment
|
16
|
-
Classifier: Topic :: Software Development :: Build Tools
|
17
|
-
Requires-Python: >=3.8
|
18
|
-
Description-Content-Type: text/markdown
|
19
|
-
|
20
|
-
# bitmex-python
|
21
|
-
Python SDK (sync and async) for Bitmex cryptocurrency exchange with Rest and WS capabilities.
|
22
|
-
|
23
|
-
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/bitmex)
|
24
|
-
You can check Bitmex's docs here: [Docs](https://ccxt.com)
|
25
|
-
|
26
|
-
*This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly*
|
27
|
-
|
28
|
-
## Installation
|
29
|
-
|
30
|
-
```
|
31
|
-
pip install bitmex-api
|
32
|
-
```
|
33
|
-
|
34
|
-
## Usage
|
35
|
-
|
36
|
-
### Sync
|
37
|
-
|
38
|
-
```Python
|
39
|
-
from bitmex import BitmexSync
|
40
|
-
|
41
|
-
def main():
|
42
|
-
instance = BitmexSync({})
|
43
|
-
ob = instance.fetch_order_book("BTC/USDC")
|
44
|
-
print(ob)
|
45
|
-
#
|
46
|
-
# balance = instance.fetch_balance()
|
47
|
-
# order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
|
48
|
-
```
|
49
|
-
|
50
|
-
### Async
|
51
|
-
|
52
|
-
```Python
|
53
|
-
import asyncio
|
54
|
-
from bitmex import BitmexAsync
|
55
|
-
|
56
|
-
async def main():
|
57
|
-
instance = BitmexAsync({})
|
58
|
-
ob = await instance.fetch_order_book("BTC/USDC")
|
59
|
-
print(ob)
|
60
|
-
#
|
61
|
-
# balance = await instance.fetch_balance()
|
62
|
-
# order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
|
63
|
-
|
64
|
-
asyncio.run(main())
|
65
|
-
```
|
66
|
-
|
67
|
-
### Websockets
|
68
|
-
|
69
|
-
```Python
|
70
|
-
from bitmex import BitmexWs
|
71
|
-
|
72
|
-
async def main():
|
73
|
-
instance = BitmexWs({})
|
74
|
-
while True:
|
75
|
-
ob = await instance.watch_order_book("BTC/USDC")
|
76
|
-
print(ob)
|
77
|
-
# orders = await instance.watch_orders("BTC/USDC")
|
78
|
-
```
|
79
|
-
|
File without changes
|