ccxt 4.4.75__py2.py3-none-any.whl → 4.4.78__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.
Files changed (111) hide show
  1. ccxt/__init__.py +3 -3
  2. ccxt/abstract/apex.py +31 -0
  3. ccxt/abstract/myokx.py +4 -0
  4. ccxt/abstract/okx.py +4 -0
  5. ccxt/abstract/upbit.py +51 -37
  6. ccxt/abstract/xt.py +3 -0
  7. ccxt/apex.py +1884 -0
  8. ccxt/ascendex.py +2 -2
  9. ccxt/async_support/__init__.py +3 -3
  10. ccxt/async_support/apex.py +1884 -0
  11. ccxt/async_support/ascendex.py +2 -2
  12. ccxt/async_support/base/exchange.py +2 -2
  13. ccxt/async_support/binance.py +39 -217
  14. ccxt/async_support/bingx.py +1 -1
  15. ccxt/async_support/bitfinex.py +2 -2
  16. ccxt/async_support/bitflyer.py +2 -2
  17. ccxt/async_support/bitget.py +135 -65
  18. ccxt/async_support/bitmart.py +2 -2
  19. ccxt/async_support/bitmex.py +6 -6
  20. ccxt/async_support/bitrue.py +48 -0
  21. ccxt/async_support/cex.py +1 -1
  22. ccxt/async_support/coinbase.py +29 -4
  23. ccxt/async_support/coincatch.py +66 -0
  24. ccxt/async_support/coinex.py +3 -1
  25. ccxt/async_support/coinlist.py +85 -2
  26. ccxt/async_support/cryptocom.py +2 -2
  27. ccxt/async_support/defx.py +1 -1
  28. ccxt/async_support/delta.py +1 -1
  29. ccxt/async_support/deribit.py +2 -2
  30. ccxt/async_support/derive.py +2 -2
  31. ccxt/async_support/digifinex.py +2 -2
  32. ccxt/async_support/gate.py +1 -1
  33. ccxt/async_support/hitbtc.py +5 -2
  34. ccxt/async_support/htx.py +2 -2
  35. ccxt/async_support/hyperliquid.py +13 -6
  36. ccxt/async_support/kraken.py +2 -2
  37. ccxt/async_support/krakenfutures.py +2 -2
  38. ccxt/async_support/kucoinfutures.py +2 -2
  39. ccxt/async_support/mexc.py +50 -52
  40. ccxt/async_support/okx.py +21 -9
  41. ccxt/async_support/oxfun.py +2 -2
  42. ccxt/async_support/paradex.py +5 -10
  43. ccxt/async_support/phemex.py +4 -3
  44. ccxt/async_support/poloniex.py +3 -3
  45. ccxt/async_support/probit.py +1 -0
  46. ccxt/async_support/tradeogre.py +2 -1
  47. ccxt/async_support/upbit.py +265 -89
  48. ccxt/async_support/vertex.py +2 -2
  49. ccxt/async_support/whitebit.py +1 -0
  50. ccxt/async_support/woo.py +5 -3
  51. ccxt/async_support/woofipro.py +2 -2
  52. ccxt/async_support/xt.py +115 -5
  53. ccxt/base/exchange.py +76 -3
  54. ccxt/binance.py +39 -217
  55. ccxt/bingx.py +1 -1
  56. ccxt/bitfinex.py +2 -2
  57. ccxt/bitflyer.py +2 -2
  58. ccxt/bitget.py +135 -65
  59. ccxt/bitmart.py +2 -2
  60. ccxt/bitmex.py +6 -6
  61. ccxt/bitrue.py +48 -0
  62. ccxt/cex.py +1 -1
  63. ccxt/coinbase.py +29 -4
  64. ccxt/coincatch.py +66 -0
  65. ccxt/coinex.py +3 -1
  66. ccxt/coinlist.py +85 -2
  67. ccxt/cryptocom.py +2 -2
  68. ccxt/defx.py +1 -1
  69. ccxt/delta.py +1 -1
  70. ccxt/deribit.py +2 -2
  71. ccxt/derive.py +2 -2
  72. ccxt/digifinex.py +2 -2
  73. ccxt/gate.py +1 -1
  74. ccxt/hitbtc.py +5 -2
  75. ccxt/htx.py +2 -2
  76. ccxt/hyperliquid.py +13 -6
  77. ccxt/kraken.py +2 -2
  78. ccxt/krakenfutures.py +2 -2
  79. ccxt/kucoinfutures.py +2 -2
  80. ccxt/mexc.py +50 -52
  81. ccxt/okx.py +21 -9
  82. ccxt/oxfun.py +2 -2
  83. ccxt/paradex.py +5 -10
  84. ccxt/phemex.py +4 -3
  85. ccxt/poloniex.py +3 -3
  86. ccxt/pro/__init__.py +5 -1
  87. ccxt/pro/apex.py +984 -0
  88. ccxt/pro/coinbase.py +4 -6
  89. ccxt/pro/gate.py +22 -2
  90. ccxt/pro/hollaex.py +2 -2
  91. ccxt/pro/hyperliquid.py +1 -1
  92. ccxt/pro/p2b.py +2 -2
  93. ccxt/pro/tradeogre.py +272 -0
  94. ccxt/probit.py +1 -0
  95. ccxt/test/tests_async.py +27 -0
  96. ccxt/test/tests_sync.py +27 -0
  97. ccxt/tradeogre.py +2 -1
  98. ccxt/upbit.py +265 -89
  99. ccxt/vertex.py +2 -2
  100. ccxt/whitebit.py +1 -0
  101. ccxt/woo.py +5 -3
  102. ccxt/woofipro.py +2 -2
  103. ccxt/xt.py +115 -5
  104. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/METADATA +4 -4
  105. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/RECORD +108 -106
  106. ccxt/abstract/ace.py +0 -15
  107. ccxt/ace.py +0 -1152
  108. ccxt/async_support/ace.py +0 -1152
  109. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/LICENSE.txt +0 -0
  110. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/WHEEL +0 -0
  111. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -2633,7 +2633,7 @@ class ascendex(Exchange, ImplicitAPI):
