ccxt 4.4.26__py2.py3-none-any.whl → 4.4.27__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 (97) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/alpaca.py +2 -0
  3. ccxt/abstract/hyperliquid.py +1 -1
  4. ccxt/ace.py +1 -1
  5. ccxt/alpaca.py +182 -6
  6. ccxt/ascendex.py +1 -1
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/ace.py +1 -1
  9. ccxt/async_support/alpaca.py +182 -6
  10. ccxt/async_support/ascendex.py +1 -1
  11. ccxt/async_support/base/exchange.py +19 -1
  12. ccxt/async_support/bequant.py +1 -1
  13. ccxt/async_support/bigone.py +1 -1
  14. ccxt/async_support/binance.py +1 -1
  15. ccxt/async_support/binancecoinm.py +1 -1
  16. ccxt/async_support/binanceus.py +1 -1
  17. ccxt/async_support/binanceusdm.py +1 -1
  18. ccxt/async_support/bingx.py +23 -28
  19. ccxt/async_support/bit2c.py +1 -1
  20. ccxt/async_support/bitbank.py +1 -1
  21. ccxt/async_support/bitbns.py +1 -1
  22. ccxt/async_support/bitfinex.py +1 -1
  23. ccxt/async_support/bitfinex2.py +1 -1
  24. ccxt/async_support/bitflyer.py +1 -1
  25. ccxt/async_support/bitget.py +1 -1
  26. ccxt/async_support/bithumb.py +1 -1
  27. ccxt/async_support/bitmart.py +1 -1
  28. ccxt/async_support/bitmex.py +1 -1
  29. ccxt/async_support/bitopro.py +1 -1
  30. ccxt/async_support/bitrue.py +1 -1
  31. ccxt/async_support/bitso.py +1 -1
  32. ccxt/async_support/bitstamp.py +1 -1
  33. ccxt/async_support/bitteam.py +1 -1
  34. ccxt/async_support/bitvavo.py +1 -1
  35. ccxt/async_support/bl3p.py +1 -1
  36. ccxt/async_support/blockchaincom.py +1 -1
  37. ccxt/async_support/blofin.py +1 -1
  38. ccxt/async_support/btcalpha.py +1 -1
  39. ccxt/async_support/btcbox.py +1 -1
  40. ccxt/async_support/btcmarkets.py +1 -1
  41. ccxt/async_support/btcturk.py +1 -1
  42. ccxt/async_support/bybit.py +4 -1
  43. ccxt/async_support/coinbase.py +89 -11
  44. ccxt/async_support/coinex.py +1 -1
  45. ccxt/async_support/gate.py +20 -16
  46. ccxt/async_support/hyperliquid.py +19 -1
  47. ccxt/async_support/lbank.py +97 -2
  48. ccxt/async_support/wavesexchange.py +13 -2
  49. ccxt/base/exchange.py +19 -1
  50. ccxt/bequant.py +1 -1
  51. ccxt/bigone.py +1 -1
  52. ccxt/binance.py +1 -1
  53. ccxt/binancecoinm.py +1 -1
  54. ccxt/binanceus.py +1 -1
  55. ccxt/binanceusdm.py +1 -1
  56. ccxt/bingx.py +23 -28
  57. ccxt/bit2c.py +1 -1
  58. ccxt/bitbank.py +1 -1
  59. ccxt/bitbns.py +1 -1
  60. ccxt/bitfinex.py +1 -1
  61. ccxt/bitfinex2.py +1 -1
  62. ccxt/bitflyer.py +1 -1
  63. ccxt/bitget.py +1 -1
  64. ccxt/bithumb.py +1 -1
  65. ccxt/bitmart.py +1 -1
  66. ccxt/bitmex.py +1 -1
  67. ccxt/bitopro.py +1 -1
  68. ccxt/bitrue.py +1 -1
  69. ccxt/bitso.py +1 -1
  70. ccxt/bitstamp.py +1 -1
  71. ccxt/bitteam.py +1 -1
  72. ccxt/bitvavo.py +1 -1
  73. ccxt/bl3p.py +1 -1
  74. ccxt/blockchaincom.py +1 -1
  75. ccxt/blofin.py +1 -1
  76. ccxt/btcalpha.py +1 -1
  77. ccxt/btcbox.py +1 -1
  78. ccxt/btcmarkets.py +1 -1
  79. ccxt/btcturk.py +1 -1
  80. ccxt/bybit.py +4 -1
  81. ccxt/coinbase.py +89 -11
  82. ccxt/coinex.py +1 -1
  83. ccxt/gate.py +20 -16
  84. ccxt/hyperliquid.py +19 -1
  85. ccxt/lbank.py +97 -2
  86. ccxt/pro/__init__.py +1 -1
  87. ccxt/pro/binance.py +2 -2
  88. ccxt/pro/bybit.py +1 -1
  89. ccxt/pro/lbank.py +7 -4
  90. ccxt/pro/okx.py +1 -1
  91. ccxt/wavesexchange.py +13 -2
  92. ccxt-4.4.27.dist-info/METADATA +637 -0
  93. {ccxt-4.4.26.dist-info → ccxt-4.4.27.dist-info}/RECORD +96 -96
  94. ccxt-4.4.26.dist-info/METADATA +0 -636
  95. {ccxt-4.4.26.dist-info → ccxt-4.4.27.dist-info}/LICENSE.txt +0 -0
  96. {ccxt-4.4.26.dist-info → ccxt-4.4.27.dist-info}/WHEEL +0 -0
  97. {ccxt-4.4.26.dist-info → ccxt-4.4.27.dist-info}/top_level.txt +0 -0
