ccxt 4.2.95__py2.py3-none-any.whl → 4.2.96__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.
@@ -300,7 +300,13 @@ class gemini(Exchange, ImplicitAPI):
300
300
  'ATOM': 'cosmos',
301
301
  'DOT': 'polkadot',
302
302
  },
303
- 'nonce': 'milliseconds', # if getting a Network 400 error change to seconds
303
+ 'nonce': 'milliseconds', # if getting a Network 400 error change to seconds,
304
+ 'conflictingMarkets': {
305
+ 'paxgusd': {
306
+ 'base': 'PAXG',
307
+ 'quote': 'USD',
308
+ },
309
+ },
304
310
  },
305
311
  })
306
312
 
@@ -662,16 +668,25 @@ class gemini(Exchange, ImplicitAPI):
662
668
  marketIdUpper = marketId.upper()
663
669
  isPerp = (marketIdUpper.find('PERP') >= 0)
664
670
  marketIdWithoutPerp = marketIdUpper.replace('PERP', '')
665
- quoteQurrencies = self.handle_option('fetchMarketsFromAPI', 'quoteCurrencies', [])
666
- for i in range(0, len(quoteQurrencies)):
667
- quoteCurrency = quoteQurrencies[i]
668
- if marketIdWithoutPerp.endswith(quoteCurrency):
669
- quoteLength = self.parse_to_int(-1 * len(quoteCurrency))
670
- baseId = marketIdWithoutPerp[0:quoteLength]
671
- quoteId = quoteCurrency
672
- if isPerp:
673
- settleId = quoteCurrency # always same
674
- break
671
+ conflictingMarkets = self.safe_dict(self.options, 'conflictingMarkets', {})
672
+ lowerCaseId = marketIdWithoutPerp.lower()
673
+ if lowerCaseId in conflictingMarkets:
674
+ conflictingMarket = conflictingMarkets[lowerCaseId]
675
+ baseId = conflictingMarket['base']
676
+ quoteId = conflictingMarket['quote']
677
+ if isPerp:
678
+ settleId = conflictingMarket['quote']
679
+ else:
680
+ quoteCurrencies = self.handle_option('fetchMarketsFromAPI', 'quoteCurrencies', [])
681
+ for i in range(0, len(quoteCurrencies)):
682
+ quoteCurrency = quoteCurrencies[i]
683
+ if marketIdWithoutPerp.endswith(quoteCurrency):
684
+ quoteLength = self.parse_to_int(-1 * len(quoteCurrency))
685
+ baseId = marketIdWithoutPerp[0:quoteLength]
686
+ quoteId = quoteCurrency
687
+ if isPerp:
688
+ settleId = quoteCurrency # always same
689
+ break
675
690
  base = self.safe_currency_code(baseId)
676
691
  quote = self.safe_currency_code(quoteId)
677
692
  settle = self.safe_currency_code(settleId)
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.95'
7
+ __version__ = '4.2.96'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1341,7 +1341,7 @@ class Exchange(object):
1341
1341
  signature = Exchange.base64_to_binary(Exchange.rsa(token, Exchange.decode(secret), algorithm))
1342
1342
  elif algoType == 'ES':
1343
1343
  rawSignature = Exchange.ecdsa(token, secret, 'p256', algorithm)
1344
- signature = Exchange.base16_to_binary(rawSignature['r'] + rawSignature['s'])
1344
+ signature = Exchange.base16_to_binary(rawSignature['r'].rjust(64, "0") + rawSignature['s'].rjust(64, "0"))
1345
1345
  else:
1346
1346
  signature = Exchange.hmac(Exchange.encode(token), secret, algos[algorithm], 'binary')
1347
1347
  return token + '.' + Exchange.base64urlencode(signature)