ccxt 4.3.94__py2.py3-none-any.whl → 4.3.95__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.
@@ -462,164 +462,82 @@ class mexc(Exchange, ImplicitAPI):
462
462
  'LTC': 'LTC',
463
463
  },
464
464
  'networks': {
465
- 'ABBC': 'ABBC',
465
+ 'TRC20': 'TRX',
466
+ 'TON': 'TONCOIN',
467
+ 'AVAXC': 'AVAX_CCHAIN',
468
+ 'ERC20': 'ETH',
466
469
  'ACA': 'ACALA',
467
- 'ADA': 'Cardano(ADA)',
468
- 'AE': 'AE',
469
- 'ALGO': 'Algorand(ALGO)',
470
- 'ALPH': 'Alephium(ALPH)',
471
- 'AME': 'AME',
472
- 'AOK': 'AOK',
473
- 'APT': 'APTOS(APT)',
474
- 'AR': 'AR',
475
- 'ARB': 'Arbitrum One(ARB)',
476
- 'ARBNOVA': 'ARBNOVA',
477
- 'ARBONE': 'ArbitrumOne(ARB)',
478
- 'ARK': 'ARK',
470
+ # 'ADA': 'Cardano(ADA)',
471
+ # 'AE': 'AE',
472
+ # 'ALGO': 'Algorand(ALGO)',
473
+ # 'ALPH': 'Alephium(ALPH)',
474
+ # 'ARB': 'Arbitrum One(ARB)',
475
+ # 'ARBONE': 'ArbitrumOne(ARB)',
479
476
  'ASTR': 'ASTAR', # ASTAREVM is different
480
- 'ATOM': 'Cosmos(ATOM)',
481
- 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
482
- 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
483
- 'AZERO': 'Aleph Zero(AZERO)',
484
- 'BCH': 'Bitcoin Cash(BCH)',
485
- 'BDX': 'BDX',
486
- 'BEAM': 'BEAM',
487
- 'BEP2': 'BNB Beacon Chain(BEP2)',
488
- 'BEP20': 'BNB Smart Chain(BEP20)',
489
- 'BITCI': 'BITCI',
490
- 'BNC': 'BNC',
491
- 'BNCDOT': 'BNCPOLKA',
492
- 'BOBA': 'BOBA',
493
- 'BSC': 'BEP20(BSC)',
494
- 'BSV': 'Bitcoin SV(BSV)',
495
- 'BTC': 'Bitcoin(BTC)',
477
+ # 'ATOM': 'Cosmos(ATOM)',
478
+ # 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
479
+ # 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
480
+ # 'AZERO': 'Aleph Zero(AZERO)',
481
+ # 'BCH': 'Bitcoin Cash(BCH)',
482
+ # 'BNCDOT': 'BNCPOLKA',
483
+ # 'BSV': 'Bitcoin SV(BSV)',
484
+ # 'BTC': 'Bitcoin(BTC)',
496
485
  'BTM': 'BTM2',
497
- 'CELO': 'CELO',
498
- 'CFX': 'CFX',
499
- 'CHZ': 'Chiliz Legacy Chain(CHZ)',
500
- 'CHZ2': 'Chiliz Chain(CHZ2)',
501
- 'CKB': 'CKB',
502
- 'CLORE': 'Clore.ai(CLORE)',
486
+ # 'CHZ': 'Chiliz Legacy Chain(CHZ)',
487
+ # 'CHZ2': 'Chiliz Chain(CHZ2)',
488
+ # 'CLORE': 'Clore.ai(CLORE)',
503
489
  'CRC20': 'CRONOS',
504
- 'CSPR': 'CSPR',
505
- 'DASH': 'DASH',
506
- 'DC': 'Dogechain(DC)',
507
- 'DCR': 'DCR',
508
- 'DNX': 'Dynex(DNX)',
509
- 'DOGE': 'Dogecoin(DOGE)',
510
- 'DOT': 'Polkadot(DOT)',
511
- 'DYM': 'Dymension(DYM)',
512
- 'EDG': 'EDG',
513
- 'EGLD': 'EGLD',
514
- 'EOS': 'EOS',
515
- 'ERC20': 'Ethereum(ERC20)',
516
- 'ETC': 'Ethereum Classic(ETC)',
490
+ # 'DC': 'Dogechain(DC)',
491
+ # 'DNX': 'Dynex(DNX)',
492
+ # 'DOGE': 'Dogecoin(DOGE)',
493
+ # 'DOT': 'Polkadot(DOT)',
494
+ # 'DYM': 'Dymension(DYM)',
517
495
  'ETHF': 'ETF',
518
- 'ETHW': 'ETHW',
519
- 'EVER': 'EVER',
520
- 'FET': 'FET',
521
- 'FIL': 'FIL',
522
- 'FIO': 'FIO',
523
- 'FLOW': 'FLOW',
524
- 'FSN': 'FSN',
525
- 'FTM': 'Fantom(FTM)',
526
- 'FUSE': 'FUSE',
527
- 'GLMR': 'GLMR',
528
- 'GRIN': 'GRIN',
529
- 'HBAR': 'Hedera(HBAR)',
530
- 'HIVE': 'HIVE',
531
496
  'HRC20': 'HECO',
532
- 'HYDRA': 'HYDRA',
533
- 'ICP': 'Internet Computer(ICP)',
534
- 'INDEX': 'Index Chain',
535
- 'IOST': 'IOST',
536
- 'IOTA': 'IOTA',
537
- 'IOTX': 'IOTX',
538
- 'IRIS': 'IRIS',
539
- 'KAR': 'KAR',
540
- 'KAS': 'Kaspa(KAS)',
541
- 'KAVA': 'KAVA',
542
- 'KDA': 'KDA',
543
- 'KILT': 'KILT',
544
- 'KLAY': 'Klaytn(KLAY)',
545
- 'KMA': 'KMA',
546
- 'KSM': 'KSM',
547
- 'LAT': 'LAT',
548
- 'LAVA': 'Elysium(LAVA)',
549
- 'LTC': 'Litecoin(LTC)',
550
- 'LUNA': 'Terra(LUNA)',
551
- 'MASS': 'MASS',
552
- 'MATIC': 'Polygon(MATIC)',
553
- 'MCOIN': 'Mcoin Network',
554
- 'METIS': 'METIS',
555
- 'MINA': 'MINA',
556
- 'MNT': 'Mantle(MNT)',
557
- 'MOVR': 'MOVR',
558
- 'MTRG': 'Meter(MTRG)',
559
- 'NAS': 'NAS',
560
- 'NEAR': 'NEAR Protocol(NEAR)',
561
- 'NEBL': 'NEBL',
562
- 'NEM': 'NEM',
563
- 'NEO': 'NEO',
564
- 'NEO3': 'NEO3',
565
- 'NEOXA': 'Neoxa Network',
566
- 'NULS': 'NULS',
497
+ # 'KLAY': 'Klaytn(KLAY)',
567
498
  'OASIS': 'ROSE',
568
- 'OASYS': 'OASYS',
569
499
  'OKC': 'OKT',
570
- 'OMN': 'Omega Network(OMN)',
571
- 'OMNI': 'OMNI',
572
- 'ONE': 'ONE',
573
- 'ONT': 'ONT',
574
- 'OPTIMISM': 'Optimism(OP)',
575
- 'OSMO': 'OSMO',
576
- 'PLCU': 'PLCU',
577
- 'POKT': 'POKT',
578
- 'QKC': 'QKC',
579
- 'QTUM': 'QTUM',
580
- 'RAP20': 'RAP20' + ' ' + '(Rangers Mainnet)',
581
- 'REI': 'REI',
582
500
  'RSK': 'RBTC',
583
- 'RVN': 'Ravencoin(RVN)',
584
- 'SATOX': 'Satoxcoin(SATOX)',
585
- 'SC': 'SC',
586
- 'SCRT': 'SCRT',
587
- 'SDN': 'SDN',
588
- 'SGB': 'SGB',
589
- 'SOL': 'Solana(SOL)',
590
- 'STAR': 'STAR',
591
- 'STARK': 'Starknet(STARK)',
592
- 'STEEM': 'STEEM',
593
- 'SYS': 'SYS',
594
- 'TAO': 'Bittensor(TAO)',
595
- 'TIA': 'Celestia(TIA)',
596
- 'TOMO': 'TOMO',
597
- 'TON': 'Toncoin(TON)',
598
- 'TRC10': 'TRC10',
599
- 'TRC20': 'Tron(TRC20)',
600
- 'UGAS': 'UGAS(Ultrain)',
601
- 'VET': 'VeChain(VET)',
602
- 'VEX': 'Vexanium(VEX)',
603
- 'VSYS': 'VSYS',
604
- 'WAVES': 'WAVES',
605
- 'WAX': 'WAX',
606
- 'WEMIX': 'WEMIX',
607
- 'XCH': 'Chia(XCH)',
608
- 'XDC': 'XDC',
609
- 'XEC': 'XEC',
610
- 'XLM': 'Stellar(XLM)',
611
- 'XMR': 'Monero(XMR)',
612
- 'XNA': 'Neurai(XNA)',
613
- 'XPR': 'XPR Network',
614
- 'XRD': 'XRD',
615
- 'XRP': 'Ripple(XRP)',
616
- 'XTZ': 'XTZ',
617
- 'XVG': 'XVG',
618
- 'XYM': 'XYM',
619
- 'ZEC': 'ZEC',
620
- 'ZEN': 'ZEN',
621
- 'ZIL': 'Zilliqa(ZIL)',
622
- 'ZTG': 'ZTG',
501
+ # 'RVN': 'Ravencoin(RVN)',
502
+ # 'SATOX': 'Satoxcoin(SATOX)',
503
+ # 'SC': 'SC',
504
+ # 'SCRT': 'SCRT',
505
+ # 'SDN': 'SDN',
506
+ # 'SGB': 'SGB',
507
+ # 'SOL': 'Solana(SOL)',
508
+ # 'STAR': 'STAR',
509
+ # 'STARK': 'Starknet(STARK)',
510
+ # 'STEEM': 'STEEM',
511
+ # 'SYS': 'SYS',
512
+ # 'TAO': 'Bittensor(TAO)',
513
+ # 'TIA': 'Celestia(TIA)',
514
+ # 'TOMO': 'TOMO',
515
+ # 'TON': 'Toncoin(TON)',
516
+ # 'TRC10': 'TRC10',
517
+ # 'TRC20': 'Tron(TRC20)',
518
+ # 'UGAS': 'UGAS(Ultrain)',
519
+ # 'VET': 'VeChain(VET)',
520
+ # 'VEX': 'Vexanium(VEX)',
521
+ # 'VSYS': 'VSYS',
522
+ # 'WAVES': 'WAVES',
523
+ # 'WAX': 'WAX',
524
+ # 'WEMIX': 'WEMIX',
525
+ # 'XCH': 'Chia(XCH)',
526
+ # 'XDC': 'XDC',
527
+ # 'XEC': 'XEC',
528
+ # 'XLM': 'Stellar(XLM)',
529
+ # 'XMR': 'Monero(XMR)',
530
+ # 'XNA': 'Neurai(XNA)',
531
+ # 'XPR': 'XPR Network',
532
+ # 'XRD': 'XRD',
533
+ # 'XRP': 'Ripple(XRP)',
534
+ # 'XTZ': 'XTZ',
535
+ # 'XVG': 'XVG',
536
+ # 'XYM': 'XYM',
537
+ # 'ZEC': 'ZEC',
538
+ # 'ZEN': 'ZEN',
539
+ # 'ZIL': 'Zilliqa(ZIL)',
540
+ # 'ZTG': 'ZTG',
623
541
  # todo: uncomment below after concensus
624
542
  # 'ALAYA': 'ATP',
625
543
  # 'ANDUSCHAIN': 'DEB',
@@ -1011,7 +929,7 @@ class mexc(Exchange, ImplicitAPI):
1011
929
  chains = self.safe_value(currency, 'networkList', [])
1012
930
  for j in range(0, len(chains)):
1013
931
  chain = chains[j]
1014
- networkId = self.safe_string_2(chain, 'network', 'netWork')
932
+ networkId = self.safe_string_2(chain, 'netWork', 'network')
1015
933
  network = self.network_id_to_code(networkId)
1016
934
  isDepositEnabled = self.safe_bool(chain, 'depositEnable', False)
1017
935
  isWithdrawEnabled = self.safe_bool(chain, 'withdrawEnable', False)
@@ -4120,7 +4038,7 @@ class mexc(Exchange, ImplicitAPI):
4120
4038
  #
4121
4039
  address = self.safe_string(depositAddress, 'address')
4122
4040
  currencyId = self.safe_string(depositAddress, 'coin')
4123
- networkId = self.safe_string(depositAddress, 'network')
4041
+ networkId = self.safe_string(depositAddress, 'netWork')
4124
4042
  self.check_address(address)
4125
4043
  return {
4126
4044
  'currency': self.safe_currency_code(currencyId, currency),
@@ -4844,14 +4762,14 @@ class mexc(Exchange, ImplicitAPI):
4844
4762
  :param dict [params]: extra parameters specific to the exchange API endpoint
4845
4763
  :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
4846
4764
  """
4765
+ await self.load_markets()
4766
+ currency = self.currency(code)
4847
4767
  tag, params = self.handle_withdraw_tag_and_params(tag, params)
4848
4768
  networks = self.safe_dict(self.options, 'networks', {})
4849
4769
  network = self.safe_string_2(params, 'network', 'netWork') # self line allows the user to specify either ERC20 or ETH
4850
4770
  network = self.safe_string(networks, network, network) # handle ETH > ERC-20 alias
4851
- network = self.network_id_to_code(network)
4771
+ network = self.network_code_to_id(network, currency['code'])
4852
4772
  self.check_address(address)
4853
- await self.load_markets()
4854
- currency = self.currency(code)
4855
4773
  request: dict = {
4856
4774
  'coin': currency['id'],
4857
4775
  'address': address,
ccxt/async_support/okx.py CHANGED
@@ -349,6 +349,7 @@ class okx(Exchange, ImplicitAPI):
349
349
  'account/account-position-risk': 2,
350
350
  'account/bills': 5 / 3,
351
351
  'account/bills-archive': 5 / 3,
352
+ 'account/bills-history-archive': 2,
352
353
  'account/config': 4,
353
354
  'account/max-size': 1,
354
355
  'account/max-avail-size': 1,
@@ -503,6 +504,7 @@ class okx(Exchange, ImplicitAPI):
503
504
  'account/fixed-loan/amend-borrowing-order': 5,
504
505
  'account/fixed-loan/manual-reborrow': 5,
505
506
  'account/fixed-loan/repay-borrowing-order': 5,
507
+ 'account/bills-history-archive': 72000, # 12 req/day
506
508
  # subaccount
507
509
  'users/subaccount/modify-apikey': 10,
508
510
  'asset/subaccount/transfer': 10,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.94'
7
+ __version__ = '4.3.95'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -3691,7 +3691,7 @@ class Exchange(object):
3691
3691
  if currencyCode is None:
3692
3692
  currencies = list(self.currencies.values())
3693
3693
  for i in range(0, len(currencies)):
3694
- currency = [i]
3694
+ currency = currencies[i]
3695
3695
  networks = self.safe_dict(currency, 'networks')
3696
3696
  network = self.safe_dict(networks, networkCode)
3697
3697
  networkId = self.safe_string(network, 'id')
@@ -3809,12 +3809,12 @@ class Exchange(object):
3809
3809
  'nonce': None,
3810
3810
  }
3811
3811
 
3812
- def parse_ohlcvs(self, ohlcvs: List[object], market: Any = None, timeframe: str = '1m', since: Int = None, limit: Int = None):
3812
+ def parse_ohlcvs(self, ohlcvs: List[object], market: Any = None, timeframe: str = '1m', since: Int = None, limit: Int = None, tail: Bool = False):
3813
3813
  results = []
3814
3814
  for i in range(0, len(ohlcvs)):
3815
3815
  results.append(self.parse_ohlcv(ohlcvs[i], market))
3816
3816
  sorted = self.sort_by(results, 0)
3817
- return self.filter_by_since_limit(sorted, since, limit, 0)
3817
+ return self.filter_by_since_limit(sorted, since, limit, 0, tail)
3818
3818
 
3819
3819
  def parse_leverage_tiers(self, response: Any, symbols: List[str] = None, marketIdKey=None):
3820
3820
  # marketIdKey should only be None when response is a dictionary
ccxt/bitfinex.py CHANGED
@@ -565,11 +565,11 @@ class bitfinex(Exchange, ImplicitAPI):
565
565
  :param dict [params]: extra parameters specific to the exchange API endpoint
566
566
  :returns dict[]: an array of objects representing market data
567
567
  """
568
- ids = self.publicGetSymbols()
568
+ idsPromise = self.publicGetSymbols()
569
569
  #
570
570
  # ["btcusd", "ltcusd", "ltcbtc"]
571
571
  #
572
- details = self.publicGetSymbolsDetails()
572
+ detailsPromise = self.publicGetSymbolsDetails()
573
573
  #
574
574
  # [
575
575
  # {
@@ -584,6 +584,7 @@ class bitfinex(Exchange, ImplicitAPI):
584
584
  # },
585
585
  # ]
586
586
  #
587
+ ids, details = [idsPromise, detailsPromise]
587
588
  result = []
588
589
  for i in range(0, len(details)):
589
590
  market = details[i]
ccxt/bitfinex2.py CHANGED
@@ -534,12 +534,13 @@ class bitfinex2(Exchange, ImplicitAPI):
534
534
  :param dict [params]: extra parameters specific to the exchange API endpoint
535
535
  :returns dict[]: an array of objects representing market data
536
536
  """
537
- spotMarketsInfo = self.publicGetConfPubInfoPair(params)
538
- futuresMarketsInfo = self.publicGetConfPubInfoPairFutures(params)
539
- spotMarketsInfo = self.safe_value(spotMarketsInfo, 0, [])
540
- futuresMarketsInfo = self.safe_value(futuresMarketsInfo, 0, [])
537
+ spotMarketsInfoPromise = self.publicGetConfPubInfoPair(params)
538
+ futuresMarketsInfoPromise = self.publicGetConfPubInfoPairFutures(params)
539
+ marginIdsPromise = self.publicGetConfPubListPairMargin(params)
540
+ spotMarketsInfo, futuresMarketsInfo, marginIds = [spotMarketsInfoPromise, futuresMarketsInfoPromise, marginIdsPromise]
541
+ spotMarketsInfo = self.safe_list(spotMarketsInfo, 0, [])
542
+ futuresMarketsInfo = self.safe_list(futuresMarketsInfo, 0, [])
541
543
  markets = self.array_concat(spotMarketsInfo, futuresMarketsInfo)
542
- marginIds = self.publicGetConfPubListPairMargin(params)
543
544
  marginIds = self.safe_value(marginIds, 0, [])
544
545
  #
545
546
  # [
ccxt/btcturk.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.btcturk import ImplicitAPI
8
8
  import hashlib
9
9
  import math
10
- from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
10
+ from ccxt.base.types import Balances, Bool, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import BadRequest
@@ -621,7 +621,7 @@ class btcturk(Exchange, ImplicitAPI):
621
621
  #
622
622
  return self.parse_ohlcvs(response, market, timeframe, since, limit)
623
623
 
624
- def parse_ohlcvs(self, ohlcvs, market=None, timeframe='1m', since: Int = None, limit: Int = None):
624
+ def parse_ohlcvs(self, ohlcvs, market=None, timeframe='1m', since: Int = None, limit: Int = None, tail: Bool = False):
625
625
  results = []
626
626
  timestamp = self.safe_value(ohlcvs, 't')
627
627
  high = self.safe_value(ohlcvs, 'h')
@@ -640,7 +640,7 @@ class btcturk(Exchange, ImplicitAPI):
640
640
  }
641
641
  results.append(self.parse_ohlcv(ohlcv, market))
642
642
  sorted = self.sort_by(results, 0)
643
- return self.filter_by_since_limit(sorted, since, limit, 0)
643
+ return self.filter_by_since_limit(sorted, since, limit, 0, tail)
644
644
 
645
645
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
646
646
  """
ccxt/gate.py CHANGED
@@ -993,8 +993,9 @@ class gate(Exchange, ImplicitAPI):
993
993
  return self.array_concat(markets, optionMarkets)
994
994
 
995
995
  def fetch_spot_markets(self, params={}):
996
- marginResponse = self.publicMarginGetCurrencyPairs(params)
997
- spotMarketsResponse = self.publicSpotGetCurrencyPairs(params)
996
+ marginPromise = self.publicMarginGetCurrencyPairs(params)
997
+ spotMarketsPromise = self.publicSpotGetCurrencyPairs(params)
998
+ marginResponse, spotMarketsResponse = [marginPromise, spotMarketsPromise]
998
999
  marginMarkets = self.index_by(marginResponse, 'id')
999
1000
  #
1000
1001
  # Spot
ccxt/gemini.py CHANGED
@@ -813,8 +813,9 @@ class gemini(Exchange, ImplicitAPI):
813
813
  return self.parse_ticker(response, market)
814
814
 
815
815
  def fetch_ticker_v1_and_v2(self, symbol: str, params={}):
816
- tickerA = self.fetch_ticker_v1(symbol, params)
817
- tickerB = self.fetch_ticker_v2(symbol, params)
816
+ tickerPromiseA = self.fetch_ticker_v1(symbol, params)
817
+ tickerPromiseB = self.fetch_ticker_v2(symbol, params)
818
+ tickerA, tickerB = [tickerPromiseA, tickerPromiseB]
818
819
  return self.deep_extend(tickerA, {
819
820
  'open': tickerB['open'],
820
821
  'high': tickerB['high'],
ccxt/hyperliquid.py CHANGED
@@ -61,7 +61,8 @@ class hyperliquid(Exchange, ImplicitAPI):
61
61
  'fetchBorrowInterest': False,
62
62
  'fetchBorrowRateHistories': False,
63
63
  'fetchBorrowRateHistory': False,
64
- 'fetchCanceledOrders': False,
64
+ 'fetchCanceledAndClosedOrders': True,
65
+ 'fetchCanceledOrders': True,
65
66
  'fetchClosedOrders': True,
66
67
  'fetchCrossBorrowRate': False,
67
68
  'fetchCrossBorrowRates': False,
@@ -94,7 +95,7 @@ class hyperliquid(Exchange, ImplicitAPI):
94
95
  'fetchOpenOrders': True,
95
96
  'fetchOrder': True,
96
97
  'fetchOrderBook': True,
97
- 'fetchOrders': False,
98
+ 'fetchOrders': True,
98
99
  'fetchOrderTrades': False,
99
100
  'fetchPosition': True,
100
101
  'fetchPositionMode': False,
@@ -814,6 +815,7 @@ class hyperliquid(Exchange, ImplicitAPI):
814
815
  self.load_markets()
815
816
  market = self.market(symbol)
816
817
  until = self.safe_integer(params, 'until', self.milliseconds())
818
+ useTail = (since is None)
817
819
  if since is None:
818
820
  since = 0
819
821
  params = self.omit(params, ['until'])
@@ -843,7 +845,7 @@ class hyperliquid(Exchange, ImplicitAPI):
843
845
  # }
844
846
  # ]
845
847
  #
846
- return self.parse_ohlcvs(response, market, timeframe, since, limit)
848
+ return self.parse_ohlcvs(response, market, timeframe, since, limit, useTail)
847
849
 
848
850
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
849
851
  #
@@ -1644,7 +1646,14 @@ class hyperliquid(Exchange, ImplicitAPI):
1644
1646
  # }
1645
1647
  # ]
1646
1648
  #
1647
- return self.parse_orders(response, market, since, limit)
1649
+ orderWithStatus = []
1650
+ for i in range(0, len(response)):
1651
+ order = response[i]
1652
+ extendOrder = {}
1653
+ if self.safe_string(order, 'status') is None:
1654
+ extendOrder['ccxtStatus'] = 'open'
1655
+ orderWithStatus.append(self.extend(order, extendOrder))
1656
+ return self.parse_orders(orderWithStatus, market, since, limit)
1648
1657
 
1649
1658
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1650
1659
  """
@@ -1656,8 +1665,53 @@ class hyperliquid(Exchange, ImplicitAPI):
1656
1665
  :param str [params.user]: user address, will default to self.walletAddress if not provided
1657
1666
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1658
1667
  """
1668
+ self.load_markets()
1669
+ orders = self.fetch_orders(symbol, None, None, params) # don't filter here because we don't want to catch open orders
1670
+ closedOrders = self.filter_by_array(orders, 'status', ['closed'], False)
1671
+ return self.filter_by_symbol_since_limit(closedOrders, symbol, since, limit)
1672
+
1673
+ def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1674
+ """
1675
+ fetch all canceled orders
1676
+ :param str symbol: unified market symbol
1677
+ :param int [since]: the earliest time in ms to fetch open orders for
1678
+ :param int [limit]: the maximum number of open orders structures to retrieve
1679
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1680
+ :param str [params.user]: user address, will default to self.walletAddress if not provided
1681
+ :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1682
+ """
1683
+ self.load_markets()
1684
+ orders = self.fetch_orders(symbol, None, None, params) # don't filter here because we don't want to catch open orders
1685
+ closedOrders = self.filter_by_array(orders, 'status', ['canceled'], False)
1686
+ return self.filter_by_symbol_since_limit(closedOrders, symbol, since, limit)
1687
+
1688
+ def fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1689
+ """
1690
+ fetch all closed and canceled orders
1691
+ :param str symbol: unified market symbol
1692
+ :param int [since]: the earliest time in ms to fetch open orders for
1693
+ :param int [limit]: the maximum number of open orders structures to retrieve
1694
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1695
+ :param str [params.user]: user address, will default to self.walletAddress if not provided
1696
+ :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1697
+ """
1698
+ self.load_markets()
1699
+ orders = self.fetch_orders(symbol, None, None, params) # don't filter here because we don't want to catch open orders
1700
+ closedOrders = self.filter_by_array(orders, 'status', ['canceled', 'closed', 'rejected'], False)
1701
+ return self.filter_by_symbol_since_limit(closedOrders, symbol, since, limit)
1702
+
1703
+ def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1704
+ """
1705
+ fetch all orders
1706
+ :param str symbol: unified market symbol
1707
+ :param int [since]: the earliest time in ms to fetch open orders for
1708
+ :param int [limit]: the maximum number of open orders structures to retrieve
1709
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1710
+ :param str [params.user]: user address, will default to self.walletAddress if not provided
1711
+ :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1712
+ """
1659
1713
  userAddress = None
1660
- userAddress, params = self.handle_public_address('fetchClosedOrders', params)
1714
+ userAddress, params = self.handle_public_address('fetchOrders', params)
1661
1715
  self.load_markets()
1662
1716
  market = self.safe_market(symbol)
1663
1717
  request: dict = {
@@ -1838,10 +1892,13 @@ class hyperliquid(Exchange, ImplicitAPI):
1838
1892
  market = self.safe_market(marketId, market)
1839
1893
  symbol = market['symbol']
1840
1894
  timestamp = self.safe_integer_2(order, 'timestamp', 'statusTimestamp')
1841
- status = self.safe_string(order, 'status')
1895
+ status = self.safe_string_2(order, 'status', 'ccxtStatus')
1896
+ order = self.omit(order, ['ccxtStatus'])
1842
1897
  side = self.safe_string(entry, 'side')
1843
1898
  if side is not None:
1844
1899
  side = 'sell' if (side == 'A') else 'buy'
1900
+ totalAmount = self.safe_string_2(entry, 'origSz', 'totalSz')
1901
+ remaining = self.safe_string(entry, 'sz')
1845
1902
  return self.safe_order({
1846
1903
  'info': order,
1847
1904
  'id': self.safe_string(entry, 'oid'),
@@ -1856,13 +1913,13 @@ class hyperliquid(Exchange, ImplicitAPI):
1856
1913
  'postOnly': None,
1857
1914
  'reduceOnly': self.safe_bool(entry, 'reduceOnly'),
1858
1915
  'side': side,
1859
- 'price': self.safe_number(entry, 'limitPx'),
1916
+ 'price': self.safe_string(entry, 'limitPx'),
1860
1917
  'triggerPrice': self.safe_number(entry, 'triggerPx') if self.safe_bool(entry, 'isTrigger') else None,
1861
- 'amount': self.safe_number_2(entry, 'sz', 'totalSz'),
1918
+ 'amount': totalAmount,
1862
1919
  'cost': None,
1863
- 'average': self.safe_number(entry, 'avgPx'),
1864
- 'filled': None,
1865
- 'remaining': None,
1920
+ 'average': self.safe_string(entry, 'avgPx'),
1921
+ 'filled': Precise.string_sub(totalAmount, remaining),
1922
+ 'remaining': remaining,
1866
1923
  'status': self.parse_order_status(status),
1867
1924
  'fee': None,
1868
1925
  'trades': None,
@@ -154,11 +154,12 @@ class independentreserve(Exchange, ImplicitAPI):
154
154
  :param dict [params]: extra parameters specific to the exchange API endpoint
155
155
  :returns dict[]: an array of objects representing market data
156
156
  """
157
- baseCurrencies = self.publicGetGetValidPrimaryCurrencyCodes(params)
157
+ baseCurrenciesPromise = self.publicGetGetValidPrimaryCurrencyCodes(params)
158
158
  # ['Xbt', 'Eth', 'Usdt', ...]
159
- quoteCurrencies = self.publicGetGetValidSecondaryCurrencyCodes(params)
159
+ quoteCurrenciesPromise = self.publicGetGetValidSecondaryCurrencyCodes(params)
160
160
  # ['Aud', 'Usd', 'Nzd', 'Sgd']
161
- limits = self.publicGetGetOrderMinimumVolumes(params)
161
+ limitsPromise = self.publicGetGetOrderMinimumVolumes(params)
162
+ baseCurrencies, quoteCurrencies, limits = [baseCurrenciesPromise, quoteCurrenciesPromise, limitsPromise]
162
163
  #
163
164
  # {
164
165
  # "Xbt": 0.0001,
ccxt/indodax.py CHANGED
@@ -831,6 +831,8 @@ class indodax(Exchange, ImplicitAPI):
831
831
  elif type == 'limit':
832
832
  priceIsRequired = True
833
833
  quantityIsRequired = True
834
+ if side == 'buy':
835
+ request[market['quoteId']] = self.parse_to_numeric(Precise.string_mul(self.number_to_string(amount), self.number_to_string(price)))
834
836
  if priceIsRequired:
835
837
  if price is None:
836
838
  raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')