gate-io-api 0.0.16__py3-none-any.whl → 0.0.18__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.
Potentially problematic release.
This version of gate-io-api might be problematic. Click here for more details.
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gate-io-api
|
|
3
|
+
Version: 0.0.18
|
|
4
|
+
Summary: gate 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
|
+
# gate-python
|
|
21
|
+
Python SDK (sync and async) for Gate cryptocurrency exchange with Rest and WS capabilities.
|
|
22
|
+
|
|
23
|
+
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/gate)
|
|
24
|
+
You can check Gate's docs here: [Docs](https://ccxt.com)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
pip install gate-io-api
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Sync
|
|
36
|
+
|
|
37
|
+
```Python
|
|
38
|
+
from gate import GateSync
|
|
39
|
+
|
|
40
|
+
def main():
|
|
41
|
+
instance = GateSync({})
|
|
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 gate import GateAsync
|
|
54
|
+
|
|
55
|
+
async def main():
|
|
56
|
+
instance = GateAsync({})
|
|
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 gate import GateWs
|
|
72
|
+
|
|
73
|
+
async def main():
|
|
74
|
+
instance = GateWs({})
|
|
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_expired_option_market(self, symbol: str)`
|
|
110
|
+
- `create_market_buy_order_with_cost(self, symbol: str, cost: float, params={})`
|
|
111
|
+
- `create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`
|
|
112
|
+
- `create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`
|
|
113
|
+
- `create_orders_request(self, orders: List[OrderRequest], params={})`
|
|
114
|
+
- `create_orders(self, orders: List[OrderRequest], params={})`
|
|
115
|
+
- `fetch_balance(self, params={})`
|
|
116
|
+
- `fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
117
|
+
- `fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
118
|
+
- `fetch_contract_markets(self, params={})`
|
|
119
|
+
- `fetch_currencies(self, params={})`
|
|
120
|
+
- `fetch_deposit_address(self, code: str, params={})`
|
|
121
|
+
- `fetch_deposit_addresses_by_network(self, code: str, params={})`
|
|
122
|
+
- `fetch_deposit_withdraw_fees(self, codes: Strings = None, params={})`
|
|
123
|
+
- `fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
124
|
+
- `fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
125
|
+
- `fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
126
|
+
- `fetch_funding_rate(self, symbol: str, params={})`
|
|
127
|
+
- `fetch_funding_rates(self, symbols: Strings = None, params={})`
|
|
128
|
+
- `fetch_greeks(self, symbol: str, params={})`
|
|
129
|
+
- `fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
130
|
+
- `fetch_leverage_tiers(self, symbols: Strings = None, params={})`
|
|
131
|
+
- `fetch_leverage(self, symbol: str, params={})`
|
|
132
|
+
- `fetch_leverages(self, symbols: Strings = None, params={})`
|
|
133
|
+
- `fetch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
|
134
|
+
- `fetch_market_leverage_tiers(self, symbol: str, params={})`
|
|
135
|
+
- `fetch_markets(self, params={})`
|
|
136
|
+
- `fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
137
|
+
- `fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
138
|
+
- `fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
139
|
+
- `fetch_network_deposit_address(self, code: str, params={})`
|
|
140
|
+
- `fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`
|
|
141
|
+
- `fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Int = None, limit: Int = None, params={})`
|
|
142
|
+
- `fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
143
|
+
- `fetch_option_chain(self, code: str, params={})`
|
|
144
|
+
- `fetch_option_markets(self, params={})`
|
|
145
|
+
- `fetch_option_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`
|
|
146
|
+
- `fetch_option_underlyings(self)`
|
|
147
|
+
- `fetch_option(self, symbol: str, params={})`
|
|
148
|
+
- `fetch_order_book(self, symbol: str, limit: Int = None, params={})`
|
|
149
|
+
- `fetch_order_request(self, id: str, symbol: Str = None, params={})`
|
|
150
|
+
- `fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
151
|
+
- `fetch_order(self, id: str, symbol: Str = None, params={})`
|
|
152
|
+
- `fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
153
|
+
- `fetch_position(self, symbol: str, params={})`
|
|
154
|
+
- `fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={})`
|
|
155
|
+
- `fetch_positions(self, symbols: Strings = None, params={})`
|
|
156
|
+
- `fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
157
|
+
- `fetch_spot_markets(self, params={})`
|
|
158
|
+
- `fetch_ticker(self, symbol: str, params={})`
|
|
159
|
+
- `fetch_tickers(self, symbols: Strings = None, params={})`
|
|
160
|
+
- `fetch_time(self, params={})`
|
|
161
|
+
- `fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
|
162
|
+
- `fetch_trading_fee(self, symbol: str, params={})`
|
|
163
|
+
- `fetch_trading_fees(self, params={})`
|
|
164
|
+
- `fetch_transaction_fees(self, codes: Strings = None, params={})`
|
|
165
|
+
- `fetch_underlying_assets(self, params={})`
|
|
166
|
+
- `fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
167
|
+
- `add_margin(self, symbol: str, amount: float, params={})`
|
|
168
|
+
- `borrow_cross_margin(self, code: str, amount: float, params={})`
|
|
169
|
+
- `borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={})`
|
|
170
|
+
- `cancel_all_orders(self, symbol: Str = None, params={})`
|
|
171
|
+
- `cancel_order(self, id: str, symbol: Str = None, params={})`
|
|
172
|
+
- `cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={})`
|
|
173
|
+
- `cancel_orders(self, ids: List[str], symbol: Str = None, params={})`
|
|
174
|
+
- `close_position(self, symbol: str, side: OrderSide = None, params={})`
|
|
175
|
+
- `describe(self)`
|
|
176
|
+
- `edit_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
|
|
177
|
+
- `edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
|
|
178
|
+
- `get_margin_mode(self, trigger, params)`
|
|
179
|
+
- `get_settlement_currencies(self, type, method)`
|
|
180
|
+
- `modify_margin_helper(self, symbol: str, amount, params={})`
|
|
181
|
+
- `multi_order_spot_prepare_request(self, market=None, trigger=False, params={})`
|
|
182
|
+
- `nonce(self)`
|
|
183
|
+
- `prepare_orders_by_status_request(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
184
|
+
- `prepare_request(self, market=None, type=None, params={})`
|
|
185
|
+
- `reduce_margin(self, symbol: str, amount: float, params={})`
|
|
186
|
+
- `repay_cross_margin(self, code: str, amount, params={})`
|
|
187
|
+
- `repay_isolated_margin(self, symbol: str, code: str, amount, params={})`
|
|
188
|
+
- `safe_market(self, marketId: Str = None, market: Market = None, delimiter: Str = None, marketType: Str = None)`
|
|
189
|
+
- `set_leverage(self, leverage: Int, symbol: Str = None, params={})`
|
|
190
|
+
- `set_position_mode(self, hedged: bool, symbol: Str = None, params={})`
|
|
191
|
+
- `set_sandbox_mode(self, enable: bool)`
|
|
192
|
+
- `spot_order_prepare_request(self, market=None, trigger=False, params={})`
|
|
193
|
+
- `transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={})`
|
|
194
|
+
- `upgrade_unified_trade_account(self, params={})`
|
|
195
|
+
- `withdraw(self, code: str, amount: float, address: str, tag=None, params={})`
|
|
196
|
+
|
|
197
|
+
### REST Raw
|
|
198
|
+
|
|
199
|
+
- `public_wallet_get_currency_chains(request)`
|
|
200
|
+
- `public_spot_get_currencies(request)`
|
|
201
|
+
- `public_spot_get_currencies_currency(request)`
|
|
202
|
+
- `public_spot_get_currency_pairs(request)`
|
|
203
|
+
- `public_spot_get_currency_pairs_currency_pair(request)`
|
|
204
|
+
- `public_spot_get_tickers(request)`
|
|
205
|
+
- `public_spot_get_order_book(request)`
|
|
206
|
+
- `public_spot_get_trades(request)`
|
|
207
|
+
- `public_spot_get_candlesticks(request)`
|
|
208
|
+
- `public_spot_get_time(request)`
|
|
209
|
+
- `public_margin_get_currency_pairs(request)`
|
|
210
|
+
- `public_margin_get_currency_pairs_currency_pair(request)`
|
|
211
|
+
- `public_margin_get_funding_book(request)`
|
|
212
|
+
- `public_margin_get_cross_currencies(request)`
|
|
213
|
+
- `public_margin_get_cross_currencies_currency(request)`
|
|
214
|
+
- `public_margin_get_uni_currency_pairs(request)`
|
|
215
|
+
- `public_margin_get_uni_currency_pairs_currency_pair(request)`
|
|
216
|
+
- `public_flash_swap_get_currencies(request)`
|
|
217
|
+
- `public_futures_get_settle_contracts(request)`
|
|
218
|
+
- `public_futures_get_settle_contracts_contract(request)`
|
|
219
|
+
- `public_futures_get_settle_order_book(request)`
|
|
220
|
+
- `public_futures_get_settle_trades(request)`
|
|
221
|
+
- `public_futures_get_settle_candlesticks(request)`
|
|
222
|
+
- `public_futures_get_settle_premium_index(request)`
|
|
223
|
+
- `public_futures_get_settle_tickers(request)`
|
|
224
|
+
- `public_futures_get_settle_funding_rate(request)`
|
|
225
|
+
- `public_futures_get_settle_insurance(request)`
|
|
226
|
+
- `public_futures_get_settle_contract_stats(request)`
|
|
227
|
+
- `public_futures_get_settle_index_constituents_index(request)`
|
|
228
|
+
- `public_futures_get_settle_liq_orders(request)`
|
|
229
|
+
- `public_futures_get_settle_risk_limit_tiers(request)`
|
|
230
|
+
- `public_delivery_get_settle_contracts(request)`
|
|
231
|
+
- `public_delivery_get_settle_contracts_contract(request)`
|
|
232
|
+
- `public_delivery_get_settle_order_book(request)`
|
|
233
|
+
- `public_delivery_get_settle_trades(request)`
|
|
234
|
+
- `public_delivery_get_settle_candlesticks(request)`
|
|
235
|
+
- `public_delivery_get_settle_tickers(request)`
|
|
236
|
+
- `public_delivery_get_settle_insurance(request)`
|
|
237
|
+
- `public_options_get_underlyings(request)`
|
|
238
|
+
- `public_options_get_expirations(request)`
|
|
239
|
+
- `public_options_get_contracts(request)`
|
|
240
|
+
- `public_options_get_contracts_contract(request)`
|
|
241
|
+
- `public_options_get_settlements(request)`
|
|
242
|
+
- `public_options_get_settlements_contract(request)`
|
|
243
|
+
- `public_options_get_order_book(request)`
|
|
244
|
+
- `public_options_get_tickers(request)`
|
|
245
|
+
- `public_options_get_underlying_tickers_underlying(request)`
|
|
246
|
+
- `public_options_get_candlesticks(request)`
|
|
247
|
+
- `public_options_get_underlying_candlesticks(request)`
|
|
248
|
+
- `public_options_get_trades(request)`
|
|
249
|
+
- `public_earn_get_uni_currencies(request)`
|
|
250
|
+
- `public_earn_get_uni_currencies_currency(request)`
|
|
251
|
+
- `private_withdrawals_post_withdrawals(request)`
|
|
252
|
+
- `private_withdrawals_post_push(request)`
|
|
253
|
+
- `private_withdrawals_delete_withdrawals_withdrawal_id(request)`
|
|
254
|
+
- `private_wallet_get_deposit_address(request)`
|
|
255
|
+
- `private_wallet_get_withdrawals(request)`
|
|
256
|
+
- `private_wallet_get_deposits(request)`
|
|
257
|
+
- `private_wallet_get_sub_account_transfers(request)`
|
|
258
|
+
- `private_wallet_get_order_status(request)`
|
|
259
|
+
- `private_wallet_get_withdraw_status(request)`
|
|
260
|
+
- `private_wallet_get_sub_account_balances(request)`
|
|
261
|
+
- `private_wallet_get_sub_account_margin_balances(request)`
|
|
262
|
+
- `private_wallet_get_sub_account_futures_balances(request)`
|
|
263
|
+
- `private_wallet_get_sub_account_cross_margin_balances(request)`
|
|
264
|
+
- `private_wallet_get_saved_address(request)`
|
|
265
|
+
- `private_wallet_get_fee(request)`
|
|
266
|
+
- `private_wallet_get_total_balance(request)`
|
|
267
|
+
- `private_wallet_get_small_balance(request)`
|
|
268
|
+
- `private_wallet_get_small_balance_history(request)`
|
|
269
|
+
- `private_wallet_get_push(request)`
|
|
270
|
+
- `private_wallet_post_transfers(request)`
|
|
271
|
+
- `private_wallet_post_sub_account_transfers(request)`
|
|
272
|
+
- `private_wallet_post_sub_account_to_sub_account(request)`
|
|
273
|
+
- `private_wallet_post_small_balance(request)`
|
|
274
|
+
- `private_subaccounts_get_sub_accounts(request)`
|
|
275
|
+
- `private_subaccounts_get_sub_accounts_user_id(request)`
|
|
276
|
+
- `private_subaccounts_get_sub_accounts_user_id_keys(request)`
|
|
277
|
+
- `private_subaccounts_get_sub_accounts_user_id_keys_key(request)`
|
|
278
|
+
- `private_subaccounts_post_sub_accounts(request)`
|
|
279
|
+
- `private_subaccounts_post_sub_accounts_user_id_keys(request)`
|
|
280
|
+
- `private_subaccounts_post_sub_accounts_user_id_lock(request)`
|
|
281
|
+
- `private_subaccounts_post_sub_accounts_user_id_unlock(request)`
|
|
282
|
+
- `private_subaccounts_put_sub_accounts_user_id_keys_key(request)`
|
|
283
|
+
- `private_subaccounts_delete_sub_accounts_user_id_keys_key(request)`
|
|
284
|
+
- `private_unified_get_accounts(request)`
|
|
285
|
+
- `private_unified_get_account_mode(request)`
|
|
286
|
+
- `private_unified_get_borrowable(request)`
|
|
287
|
+
- `private_unified_get_transferable(request)`
|
|
288
|
+
- `private_unified_get_loans(request)`
|
|
289
|
+
- `private_unified_get_loan_records(request)`
|
|
290
|
+
- `private_unified_get_interest_records(request)`
|
|
291
|
+
- `private_unified_get_estimate_rate(request)`
|
|
292
|
+
- `private_unified_get_currency_discount_tiers(request)`
|
|
293
|
+
- `private_unified_get_risk_units(request)`
|
|
294
|
+
- `private_unified_get_unified_mode(request)`
|
|
295
|
+
- `private_unified_get_loan_margin_tiers(request)`
|
|
296
|
+
- `private_unified_get_leverage_user_currency_config(request)`
|
|
297
|
+
- `private_unified_get_leverage_user_currency_setting(request)`
|
|
298
|
+
- `private_unified_post_account_mode(request)`
|
|
299
|
+
- `private_unified_post_loans(request)`
|
|
300
|
+
- `private_unified_post_portfolio_calculator(request)`
|
|
301
|
+
- `private_unified_post_leverage_user_currency_setting(request)`
|
|
302
|
+
- `private_unified_put_unified_mode(request)`
|
|
303
|
+
- `private_spot_get_fee(request)`
|
|
304
|
+
- `private_spot_get_batch_fee(request)`
|
|
305
|
+
- `private_spot_get_accounts(request)`
|
|
306
|
+
- `private_spot_get_account_book(request)`
|
|
307
|
+
- `private_spot_get_open_orders(request)`
|
|
308
|
+
- `private_spot_get_orders(request)`
|
|
309
|
+
- `private_spot_get_orders_order_id(request)`
|
|
310
|
+
- `private_spot_get_my_trades(request)`
|
|
311
|
+
- `private_spot_get_price_orders(request)`
|
|
312
|
+
- `private_spot_get_price_orders_order_id(request)`
|
|
313
|
+
- `private_spot_post_batch_orders(request)`
|
|
314
|
+
- `private_spot_post_cross_liquidate_orders(request)`
|
|
315
|
+
- `private_spot_post_orders(request)`
|
|
316
|
+
- `private_spot_post_cancel_batch_orders(request)`
|
|
317
|
+
- `private_spot_post_countdown_cancel_all(request)`
|
|
318
|
+
- `private_spot_post_amend_batch_orders(request)`
|
|
319
|
+
- `private_spot_post_price_orders(request)`
|
|
320
|
+
- `private_spot_delete_orders(request)`
|
|
321
|
+
- `private_spot_delete_orders_order_id(request)`
|
|
322
|
+
- `private_spot_delete_price_orders(request)`
|
|
323
|
+
- `private_spot_delete_price_orders_order_id(request)`
|
|
324
|
+
- `private_spot_patch_orders_order_id(request)`
|
|
325
|
+
- `private_margin_get_accounts(request)`
|
|
326
|
+
- `private_margin_get_account_book(request)`
|
|
327
|
+
- `private_margin_get_funding_accounts(request)`
|
|
328
|
+
- `private_margin_get_auto_repay(request)`
|
|
329
|
+
- `private_margin_get_transferable(request)`
|
|
330
|
+
- `private_margin_get_loans(request)`
|
|
331
|
+
- `private_margin_get_loans_loan_id(request)`
|
|
332
|
+
- `private_margin_get_loans_loan_id_repayment(request)`
|
|
333
|
+
- `private_margin_get_loan_records(request)`
|
|
334
|
+
- `private_margin_get_loan_records_loan_record_id(request)`
|
|
335
|
+
- `private_margin_get_borrowable(request)`
|
|
336
|
+
- `private_margin_get_cross_accounts(request)`
|
|
337
|
+
- `private_margin_get_cross_account_book(request)`
|
|
338
|
+
- `private_margin_get_cross_loans(request)`
|
|
339
|
+
- `private_margin_get_cross_loans_loan_id(request)`
|
|
340
|
+
- `private_margin_get_cross_repayments(request)`
|
|
341
|
+
- `private_margin_get_cross_interest_records(request)`
|
|
342
|
+
- `private_margin_get_cross_transferable(request)`
|
|
343
|
+
- `private_margin_get_cross_estimate_rate(request)`
|
|
344
|
+
- `private_margin_get_cross_borrowable(request)`
|
|
345
|
+
- `private_margin_get_uni_estimate_rate(request)`
|
|
346
|
+
- `private_margin_get_uni_loans(request)`
|
|
347
|
+
- `private_margin_get_uni_loan_records(request)`
|
|
348
|
+
- `private_margin_get_uni_interest_records(request)`
|
|
349
|
+
- `private_margin_get_uni_borrowable(request)`
|
|
350
|
+
- `private_margin_post_auto_repay(request)`
|
|
351
|
+
- `private_margin_post_loans(request)`
|
|
352
|
+
- `private_margin_post_merged_loans(request)`
|
|
353
|
+
- `private_margin_post_loans_loan_id_repayment(request)`
|
|
354
|
+
- `private_margin_post_cross_loans(request)`
|
|
355
|
+
- `private_margin_post_cross_repayments(request)`
|
|
356
|
+
- `private_margin_post_uni_loans(request)`
|
|
357
|
+
- `private_margin_patch_loans_loan_id(request)`
|
|
358
|
+
- `private_margin_patch_loan_records_loan_record_id(request)`
|
|
359
|
+
- `private_margin_delete_loans_loan_id(request)`
|
|
360
|
+
- `private_flash_swap_get_currencies(request)`
|
|
361
|
+
- `private_flash_swap_get_currency_pairs(request)`
|
|
362
|
+
- `private_flash_swap_get_orders(request)`
|
|
363
|
+
- `private_flash_swap_get_orders_order_id(request)`
|
|
364
|
+
- `private_flash_swap_post_orders(request)`
|
|
365
|
+
- `private_flash_swap_post_orders_preview(request)`
|
|
366
|
+
- `private_futures_get_settle_accounts(request)`
|
|
367
|
+
- `private_futures_get_settle_account_book(request)`
|
|
368
|
+
- `private_futures_get_settle_positions(request)`
|
|
369
|
+
- `private_futures_get_settle_positions_contract(request)`
|
|
370
|
+
- `private_futures_get_settle_dual_comp_positions_contract(request)`
|
|
371
|
+
- `private_futures_get_settle_orders(request)`
|
|
372
|
+
- `private_futures_get_settle_orders_timerange(request)`
|
|
373
|
+
- `private_futures_get_settle_orders_order_id(request)`
|
|
374
|
+
- `private_futures_get_settle_my_trades(request)`
|
|
375
|
+
- `private_futures_get_settle_my_trades_timerange(request)`
|
|
376
|
+
- `private_futures_get_settle_position_close(request)`
|
|
377
|
+
- `private_futures_get_settle_liquidates(request)`
|
|
378
|
+
- `private_futures_get_settle_auto_deleverages(request)`
|
|
379
|
+
- `private_futures_get_settle_fee(request)`
|
|
380
|
+
- `private_futures_get_settle_risk_limit_tiers(request)`
|
|
381
|
+
- `private_futures_get_settle_price_orders(request)`
|
|
382
|
+
- `private_futures_get_settle_price_orders_order_id(request)`
|
|
383
|
+
- `private_futures_post_settle_positions_contract_margin(request)`
|
|
384
|
+
- `private_futures_post_settle_positions_contract_leverage(request)`
|
|
385
|
+
- `private_futures_post_settle_positions_contract_risk_limit(request)`
|
|
386
|
+
- `private_futures_post_settle_dual_mode(request)`
|
|
387
|
+
- `private_futures_post_settle_dual_comp_positions_contract_margin(request)`
|
|
388
|
+
- `private_futures_post_settle_dual_comp_positions_contract_leverage(request)`
|
|
389
|
+
- `private_futures_post_settle_dual_comp_positions_contract_risk_limit(request)`
|
|
390
|
+
- `private_futures_post_settle_orders(request)`
|
|
391
|
+
- `private_futures_post_settle_batch_orders(request)`
|
|
392
|
+
- `private_futures_post_settle_countdown_cancel_all(request)`
|
|
393
|
+
- `private_futures_post_settle_batch_cancel_orders(request)`
|
|
394
|
+
- `private_futures_post_settle_price_orders(request)`
|
|
395
|
+
- `private_futures_put_settle_orders_order_id(request)`
|
|
396
|
+
- `private_futures_delete_settle_orders(request)`
|
|
397
|
+
- `private_futures_delete_settle_orders_order_id(request)`
|
|
398
|
+
- `private_futures_delete_settle_price_orders(request)`
|
|
399
|
+
- `private_futures_delete_settle_price_orders_order_id(request)`
|
|
400
|
+
- `private_delivery_get_settle_accounts(request)`
|
|
401
|
+
- `private_delivery_get_settle_account_book(request)`
|
|
402
|
+
- `private_delivery_get_settle_positions(request)`
|
|
403
|
+
- `private_delivery_get_settle_positions_contract(request)`
|
|
404
|
+
- `private_delivery_get_settle_orders(request)`
|
|
405
|
+
- `private_delivery_get_settle_orders_order_id(request)`
|
|
406
|
+
- `private_delivery_get_settle_my_trades(request)`
|
|
407
|
+
- `private_delivery_get_settle_position_close(request)`
|
|
408
|
+
- `private_delivery_get_settle_liquidates(request)`
|
|
409
|
+
- `private_delivery_get_settle_settlements(request)`
|
|
410
|
+
- `private_delivery_get_settle_price_orders(request)`
|
|
411
|
+
- `private_delivery_get_settle_price_orders_order_id(request)`
|
|
412
|
+
- `private_delivery_post_settle_positions_contract_margin(request)`
|
|
413
|
+
- `private_delivery_post_settle_positions_contract_leverage(request)`
|
|
414
|
+
- `private_delivery_post_settle_positions_contract_risk_limit(request)`
|
|
415
|
+
- `private_delivery_post_settle_orders(request)`
|
|
416
|
+
- `private_delivery_post_settle_price_orders(request)`
|
|
417
|
+
- `private_delivery_delete_settle_orders(request)`
|
|
418
|
+
- `private_delivery_delete_settle_orders_order_id(request)`
|
|
419
|
+
- `private_delivery_delete_settle_price_orders(request)`
|
|
420
|
+
- `private_delivery_delete_settle_price_orders_order_id(request)`
|
|
421
|
+
- `private_options_get_my_settlements(request)`
|
|
422
|
+
- `private_options_get_accounts(request)`
|
|
423
|
+
- `private_options_get_account_book(request)`
|
|
424
|
+
- `private_options_get_positions(request)`
|
|
425
|
+
- `private_options_get_positions_contract(request)`
|
|
426
|
+
- `private_options_get_position_close(request)`
|
|
427
|
+
- `private_options_get_orders(request)`
|
|
428
|
+
- `private_options_get_orders_order_id(request)`
|
|
429
|
+
- `private_options_get_my_trades(request)`
|
|
430
|
+
- `private_options_get_mmp(request)`
|
|
431
|
+
- `private_options_post_orders(request)`
|
|
432
|
+
- `private_options_post_countdown_cancel_all(request)`
|
|
433
|
+
- `private_options_post_mmp(request)`
|
|
434
|
+
- `private_options_post_mmp_reset(request)`
|
|
435
|
+
- `private_options_delete_orders(request)`
|
|
436
|
+
- `private_options_delete_orders_order_id(request)`
|
|
437
|
+
- `private_earn_get_uni_currencies(request)`
|
|
438
|
+
- `private_earn_get_uni_currencies_currency(request)`
|
|
439
|
+
- `private_earn_get_uni_lends(request)`
|
|
440
|
+
- `private_earn_get_uni_lend_records(request)`
|
|
441
|
+
- `private_earn_get_uni_interests_currency(request)`
|
|
442
|
+
- `private_earn_get_uni_interest_records(request)`
|
|
443
|
+
- `private_earn_get_uni_interest_status_currency(request)`
|
|
444
|
+
- `private_earn_post_uni_lends(request)`
|
|
445
|
+
- `private_earn_put_uni_interest_reinvest(request)`
|
|
446
|
+
- `private_earn_patch_uni_lends(request)`
|
|
447
|
+
- `private_loan_get_collateral_orders(request)`
|
|
448
|
+
- `private_loan_get_collateral_orders_order_id(request)`
|
|
449
|
+
- `private_loan_get_collateral_repay_records(request)`
|
|
450
|
+
- `private_loan_get_collateral_collaterals(request)`
|
|
451
|
+
- `private_loan_get_collateral_total_amount(request)`
|
|
452
|
+
- `private_loan_get_collateral_ltv(request)`
|
|
453
|
+
- `private_loan_get_collateral_currencies(request)`
|
|
454
|
+
- `private_loan_get_multi_collateral_orders(request)`
|
|
455
|
+
- `private_loan_get_multi_collateral_orders_order_id(request)`
|
|
456
|
+
- `private_loan_get_multi_collateral_repay(request)`
|
|
457
|
+
- `private_loan_get_multi_collateral_mortgage(request)`
|
|
458
|
+
- `private_loan_get_multi_collateral_currency_quota(request)`
|
|
459
|
+
- `private_loan_get_multi_collateral_currencies(request)`
|
|
460
|
+
- `private_loan_get_multi_collateral_ltv(request)`
|
|
461
|
+
- `private_loan_get_multi_collateral_fixed_rate(request)`
|
|
462
|
+
- `private_loan_get_multi_collateral_current_rate(request)`
|
|
463
|
+
- `private_loan_post_collateral_orders(request)`
|
|
464
|
+
- `private_loan_post_collateral_repay(request)`
|
|
465
|
+
- `private_loan_post_collateral_collaterals(request)`
|
|
466
|
+
- `private_loan_post_multi_collateral_orders(request)`
|
|
467
|
+
- `private_loan_post_multi_collateral_repay(request)`
|
|
468
|
+
- `private_loan_post_multi_collateral_mortgage(request)`
|
|
469
|
+
- `private_account_get_detail(request)`
|
|
470
|
+
- `private_account_get_rate_limit(request)`
|
|
471
|
+
- `private_account_get_stp_groups(request)`
|
|
472
|
+
- `private_account_get_stp_groups_stp_id_users(request)`
|
|
473
|
+
- `private_account_get_stp_groups_debit_fee(request)`
|
|
474
|
+
- `private_account_post_stp_groups(request)`
|
|
475
|
+
- `private_account_post_stp_groups_stp_id_users(request)`
|
|
476
|
+
- `private_account_delete_stp_groups_stp_id_users(request)`
|
|
477
|
+
- `private_rebate_get_agency_transaction_history(request)`
|
|
478
|
+
- `private_rebate_get_agency_commission_history(request)`
|
|
479
|
+
|
|
480
|
+
### WS Unified
|
|
481
|
+
|
|
482
|
+
- `describe(self)`
|
|
483
|
+
- `create_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`
|
|
484
|
+
- `create_orders_ws(self, orders: List[OrderRequest], params={})`
|
|
485
|
+
- `cancel_all_orders_ws(self, symbol: Str = None, params={})`
|
|
486
|
+
- `cancel_order_ws(self, id: str, symbol: Str = None, params={})`
|
|
487
|
+
- `edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
|
|
488
|
+
- `fetch_order_ws(self, id: str, symbol: Str = None, params={})`
|
|
489
|
+
- `fetch_open_orders_ws(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
490
|
+
- `fetch_closed_orders_ws(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
491
|
+
- `fetch_orders_by_status_ws(self, status: str, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
492
|
+
- `watch_order_book(self, symbol: str, limit: Int = None, params={})`
|
|
493
|
+
- `un_watch_order_book(self, symbol: str, params={})`
|
|
494
|
+
- `get_cache_index(self, orderBook, cache)`
|
|
495
|
+
- `watch_ticker(self, symbol: str, params={})`
|
|
496
|
+
- `watch_tickers(self, symbols: Strings = None, params={})`
|
|
497
|
+
- `watch_bids_asks(self, symbols: Strings = None, params={})`
|
|
498
|
+
- `subscribe_watch_tickers_and_bids_asks(self, symbols: Strings = None, callerMethodName: Str = None, params={})`
|
|
499
|
+
- `watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
|
500
|
+
- `watch_trades_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={})`
|
|
501
|
+
- `un_watch_trades_for_symbols(self, symbols: List[str], params={})`
|
|
502
|
+
- `un_watch_trades(self, symbol: str, params={})`
|
|
503
|
+
- `watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={})`
|
|
504
|
+
- `watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
505
|
+
- `watch_balance(self, params={})`
|
|
506
|
+
- `watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={})`
|
|
507
|
+
- `set_positions_cache(self, client: Client, type, symbols: Strings = None)`
|
|
508
|
+
- `load_positions_snapshot(self, client, messageHash, type)`
|
|
509
|
+
- `watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
|
510
|
+
- `watch_my_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={})`
|
|
511
|
+
- `watch_my_liquidations_for_symbols(self, symbols: List[str] = None, since: Int = None, limit: Int = None, params={})`
|
|
512
|
+
- `clean_cache(self, subscription: dict)`
|
|
513
|
+
- `get_url_by_market(self, market)`
|
|
514
|
+
- `get_type_by_market(self, market: Market)`
|
|
515
|
+
- `get_url_by_market_type(self, type: MarketType, isInverse=False)`
|
|
516
|
+
- `get_market_type_by_url(self, url: str)`
|
|
517
|
+
- `subscribe_public(self, url, messageHash, payload, channel, params={}, subscription=None)`
|
|
518
|
+
- `subscribe_public_multiple(self, url, messageHashes, payload, channel, params={})`
|
|
519
|
+
- `un_subscribe_public_multiple(self, url, topic, symbols, messageHashes, subMessageHashes, payload, channel, params={})`
|
|
520
|
+
- `authenticate(self, url, messageType)`
|
|
521
|
+
- `subscribe_private(self, url, messageHash, payload, channel, params, requiresUid=False)`
|
|
522
|
+
|
|
523
|
+
## Contribution
|
|
524
|
+
- Give us a star :star:
|
|
525
|
+
- Fork and Clone! Awesome
|
|
526
|
+
- Select existing issues or create a new issue.
|
|
@@ -283,6 +283,6 @@ gate/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX2u
|
|
|
283
283
|
gate/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
|
|
284
284
|
gate/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
285
285
|
gate/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
|
|
286
|
-
gate_io_api-0.0.
|
|
287
|
-
gate_io_api-0.0.
|
|
288
|
-
gate_io_api-0.0.
|
|
286
|
+
gate_io_api-0.0.18.dist-info/METADATA,sha256=Wre9X1n69Tpb4X8YJWDwv3uS3HcDKpQ8GlNNwnCAfFs,26154
|
|
287
|
+
gate_io_api-0.0.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
288
|
+
gate_io_api-0.0.18.dist-info/RECORD,,
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gate-io-api
|
|
3
|
-
Version: 0.0.16
|
|
4
|
-
Summary: gate 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
|
-
# gate-python
|
|
21
|
-
Python SDK (sync and async) for Gate cryptocurrency exchange with Rest and WS capabilities.
|
|
22
|
-
|
|
23
|
-
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/gate)
|
|
24
|
-
You can check Gate'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 gate-io-api
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Usage
|
|
35
|
-
|
|
36
|
-
### Sync
|
|
37
|
-
|
|
38
|
-
```Python
|
|
39
|
-
from gate import GateSync
|
|
40
|
-
|
|
41
|
-
def main():
|
|
42
|
-
instance = GateSync({})
|
|
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 gate import GateAsync
|
|
55
|
-
|
|
56
|
-
async def main():
|
|
57
|
-
instance = GateAsync({})
|
|
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 gate import GateWs
|
|
71
|
-
|
|
72
|
-
async def main():
|
|
73
|
-
instance = GateWs({})
|
|
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
|