ccxt 4.4.87__py2.py3-none-any.whl → 4.4.90__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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitget.py +58 -0
- ccxt/abstract/bitrue.py +65 -65
- ccxt/abstract/cryptocom.py +2 -0
- ccxt/abstract/luno.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +4 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +55 -29
- ccxt/async_support/bitget.py +469 -147
- ccxt/async_support/bitrue.py +72 -66
- ccxt/async_support/bitvavo.py +34 -0
- ccxt/async_support/btcalpha.py +35 -0
- ccxt/async_support/btcbox.py +35 -0
- ccxt/async_support/btcmarkets.py +35 -0
- ccxt/async_support/btcturk.py +35 -0
- ccxt/async_support/bybit.py +28 -60
- ccxt/async_support/coinbase.py +1 -3
- ccxt/async_support/cryptocom.py +49 -0
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/digifinex.py +39 -99
- ccxt/async_support/gate.py +12 -5
- ccxt/async_support/hashkey.py +15 -28
- ccxt/async_support/hollaex.py +27 -22
- ccxt/async_support/kraken.py +28 -49
- ccxt/async_support/luno.py +87 -1
- ccxt/async_support/modetrade.py +7 -7
- ccxt/async_support/okx.py +2 -1
- ccxt/async_support/phemex.py +16 -8
- ccxt/async_support/tradeogre.py +3 -3
- ccxt/async_support/xt.py +1 -1
- ccxt/base/exchange.py +15 -5
- ccxt/binance.py +1 -1
- ccxt/bingx.py +55 -29
- ccxt/bitget.py +469 -147
- ccxt/bitrue.py +72 -66
- ccxt/bitvavo.py +34 -0
- ccxt/btcalpha.py +35 -0
- ccxt/btcbox.py +35 -0
- ccxt/btcmarkets.py +35 -0
- ccxt/btcturk.py +35 -0
- ccxt/bybit.py +28 -60
- ccxt/coinbase.py +1 -3
- ccxt/cryptocom.py +49 -0
- ccxt/delta.py +2 -2
- ccxt/digifinex.py +39 -99
- ccxt/gate.py +12 -5
- ccxt/hashkey.py +15 -28
- ccxt/hollaex.py +27 -22
- ccxt/kraken.py +27 -49
- ccxt/luno.py +87 -1
- ccxt/modetrade.py +7 -7
- ccxt/okx.py +2 -1
- ccxt/phemex.py +16 -8
- ccxt/pro/__init__.py +1 -119
- ccxt/pro/coinbase.py +2 -0
- ccxt/pro/cryptocom.py +27 -0
- ccxt/pro/kraken.py +3 -9
- ccxt/test/tests_async.py +1 -1
- ccxt/test/tests_sync.py +1 -1
- ccxt/tradeogre.py +3 -3
- ccxt/xt.py +1 -1
- {ccxt-4.4.87.dist-info → ccxt-4.4.90.dist-info}/METADATA +62 -20
- {ccxt-4.4.87.dist-info → ccxt-4.4.90.dist-info}/RECORD +67 -67
- {ccxt-4.4.87.dist-info → ccxt-4.4.90.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.87.dist-info → ccxt-4.4.90.dist-info}/WHEEL +0 -0
- {ccxt-4.4.87.dist-info → ccxt-4.4.90.dist-info}/top_level.txt +0 -0
ccxt/bingx.py
CHANGED
@@ -513,6 +513,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
513
513
|
'100437': BadRequest, # {"code":100437,"msg":"The withdrawal amount is lower than the minimum limit, please re-enter.","timestamp":1689258588845}
|
514
514
|
'101204': InsufficientFunds, # {"code":101204,"msg":"","data":{}}
|
515
515
|
'110425': InvalidOrder, # {"code":110425,"msg":"Please ensure that the minimum nominal value of the order placed must be greater than 2u","data":{}}
|
516
|
+
'Insufficient assets': InsufficientFunds, # {"transferErrorMsg":"Insufficient assets"}
|
517
|
+
'illegal transferType': BadRequest, # {"transferErrorMsg":"illegal transferType"}
|
516
518
|
},
|
517
519
|
'broad': {},
|
518
520
|
},
|
@@ -526,12 +528,14 @@ class bingx(Exchange, ImplicitAPI):
|
|
526
528
|
'options': {
|
527
529
|
'defaultType': 'spot',
|
528
530
|
'accountsByType': {
|
529
|
-
'
|
531
|
+
'funding': 'FUND',
|
532
|
+
'spot': 'SPOT',
|
530
533
|
'swap': 'PFUTURES',
|
531
534
|
'future': 'SFUTURES',
|
532
535
|
},
|
533
536
|
'accountsById': {
|
534
|
-
'FUND': '
|
537
|
+
'FUND': 'funding',
|
538
|
+
'SPOT': 'spot',
|
535
539
|
'PFUTURES': 'swap',
|
536
540
|
'SFUTURES': 'future',
|
537
541
|
},
|
@@ -1529,7 +1533,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1529
1533
|
# ]
|
1530
1534
|
# }
|
1531
1535
|
#
|
1532
|
-
data = self.
|
1536
|
+
data = self.safe_dict(response, 'data')
|
1533
1537
|
return self.parse_funding_rate(data, market)
|
1534
1538
|
|
1535
1539
|
def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
@@ -4637,12 +4641,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
4637
4641
|
"""
|
4638
4642
|
transfer currency internally between wallets on the same account
|
4639
4643
|
|
4640
|
-
https://bingx-api.github.io/docs/#/
|
4644
|
+
https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer
|
4641
4645
|
|
4642
4646
|
:param str code: unified currency code
|
4643
4647
|
:param float amount: amount to transfer
|
4644
|
-
:param str fromAccount: account to transfer from
|
4645
|
-
:param str toAccount: account to transfer to
|
4648
|
+
:param str fromAccount: account to transfer from(spot, swap, futures, or funding)
|
4649
|
+
:param str toAccount: account to transfer to(spot, swap, futures, or funding)
|
4646
4650
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4647
4651
|
:returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
|
4648
4652
|
"""
|
@@ -4658,9 +4662,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
4658
4662
|
}
|
4659
4663
|
response = self.spotV3PrivateGetGetAssetTransfer(self.extend(request, params))
|
4660
4664
|
#
|
4661
|
-
#
|
4662
|
-
#
|
4663
|
-
#
|
4665
|
+
# {
|
4666
|
+
# "tranId": 1933130865269936128,
|
4667
|
+
# "transferId": "1051450703949464903736"
|
4668
|
+
# }
|
4664
4669
|
#
|
4665
4670
|
return {
|
4666
4671
|
'info': response,
|
@@ -4682,8 +4687,11 @@ class bingx(Exchange, ImplicitAPI):
|
|
4682
4687
|
|
4683
4688
|
:param str [code]: unified currency code of the currency transferred
|
4684
4689
|
:param int [since]: the earliest time in ms to fetch transfers for
|
4685
|
-
:param int [limit]: the maximum number of transfers structures to retrieve
|
4690
|
+
:param int [limit]: the maximum number of transfers structures to retrieve(default 10, max 100)
|
4686
4691
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4692
|
+
:param str params.fromAccount:(mandatory) transfer from(spot, swap, futures, or funding)
|
4693
|
+
:param str params.toAccount:(mandatory) transfer to(spot, swap, futures, or funding)
|
4694
|
+
:param boolean [params.paginate]: whether to paginate the results(default False)
|
4687
4695
|
:returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
|
4688
4696
|
"""
|
4689
4697
|
self.load_markets()
|
@@ -4697,6 +4705,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
4697
4705
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
4698
4706
|
if fromId is None or toId is None:
|
4699
4707
|
raise ExchangeError(self.id + ' fromAccount & toAccount parameter are required')
|
4708
|
+
params = self.omit(params, ['fromAccount', 'toAccount'])
|
4709
|
+
maxLimit = 100
|
4710
|
+
paginate = False
|
4711
|
+
paginate, params = self.handle_option_and_params(params, 'fetchTransfers', 'paginate', False)
|
4712
|
+
if paginate:
|
4713
|
+
return self.fetch_paginated_call_dynamic('fetchTransfers', None, since, limit, params, maxLimit)
|
4700
4714
|
request: dict = {
|
4701
4715
|
'type': fromId + '_' + toId,
|
4702
4716
|
}
|
@@ -4704,18 +4718,19 @@ class bingx(Exchange, ImplicitAPI):
|
|
4704
4718
|
request['startTime'] = since
|
4705
4719
|
if limit is not None:
|
4706
4720
|
request['size'] = limit
|
4721
|
+
request, params = self.handle_until_option('endTime', request, params)
|
4707
4722
|
response = self.spotV3PrivateGetAssetTransfer(self.extend(request, params))
|
4708
4723
|
#
|
4709
4724
|
# {
|
4710
4725
|
# "total": 3,
|
4711
4726
|
# "rows": [
|
4712
4727
|
# {
|
4713
|
-
# "asset":"USDT",
|
4714
|
-
# "amount":"
|
4715
|
-
# "type":"FUND_SFUTURES",
|
4716
|
-
# "status":"CONFIRMED",
|
4717
|
-
# "tranId":1067594500957016069,
|
4718
|
-
# "timestamp":1658388859000
|
4728
|
+
# "asset": "USDT",
|
4729
|
+
# "amount": "100.00000000000000000000",
|
4730
|
+
# "type": "FUND_SFUTURES",
|
4731
|
+
# "status": "CONFIRMED",
|
4732
|
+
# "tranId": 1067594500957016069,
|
4733
|
+
# "timestamp": 1658388859000
|
4719
4734
|
# },
|
4720
4735
|
# ]
|
4721
4736
|
# }
|
@@ -4732,7 +4747,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
4732
4747
|
typeId = self.safe_string(transfer, 'type')
|
4733
4748
|
typeIdSplit = typeId.split('_')
|
4734
4749
|
fromId = self.safe_string(typeIdSplit, 0)
|
4735
|
-
toId = self.safe_string(
|
4750
|
+
toId = self.safe_string(typeIdSplit, 1)
|
4736
4751
|
fromAccount = self.safe_string(accountsById, fromId, fromId)
|
4737
4752
|
toAccount = self.safe_string(accountsById, toId, toId)
|
4738
4753
|
return {
|
@@ -4744,9 +4759,15 @@ class bingx(Exchange, ImplicitAPI):
|
|
4744
4759
|
'amount': self.safe_number(transfer, 'amount'),
|
4745
4760
|
'fromAccount': fromAccount,
|
4746
4761
|
'toAccount': toAccount,
|
4747
|
-
'status': status,
|
4762
|
+
'status': self.parse_transfer_status(status),
|
4748
4763
|
}
|
4749
4764
|
|
4765
|
+
def parse_transfer_status(self, status: Str) -> str:
|
4766
|
+
statuses: dict = {
|
4767
|
+
'CONFIRMED': 'ok',
|
4768
|
+
}
|
4769
|
+
return self.safe_string(statuses, status, status)
|
4770
|
+
|
4750
4771
|
def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
4751
4772
|
"""
|
4752
4773
|
fetch the deposit addresses for a currency associated with self account
|
@@ -5552,11 +5573,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
5552
5573
|
return self.parse_transaction(data)
|
5553
5574
|
|
5554
5575
|
def parse_params(self, params):
|
5555
|
-
sortedParams = self.keysort(params)
|
5556
|
-
|
5576
|
+
# sortedParams = self.keysort(params)
|
5577
|
+
rawKeys = list(params.keys())
|
5578
|
+
keys = self.sort(rawKeys)
|
5557
5579
|
for i in range(0, len(keys)):
|
5558
5580
|
key = keys[i]
|
5559
|
-
value =
|
5581
|
+
value = params[key]
|
5560
5582
|
if isinstance(value, list):
|
5561
5583
|
arrStr = '['
|
5562
5584
|
for j in range(0, len(value)):
|
@@ -5565,8 +5587,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
5565
5587
|
arrStr += ','
|
5566
5588
|
arrStr += str(arrayElement)
|
5567
5589
|
arrStr += ']'
|
5568
|
-
|
5569
|
-
return
|
5590
|
+
params[key] = arrStr
|
5591
|
+
return params
|
5570
5592
|
|
5571
5593
|
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5572
5594
|
"""
|
@@ -6166,13 +6188,14 @@ class bingx(Exchange, ImplicitAPI):
|
|
6166
6188
|
}
|
6167
6189
|
|
6168
6190
|
def custom_encode(self, params):
|
6169
|
-
sortedParams = self.keysort(params)
|
6170
|
-
|
6191
|
+
# sortedParams = self.keysort(params)
|
6192
|
+
rawKeys = list(params.keys())
|
6193
|
+
keys = self.sort(rawKeys)
|
6171
6194
|
adjustedValue = None
|
6172
6195
|
result = None
|
6173
6196
|
for i in range(0, len(keys)):
|
6174
6197
|
key = keys[i]
|
6175
|
-
value =
|
6198
|
+
value = params[key]
|
6176
6199
|
if isinstance(value, list):
|
6177
6200
|
arrStr = None
|
6178
6201
|
for j in range(0, len(value)):
|
@@ -6230,7 +6253,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
6230
6253
|
encodeRequest = self.custom_encode(params)
|
6231
6254
|
else:
|
6232
6255
|
parsedParams = self.parse_params(params)
|
6233
|
-
encodeRequest = self.rawencode(parsedParams)
|
6256
|
+
encodeRequest = self.rawencode(parsedParams, True)
|
6234
6257
|
signature = self.hmac(self.encode(encodeRequest), self.encode(self.secret), hashlib.sha256)
|
6235
6258
|
headers = {
|
6236
6259
|
'X-BX-APIKEY': self.apiKey,
|
@@ -6241,7 +6264,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
6241
6264
|
params['signature'] = signature
|
6242
6265
|
body = self.json(params)
|
6243
6266
|
else:
|
6244
|
-
query = self.urlencode(parsedParams)
|
6267
|
+
query = self.urlencode(parsedParams, True)
|
6245
6268
|
url += '?' + query + '&' + 'signature=' + signature
|
6246
6269
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
6247
6270
|
|
@@ -6265,7 +6288,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
6265
6288
|
#
|
6266
6289
|
code = self.safe_string(response, 'code')
|
6267
6290
|
message = self.safe_string(response, 'msg')
|
6268
|
-
|
6291
|
+
transferErrorMsg = self.safe_string(response, 'transferErrorMsg') # handling with errors from transfer endpoint
|
6292
|
+
if (transferErrorMsg is not None) or (code is not None and code != '0'):
|
6293
|
+
if transferErrorMsg is not None:
|
6294
|
+
message = transferErrorMsg
|
6269
6295
|
feedback = self.id + ' ' + body
|
6270
6296
|
self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
|
6271
6297
|
self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
|