ccxt 4.4.69__py2.py3-none-any.whl → 4.4.70__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.
@@ -1757,11 +1757,12 @@ class hyperliquid(Exchange, ImplicitAPI):
1757
1757
  isTrigger = (stopLossPrice or takeProfitPrice)
1758
1758
  reduceOnly = self.safe_bool(orderParams, 'reduceOnly', False)
1759
1759
  orderParams = self.omit(orderParams, ['slippage', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'clientOrderId', 'client_id', 'postOnly', 'reduceOnly'])
1760
- px = str(price)
1760
+ px = self.number_to_string(price)
1761
1761
  if isMarket:
1762
- px = str(Precise.string_mul(price), Precise.string_add('1', slippage)) if (isBuy) else str(Precise.string_mul(price), Precise.string_sub('1', slippage))
1762
+ px = Precise.string_mul(px, Precise.string_add('1', slippage)) if (isBuy) else Precise.string_mul(px, Precise.string_sub('1', slippage))
1763
+ px = self.price_to_precision(symbol, px)
1763
1764
  else:
1764
- px = self.price_to_precision(symbol, str(price))
1765
+ px = self.price_to_precision(symbol, px)
1765
1766
  sz = self.amount_to_precision(symbol, amount)
1766
1767
  orderType: dict = {}
1767
1768
  if isTrigger:
@@ -2243,6 +2244,10 @@ class hyperliquid(Exchange, ImplicitAPI):
2243
2244
  side = 'sell' if (side == 'A') else 'buy'
2244
2245
  totalAmount = self.safe_string_2(entry, 'origSz', 'totalSz')
2245
2246
  remaining = self.safe_string(entry, 'sz')