@@ -212,7 +212,7 @@ class binance(Exchange, ImplicitAPI):
212
212
  '1M': '1M',
213
213
  },
214
214
  'urls': {
215
- 'logo': 'https://user-images.githubusercontent.com/1294454/29604020-d5483cdc-87ee-11e7-94c7-d1a8d9169293.jpg',
215
+ 'logo': 'https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b',
216
216
  'test': {
217
217
  'dapiPublic': 'https://testnet.binancefuture.com/dapi/v1',
218
218
  'dapiPrivate': 'https://testnet.binancefuture.com/dapi/v1',
@@ -14,7 +14,7 @@ class binancecoinm(binance, ImplicitAPI):
14
14
  'id': 'binancecoinm',
15
15
  'name': 'Binance COIN-M',
16
16
  'urls': {
17
- 'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
17
+ 'logo': 'https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c',
18
18
  'doc': [
19
19
  'https://binance-docs.github.io/apidocs/delivery/en/',
20
20
  'https://binance-docs.github.io/apidocs/spot/en',
@@ -19,7 +19,7 @@ class binanceus(binance, ImplicitAPI):
19
19
  'certified': False,
20
20
  'pro': True,
21
21
  'urls': {
22
- 'logo': 'https://user-images.githubusercontent.com/1294454/65177307-217b7c80-da5f-11e9-876e-0b748ba0a358.jpg',
22
+ 'logo': 'https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c',
23
23
  'api': {
24
24
  'web': 'https://www.binance.us',
25
25
  'public': 'https://api.binance.us/api/v3',
@@ -15,7 +15,7 @@ class binanceusdm(binance, ImplicitAPI):
15
15
  'id': 'binanceusdm',
16
16
  'name': 'Binance USDⓈ-M',
17
17
  'urls': {
18
- 'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
18
+ 'logo': 'https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a',
19
19
  'doc': [
20
20
  'https://binance-docs.github.io/apidocs/futures/en/',
21
21
  'https://binance-docs.github.io/apidocs/spot/en',
@@ -2683,26 +2683,26 @@ class bingx(Exchange, ImplicitAPI):
2683
2683
  """
2684
2684
  await self.load_markets()
2685
2685
  ordersRequests = []
2686
- symbol = None
2686
+ marketIds = []
2687
2687
  for i in range(0, len(orders)):
2688
2688
  rawOrder = orders[i]
2689
2689
  marketId = self.safe_string(rawOrder, 'symbol')
2690
- if symbol is None:
2691
- symbol = marketId
2692
- else:
2693
- if symbol != marketId:
2694
- raise BadRequest(self.id + ' createOrders() requires all orders to have the same symbol')
2695
2690
  type = self.safe_string(rawOrder, 'type')
2691
+ marketIds.append(marketId)
2696
2692
  side = self.safe_string(rawOrder, 'side')
2697
2693
  amount = self.safe_number(rawOrder, 'amount')
2698
2694
  price = self.safe_number(rawOrder, 'price')
2699
2695
  orderParams = self.safe_dict(rawOrder, 'params', {})
2700
2696
  orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
2701
2697
  ordersRequests.append(orderRequest)
2702
- market = self.market(symbol)
2698
+ symbols = self.market_symbols(marketIds, None, False, True, True)
2699
+ symbolsLength = len(symbols)
2700
+ market = self.market(symbols[0])
2703
2701
  request: dict = {}
2704
2702
  response = None
2705
2703
  if market['swap']:
2704
+ if symbolsLength > 5:
2705
+ raise InvalidOrder(self.id + ' createOrders() can not create more than 5 orders at once for swap markets')
2706
2706
  request['batchOrders'] = self.json(ordersRequests)
2707
2707
  response = await self.swapV2PrivatePostTradeBatchOrders(request)
2708
2708
  else:
@@ -2756,6 +2756,12 @@ class bingx(Exchange, ImplicitAPI):
2756
2756
  # }
2757
2757
  # }
2758
2758
  #
2759
+ if isinstance(response, str):
2760
+ # broken api engine : order-ids are too long numbers(i.e. 1742930526912864656)
2761
+ # and json.loadscan not handle them in JS, so we have to use .parseJson
2762
+ # however, when order has an attached SL/TP, their value types need extra parsing
2763
+ response = self.fix_stringified_json_members(response)
2764
+ response = self.parse_json(response)
2759
2765
  data = self.safe_dict(response, 'data', {})
2760
2766
  result = self.safe_list(data, 'orders', [])
2761
2767
  return self.parse_orders(result, market)
@@ -4300,32 +4306,21 @@ class bingx(Exchange, ImplicitAPI):
4300
4306
 
4301
4307
  def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4302
4308
  #
4303
- # {
4304
- # "coinId": "799",
4305
- # "coin": "USDT",
4306
- # "network": "BEP20",
4307
- # "address": "6a7eda2817462dabb6493277a2cfe0f5c3f2550b",
4308
- # "tag": ''
4309
- # }
4309
+ # {
4310
+ # "coinId":"4",
4311
+ # "coin":"USDT",
4312
+ # "network":"OMNI",
4313
+ # "address":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN",
4314
+ # "addressWithPrefix":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN"
4315
+ # }
4310
4316
  #
4311
- address = self.safe_string(depositAddress, 'address')
4312
4317
  tag = self.safe_string(depositAddress, 'tag')
4313
4318
  currencyId = self.safe_string(depositAddress, 'coin')
4314
4319
  currency = self.safe_currency(currencyId, currency)
4315
4320
  code = currency['code']
4316
- # the exchange API returns deposit addresses without the leading '0x' prefix
4317
- # however, the exchange API does require the 0x prefix to withdraw
4318
- # so we append the prefix before returning the address to the user
4319
- # that is only if the underlying contract address has the 0x prefix
4320
- networkCode = self.safe_string(depositAddress, 'network')
4321
- if networkCode is not None:
4322
- if networkCode in currency['networks']:
4323
- network = currency['networks'][networkCode]
4324
- contractAddress = self.safe_string(network['info'], 'contractAddress')
4325
- if contractAddress is not None:
4326
- if contractAddress[0] == '0' and contractAddress[1] == 'x':
4327
- if address[0] != '0' or address[1] != 'x':
4328
- address = '0x' + address
4321
+ address = self.safe_string(depositAddress, 'addressWithPrefix')
4322
+ networkdId = self.safe_string(depositAddress, 'network')
4323
+ networkCode = self.network_id_to_code(networkdId, code)
4329
4324
  self.check_address(address)
4330
4325
  return {
4331
4326
  'info': depositAddress,
@@ -85,7 +85,7 @@ class bit2c(Exchange, ImplicitAPI):
85
85
  'ws': False,
86
86
  },
87
87
  'urls': {
88
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766119-3593220e-5ece-11e7-8b3a-5a041f6bcc3f.jpg',
88
+ 'logo': 'https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa',
89
89
  'api': {
90
90
  'rest': 'https://bit2c.co.il',
91
91
  },
@@ -100,7 +100,7 @@ class bitbank(Exchange, ImplicitAPI):
100
100
  },
101
101
  'hostname': 'bitbank.cc',
102
102
  'urls': {
103
- 'logo': 'https://user-images.githubusercontent.com/1294454/37808081-b87f2d9c-2e59-11e8-894d-c1900b7584fe.jpg',
103
+ 'logo': 'https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348',
104
104
  'api': {
105
105
  'public': 'https://public.{hostname}',
106
106
  'private': 'https://api.{hostname}',
@@ -74,7 +74,7 @@ class bitbns(Exchange, ImplicitAPI):
74
74
  },
75
75
  'hostname': 'bitbns.com',
76
76
  'urls': {
77
- 'logo': 'https://user-images.githubusercontent.com/1294454/117201933-e7a6e780-adf5-11eb-9d80-98fc2a21c3d6.jpg',
77
+ 'logo': 'https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9',
78
78
  'api': {
79
79
  'www': 'https://{hostname}',
80
80
  'v1': 'https://api.{hostname}/api/trade/v1',
@@ -105,7 +105,7 @@ class bitfinex(Exchange, ImplicitAPI):
105
105
  '1M': '1M',
106
106
  },
107
107
  'urls': {
108
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg',
108
+ 'logo': 'https://github.com/user-attachments/assets/9147c6c5-7197-481e-827b-7483672bb0e9',
109
109
  'api': {
110
110
  'v2': 'https://api-pub.bitfinex.com', # https://github.com/ccxt/ccxt/issues/5109
111
111
  'public': 'https://api.bitfinex.com',
@@ -148,7 +148,7 @@ class bitfinex2(Exchange, ImplicitAPI):
148
148
  # cheapest endpoint is 240 requests per minute => ~ 4 requests per second =>( 1000ms / 4 ) = 250ms between requests on average
149
149
  'rateLimit': 250,
150
150
  'urls': {
151
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg',
151
+ 'logo': 'https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178',
152
152
  'api': {
153
153
  'v1': 'https://api.bitfinex.com',
154
154
  'public': 'https://api-pub.bitfinex.com',
@@ -62,7 +62,7 @@ class bitflyer(Exchange, ImplicitAPI):
62
62
  'withdraw': True,
63
63
  },
64
64
  'urls': {
65
- 'logo': 'https://user-images.githubusercontent.com/1294454/28051642-56154182-660e-11e7-9b0d-6042d1e6edd8.jpg',
65
+ 'logo': 'https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb',
66
66
  'api': {
67
67
  'rest': 'https://api.{hostname}',
68
68
  },
@@ -182,7 +182,7 @@ class bitget(Exchange, ImplicitAPI):
182
182
  },
183
183
  'hostname': 'bitget.com',
184
184
  'urls': {
185
- 'logo': 'https://user-images.githubusercontent.com/1294454/195989417-4253ddb0-afbe-4a1c-9dea-9dbcd121fa5d.jpg',
185
+ 'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
186
186
  'api': {
187
187
  'spot': 'https://api.{hostname}',
188
188
  'mix': 'https://api.{hostname}',
@@ -88,7 +88,7 @@ class bithumb(Exchange, ImplicitAPI):
88
88
  },
89
89
  'hostname': 'bithumb.com',
90
90
  'urls': {
91
- 'logo': 'https://user-images.githubusercontent.com/1294454/30597177-ea800172-9d5e-11e7-804c-b9d4fa9b56b0.jpg',
91
+ 'logo': 'https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d',
92
92
  'api': {
93
93
  'public': 'https://api.{hostname}/public',
94
94
  'private': 'https://api.{hostname}',
@@ -127,7 +127,7 @@ class bitmart(Exchange, ImplicitAPI):
127
127
  },
128
128
  'hostname': 'bitmart.com', # bitmart.info, bitmart.news for Hong Kong users
129
129
  'urls': {
130
- 'logo': 'https://user-images.githubusercontent.com/1294454/129991357-8f47464b-d0f4-41d6-8a82-34122f0d1398.jpg',
130
+ 'logo': 'https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14',
131
131
  'api': {
132
132
  'spot': 'https://api-cloud.{hostname}',
133
133
  'swap': 'https://api-cloud-v2.{hostname}', # bitmart.info for Hong Kong users
@@ -119,7 +119,7 @@ class bitmex(Exchange, ImplicitAPI):
119
119
  'public': 'https://testnet.bitmex.com',
120
120
  'private': 'https://testnet.bitmex.com',
121
121
  },
122
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/cea9cfe5-c57e-4b84-b2ac-77b960b04445',
122
+ 'logo': 'https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04',
123
123
  'api': {
124
124
  'public': 'https://www.bitmex.com',
125
125
  'private': 'https://www.bitmex.com',
@@ -112,7 +112,7 @@ class bitopro(Exchange, ImplicitAPI):
112
112
  '1M': '1M',
113
113
  },
114
114
  'urls': {
115
- 'logo': 'https://user-images.githubusercontent.com/1294454/158227251-3a92a220-9222-453c-9277-977c6677fe71.jpg',
115
+ 'logo': 'https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6',
116
116
  'api': {
117
117
  'rest': 'https://api.bitopro.com/v3',
118
118
  },
@@ -116,7 +116,7 @@ class bitrue(Exchange, ImplicitAPI):
116
116
  '1w': '1W',
117
117
  },
118
118
  'urls': {
119
- 'logo': 'https://user-images.githubusercontent.com/1294454/139516488-243a830d-05dd-446b-91c6-c1f18fe30c63.jpg',
119
+ 'logo': 'https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e',
120
120
  'api': {
121
121
  'spot': 'https://www.bitrue.com/api',
122
122
  'fapi': 'https://fapi.bitrue.com/fapi',
@@ -104,7 +104,7 @@ class bitso(Exchange, ImplicitAPI):
104
104
  'withdraw': True,
105
105
  },
106
106
  'urls': {
107
- 'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
107
+ 'logo': 'https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975',
108
108
  'api': {
109
109
  'rest': 'https://bitso.com/api',
110
110
  },
@@ -107,7 +107,7 @@ class bitstamp(Exchange, ImplicitAPI):
107
107
  'withdraw': True,
108
108
  },
109
109
  'urls': {
110
- 'logo': 'https://user-images.githubusercontent.com/1294454/27786377-8c8ab57e-5fe9-11e7-8ea4-2b05b6bcceec.jpg',
110
+ 'logo': 'https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024',
111
111
  'api': {
112
112
  'public': 'https://www.bitstamp.net/api',
113
113
  'private': 'https://www.bitstamp.net/api',
@@ -137,7 +137,7 @@ class bitteam(Exchange, ImplicitAPI):
137
137
  '1d': '1D',
138
138
  },
139
139
  'urls': {
140
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/cf71fe3d-b8b4-40f2-a906-907661b28793',
140
+ 'logo': 'https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135',
141
141
  'api': {
142
142
  'history': 'https://history.bit.team',
143
143
  'public': 'https://bit.team',
@@ -127,7 +127,7 @@ class bitvavo(Exchange, ImplicitAPI):
127
127
  '1d': '1d',
128
128
  },
129
129
  'urls': {
130
- 'logo': 'https://user-images.githubusercontent.com/1294454/169202626-bd130fc5-fcf9-41bb-8d97-6093225c73cd.jpg',
130
+ 'logo': 'https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8',
131
131
  'api': {
132
132
  'public': 'https://api.bitvavo.com',
133
133
  'private': 'https://api.bitvavo.com',
@@ -82,7 +82,7 @@ class bl3p(Exchange, ImplicitAPI):
82
82
  'ws': False,
83
83
  },
84
84
  'urls': {
85
- 'logo': 'https://user-images.githubusercontent.com/1294454/28501752-60c21b82-6feb-11e7-818b-055ee6d0e754.jpg',
85
+ 'logo': 'https://github.com/user-attachments/assets/75aeb14e-cd48-43c8-8492-dff002dea0be',
86
86
  'api': {
87
87
  'rest': 'https://api.bl3p.eu',
88
88
  },
@@ -82,7 +82,7 @@ class blockchaincom(Exchange, ImplicitAPI):
82
82
  },
83
83
  'timeframes': None,
84
84
  'urls': {
85
- 'logo': 'https://user-images.githubusercontent.com/1294454/147515585-1296e91b-7398-45e5-9d32-f6121538533f.jpeg',
85
+ 'logo': 'https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8',
86
86
  'test': {
87
87
  'public': 'https://testnet-api.delta.exchange',
88
88
  'private': 'https://testnet-api.delta.exchange',
@@ -162,7 +162,7 @@ class blofin(Exchange, ImplicitAPI):
162
162
  },
163
163
  'hostname': 'www.blofin.com',
164
164
  'urls': {
165
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/255a7b29-341f-4d20-8342-fbfae4932807',
165
+ 'logo': 'https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b',
166
166
  'api': {
167
167
  'rest': 'https://openapi.blofin.com',
168
168
  },
@@ -103,7 +103,7 @@ class btcalpha(Exchange, ImplicitAPI):
103
103
  '1d': 'D',
104
104
  },
105
105
  'urls': {
106
- 'logo': 'https://user-images.githubusercontent.com/1294454/42625213-dabaa5da-85cf-11e8-8f99-aa8f8f7699f0.jpg',
106
+ 'logo': 'https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d',
107
107
  'api': {
108
108
  'rest': 'https://btc-alpha.com/api',
109
109
  },
@@ -88,7 +88,7 @@ class btcbox(Exchange, ImplicitAPI):
88
88
  'ws': False,
89
89
  },
90
90
  'urls': {
91
- 'logo': 'https://user-images.githubusercontent.com/51840849/87327317-98c55400-c53c-11ea-9a11-81f7d951cc74.jpg',
91
+ 'logo': 'https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b',
92
92
  'api': {
93
93
  'rest': 'https://www.btcbox.co.jp/api',
94
94
  },
@@ -91,7 +91,7 @@ class btcmarkets(Exchange, ImplicitAPI):
91
91
  'withdraw': True,
92
92
  },
93
93
  'urls': {
94
- 'logo': 'https://user-images.githubusercontent.com/51840849/89731817-b3fb8480-da52-11ea-817f-783b08aaf32b.jpg',
94
+ 'logo': 'https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e',
95
95
  'api': {
96
96
  'public': 'https://api.btcmarkets.net',
97
97
  'private': 'https://api.btcmarkets.net',
@@ -93,7 +93,7 @@ class btcturk(Exchange, ImplicitAPI):
93
93
  '1y': '1 y',
94
94
  },
95
95
  'urls': {
96
- 'logo': 'https://user-images.githubusercontent.com/51840849/87153926-efbef500-c2c0-11ea-9842-05b63612c4b9.jpg',
96
+ 'logo': 'https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6',
97
97
  'api': {
98
98
  'public': 'https://api.btcturk.com/api/v2',
99
99
  'private': 'https://api.btcturk.com/api/v1',
@@ -174,7 +174,7 @@ class bybit(Exchange, ImplicitAPI):
174
174
  'public': 'https://api-testnet.{hostname}',
175
175
  'private': 'https://api-testnet.{hostname}',
176
176
  },
177
- 'logo': 'https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg',
177
+ 'logo': 'https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed',
178
178
  'api': {
179
179
  'spot': 'https://api.{hostname}',
180
180
  'futures': 'https://api.{hostname}',
@@ -2488,6 +2488,9 @@ class bybit(Exchange, ImplicitAPI):
2488
2488
  #
2489
2489
  data = self.safe_dict(response, 'result', {})
2490
2490
  tickerList = self.safe_list(data, 'list', [])
2491
+ timestamp = self.safe_integer(response, 'time')
2492
+ for i in range(0, len(tickerList)):
2493
+ tickerList[i]['timestamp'] = timestamp # will be removed inside the parser
2491
2494
  result = self.parse_funding_rates(tickerList)
2492
2495
  return self.filter_by_array(result, 'symbol', symbols)
2493
2496
 
@@ -90,6 +90,7 @@ class coinbase(Exchange, ImplicitAPI):
90
90
  'fetchDepositAddresses': False,
91
91
  'fetchDepositAddressesByNetwork': True,
92
92
  'fetchDeposits': True,
93
+ 'fetchDepositsWithdrawals': True,
93
94
  'fetchFundingHistory': False,
94
95
  'fetchFundingRate': False,
95
96
  'fetchFundingRateHistory': False,
@@ -758,8 +759,14 @@ class coinbase(Exchange, ImplicitAPI):
758
759
  :param int [since]: the earliest time in ms to fetch withdrawals for
759
760
  :param int [limit]: the maximum number of withdrawals structures to retrieve
760
761
  :param dict [params]: extra parameters specific to the exchange API endpoint
762
+ :param str [params.currencyType]: "fiat" or "crypto"
761
763
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
762
764
  """
765
+ currencyType = None
766
+ currencyType, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'currencyType')
767
+ if currencyType == 'crypto':
768
+ results = await self.fetch_transactions_with_method('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params)
769
+ return self.filter_by_array(results, 'type', 'withdrawal', False)
763
770
  return await self.fetch_transactions_with_method('v2PrivateGetAccountsAccountIdWithdrawals', code, since, limit, params)
764
771
 
765
772
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -770,10 +777,30 @@ class coinbase(Exchange, ImplicitAPI):
770
777
  :param int [since]: the earliest time in ms to fetch deposits for
771
778
  :param int [limit]: the maximum number of deposits structures to retrieve
772
779
  :param dict [params]: extra parameters specific to the exchange API endpoint
780
+ :param str [params.currencyType]: "fiat" or "crypto"
773
781
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
774
782
  """
783
+ currencyType = None
784
+ currencyType, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'currencyType')
785
+ if currencyType == 'crypto':
786
+ results = await self.fetch_transactions_with_method('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params)
787
+ return self.filter_by_array(results, 'type', 'deposit', False)
775
788
  return await self.fetch_transactions_with_method('v2PrivateGetAccountsAccountIdDeposits', code, since, limit, params)
776
789
 
790
+ async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
791
+ """
792
+ fetch history of deposits and withdrawals
793
+ :see: https://docs.cdp.coinbase.com/coinbase-app/docs/api-transactions
794
+ :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
795
+ :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
796
+ :param int [limit]: max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100
797
+ :param dict [params]: extra parameters specific to the exchange API endpoint
798
+ :returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
799
+ """
800
+ await self.load_markets()
801
+ results = await self.fetch_transactions_with_method('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params)
802
+ return self.filter_by_array(results, 'type', ['deposit', 'withdrawal'], False)
803
+
777
804
  def parse_transaction_status(self, status: Str):
778
805
  statuses: dict = {
779
806
  'created': 'pending',
@@ -897,16 +924,59 @@ class coinbase(Exchange, ImplicitAPI):
897
924
  # "hide_native_amount": False
898
925
  # }
899
926
  #
927
+ #
928
+ # crypto deposit & withdrawal(using `/transactions` endpoint)
929
+ # {
930
+ # "amount": {
931
+ # "amount": "0.00014200",(negative for withdrawal)
932
+ # "currency": "BTC"
933
+ # },
934
+ # "created_at": "2024-03-29T15:48:30Z",
935
+ # "id": "0031a605-241d-514d-a97b-d4b99f3225d3",
936
+ # "idem": "092a979b-017e-4403-940a-2ca57811f442", # field present only in case of withdrawal
937
+ # "native_amount": {
938
+ # "amount": "9.85",(negative for withdrawal)
939
+ # "currency": "USD"
940
+ # },
941
+ # "network": {
942
+ # "status": "pending", # if status is `off_blockchain` then no more other fields are hasattr(self, present) object
943
+ # "hash": "5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE",
944
+ # "network_name": "solana",
945
+ # "transaction_fee": {
946
+ # "amount": "0.000100000",
947
+ # "currency": "SOL"
948
+ # }
949
+ # },
950
+ # "resource": "transaction",
951
+ # "resource_path": "/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3",
952
+ # "status": "completed",
953
+ # "type": "send",
954
+ # "from": { # in some cases, field might be present for deposit
955
+ # "id": "7fd10cd7-b091-5cee-ba41-c29e49a7cccf",
956
+ # "name": "Coinbase",
957
+ # "resource": "user"
958
+ # },
959
+ # "to": { # field only present for withdrawal
960
+ # "address": "5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE",
961
+ # "resource": "address"
962
+ # },
963
+ # "description": "C3 - One Time BTC Credit . Reference Case # 123.", # in some cases, field might be present for deposit
964
+ # }
965
+ #
900
966
  transactionType = self.safe_string(transaction, 'type')
901
967
  amountAndCurrencyObject = None
902
968
  feeObject = None
969
+ network = self.safe_dict(transaction, 'network', {})
903
970
  if transactionType == 'send':
904
- network = self.safe_dict(transaction, 'network', {})
905
- amountAndCurrencyObject = self.safe_dict(network, 'transaction_amount', {})
971
+ amountAndCurrencyObject = self.safe_dict(network, 'transaction_amount')
906
972
  feeObject = self.safe_dict(network, 'transaction_fee', {})
907
973
  else:
908
- amountAndCurrencyObject = self.safe_dict(transaction, 'subtotal', {})
974
+ amountAndCurrencyObject = self.safe_dict(transaction, 'subtotal')
909
975
  feeObject = self.safe_dict(transaction, 'fee', {})
976
+ if amountAndCurrencyObject is None:
977
+ amountAndCurrencyObject = self.safe_dict(transaction, 'amount')
978
+ amountString = self.safe_string(amountAndCurrencyObject, 'amount')
979
+ amountStringAbs = Precise.string_abs(amountString)
910
980
  status = self.parse_transaction_status(self.safe_string(transaction, 'status'))
911
981
  if status is None:
912
982
  committed = self.safe_bool(transaction, 'committed')
@@ -915,23 +985,31 @@ class coinbase(Exchange, ImplicitAPI):
915
985
  currencyId = self.safe_string(amountAndCurrencyObject, 'currency')
916
986
  feeCurrencyId = self.safe_string(feeObject, 'currency')
917
987
  datetime = self.safe_string(transaction, 'created_at')
918
- toObject = self.safe_dict(transaction, 'to', {})
919
- toAddress = self.safe_string(toObject, 'address')
988
+ resource = self.safe_string(transaction, 'resource')
989
+ type = resource
990
+ if not self.in_array(type, ['deposit', 'withdrawal']):
991
+ if Precise.string_gt(amountString, '0'):
992
+ type = 'deposit'
993
+ elif Precise.string_lt(amountString, '0'):
994
+ type = 'withdrawal'
995
+ toObject = self.safe_dict(transaction, 'to')
996
+ addressTo = self.safe_string(toObject, 'address')
997
+ networkId = self.safe_string(network, 'network_name')
920
998
  return {
921
999
  'info': transaction,
922
1000
  'id': id,
923
- 'txid': id,
1001
+ 'txid': self.safe_string(network, 'hash', id),
924
1002
  'timestamp': self.parse8601(datetime),
925
1003
  'datetime': datetime,
926
- 'network': None,
927
- 'address': toAddress,
928
- 'addressTo': toAddress,
1004
+ 'network': self.network_id_to_code(networkId),
1005
+ 'address': addressTo,
1006
+ 'addressTo': addressTo,
929
1007
  'addressFrom': None,
930
1008
  'tag': None,
931
1009
  'tagTo': None,
932
1010
  'tagFrom': None,
933
- 'type': self.safe_string(transaction, 'resource'),
934
- 'amount': self.safe_number(amountAndCurrencyObject, 'amount'),
1011
+ 'type': type,
1012
+ 'amount': self.parse_number(amountStringAbs),
935
1013
  'currency': self.safe_currency_code(currencyId, currency),
936
1014
  'status': status,
937
1015
  'updated': self.parse8601(self.safe_string(transaction, 'updated_at')),
@@ -4673,7 +4673,7 @@ class coinex(Exchange, ImplicitAPI):
4673
4673
  await self.load_markets()
4674
4674
  currency = self.currency(code)
4675
4675
  amountToPrecision = self.currency_to_precision(code, amount)
4676
- accountsByType = self.safe_dict(self.options, 'accountsById', {})
4676
+ accountsByType = self.safe_dict(self.options, 'accountsByType', {})
4677
4677
  fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
4678
4678
  toId = self.safe_string(accountsByType, toAccount, toAccount)
4679
4679
  request: dict = {
@@ -923,22 +923,26 @@ class gate(Exchange, ImplicitAPI):
923
923
  """
924
924
  unifiedAccount = self.safe_bool(self.options, 'unifiedAccount')
925
925
  if unifiedAccount is None:
926
- response = await self.privateAccountGetDetail(params)
927
- #
928
- # {
929
- # "user_id": 10406147,
930
- # "ip_whitelist": [],
931
- # "currency_pairs": [],
932
- # "key": {
933
- # "mode": 1
934
- # },
935
- # "tier": 0,
936
- # "tier_expire_time": "0001-01-01T00:00:00Z",
937
- # "copy_trading_role": 0
938
- # }
939
- #
940
- result = self.safe_dict(response, 'key', {})
941
- self.options['unifiedAccount'] = self.safe_integer(result, 'mode') == 2
926
+ try:
927
+ #
928
+ # {
929
+ # "user_id": 10406147,
930
+ # "ip_whitelist": [],
931
+ # "currency_pairs": [],
932
+ # "key": {
933
+ # "mode": 1
934
+ # },
935
+ # "tier": 0,
936
+ # "tier_expire_time": "0001-01-01T00:00:00Z",
937
+ # "copy_trading_role": 0
938
+ # }
939
+ #
940
+ response = await self.privateAccountGetDetail(params)
941
+ result = self.safe_dict(response, 'key', {})
942
+ self.options['unifiedAccount'] = self.safe_integer(result, 'mode') == 2
943
+ except Exception as e:
944
+ # if the request fails, the unifiedAccount is disabled
945
+ self.options['unifiedAccount'] = False
942
946
 
943
947
  async def upgrade_unified_trade_account(self, params={}):
944
948
  return await self.privateUnifiedPutUnifiedMode(params)