ccxt 4.4.80__py2.py3-none-any.whl → 4.4.85__py2.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.
- ccxt/__init__.py +1 -5
- ccxt/abstract/blofin.py +8 -0
- ccxt/abstract/btcbox.py +1 -0
- ccxt/apex.py +21 -30
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -5
- ccxt/async_support/apex.py +21 -30
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +26 -3
- ccxt/async_support/base/ws/cache.py +6 -1
- ccxt/async_support/bigone.py +17 -14
- ccxt/async_support/bingx.py +13 -32
- ccxt/async_support/bitfinex.py +61 -48
- ccxt/async_support/bitget.py +7 -4
- ccxt/async_support/bitrue.py +14 -32
- ccxt/async_support/bitso.py +33 -0
- ccxt/async_support/bitstamp.py +33 -0
- ccxt/async_support/blofin.py +145 -14
- ccxt/async_support/btcbox.py +25 -5
- ccxt/async_support/bybit.py +20 -39
- ccxt/async_support/cex.py +2 -4
- ccxt/async_support/coinbase.py +56 -42
- ccxt/async_support/coinbaseexchange.py +141 -32
- ccxt/async_support/coincatch.py +14 -67
- ccxt/async_support/coinex.py +28 -29
- ccxt/async_support/coinlist.py +17 -16
- ccxt/async_support/coinmetro.py +20 -11
- ccxt/async_support/coinone.py +8 -10
- ccxt/async_support/coinsph.py +124 -2
- ccxt/async_support/cryptocom.py +109 -2
- ccxt/async_support/cryptomus.py +42 -80
- ccxt/async_support/delta.py +75 -36
- ccxt/async_support/derive.py +46 -10
- ccxt/async_support/ellipx.py +175 -77
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/gemini.py +3 -4
- ccxt/async_support/hitbtc.py +56 -65
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/hyperliquid.py +15 -2
- ccxt/async_support/kraken.py +27 -23
- ccxt/async_support/kucoinfutures.py +5 -0
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/okx.py +1 -2
- ccxt/async_support/oxfun.py +21 -1
- ccxt/async_support/paradex.py +120 -4
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +40 -3
- ccxt/base/types.py +3 -0
- ccxt/bigone.py +17 -14
- ccxt/bingx.py +13 -32
- ccxt/bitfinex.py +61 -48
- ccxt/bitget.py +7 -4
- ccxt/bitrue.py +14 -32
- ccxt/bitso.py +33 -0
- ccxt/bitstamp.py +33 -0
- ccxt/blofin.py +145 -14
- ccxt/btcbox.py +24 -5
- ccxt/bybit.py +20 -39
- ccxt/cex.py +2 -4
- ccxt/coinbase.py +56 -42
- ccxt/coinbaseexchange.py +141 -32
- ccxt/coincatch.py +14 -67
- ccxt/coinex.py +28 -29
- ccxt/coinlist.py +17 -16
- ccxt/coinmetro.py +20 -11
- ccxt/coinone.py +8 -10
- ccxt/coinsph.py +124 -2
- ccxt/cryptocom.py +109 -2
- ccxt/cryptomus.py +42 -80
- ccxt/delta.py +75 -36
- ccxt/derive.py +46 -10
- ccxt/ellipx.py +175 -77
- ccxt/gate.py +1 -1
- ccxt/gemini.py +3 -4
- ccxt/hitbtc.py +56 -65
- ccxt/htx.py +2 -2
- ccxt/hyperliquid.py +15 -2
- ccxt/kraken.py +27 -23
- ccxt/kucoinfutures.py +5 -0
- ccxt/lbank.py +1 -1
- ccxt/okx.py +1 -2
- ccxt/oxfun.py +21 -1
- ccxt/paradex.py +120 -4
- ccxt/pro/__init__.py +69 -3
- ccxt/pro/binance.py +31 -33
- ccxt/pro/bithumb.py +5 -3
- ccxt/pro/coinbase.py +1 -1
- ccxt/pro/hyperliquid.py +10 -2
- ccxt/pro/kraken.py +249 -79
- ccxt/pro/mexc.py +252 -7
- ccxt/pro/poloniex.py +6 -2
- {ccxt-4.4.80.dist-info → ccxt-4.4.85.dist-info}/METADATA +7 -11
- {ccxt-4.4.80.dist-info → ccxt-4.4.85.dist-info}/RECORD +96 -104
- ccxt/abstract/bl3p.py +0 -19
- ccxt/abstract/idex.py +0 -26
- ccxt/async_support/base/ws/fast_client.py +0 -97
- ccxt/async_support/bl3p.py +0 -543
- ccxt/async_support/idex.py +0 -1889
- ccxt/bl3p.py +0 -543
- ccxt/idex.py +0 -1889
- ccxt/pro/idex.py +0 -687
- {ccxt-4.4.80.dist-info → ccxt-4.4.85.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.80.dist-info → ccxt-4.4.85.dist-info}/WHEEL +0 -0
- {ccxt-4.4.80.dist-info → ccxt-4.4.85.dist-info}/top_level.txt +0 -0
ccxt/bl3p.py
DELETED
@@ -1,543 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
4
|
-
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
|
-
|
6
|
-
from ccxt.base.exchange import Exchange
|
7
|
-
from ccxt.abstract.bl3p import ImplicitAPI
|
8
|
-
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, DepositAddress, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
|
-
from typing import List
|
11
|
-
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
|
-
from ccxt.base.precise import Precise
|
13
|
-
|
14
|
-
|
15
|
-
class bl3p(Exchange, ImplicitAPI):
|
16
|
-
|
17
|
-
def describe(self) -> Any:
|
18
|
-
return self.deep_extend(super(bl3p, self).describe(), {
|
19
|
-
'id': 'bl3p',
|
20
|
-
'name': 'BL3P',
|
21
|
-
'countries': ['NL'], # Netherlands
|
22
|
-
'rateLimit': 1000,
|
23
|
-
'version': '1',
|
24
|
-
'comment': 'An exchange market by BitonicNL',
|
25
|
-
'pro': False,
|
26
|
-
'has': {
|
27
|
-
'CORS': None,
|
28
|
-
'spot': True,
|
29
|
-
'margin': False,
|
30
|
-
'swap': False,
|
31
|
-
'future': False,
|
32
|
-
'option': False,
|
33
|
-
'addMargin': False,
|
34
|
-
'cancelOrder': True,
|
35
|
-
'closeAllPositions': False,
|
36
|
-
'closePosition': False,
|
37
|
-
'createDepositAddress': True,
|
38
|
-
'createOrder': True,
|
39
|
-
'createReduceOnlyOrder': False,
|
40
|
-
'createStopLimitOrder': False,
|
41
|
-
'createStopMarketOrder': False,
|
42
|
-
'createStopOrder': False,
|
43
|
-
'fetchBalance': True,
|
44
|
-
'fetchBorrowRateHistories': False,
|
45
|
-
'fetchBorrowRateHistory': False,
|
46
|
-
'fetchCrossBorrowRate': False,
|
47
|
-
'fetchCrossBorrowRates': False,
|
48
|
-
'fetchDepositAddress': False,
|
49
|
-
'fetchDepositAddresses': False,
|
50
|
-
'fetchDepositAddressesByNetwork': False,
|
51
|
-
'fetchFundingHistory': False,
|
52
|
-
'fetchFundingRate': False,
|
53
|
-
'fetchFundingRateHistory': False,
|
54
|
-
'fetchFundingRates': False,
|
55
|
-
'fetchIndexOHLCV': False,
|
56
|
-
'fetchIsolatedBorrowRate': False,
|
57
|
-
'fetchIsolatedBorrowRates': False,
|
58
|
-
'fetchLeverage': False,
|
59
|
-
'fetchMarginMode': False,
|
60
|
-
'fetchMarkOHLCV': False,
|
61
|
-
'fetchOpenInterestHistory': False,
|
62
|
-
'fetchOrderBook': True,
|
63
|
-
'fetchPosition': False,
|
64
|
-
'fetchPositionHistory': False,
|
65
|
-
'fetchPositionMode': False,
|
66
|
-
'fetchPositions': False,
|
67
|
-
'fetchPositionsForSymbol': False,
|
68
|
-
'fetchPositionsHistory': False,
|
69
|
-
'fetchPositionsRisk': False,
|
70
|
-
'fetchPremiumIndexOHLCV': False,
|
71
|
-
'fetchTicker': True,
|
72
|
-
'fetchTrades': True,
|
73
|
-
'fetchTradingFee': False,
|
74
|
-
'fetchTradingFees': True,
|
75
|
-
'fetchTransfer': False,
|
76
|
-
'fetchTransfers': False,
|
77
|
-
'reduceMargin': False,
|
78
|
-
'setLeverage': False,
|
79
|
-
'setMarginMode': False,
|
80
|
-
'setPositionMode': False,
|
81
|
-
'transfer': False,
|
82
|
-
'ws': False,
|
83
|
-
},
|
84
|
-
'urls': {
|
85
|
-
'logo': 'https://github.com/user-attachments/assets/75aeb14e-cd48-43c8-8492-dff002dea0be',
|
86
|
-
'api': {
|
87
|
-
'rest': 'https://api.bl3p.eu',
|
88
|
-
},
|
89
|
-
'www': 'https://bl3p.eu', # 'https://bitonic.nl'
|
90
|
-
'doc': [
|
91
|
-
'https://github.com/BitonicNL/bl3p-api/tree/master/docs',
|
92
|
-
'https://bl3p.eu/api',
|
93
|
-
'https://bitonic.nl/en/api',
|
94
|
-
],
|
95
|
-
},
|
96
|
-
'api': {
|
97
|
-
'public': {
|
98
|
-
'get': [
|
99
|
-
'{market}/ticker',
|
100
|
-
'{market}/orderbook',
|
101
|
-
'{market}/trades',
|
102
|
-
],
|
103
|
-
},
|
104
|
-
'private': {
|
105
|
-
'post': [
|
106
|
-
'{market}/money/depth/full',
|
107
|
-
'{market}/money/order/add',
|
108
|
-
'{market}/money/order/cancel',
|
109
|
-
'{market}/money/order/result',
|
110
|
-
'{market}/money/orders',
|
111
|
-
'{market}/money/orders/history',
|
112
|
-
'{market}/money/trades/fetch',
|
113
|
-
'GENMKT/money/info',
|
114
|
-
'GENMKT/money/deposit_address',
|
115
|
-
'GENMKT/money/new_deposit_address',
|
116
|
-
'GENMKT/money/wallet/history',
|
117
|
-
'GENMKT/money/withdraw',
|
118
|
-
],
|
119
|
-
},
|
120
|
-
},
|
121
|
-
'markets': {
|
122
|
-
'BTC/EUR': self.safe_market_structure({'id': 'BTCEUR', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'BTC', 'quoteId': 'EUR', 'maker': 0.0025, 'taker': 0.0025, 'type': 'spot', 'spot': True}),
|
123
|
-
},
|
124
|
-
'features': {
|
125
|
-
'spot': {
|
126
|
-
'sandbox': False,
|
127
|
-
'createOrder': {
|
128
|
-
'marginMode': False,
|
129
|
-
'triggerPrice': False,
|
130
|
-
'triggerPriceType': None,
|
131
|
-
'triggerDirection': False,
|
132
|
-
'stopLossPrice': False,
|
133
|
-
'takeProfitPrice': False,
|
134
|
-
'attachedStopLossTakeProfit': None,
|
135
|
-
'timeInForce': {
|
136
|
-
'IOC': False,
|
137
|
-
'FOK': False,
|
138
|
-
'PO': False,
|
139
|
-
'GTD': False,
|
140
|
-
},
|
141
|
-
'hedged': False,
|
142
|
-
'leverage': False,
|
143
|
-
'marketBuyRequiresPrice': False,
|
144
|
-
'marketBuyByCost': False,
|
145
|
-
'selfTradePrevention': False,
|
146
|
-
'trailing': False,
|
147
|
-
'iceberg': False,
|
148
|
-
},
|
149
|
-
'createOrders': None,
|
150
|
-
'fetchMyTrades': None,
|
151
|
-
'fetchOrder': None,
|
152
|
-
'fetchOpenOrders': None,
|
153
|
-
'fetchOrders': None,
|
154
|
-
'fetchClosedOrders': None,
|
155
|
-
'fetchOHLCV': None,
|
156
|
-
},
|
157
|
-
'swap': {
|
158
|
-
'linear': None,
|
159
|
-
'inverse': None,
|
160
|
-
},
|
161
|
-
'future': {
|
162
|
-
'linear': None,
|
163
|
-
'inverse': None,
|
164
|
-
},
|
165
|
-
},
|
166
|
-
'precisionMode': TICK_SIZE,
|
167
|
-
})
|
168
|
-
|
169
|
-
def parse_balance(self, response) -> Balances:
|
170
|
-
data = self.safe_value(response, 'data', {})
|
171
|
-
wallets = self.safe_value(data, 'wallets', {})
|
172
|
-
result: dict = {'info': data}
|
173
|
-
codes = list(self.currencies.keys())
|
174
|
-
for i in range(0, len(codes)):
|
175
|
-
code = codes[i]
|
176
|
-
currency = self.currency(code)
|
177
|
-
currencyId = currency['id']
|
178
|
-
wallet = self.safe_value(wallets, currencyId, {})
|
179
|
-
available = self.safe_value(wallet, 'available', {})
|
180
|
-
balance = self.safe_value(wallet, 'balance', {})
|
181
|
-
account = self.account()
|
182
|
-
account['free'] = self.safe_string(available, 'value')
|
183
|
-
account['total'] = self.safe_string(balance, 'value')
|
184
|
-
result[code] = account
|
185
|
-
return self.safe_balance(result)
|
186
|
-
|
187
|
-
def fetch_balance(self, params={}) -> Balances:
|
188
|
-
"""
|
189
|
-
query for balance and get the amount of funds available for trading or funds locked in orders
|
190
|
-
|
191
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#35---get-account-info--balance
|
192
|
-
|
193
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
194
|
-
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
195
|
-
"""
|
196
|
-
self.load_markets()
|
197
|
-
response = self.privatePostGENMKTMoneyInfo(params)
|
198
|
-
return self.parse_balance(response)
|
199
|
-
|
200
|
-
def parse_bid_ask(self, bidask, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2):
|
201
|
-
price = self.safe_string(bidask, priceKey)
|
202
|
-
size = self.safe_string(bidask, amountKey)
|
203
|
-
return [
|
204
|
-
self.parse_number(Precise.string_div(price, '100000.0')),
|
205
|
-
self.parse_number(Precise.string_div(size, '100000000.0')),
|
206
|
-
]
|
207
|
-
|
208
|
-
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
209
|
-
"""
|
210
|
-
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
211
|
-
|
212
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#22---orderbook
|
213
|
-
|
214
|
-
:param str symbol: unified symbol of the market to fetch the order book for
|
215
|
-
:param int [limit]: the maximum amount of order book entries to return
|
216
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
217
|
-
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
|
218
|
-
"""
|
219
|
-
market = self.market(symbol)
|
220
|
-
request: dict = {
|
221
|
-
'market': market['id'],
|
222
|
-
}
|
223
|
-
response = self.publicGetMarketOrderbook(self.extend(request, params))
|
224
|
-
orderbook = self.safe_dict(response, 'data')
|
225
|
-
return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price_int', 'amount_int')
|
226
|
-
|
227
|
-
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
228
|
-
#
|
229
|
-
# {
|
230
|
-
# "currency":"BTC",
|
231
|
-
# "last":32654.55595,
|
232
|
-
# "bid":32552.3642,
|
233
|
-
# "ask":32703.58231,
|
234
|
-
# "high":33500,
|
235
|
-
# "low":31943,
|
236
|
-
# "timestamp":1643372789,
|
237
|
-
# "volume":{
|
238
|
-
# "24h":2.27372413,
|
239
|
-
# "30d":320.79375456
|
240
|
-
# }
|
241
|
-
# }
|
242
|
-
#
|
243
|
-
symbol = self.safe_symbol(None, market)
|
244
|
-
timestamp = self.safe_timestamp(ticker, 'timestamp')
|
245
|
-
last = self.safe_string(ticker, 'last')
|
246
|
-
volume = self.safe_value(ticker, 'volume', {})
|
247
|
-
return self.safe_ticker({
|
248
|
-
'symbol': symbol,
|
249
|
-
'timestamp': timestamp,
|
250
|
-
'datetime': self.iso8601(timestamp),
|
251
|
-
'high': self.safe_string(ticker, 'high'),
|
252
|
-
'low': self.safe_string(ticker, 'low'),
|
253
|
-
'bid': self.safe_string(ticker, 'bid'),
|
254
|
-
'bidVolume': None,
|
255
|
-
'ask': self.safe_string(ticker, 'ask'),
|
256
|
-
'askVolume': None,
|
257
|
-
'vwap': None,
|
258
|
-
'open': None,
|
259
|
-
'close': last,
|
260
|
-
'last': last,
|
261
|
-
'previousClose': None,
|
262
|
-
'change': None,
|
263
|
-
'percentage': None,
|
264
|
-
'average': None,
|
265
|
-
'baseVolume': self.safe_string(volume, '24h'),
|
266
|
-
'quoteVolume': None,
|
267
|
-
'info': ticker,
|
268
|
-
}, market)
|
269
|
-
|
270
|
-
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
271
|
-
"""
|
272
|
-
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
273
|
-
|
274
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#21---ticker
|
275
|
-
|
276
|
-
:param str symbol: unified symbol of the market to fetch the ticker for
|
277
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
278
|
-
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
279
|
-
"""
|
280
|
-
market = self.market(symbol)
|
281
|
-
request: dict = {
|
282
|
-
'market': market['id'],
|
283
|
-
}
|
284
|
-
ticker = self.publicGetMarketTicker(self.extend(request, params))
|
285
|
-
#
|
286
|
-
# {
|
287
|
-
# "currency":"BTC",
|
288
|
-
# "last":32654.55595,
|
289
|
-
# "bid":32552.3642,
|
290
|
-
# "ask":32703.58231,
|
291
|
-
# "high":33500,
|
292
|
-
# "low":31943,
|
293
|
-
# "timestamp":1643372789,
|
294
|
-
# "volume":{
|
295
|
-
# "24h":2.27372413,
|
296
|
-
# "30d":320.79375456
|
297
|
-
# }
|
298
|
-
# }
|
299
|
-
#
|
300
|
-
return self.parse_ticker(ticker, market)
|
301
|
-
|
302
|
-
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
303
|
-
#
|
304
|
-
# fetchTrades
|
305
|
-
#
|
306
|
-
# {
|
307
|
-
# "trade_id": "2518789",
|
308
|
-
# "date": "1694348697745",
|
309
|
-
# "amount_int": "2959153",
|
310
|
-
# "price_int": "2416231440"
|
311
|
-
# }
|
312
|
-
#
|
313
|
-
id = self.safe_string(trade, 'trade_id')
|
314
|
-
timestamp = self.safe_integer(trade, 'date')
|
315
|
-
price = self.safe_string(trade, 'price_int')
|
316
|
-
amount = self.safe_string(trade, 'amount_int')
|
317
|
-
market = self.safe_market(None, market)
|
318
|
-
return self.safe_trade({
|
319
|
-
'id': id,
|
320
|
-
'info': trade,
|
321
|
-
'timestamp': timestamp,
|
322
|
-
'datetime': self.iso8601(timestamp),
|
323
|
-
'symbol': market['symbol'],
|
324
|
-
'type': None,
|
325
|
-
'side': None,
|
326
|
-
'order': None,
|
327
|
-
'takerOrMaker': None,
|
328
|
-
'price': Precise.string_div(price, '100000'),
|
329
|
-
'amount': Precise.string_div(amount, '100000000'),
|
330
|
-
'cost': None,
|
331
|
-
'fee': None,
|
332
|
-
}, market)
|
333
|
-
|
334
|
-
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
335
|
-
"""
|
336
|
-
get the list of most recent trades for a particular symbol
|
337
|
-
|
338
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#23---last-1000-trades
|
339
|
-
|
340
|
-
:param str symbol: unified symbol of the market to fetch trades for
|
341
|
-
:param int [since]: timestamp in ms of the earliest trade to fetch
|
342
|
-
:param int [limit]: the maximum amount of trades to fetch
|
343
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
344
|
-
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
345
|
-
"""
|
346
|
-
market = self.market(symbol)
|
347
|
-
response = self.publicGetMarketTrades(self.extend({
|
348
|
-
'market': market['id'],
|
349
|
-
}, params))
|
350
|
-
#
|
351
|
-
# {
|
352
|
-
# "result": "success",
|
353
|
-
# "data": {
|
354
|
-
# "trades": [
|
355
|
-
# {
|
356
|
-
# "trade_id": "2518789",
|
357
|
-
# "date": "1694348697745",
|
358
|
-
# "amount_int": "2959153",
|
359
|
-
# "price_int": "2416231440"
|
360
|
-
# },
|
361
|
-
# ]
|
362
|
-
# }
|
363
|
-
# }
|
364
|
-
result = self.parse_trades(response['data']['trades'], market, since, limit)
|
365
|
-
return result
|
366
|
-
|
367
|
-
def fetch_trading_fees(self, params={}) -> TradingFees:
|
368
|
-
"""
|
369
|
-
fetch the trading fees for multiple markets
|
370
|
-
|
371
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#35---get-account-info--balance
|
372
|
-
|
373
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
374
|
-
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
375
|
-
"""
|
376
|
-
self.load_markets()
|
377
|
-
response = self.privatePostGENMKTMoneyInfo(params)
|
378
|
-
#
|
379
|
-
# {
|
380
|
-
# "result": "success",
|
381
|
-
# "data": {
|
382
|
-
# "user_id": "13396",
|
383
|
-
# "wallets": {
|
384
|
-
# "BTC": {
|
385
|
-
# "balance": {
|
386
|
-
# "value_int": "0",
|
387
|
-
# "display": "0.00000000 BTC",
|
388
|
-
# "currency": "BTC",
|
389
|
-
# "value": "0.00000000",
|
390
|
-
# "display_short": "0.00 BTC"
|
391
|
-
# },
|
392
|
-
# "available": {
|
393
|
-
# "value_int": "0",
|
394
|
-
# "display": "0.00000000 BTC",
|
395
|
-
# "currency": "BTC",
|
396
|
-
# "value": "0.00000000",
|
397
|
-
# "display_short": "0.00 BTC"
|
398
|
-
# }
|
399
|
-
# },
|
400
|
-
# ...
|
401
|
-
# },
|
402
|
-
# "trade_fee": "0.25"
|
403
|
-
# }
|
404
|
-
# }
|
405
|
-
#
|
406
|
-
data = self.safe_value(response, 'data', {})
|
407
|
-
feeString = self.safe_string(data, 'trade_fee')
|
408
|
-
fee = self.parse_number(Precise.string_div(feeString, '100'))
|
409
|
-
result: dict = {}
|
410
|
-
for i in range(0, len(self.symbols)):
|
411
|
-
symbol = self.symbols[i]
|
412
|
-
result[symbol] = {
|
413
|
-
'info': data,
|
414
|
-
'symbol': symbol,
|
415
|
-
'maker': fee,
|
416
|
-
'taker': fee,
|
417
|
-
'percentage': True,
|
418
|
-
'tierBased': False,
|
419
|
-
}
|
420
|
-
return result
|
421
|
-
|
422
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
423
|
-
"""
|
424
|
-
create a trade order
|
425
|
-
|
426
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/examples/nodejs/example.md#21---create-an-order
|
427
|
-
|
428
|
-
:param str symbol: unified symbol of the market to create an order in
|
429
|
-
:param str type: 'market' or 'limit'
|
430
|
-
:param str side: 'buy' or 'sell'
|
431
|
-
:param float amount: how much of currency you want to trade in units of base currency
|
432
|
-
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
433
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
434
|
-
|
435
|
-
EXCHANGE SPECIFIC PARAMETERS
|
436
|
-
:param int [params.amount_funds]: maximal EUR amount to spend(*1e5)
|
437
|
-
:param str [params.fee_currency]: 'EUR' or 'BTC'
|
438
|
-
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
439
|
-
"""
|
440
|
-
market = self.market(symbol)
|
441
|
-
amountString = self.number_to_string(amount)
|
442
|
-
priceString = self.number_to_string(price)
|
443
|
-
order: dict = {
|
444
|
-
'market': market['id'],
|
445
|
-
'amount_int': int(Precise.string_mul(amountString, '100000000')),
|
446
|
-
'fee_currency': market['quote'],
|
447
|
-
'type': 'bid' if (side == 'buy') else 'ask',
|
448
|
-
}
|
449
|
-
if type == 'limit':
|
450
|
-
order['price_int'] = int(Precise.string_mul(priceString, '100000.0'))
|
451
|
-
response = self.privatePostMarketMoneyOrderAdd(self.extend(order, params))
|
452
|
-
orderId = self.safe_string(response['data'], 'order_id')
|
453
|
-
return self.safe_order({
|
454
|
-
'info': response,
|
455
|
-
'id': orderId,
|
456
|
-
}, market)
|
457
|
-
|
458
|
-
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
459
|
-
"""
|
460
|
-
cancels an open order
|
461
|
-
|
462
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#22---cancel-an-order
|
463
|
-
|
464
|
-
:param str id: order id
|
465
|
-
:param str symbol: unified symbol of the market the order was made in
|
466
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
467
|
-
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
468
|
-
"""
|
469
|
-
request: dict = {
|
470
|
-
'order_id': id,
|
471
|
-
}
|
472
|
-
response = self.privatePostMarketMoneyOrderCancel(self.extend(request, params))
|
473
|
-
#
|
474
|
-
# "success"
|
475
|
-
#
|
476
|
-
return self.safe_order({
|
477
|
-
'info': response,
|
478
|
-
})
|
479
|
-
|
480
|
-
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
481
|
-
"""
|
482
|
-
create a currency deposit address
|
483
|
-
|
484
|
-
https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#32---create-a-new-deposit-address
|
485
|
-
|
486
|
-
:param str code: unified currency code of the currency for the deposit address
|
487
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
488
|
-
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
489
|
-
"""
|
490
|
-
self.load_markets()
|
491
|
-
currency = self.currency(code)
|
492
|
-
request: dict = {
|
493
|
-
'currency': currency['id'],
|
494
|
-
}
|
495
|
-
response = self.privatePostGENMKTMoneyNewDepositAddress(self.extend(request, params))
|
496
|
-
#
|
497
|
-
# {
|
498
|
-
# "result": "success",
|
499
|
-
# "data": {
|
500
|
-
# "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
501
|
-
# }
|
502
|
-
# }
|
503
|
-
#
|
504
|
-
data = self.safe_dict(response, 'data')
|
505
|
-
return self.parse_deposit_address(data, currency)
|
506
|
-
|
507
|
-
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
508
|
-
#
|
509
|
-
# {
|
510
|
-
# "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
511
|
-
# }
|
512
|
-
#
|
513
|
-
address = self.safe_string(depositAddress, 'address')
|
514
|
-
self.check_address(address)
|
515
|
-
return {
|
516
|
-
'info': depositAddress,
|
517
|
-
'currency': self.safe_string(currency, 'code'),
|
518
|
-
'address': address,
|
519
|
-
'tag': None,
|
520
|
-
'network': None,
|
521
|
-
}
|
522
|
-
|
523
|
-
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
524
|
-
request = self.implode_params(path, params)
|
525
|
-
url = self.urls['api']['rest'] + '/' + self.version + '/' + request
|
526
|
-
query = self.omit(params, self.extract_params(path))
|
527
|
-
if api == 'public':
|
528
|
-
if query:
|
529
|
-
url += '?' + self.urlencode(query)
|
530
|
-
else:
|
531
|
-
self.check_required_credentials()
|
532
|
-
nonce = self.nonce()
|
533
|
-
body = self.urlencode(self.extend({'nonce': nonce}, query))
|
534
|
-
secret = self.base64_to_binary(self.secret)
|
535
|
-
# eslint-disable-next-line quotes
|
536
|
-
auth = request + "\0" + body
|
537
|
-
signature = self.hmac(self.encode(auth), secret, hashlib.sha512, 'base64')
|
538
|
-
headers = {
|
539
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
540
|
-
'Rest-Key': self.apiKey,
|
541
|
-
'Rest-Sign': signature,
|
542
|
-
}
|
543
|
-
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|