ccxt 4.4.82__py2.py3-none-any.whl → 4.4.85__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 -5
- ccxt/abstract/blofin.py +8 -0
- ccxt/abstract/btcbox.py +1 -0
- ccxt/apex.py +2 -1
- ccxt/async_support/__init__.py +1 -5
- ccxt/async_support/apex.py +2 -1
- ccxt/async_support/base/exchange.py +26 -3
- ccxt/async_support/base/ws/cache.py +6 -1
- ccxt/async_support/bitget.py +1 -2
- ccxt/async_support/bitrue.py +14 -32
- ccxt/async_support/bitso.py +33 -0
- ccxt/async_support/bitstamp.py +33 -0
- ccxt/async_support/blofin.py +145 -14
- ccxt/async_support/btcbox.py +25 -5
- ccxt/async_support/bybit.py +16 -37
- ccxt/async_support/cex.py +2 -4
- ccxt/async_support/coinbase.py +56 -42
- ccxt/async_support/coinbaseexchange.py +141 -32
- ccxt/async_support/coincatch.py +14 -67
- ccxt/async_support/coinex.py +28 -29
- ccxt/async_support/coinlist.py +17 -16
- ccxt/async_support/coinmetro.py +20 -11
- ccxt/async_support/coinone.py +8 -10
- ccxt/async_support/coinsph.py +124 -2
- ccxt/async_support/cryptocom.py +109 -2
- ccxt/async_support/cryptomus.py +42 -80
- ccxt/async_support/delta.py +75 -36
- ccxt/async_support/derive.py +46 -10
- ccxt/async_support/ellipx.py +175 -77
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/gemini.py +3 -4
- ccxt/async_support/hitbtc.py +56 -65
- ccxt/async_support/hyperliquid.py +2 -2
- ccxt/async_support/kraken.py +27 -23
- ccxt/async_support/kucoinfutures.py +5 -0
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/paradex.py +120 -4
- ccxt/base/exchange.py +21 -2
- ccxt/base/types.py +3 -0
- ccxt/bitget.py +1 -2
- ccxt/bitrue.py +14 -32
- ccxt/bitso.py +33 -0
- ccxt/bitstamp.py +33 -0
- ccxt/blofin.py +145 -14
- ccxt/btcbox.py +24 -5
- ccxt/bybit.py +16 -37
- ccxt/cex.py +2 -4
- ccxt/coinbase.py +56 -42
- ccxt/coinbaseexchange.py +141 -32
- ccxt/coincatch.py +14 -67
- ccxt/coinex.py +28 -29
- ccxt/coinlist.py +17 -16
- ccxt/coinmetro.py +20 -11
- ccxt/coinone.py +8 -10
- ccxt/coinsph.py +124 -2
- ccxt/cryptocom.py +109 -2
- ccxt/cryptomus.py +42 -80
- ccxt/delta.py +75 -36
- ccxt/derive.py +46 -10
- ccxt/ellipx.py +175 -77
- ccxt/gate.py +1 -1
- ccxt/gemini.py +3 -4
- ccxt/hitbtc.py +56 -65
- ccxt/hyperliquid.py +2 -2
- ccxt/kraken.py +27 -23
- ccxt/kucoinfutures.py +5 -0
- ccxt/lbank.py +1 -1
- ccxt/paradex.py +120 -4
- ccxt/pro/__init__.py +69 -3
- ccxt/pro/binance.py +31 -33
- ccxt/pro/bithumb.py +5 -3
- ccxt/pro/kraken.py +249 -79
- ccxt/pro/mexc.py +252 -7
- ccxt/pro/poloniex.py +6 -2
- {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/METADATA +7 -9
- {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/RECORD +79 -87
- ccxt/abstract/bl3p.py +0 -19
- ccxt/abstract/idex.py +0 -26
- ccxt/async_support/base/ws/fast_client.py +0 -97
- ccxt/async_support/bl3p.py +0 -543
- ccxt/async_support/idex.py +0 -1889
- ccxt/bl3p.py +0 -543
- ccxt/idex.py +0 -1889
- ccxt/pro/idex.py +0 -687
- {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/WHEEL +0 -0
- {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/top_level.txt +0 -0
ccxt/ellipx.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.ellipx import ImplicitAPI
|
8
8
|
import math
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies,
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFeeInterface, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -799,80 +799,178 @@ class ellipx(Exchange, ImplicitAPI):
|
|
799
799
|
'results_per_page': 100,
|
800
800
|
'_expand': '/Crypto_Token,/Crypto_Chain',
|
801
801
|
}, params))
|
802
|
-
|
803
|
-
data = self.
|
802
|
+
result = {}
|
803
|
+
data = self.safe_list(response, 'data', [])
|
804
804
|
for i in range(0, len(data)):
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
805
|
+
networkEntry = data[i]
|
806
|
+
#
|
807
|
+
# {
|
808
|
+
# "Crypto_Token_Info__": "crtev-5nsn35-f4ir-g5hp-iaft-i4ztx6zu",
|
809
|
+
# "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
810
|
+
# "Crypto_Chain__": "chain-xjbini-7wlz-dmzf-gm7z-zf7ei6fq",
|
811
|
+
# "Type": "native",
|
812
|
+
# "Symbol": null,
|
813
|
+
# "Name": null,
|
814
|
+
# "Contract_Address": null,
|
815
|
+
# "Minimum_Deposit": {
|
816
|
+
# "v": "6",
|
817
|
+
# "e": "6",
|
818
|
+
# "f": "6.0e-6"
|
819
|
+
# },
|
820
|
+
# "Minimum_Withdraw": {
|
821
|
+
# "v": "15",
|
822
|
+
# "e": "5",
|
823
|
+
# "f": "0.00015"
|
824
|
+
# },
|
825
|
+
# "Withdraw_Fee": {
|
826
|
+
# "v": "1",
|
827
|
+
# "e": "4",
|
828
|
+
# "f": "0.0001"
|
829
|
+
# },
|
830
|
+
# "Minimum_Collect": null,
|
831
|
+
# "Status": "valid",
|
832
|
+
# "Can_Deposit": "Y",
|
833
|
+
# "Decimals": null,
|
834
|
+
# "Priority": "100",
|
835
|
+
# "Created": {
|
836
|
+
# "unix": "1727552199",
|
837
|
+
# "us": "0",
|
838
|
+
# "iso": "2024-09-28 19:36:39.000000",
|
839
|
+
# "tz": "UTC",
|
840
|
+
# "full": "1727552199000000",
|
841
|
+
# "unixms": "1727552199000"
|
842
|
+
# },
|
843
|
+
# "Crypto_Token": {
|
844
|
+
# "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
845
|
+
# "Name": "Bitcoin",
|
846
|
+
# "Symbol": "BTC",
|
847
|
+
# "Decimals": "8",
|
848
|
+
# "CMC_Id": "1",
|
849
|
+
# "Priority": "100",
|
850
|
+
# "Can_Deposit": "Y",
|
851
|
+
# "Category": "token",
|
852
|
+
# "Testnet": "N",
|
853
|
+
# "Created": {
|
854
|
+
# "unix": "1727552113",
|
855
|
+
# "us": "0",
|
856
|
+
# "iso": "2024-09-28 19:35:13.000000",
|
857
|
+
# "tz": "UTC",
|
858
|
+
# "full": "1727552113000000",
|
859
|
+
# "unixms": "1727552113000"
|
860
|
+
# },
|
861
|
+
# "Logo": [
|
862
|
+
# {
|
863
|
+
# "Crypto_Token_Logo__": "ctklg-aoozyr-rzm5-fphf-dhm7-5wbtetha",
|
864
|
+
# "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
865
|
+
# "Blob__": "blob-d6hvgx-37s5-dh5h-ogj5-qxqvnaoy",
|
866
|
+
# "Default": "Y",
|
867
|
+
# "Format": "png",
|
868
|
+
# "Priority": "0",
|
869
|
+
# "Created": {
|
870
|
+
# "unix": "1730196627",
|
871
|
+
# "us": "929660",
|
872
|
+
# "iso": "2024-10-29 10:10:27.929660",
|
873
|
+
# "tz": "UTC",
|
874
|
+
# "full": "1730196627929660",
|
875
|
+
# "unixms": "1730196627929"
|
876
|
+
# },
|
877
|
+
# "Source": {
|
878
|
+
# "Media_Image__": "blob-d6hvgx-37s5-dh5h-ogj5-qxqvnaoy",
|
879
|
+
# "Url": "https://static.atonline.net/image/m_X7_tnmIYFCwn6EUVQuMKqrCuPB3CMl4ONTegeYpC0wIg68YZM0CuBpbjspnYwz/1a942eab068a2173e66d08c736283cfe22e1c1ed"
|
880
|
+
# }
|
881
|
+
# }
|
882
|
+
# ]
|
883
|
+
# },
|
884
|
+
# "Crypto_Chain": {
|
885
|
+
# "Crypto_Chain__": "chain-xjbini-7wlz-dmzf-gm7z-zf7ei6fq",
|
886
|
+
# "EVM_Chain__": null,
|
887
|
+
# "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
888
|
+
# "Name": "Bitcoin",
|
889
|
+
# "Key": "bitcoin",
|
890
|
+
# "Type": "Bitcoin",
|
891
|
+
# "Curve": "secp256k1",
|
892
|
+
# "Backend_Url": null,
|
893
|
+
# "Wallet_Verification_Methods": {
|
894
|
+
# "signature": True
|
895
|
+
# },
|
896
|
+
# "Block_Margin": "3",
|
897
|
+
# "Created": {
|
898
|
+
# "unix": "1725340084",
|
899
|
+
# "us": "0",
|
900
|
+
# "iso": "2024-09-03 05:08:04.000000",
|
901
|
+
# "tz": "UTC",
|
902
|
+
# "full": "1725340084000000",
|
903
|
+
# "unixms": "1725340084000"
|
904
|
+
# }
|
905
|
+
# }
|
906
|
+
# }
|
907
|
+
#
|
908
|
+
id = self.safe_string(networkEntry, 'Crypto_Token__')
|
909
|
+
token = self.safe_dict(networkEntry, 'Crypto_Token', {})
|
910
|
+
code = self.safe_currency_code(self.safe_string(token, 'Symbol'))
|
911
|
+
if not (code in result):
|
912
|
+
result[code] = {
|
913
|
+
'id': id,
|
914
|
+
'code': code,
|
915
|
+
'info': [],
|
916
|
+
'type': None,
|
917
|
+
'name': self.safe_string(token, 'Name'),
|
918
|
+
'active': None,
|
919
|
+
'deposit': None,
|
920
|
+
'withdraw': None,
|
921
|
+
'fee': None,
|
922
|
+
'precision': None,
|
923
|
+
'limits': {
|
924
|
+
'amount': {
|
925
|
+
'min': None,
|
926
|
+
'max': None,
|
927
|
+
},
|
928
|
+
'withdraw': {
|
929
|
+
'min': None,
|
930
|
+
'max': None,
|
931
|
+
},
|
932
|
+
'deposit': {
|
933
|
+
'min': None,
|
934
|
+
'max': None,
|
935
|
+
},
|
936
|
+
},
|
937
|
+
'networks': {},
|
938
|
+
}
|
939
|
+
networkId = self.safe_string(networkEntry, 'Crypto_Chain__')
|
940
|
+
cryptoChainDict = self.safe_string(networkEntry, 'Crypto_Chain')
|
941
|
+
networkName = self.safe_string(cryptoChainDict, 'Type', 'default')
|
942
|
+
networkCode = self.network_id_to_code(networkName)
|
943
|
+
result[code]['networks'][networkCode] = {
|
944
|
+
'id': networkId,
|
945
|
+
'network': networkCode,
|
946
|
+
'active': self.safe_string(networkEntry, 'Status') == 'valid',
|
947
|
+
'deposit': self.safe_string(networkEntry, 'Can_Deposit') == 'Y',
|
948
|
+
'withdraw': None,
|
949
|
+
'fee': self.parse_number(self.parse_amount(networkEntry['Withdraw_Fee'])),
|
950
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(token, 'Decimals'))),
|
951
|
+
'limits': {
|
952
|
+
'amount': {
|
953
|
+
'min': None,
|
954
|
+
'max': None,
|
955
|
+
},
|
956
|
+
'withdraw': {
|
957
|
+
'min': self.parse_amount(networkEntry['Minimum_Withdraw']),
|
958
|
+
'max': None,
|
959
|
+
},
|
960
|
+
'deposit': {
|
961
|
+
'min': self.parse_amount(networkEntry['Minimum_Deposit']),
|
962
|
+
'max': None,
|
963
|
+
},
|
872
964
|
},
|
873
|
-
}
|
874
|
-
'
|
875
|
-
|
965
|
+
}
|
966
|
+
infos = self.safe_list(result[code], 'info', [])
|
967
|
+
infos.append(networkEntry)
|
968
|
+
result[code]['info'] = infos
|
969
|
+
# only after all entries are formed in currencies, restructure each entry
|
970
|
+
allKeys = list(result.keys())
|
971
|
+
for i in range(0, len(allKeys)):
|
972
|
+
code = allKeys[i]
|
973
|
+
result[code] = self.safe_currency_structure(result[code]) # self is needed after adding network entry
|
876
974
|
return result
|
877
975
|
|
878
976
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
@@ -1065,14 +1163,14 @@ class ellipx(Exchange, ImplicitAPI):
|
|
1065
1163
|
for i in range(0, len(dataArray)):
|
1066
1164
|
entry = dataArray[i]
|
1067
1165
|
balance = self.safe_dict(entry, 'Balance', {})
|
1068
|
-
|
1069
|
-
if
|
1166
|
+
code = self.safe_string(balance, 'currency')
|
1167
|
+
if code is not None:
|
1070
1168
|
account = {
|
1071
1169
|
'free': self.parse_amount(entry['Unencumbered_Balance']['value_xint']),
|
1072
1170
|
'used': self.parse_amount(entry['Liabilities']['value_xint']),
|
1073
1171
|
'total': self.parse_amount(balance['value_xint']),
|
1074
1172
|
}
|
1075
|
-
result[
|
1173
|
+
result[code] = account
|
1076
1174
|
return self.safe_balance(result)
|
1077
1175
|
|
1078
1176
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -1678,7 +1776,7 @@ class ellipx(Exchange, ImplicitAPI):
|
|
1678
1776
|
|
1679
1777
|
https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM/edit?tab=t.0#heading=h.zegupoa8g4t9
|
1680
1778
|
|
1681
|
-
:param str code:
|
1779
|
+
:param str code: unified currency code
|
1682
1780
|
:param number amount: Amount to withdraw
|
1683
1781
|
:param str address: Destination wallet address
|
1684
1782
|
:param str [tag]: Additional tag/memo for currencies that require it
|
ccxt/gate.py
CHANGED
ccxt/gemini.py
CHANGED
@@ -275,7 +275,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
275
275
|
'fetchMarketFromWebRetries': 10,
|
276
276
|
'fetchMarketsFromAPI': {
|
277
277
|
'fetchDetailsForAllSymbols': False,
|
278
|
-
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH'],
|
278
|
+
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
|
279
279
|
},
|
280
280
|
'fetchMarkets': {
|
281
281
|
'webApiEnable': True, # fetches from WEB
|
@@ -430,7 +430,6 @@ class gemini(Exchange, ImplicitAPI):
|
|
430
430
|
networkCode = None
|
431
431
|
if networkId is not None:
|
432
432
|
networkCode = self.network_id_to_code(networkId)
|
433
|
-
if networkCode is not None:
|
434
433
|
networks[networkCode] = {
|
435
434
|
'info': currency,
|
436
435
|
'id': networkId,
|
@@ -451,7 +450,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
451
450
|
},
|
452
451
|
},
|
453
452
|
}
|
454
|
-
result[code] = {
|
453
|
+
result[code] = self.safe_currency_structure({
|
455
454
|
'info': currency,
|
456
455
|
'id': id,
|
457
456
|
'code': code,
|
@@ -473,7 +472,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
473
472
|
},
|
474
473
|
},
|
475
474
|
'networks': networks,
|
476
|
-
}
|
475
|
+
})
|
477
476
|
return result
|
478
477
|
|
479
478
|
def fetch_markets(self, params={}) -> List[Market]:
|
ccxt/hitbtc.py
CHANGED
@@ -929,29 +929,46 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
929
929
|
"""
|
930
930
|
response = self.publicGetPublicCurrency(params)
|
931
931
|
#
|
932
|
-
#
|
933
|
-
#
|
934
|
-
#
|
935
|
-
#
|
936
|
-
#
|
937
|
-
#
|
938
|
-
#
|
939
|
-
#
|
940
|
-
#
|
941
|
-
#
|
942
|
-
#
|
943
|
-
#
|
944
|
-
#
|
945
|
-
#
|
946
|
-
#
|
947
|
-
#
|
948
|
-
#
|
949
|
-
#
|
950
|
-
#
|
951
|
-
#
|
952
|
-
#
|
953
|
-
#
|
954
|
-
#
|
932
|
+
# {
|
933
|
+
# "DFC": {
|
934
|
+
# "full_name": "DeFiScale",
|
935
|
+
# "crypto": True,
|
936
|
+
# "payin_enabled": False,
|
937
|
+
# "payout_enabled": True,
|
938
|
+
# "transfer_enabled": False,
|
939
|
+
# "transfer_to_wallet_enabled": True,
|
940
|
+
# "transfer_to_exchange_enabled": False,
|
941
|
+
# "sign": "D",
|
942
|
+
# "crypto_payment_id_name": "",
|
943
|
+
# "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
944
|
+
# "precision_transfer": "0.00000001",
|
945
|
+
# "delisted": False,
|
946
|
+
# "networks": [
|
947
|
+
# {
|
948
|
+
# "code": "ETH",
|
949
|
+
# "network_name": "Ethereum",
|
950
|
+
# "network": "ETH",
|
951
|
+
# "protocol": "ERC-20",
|
952
|
+
# "default": True,
|
953
|
+
# "is_ens_available": True,
|
954
|
+
# "payin_enabled": True,
|
955
|
+
# "payout_enabled": True,
|
956
|
+
# "precision_payout": "0.000000000000000001",
|
957
|
+
# "payout_fee": "277000.0000000000",
|
958
|
+
# "payout_is_payment_id": False,
|
959
|
+
# "payin_payment_id": False,
|
960
|
+
# "payin_confirmations": "2",
|
961
|
+
# "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af",
|
962
|
+
# "crypto_payment_id_name": "",
|
963
|
+
# "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
964
|
+
# "is_multichain": True,
|
965
|
+
# "asset_id": {
|
966
|
+
# "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af"
|
967
|
+
# }
|
968
|
+
# }
|
969
|
+
# ]
|
970
|
+
# },
|
971
|
+
# }
|
955
972
|
#
|
956
973
|
result: dict = {}
|
957
974
|
currencies = list(response.keys())
|
@@ -959,46 +976,22 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
959
976
|
currencyId = currencies[i]
|
960
977
|
code = self.safe_currency_code(currencyId)
|
961
978
|
entry = response[currencyId]
|
962
|
-
|
963
|
-
precision = self.safe_number(entry, 'precision_transfer')
|
964
|
-
payinEnabled = self.safe_bool(entry, 'payin_enabled', False)
|
965
|
-
payoutEnabled = self.safe_bool(entry, 'payout_enabled', False)
|
966
|
-
transferEnabled = self.safe_bool(entry, 'transfer_enabled', False)
|
967
|
-
active = payinEnabled and payoutEnabled and transferEnabled
|
968
|
-
rawNetworks = self.safe_value(entry, 'networks', [])
|
969
|
-
isCrypto = self.safe_bool(entry, 'crypto')
|
970
|
-
type = 'crypto' if isCrypto else 'fiat'
|
979
|
+
rawNetworks = self.safe_list(entry, 'networks', [])
|
971
980
|
networks: dict = {}
|
972
|
-
fee = None
|
973
|
-
depositEnabled = None
|
974
|
-
withdrawEnabled = None
|
975
981
|
for j in range(0, len(rawNetworks)):
|
976
982
|
rawNetwork = rawNetworks[j]
|
977
983
|
networkId = self.safe_string_2(rawNetwork, 'protocol', 'network')
|
978
984
|
networkCode = self.network_id_to_code(networkId)
|
979
|
-
networkCode = networkCode.upper() if (networkCode is not None) else
|
980
|
-
fee = self.safe_number(rawNetwork, 'payout_fee')
|
981
|
-
networkPrecision = self.safe_number(rawNetwork, 'precision_payout')
|
982
|
-
payinEnabledNetwork = self.safe_bool(rawNetwork, 'payin_enabled', False)
|
983
|
-
payoutEnabledNetwork = self.safe_bool(rawNetwork, 'payout_enabled', False)
|
984
|
-
activeNetwork = payinEnabledNetwork and payoutEnabledNetwork
|
985
|
-
if payinEnabledNetwork and not depositEnabled:
|
986
|
-
depositEnabled = True
|
987
|
-
elif not payinEnabledNetwork:
|
988
|
-
depositEnabled = False
|
989
|
-
if payoutEnabledNetwork and not withdrawEnabled:
|
990
|
-
withdrawEnabled = True
|
991
|
-
elif not payoutEnabledNetwork:
|
992
|
-
withdrawEnabled = False
|
985
|
+
networkCode = networkCode.upper() if (networkCode is not None) else code # is white label, ensure we safeguard from possible bugs
|
993
986
|
networks[networkCode] = {
|
994
987
|
'info': rawNetwork,
|
995
988
|
'id': networkId,
|
996
989
|
'network': networkCode,
|
997
|
-
'
|
998
|
-
'
|
999
|
-
'deposit':
|
1000
|
-
'withdraw':
|
1001
|
-
'precision':
|
990
|
+
'active': None,
|
991
|
+
'fee': self.safe_number(rawNetwork, 'payout_fee'),
|
992
|
+
'deposit': self.safe_bool(rawNetwork, 'payin_enabled'),
|
993
|
+
'withdraw': self.safe_bool(rawNetwork, 'payout_enabled'),
|
994
|
+
'precision': self.safe_number(rawNetwork, 'precision_payout'),
|
1002
995
|
'limits': {
|
1003
996
|
'withdraw': {
|
1004
997
|
'min': None,
|
@@ -1006,27 +999,25 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1006
999
|
},
|
1007
1000
|
},
|
1008
1001
|
}
|
1009
|
-
|
1010
|
-
networksLength = len(networksKeys)
|
1011
|
-
result[code] = {
|
1002
|
+
result[code] = self.safe_currency_structure({
|
1012
1003
|
'info': entry,
|
1013
1004
|
'code': code,
|
1014
1005
|
'id': currencyId,
|
1015
|
-
'precision':
|
1016
|
-
'name':
|
1017
|
-
'active':
|
1018
|
-
'deposit':
|
1019
|
-
'withdraw':
|
1006
|
+
'precision': self.safe_number(entry, 'precision_transfer'),
|
1007
|
+
'name': self.safe_string(entry, 'full_name'),
|
1008
|
+
'active': not self.safe_bool(entry, 'delisted'),
|
1009
|
+
'deposit': self.safe_bool(entry, 'payin_enabled'),
|
1010
|
+
'withdraw': self.safe_bool(entry, 'payout_enabled'),
|
1020
1011
|
'networks': networks,
|
1021
|
-
'fee':
|
1012
|
+
'fee': None,
|
1022
1013
|
'limits': {
|
1023
1014
|
'amount': {
|
1024
1015
|
'min': None,
|
1025
1016
|
'max': None,
|
1026
1017
|
},
|
1027
1018
|
},
|
1028
|
-
'type':
|
1029
|
-
}
|
1019
|
+
'type': None, # 'crypto' field emits incorrect values
|
1020
|
+
})
|
1030
1021
|
return result
|
1031
1022
|
|
1032
1023
|
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
ccxt/hyperliquid.py
CHANGED
@@ -368,7 +368,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
368
368
|
id = i
|
369
369
|
name = self.safe_string(data, 'name')
|
370
370
|
code = self.safe_currency_code(name)
|
371
|
-
result[code] = {
|
371
|
+
result[code] = self.safe_currency_structure({
|
372
372
|
'id': id,
|
373
373
|
'name': name,
|
374
374
|
'code': code,
|
@@ -390,7 +390,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
390
390
|
'max': None,
|
391
391
|
},
|
392
392
|
},
|
393
|
-
}
|
393
|
+
})
|
394
394
|
return result
|
395
395
|
|
396
396
|
def fetch_markets(self, params={}) -> List[Market]:
|
ccxt/kraken.py
CHANGED
@@ -1616,6 +1616,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
1616
1616
|
'volume': self.amount_to_precision(symbol, amount),
|
1617
1617
|
}
|
1618
1618
|
orderRequest = self.order_request('createOrder', symbol, type, request, amount, price, params)
|
1619
|
+
flags = self.safe_string(orderRequest[0], 'oflags', '')
|
1620
|
+
isUsingCost = flags.find('viqc') > -1
|
1619
1621
|
response = self.privatePostAddOrder(self.extend(orderRequest[0], orderRequest[1]))
|
1620
1622
|
#
|
1621
1623
|
# {
|
@@ -1627,6 +1629,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1627
1629
|
# }
|
1628
1630
|
#
|
1629
1631
|
result = self.safe_dict(response, 'result')
|
1632
|
+
result['usingCost'] = isUsingCost
|
1633
|
+
# it's impossible to know if the order was created using cost or base currency
|
1634
|
+
# becuase kraken only returns something like self: {order: 'buy 10.00000000 LTCUSD @ market'}
|
1635
|
+
# self usingCost flag is used to help the parsing but omited from the order
|
1630
1636
|
return self.parse_order(result)
|
1631
1637
|
|
1632
1638
|
def find_market_by_altname_or_id(self, id):
|
@@ -1713,22 +1719,15 @@ class kraken(Exchange, ImplicitAPI):
|
|
1713
1719
|
# }
|
1714
1720
|
#
|
1715
1721
|
# ws - createOrder
|
1716
|
-
#
|
1717
|
-
#
|
1718
|
-
#
|
1719
|
-
#
|
1720
|
-
# "status": 'ok',
|
1721
|
-
# "txid": 'OAVXZH-XIE54-JCYYDG'
|
1722
|
-
# }
|
1722
|
+
# {
|
1723
|
+
# "order_id": "OXM2QD-EALR2-YBAVEU"
|
1724
|
+
# }
|
1725
|
+
#
|
1723
1726
|
# ws - editOrder
|
1724
|
-
#
|
1725
|
-
#
|
1726
|
-
#
|
1727
|
-
#
|
1728
|
-
# "reqid": 3,
|
1729
|
-
# "status": "ok",
|
1730
|
-
# "txid": "OTI672-HJFAO-XOIPPK"
|
1731
|
-
# }
|
1727
|
+
# {
|
1728
|
+
# "amend_id": "TJSMEH-AA67V-YUSQ6O",
|
1729
|
+
# "order_id": "OXM2QD-EALR2-YBAVEU"
|
1730
|
+
# }
|
1732
1731
|
#
|
1733
1732
|
# {
|
1734
1733
|
# "error": [],
|
@@ -1796,6 +1795,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
1796
1795
|
# "oflags": "fciq"
|
1797
1796
|
# }
|
1798
1797
|
#
|
1798
|
+
isUsingCost = self.safe_bool(order, 'usingCost', False)
|
1799
|
+
order = self.omit(order, 'usingCost')
|
1799
1800
|
description = self.safe_dict(order, 'descr', {})
|
1800
1801
|
orderDescriptionObj = self.safe_dict(order, 'descr') # can be null
|
1801
1802
|
orderDescription = None
|
@@ -1808,11 +1809,15 @@ class kraken(Exchange, ImplicitAPI):
|
|
1808
1809
|
marketId = None
|
1809
1810
|
price = None
|
1810
1811
|
amount = None
|
1812
|
+
cost = None
|
1811
1813
|
triggerPrice = None
|
1812
1814
|
if orderDescription is not None:
|
1813
1815
|
parts = orderDescription.split(' ')
|
1814
1816
|
side = self.safe_string(parts, 0)
|
1815
|
-
|
1817
|
+
if not isUsingCost:
|
1818
|
+
amount = self.safe_string(parts, 1)
|
1819
|
+
else:
|
1820
|
+
cost = self.safe_string(parts, 1)
|
1816
1821
|
marketId = self.safe_string(parts, 2)
|
1817
1822
|
part4 = self.safe_string(parts, 4)
|
1818
1823
|
part5 = self.safe_string(parts, 5)
|
@@ -1842,13 +1847,12 @@ class kraken(Exchange, ImplicitAPI):
|
|
1842
1847
|
# kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
1843
1848
|
# cost = self.safe_string(order, 'cost')
|
1844
1849
|
price = self.safe_string(description, 'price', price)
|
1845
|
-
# when type =
|
1846
|
-
if (price is not None) and price.endswith('%'):
|
1850
|
+
# when type = trailing stop returns price = '+50.0000%'
|
1851
|
+
if (price is not None) and (price.endswith('%') or Precise.string_equals(price, '0.00000') or Precise.string_equals(price, '0')):
|
1847
1852
|
price = None # self is not the price we want
|
1848
|
-
if
|
1853
|
+
if price is None:
|
1849
1854
|
price = self.safe_string(description, 'price2')
|
1850
|
-
|
1851
|
-
price = self.safe_string(order, 'price', price)
|
1855
|
+
price = self.safe_string_2(order, 'limitprice', 'price', price)
|
1852
1856
|
flags = self.safe_string(order, 'oflags', '')
|
1853
1857
|
isPostOnly = flags.find('post') > -1
|
1854
1858
|
average = self.safe_number(order, 'price')
|
@@ -1865,7 +1869,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1865
1869
|
elif flags.find('fcib') >= 0:
|
1866
1870
|
fee['currency'] = market['base']
|
1867
1871
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1868
|
-
id = self.safe_string_n(order, ['id', 'txid', 'amend_id'])
|
1872
|
+
id = self.safe_string_n(order, ['id', 'txid', 'order_id', 'amend_id'])
|
1869
1873
|
if (id is None) or (id.startswith('[')):
|
1870
1874
|
txid = self.safe_list(order, 'txid')
|
1871
1875
|
id = self.safe_string(txid, 0)
|
@@ -1922,7 +1926,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1922
1926
|
'triggerPrice': triggerPrice,
|
1923
1927
|
'takeProfitPrice': takeProfitPrice,
|
1924
1928
|
'stopLossPrice': stopLossPrice,
|
1925
|
-
'cost':
|
1929
|
+
'cost': cost,
|
1926
1930
|
'amount': amount,
|
1927
1931
|
'filled': filled,
|
1928
1932
|
'average': average,
|
ccxt/kucoinfutures.py
CHANGED
@@ -1510,6 +1510,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1510
1510
|
:param str [params.timeInForce]: GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
1511
1511
|
:param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
|
1512
1512
|
:param float [params.cost]: the cost of the order in units of USDT
|
1513
|
+
:param str [params.marginMode]: 'cross' or 'isolated', default is 'isolated'
|
1513
1514
|
----------------- Exchange Specific Parameters -----------------
|
1514
1515
|
:param float [params.leverage]: Leverage size of the order(mandatory param in request, default is 1)
|
1515
1516
|
:param str [params.clientOid]: client order id, defaults to uuid if not passed
|
@@ -1607,6 +1608,10 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1607
1608
|
'type': type, # limit or market
|
1608
1609
|
'leverage': 1,
|
1609
1610
|
}
|
1611
|
+
marginModeUpper = self.safe_string_upper(params, 'marginMode')
|
1612
|
+
if marginModeUpper is not None:
|
1613
|
+
params = self.omit(params, 'marginMode')
|
1614
|
+
request['marginMode'] = marginModeUpper
|
1610
1615
|
cost = self.safe_string(params, 'cost')
|
1611
1616
|
params = self.omit(params, 'cost')
|
1612
1617
|
if cost is not None:
|