2247
+ tif = self.safe_string_upper(entry, 'tif')
2248
+ postOnly = None
2249
+ if tif is not None:
2250
+ postOnly = (tif == 'ALO')
2246
2251
  return self.safe_order({
2247
2252
  'info': order,
2248
2253
  'id': self.safe_string(entry, 'oid'),
@@ -2253,8 +2258,8 @@ class hyperliquid(Exchange, ImplicitAPI):
2253
2258
  'lastUpdateTimestamp': self.safe_integer(order, 'statusTimestamp'),
2254
2259
  'symbol': symbol,
2255
2260
  'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
2256
- 'timeInForce': self.safe_string_upper(entry, 'tif'),
2257
- 'postOnly': None,
2261
+ 'timeInForce': tif,
2262
+ 'postOnly': postOnly,
2258
2263
  'reduceOnly': self.safe_bool(entry, 'reduceOnly'),
2259
2264
  'side': side,
2260
2265
  'price': self.safe_string(entry, 'limitPx'),
@@ -2372,6 +2377,10 @@ class hyperliquid(Exchange, ImplicitAPI):
2372
2377
  if side is not None:
2373
2378
  side = 'sell' if (side == 'A') else 'buy'
2374
2379
  fee = self.safe_string(trade, 'fee')
2380
+ takerOrMaker = None
2381
+ crossed = self.safe_bool(trade, 'crossed')
2382
+ if crossed is not None:
2383
+ takerOrMaker = 'taker' if crossed else 'maker'
2375
2384
  return self.safe_trade({
2376
2385
  'info': trade,
2377
2386
  'timestamp': timestamp,
@@ -2381,7 +2390,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2381
2390
  'order': self.safe_string(trade, 'oid'),
2382
2391
  'type': None,
2383
2392
  'side': side,
2384
- 'takerOrMaker': None,
2393
+ 'takerOrMaker': takerOrMaker,
2385
2394
  'price': price,
2386
2395
  'amount': amount,
2387
2396
  'cost': None,
@@ -2928,7 +2937,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2928
2937
  'tagTo': None,
2929
2938
  'tagFrom': None,
2930
2939
  'type': None,
2931
- 'amount': self.safe_integer(delta, 'usdc'),
2940
+ 'amount': self.safe_number(delta, 'usdc'),
2932
2941
  'currency': None,
2933
2942
  'status': self.safe_string(transaction, 'status'),
2934
2943
  'updated': None,
ccxt/async_support/okx.py CHANGED
@@ -333,7 +333,9 @@ class okx(Exchange, ImplicitAPI):
333
333
  'trade/easy-convert-currency-list': 20,
334
334
  'trade/easy-convert-history': 20,
335
335
  'trade/one-click-repay-currency-list': 20,
336
+ 'trade/one-click-repay-currency-list-v2': 20,
336
337
  'trade/one-click-repay-history': 20,
338
+ 'trade/one-click-repay-history-v2': 20,
337
339
  'trade/account-rate-limit': 1,
338
340
  # asset
339
341
  'asset/currencies': 5 / 3,
@@ -490,6 +492,7 @@ class okx(Exchange, ImplicitAPI):
490
492
  'trade/cancel-advance-algos': 1,
491
493
  'trade/easy-convert': 20,
492
494
  'trade/one-click-repay': 20,
495
+ 'trade/one-click-repay-v2': 20,
493
496
  'trade/mass-cancel': 4,
494
497
  'trade/cancel-all-after': 10,
495
498
  # asset
@@ -3044,6 +3047,7 @@ class okx(Exchange, ImplicitAPI):
3044
3047
  :param str [params.trailingPercent]: the percent to trail away from the current market price
3045
3048
  :param str [params.tpOrdKind]: 'condition' or 'limit', the default is 'condition'
3046
3049
  :param bool [params.hedged]: *swap and future only* True for hedged mode, False for one way mode
3050
+ :param str [params.marginMode]: 'cross' or 'isolated', the default is 'cross'
3047
3051
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3048
3052
  """
3049
3053
  await self.load_markets()
@@ -140,7 +140,6 @@ class tradeogre(Exchange, ImplicitAPI):
140
140
  },
141
141
  'private': {
142
142
  'get': {
143
- 'account/balance': 1,
144
143
  'account/balances': 1,
145
144
  'account/order/{uuid}': 1,
146
145
  },
@@ -150,6 +149,7 @@ class tradeogre(Exchange, ImplicitAPI):
150
149
  'order/cancel': 1,
151
150
  'orders': 1,
152
151
  'account/orders': 1,
152
+ 'account/balance': 1,
153
153
  },
154
154
  },
155
155
  },
@@ -588,10 +588,26 @@ class tradeogre(Exchange, ImplicitAPI):
588
588
  """
589
589
  query for balance and get the amount of funds available for trading or funds locked in orders
590
590
  :param dict [params]: extra parameters specific to the exchange API endpoint
591
+ :param str [params.currency]: currency to fetch the balance for
591
592
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
592
593
  """
593
594
  await self.load_markets()
594
- response = await self.privateGetAccountBalances(params)
595
+ response = None
596
+ currency = self.safe_string(params, 'currency')
597
+ if currency is not None:
598
+ response = await self.privatePostAccountBalance(params)
599
+ singleCurrencyresult: dict = {
600
+ 'info': response,
601
+ }
602
+ code = self.safe_currency_code(currency)
603
+ account = {
604
+ 'total': self.safe_number(response, 'balance'),
605
+ 'free': self.safe_number(response, 'available'),
606
+ }
607
+ singleCurrencyresult[code] = account
608
+ return self.safe_balance(singleCurrencyresult)
609
+ else:
610
+ response = await self.privateGetAccountBalances(params)
595
611
  result = self.safe_dict(response, 'balances', {})
596
612
  return self.parse_balance(result)
597
613
 
@@ -744,11 +760,11 @@ class tradeogre(Exchange, ImplicitAPI):
744
760
  'side': self.safe_string(order, 'type'),
745
761
  'price': self.safe_string(order, 'price'),
746
762
  'triggerPrice': None,
747
- 'amount': self.safe_string(order, 'quantity'),
763
+ 'amount': None,
748
764
  'cost': None,
749
765
  'average': None,
750
766
  'filled': self.safe_string(order, 'fulfilled'),
751
- 'remaining': None,
767
+ 'remaining': self.safe_string(order, 'quantity'),
752
768
  'status': None,
753
769
  'fee': {
754
770
  'currency': None,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.69'
7
+ __version__ = '4.4.70'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2099,7 +2099,6 @@ class Exchange(object):
2099
2099
  },
2100
2100
  'commonCurrencies': {
2101
2101
  'XBT': 'BTC',
2102
- 'BCC': 'BCH',
2103
2102
  'BCHSV': 'BSV',
2104
2103
  },
2105
2104
  'precisionMode': TICK_SIZE,
ccxt/binance.py CHANGED
@@ -8275,7 +8275,7 @@ class binance(Exchange, ImplicitAPI):
8275
8275
  internalInteger = self.safe_integer(transaction, 'transferType')
8276
8276
  internal = None
8277
8277
  if internalInteger is not None:
8278
- internal = True if internalInteger else False
8278
+ internal = True if (internalInteger != 0) else False
8279
8279
  network = self.safe_string(transaction, 'network')
8280
8280
  return {
8281
8281
  'info': transaction,