2633
2633
  'internal': False,
2634
2634
  }
2635
2635
 
2636
- async def fetch_positions(self, symbols: Strings = None, params={}):
2636
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2637
2637
  """
2638
2638
  fetch all open positions
2639
2639
  :param str[]|None symbols: list of unified market symbols
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.75'
5
+ __version__ = '4.4.78'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -154,7 +154,7 @@ class Exchange(BaseExchange):
154
154
  proxyUrl = self.check_proxy_url_settings(url, method, headers, body)
155
155
  if proxyUrl is not None:
156
156
  request_headers.update({'Origin': self.origin})
157
- url = proxyUrl + url
157
+ url = proxyUrl + self.url_encoder_for_proxy_url(url)
158
158
  # proxy agents
159
159
  final_proxy = None # set default
160
160
  proxy_session = None
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
11
+ from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -44,7 +44,7 @@ class binance(Exchange, ImplicitAPI):
44
44
  return self.deep_extend(super(binance, self).describe(), {
45
45
  'id': 'binance',
46
46
  'name': 'Binance',
47
- 'countries': ['JP', 'MT'], # Japan, Malta
47
+ 'countries': [], # Japan
48
48
  'rateLimit': 50,
49
49
  'certified': True,
50
50
  'pro': True,
@@ -1357,195 +1357,8 @@ class binance(Exchange, ImplicitAPI):
1357
1357
  'SPL': 'SOL', # temporarily keep support for SPL(old name)
1358
1358
  'SOL': 'SOL', # we shouldn't rename SOL
1359
1359
  },
1360
- # keeping self object for backward-compatibility
1361
- 'reverseNetworks': {
1362
- 'tronscan.org': 'TRC20',
1363
- 'etherscan.io': 'ERC20',
1364
- 'bscscan.com': 'BSC',
1365
- 'explorer.binance.org': 'BEP2',
1366
- 'bithomp.com': 'XRP',
1367
- 'bloks.io': 'EOS',
1368
- 'stellar.expert': 'XLM',
1369
- 'blockchair.com/bitcoin': 'BTC',
1370
- 'blockchair.com/bitcoin-cash': 'BCH',
1371
- 'blockchair.com/ecash': 'XEC',
1372
- 'explorer.litecoin.net': 'LTC',
1373
- 'explorer.avax.network': 'AVAX',
1374
- 'solscan.io': 'SOL',
1375
- 'polkadot.subscan.io': 'DOT',
1376
- 'dashboard.internetcomputer.org': 'ICP',
1377
- 'explorer.chiliz.com': 'CHZ',
1378
- 'cardanoscan.io': 'ADA',
1379
- 'mainnet.theoan.com': 'AION',
1380
- 'algoexplorer.io': 'ALGO',
1381
- 'explorer.ambrosus.com': 'AMB',
1382
- 'viewblock.io/zilliqa': 'ZIL',
1383
- 'viewblock.io/arweave': 'AR',
1384
- 'explorer.ark.io': 'ARK',
1385
- 'atomscan.com': 'ATOM',
1386
- 'www.mintscan.io': 'CTK',
1387
- 'explorer.bitcoindiamond.org': 'BCD',
1388
- 'btgexplorer.com': 'BTG',
1389
- 'bts.ai': 'BTS',
1390
- 'explorer.celo.org': 'CELO',
1391
- 'explorer.nervos.org': 'CKB',
1392
- 'cerebro.cortexlabs.ai': 'CTXC',
1393
- 'chainz.cryptoid.info': 'VIA',
1394
- 'explorer.dcrdata.org': 'DCR',
1395
- 'digiexplorer.info': 'DGB',
1396
- 'dock.subscan.io': 'DOCK',
1397
- 'dogechain.info': 'DOGE',
1398
- 'explorer.elrond.com': 'EGLD',
1399
- 'blockscout.com': 'ETC',
1400
- 'explore-fetchhub.fetch.ai': 'FET',
1401
- 'filfox.info': 'FIL',
1402
- 'fio.bloks.io': 'FIO',
1403
- 'explorer.firo.org': 'FIRO',
1404
- 'neoscan.io': 'NEO',
1405
- 'ftmscan.com': 'FTM',
1406
- 'explorer.gochain.io': 'GO',
1407
- 'block.gxb.io': 'GXS',
1408
- 'hash-hash.info': 'HBAR',
1409
- 'www.hiveblockexplorer.com': 'HIVE',
1410
- 'explorer.helium.com': 'HNT',
1411
- 'tracker.icon.foundation': 'ICX',
1412
- 'www.iostabc.com': 'IOST',
1413
- 'explorer.iota.org': 'IOTA',
1414
- 'iotexscan.io': 'IOTX',
1415
- 'irishub.iobscan.io': 'IRIS',
1416
- 'kava.mintscan.io': 'KAVA',
1417
- 'scope.klaytn.com': 'KLAY',
1418
- 'kmdexplorer.io': 'KMD',
1419
- 'kusama.subscan.io': 'KSM',
1420
- 'explorer.lto.network': 'LTO',
1421
- 'polygonscan.com': 'POLYGON',
1422
- 'explorer.ont.io': 'ONT',
1423
- 'minaexplorer.com': 'MINA',
1424
- 'nanolooker.com': 'NANO',
1425
- 'explorer.nebulas.io': 'NAS',
1426
- 'explorer.nbs.plus': 'NBS',
1427
- 'explorer.nebl.io': 'NEBL',
1428
- 'nulscan.io': 'NULS',
1429
- 'nxscan.com': 'NXS',
1430
- 'explorer.harmony.one': 'ONE',
1431
- 'explorer.poa.network': 'POA',
1432
- 'qtum.info': 'QTUM',
1433
- 'explorer.rsk.co': 'RSK',
1434
- 'www.oasisscan.com': 'ROSE',
1435
- 'ravencoin.network': 'RVN',
1436
- 'sc.tokenview.com': 'SC',
1437
- 'secretnodes.com': 'SCRT',
1438
- 'explorer.skycoin.com': 'SKY',
1439
- 'steemscan.com': 'STEEM',
1440
- 'explorer.stacks.co': 'STX',
1441
- 'www.thetascan.io': 'THETA',
1442
- 'scan.tomochain.com': 'TOMO',
1443
- 'explore.vechain.org': 'VET',
1444
- 'explorer.vite.net': 'VITE',
1445
- 'www.wanscan.org': 'WAN',
1446
- 'wavesexplorer.com': 'WAVES',
1447
- 'wax.eosx.io': 'WAXP',
1448
- 'waltonchain.pro': 'WTC',
1449
- 'chain.nem.ninja': 'XEM',
1450
- 'verge-blockchain.info': 'XVG',
1451
- 'explorer.yoyow.org': 'YOYOW',
1452
- 'explorer.zcha.in': 'ZEC',
1453
- 'explorer.zensystem.io': 'ZEN',
1454
- },
1455
1360
  'networksById': {
1456
1361
  'SOL': 'SOL', # temporary fix for SPL definition
1457
- 'tronscan.org': 'TRC20',
1458
- 'etherscan.io': 'ERC20',
1459
- 'bscscan.com': 'BSC',
1460
- 'explorer.binance.org': 'BEP2',
1461
- 'bithomp.com': 'XRP',
1462
- 'bloks.io': 'EOS',
1463
- 'stellar.expert': 'XLM',
1464
- 'blockchair.com/bitcoin': 'BTC',
1465
- 'blockchair.com/bitcoin-cash': 'BCH',
1466
- 'blockchair.com/ecash': 'XEC',
1467
- 'explorer.litecoin.net': 'LTC',
1468
- 'explorer.avax.network': 'AVAX',
1469
- 'solscan.io': 'SOL',
1470
- 'polkadot.subscan.io': 'DOT',
1471
- 'dashboard.internetcomputer.org': 'ICP',
1472
- 'explorer.chiliz.com': 'CHZ',
1473
- 'cardanoscan.io': 'ADA',
1474
- 'mainnet.theoan.com': 'AION',
1475
- 'algoexplorer.io': 'ALGO',
1476
- 'explorer.ambrosus.com': 'AMB',
1477
- 'viewblock.io/zilliqa': 'ZIL',
1478
- 'viewblock.io/arweave': 'AR',
1479
- 'explorer.ark.io': 'ARK',
1480
- 'atomscan.com': 'ATOM',
1481
- 'www.mintscan.io': 'CTK',
1482
- 'explorer.bitcoindiamond.org': 'BCD',
1483
- 'btgexplorer.com': 'BTG',
1484
- 'bts.ai': 'BTS',
1485
- 'explorer.celo.org': 'CELO',
1486
- 'explorer.nervos.org': 'CKB',
1487
- 'cerebro.cortexlabs.ai': 'CTXC',
1488
- 'chainz.cryptoid.info': 'VIA',
1489
- 'explorer.dcrdata.org': 'DCR',
1490
- 'digiexplorer.info': 'DGB',
1491
- 'dock.subscan.io': 'DOCK',
1492
- 'dogechain.info': 'DOGE',
1493
- 'explorer.elrond.com': 'EGLD',
1494
- 'blockscout.com': 'ETC',
1495
- 'explore-fetchhub.fetch.ai': 'FET',
1496
- 'filfox.info': 'FIL',
1497
- 'fio.bloks.io': 'FIO',
1498
- 'explorer.firo.org': 'FIRO',
1499
- 'neoscan.io': 'NEO',
1500
- 'ftmscan.com': 'FTM',
1501
- 'explorer.gochain.io': 'GO',
1502
- 'block.gxb.io': 'GXS',
1503
- 'hash-hash.info': 'HBAR',
1504
- 'www.hiveblockexplorer.com': 'HIVE',
1505
- 'explorer.helium.com': 'HNT',
1506
- 'tracker.icon.foundation': 'ICX',
1507
- 'www.iostabc.com': 'IOST',
1508
- 'explorer.iota.org': 'IOTA',
1509
- 'iotexscan.io': 'IOTX',
1510
- 'irishub.iobscan.io': 'IRIS',
1511
- 'kava.mintscan.io': 'KAVA',
1512
- 'scope.klaytn.com': 'KLAY',
1513
- 'kmdexplorer.io': 'KMD',
1514
- 'kusama.subscan.io': 'KSM',
1515
- 'explorer.lto.network': 'LTO',
1516
- 'polygonscan.com': 'POLYGON',
1517
- 'explorer.ont.io': 'ONT',
1518
- 'minaexplorer.com': 'MINA',
1519
- 'nanolooker.com': 'NANO',
1520
- 'explorer.nebulas.io': 'NAS',
1521
- 'explorer.nbs.plus': 'NBS',
1522
- 'explorer.nebl.io': 'NEBL',
1523
- 'nulscan.io': 'NULS',
1524
- 'nxscan.com': 'NXS',
1525
- 'explorer.harmony.one': 'ONE',
1526
- 'explorer.poa.network': 'POA',
1527
- 'qtum.info': 'QTUM',
1528
- 'explorer.rsk.co': 'RSK',
1529
- 'www.oasisscan.com': 'ROSE',
1530
- 'ravencoin.network': 'RVN',
1531
- 'sc.tokenview.com': 'SC',
1532
- 'secretnodes.com': 'SCRT',
1533
- 'explorer.skycoin.com': 'SKY',
1534
- 'steemscan.com': 'STEEM',
1535
- 'explorer.stacks.co': 'STX',
1536
- 'www.thetascan.io': 'THETA',
1537
- 'scan.tomochain.com': 'TOMO',
1538
- 'explore.vechain.org': 'VET',
1539
- 'explorer.vite.net': 'VITE',
1540
- 'www.wanscan.org': 'WAN',
1541
- 'wavesexplorer.com': 'WAVES',
1542
- 'wax.eosx.io': 'WAXP',
1543
- 'waltonchain.pro': 'WTC',
1544
- 'chain.nem.ninja': 'XEM',
1545
- 'verge-blockchain.info': 'XVG',
1546
- 'explorer.yoyow.org': 'YOYOW',
1547
- 'explorer.zcha.in': 'ZEC',
1548
- 'explorer.zensystem.io': 'ZEN',
1549
1362
  },
1550
1363
  'impliedNetworks': {
1551
1364
  'ETH': {'ERC20': 'ETH'},
@@ -8707,39 +8520,19 @@ class binance(Exchange, ImplicitAPI):
8707
8520
  def parse_deposit_address(self, response, currency: Currency = None) -> DepositAddress:
8708
8521
  #
8709
8522
  # {
8710
- # "currency": "XRP",
8523
+ # "coin": "XRP",
8711
8524
  # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8712
8525
  # "tag": "108618262",
8713
- # "info": {
8714
- # "coin": "XRP",
8715
- # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8716
- # "tag": "108618262",
8717
- # "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
8718
- # }
8526
+ # "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
8719
8527
  # }
8720
8528
  #
8721
- info = self.safe_dict(response, 'info', {})
8722
- url = self.safe_string(info, 'url')
8529
+ url = self.safe_string(response, 'url')
8723
8530
  address = self.safe_string(response, 'address')
8724
8531
  currencyId = self.safe_string(response, 'currency')
8725
8532
  code = self.safe_currency_code(currencyId, currency)
8726
- impliedNetwork = None
8727
- if url is not None:
8728
- reverseNetworks = self.safe_dict(self.options, 'reverseNetworks', {})
8729
- parts = url.split('/')
8730
- topLevel = self.safe_string(parts, 2)
8731
- if (topLevel == 'blockchair.com') or (topLevel == 'viewblock.io'):
8732
- subLevel = self.safe_string(parts, 3)
8733
- if subLevel is not None:
8734
- topLevel = topLevel + '/' + subLevel
8735
- impliedNetwork = self.safe_string(reverseNetworks, topLevel)
8736
- impliedNetworks = self.safe_dict(self.options, 'impliedNetworks', {
8737
- 'ETH': {'ERC20': 'ETH'},
8738
- 'TRX': {'TRC20': 'TRX'},
8739
- })
8740
- if code in impliedNetworks:
8741
- conversion = self.safe_dict(impliedNetworks, code, {})
8742
- impliedNetwork = self.safe_string(conversion, impliedNetwork, impliedNetwork)
8533
+ # deposit-address endpoint provides only network url(not network ID/CODE)
8534
+ # so we should map the url to network(their data is inside currencies)
8535
+ networkCode = self.get_network_code_by_network_url(code, url)
8743
8536
  tag = self.safe_string(response, 'tag', '')
8744
8537
  if len(tag) == 0:
8745
8538
  tag = None
@@ -8747,7 +8540,7 @@ class binance(Exchange, ImplicitAPI):
8747
8540
  return {
8748
8541
  'info': response,
8749
8542
  'currency': code,
8750
- 'network': impliedNetwork,
8543
+ 'network': networkCode,
8751
8544
  'address': address,
8752
8545
  'tag': tag,
8753
8546
  }
@@ -10318,7 +10111,7 @@ class binance(Exchange, ImplicitAPI):
10318
10111
  'percentage': None,
10319
10112
  })
10320
10113
 
10321
- async def fetch_positions(self, symbols: Strings = None, params={}):
10114
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
10322
10115
  """
10323
10116
  fetch all open positions
10324
10117
 
@@ -11295,6 +11088,35 @@ class binance(Exchange, ImplicitAPI):
11295
11088
  }
11296
11089
  return self.safe_string(ledgerType, type, type)
11297
11090
 
11091
+ def get_network_code_by_network_url(self, currencyCode: str, depositUrl: Str = None) -> Str:
11092
+ # depositUrl is like : https://bscscan.com/address/0xEF238AB229342849..
11093
+ if depositUrl is None:
11094
+ return None
11095
+ networkCode = None
11096
+ currency = self.currency(currencyCode)
11097
+ networks = self.safe_dict(currency, 'networks', {})
11098
+ networkCodes = list(networks.keys())
11099
+ for i in range(0, len(networkCodes)):
11100
+ currentNetworkCode = networkCodes[i]
11101
+ info = self.safe_dict(networks[currentNetworkCode], 'info', {})
11102
+ siteUrl = self.safe_string(info, 'contractAddressUrl')
11103
+ # check if url matches the field's value
11104
+ if siteUrl is not None and depositUrl.startswith(self.get_base_domain_from_url(siteUrl)):
11105
+ networkCode = currentNetworkCode
11106
+ return networkCode
11107
+
11108
+ def get_base_domain_from_url(self, url: Str) -> Str:
11109
+ if url is None:
11110
+ return None
11111
+ urlParts = url.split('/')
11112
+ scheme = self.safe_string(urlParts, 0)
11113
+ if scheme is None:
11114
+ return None
11115
+ domain = self.safe_string(urlParts, 2)
11116
+ if domain is None:
11117
+ return None
11118
+ return scheme + '//' + domain + '/'
11119
+
11298
11120
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
11299
11121
  urls = self.urls
11300
11122
  if not (api in urls['api']):
@@ -2372,7 +2372,7 @@ class bingx(Exchange, ImplicitAPI):
2372
2372
  positions = self.parse_positions(records)
2373
2373
  return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
2374
2374
 
2375
- async def fetch_positions(self, symbols: Strings = None, params={}):
2375
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2376
2376
  """
2377
2377
  fetch all open positions
2378
2378
 
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -2676,7 +2676,7 @@ class bitfinex(Exchange, ImplicitAPI):
2676
2676
  self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
2677
2677
  return self.parse_transaction(response, currency)
2678
2678
 
2679
- async def fetch_positions(self, symbols: Strings = None, params={}):
2679
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2680
2680
  """
2681
2681
  fetch all open positions
2682
2682
 
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitflyer import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
9
+ from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -842,7 +842,7 @@ class bitflyer(Exchange, ImplicitAPI):
842
842
  #
843
843
  return self.parse_trades(response, market, since, limit)
844
844
 
845
- async def fetch_positions(self, symbols: Strings = None, params={}):
845
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
846
846
  """
847
847
  fetch all open positions
848
848