crypto-com-sdk 0.0.50__py3-none-any.whl → 0.0.51__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.
- {crypto_com_sdk-0.0.50.dist-info → crypto_com_sdk-0.0.51.dist-info}/METADATA +2 -1
- {crypto_com_sdk-0.0.50.dist-info → crypto_com_sdk-0.0.51.dist-info}/RECORD +6 -6
- cryptocom/ccxt/async_support/cryptocom.py +109 -2
- cryptocom/ccxt/base/types.py +3 -0
- cryptocom/ccxt/cryptocom.py +109 -2
- {crypto_com_sdk-0.0.50.dist-info → crypto_com_sdk-0.0.51.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypto-com-sdk
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.51
|
4
4
|
Summary: cryptocom crypto exchange api client
|
5
5
|
Project-URL: Homepage, https://github.com/ccxt/ccxt
|
6
6
|
Project-URL: Issues, https://github.com/ccxt/ccxt
|
@@ -132,6 +132,7 @@ You can also construct custom requests to available "implicit" endpoints
|
|
132
132
|
- `create_orders(self, orders: List[OrderRequest], params={})`
|
133
133
|
- `fetch_accounts(self, params={})`
|
134
134
|
- `fetch_balance(self, params={})`
|
135
|
+
- `fetch_currencies(self, params={})`
|
135
136
|
- `fetch_deposit_address(self, code: str, params={})`
|
136
137
|
- `fetch_deposit_addresses_by_network(self, code: str, params={})`
|
137
138
|
- `fetch_deposit_withdraw_fees(self, codes: Strings = None, params={})`
|
@@ -1,9 +1,9 @@
|
|
1
1
|
cryptocom/__init__.py,sha256=Ei5wz00g_3ERgN2Gsu1ZcccyL4tByDvfxR8qKkPxAgc,282
|
2
2
|
cryptocom/ccxt/__init__.py,sha256=73keLjvKcYtlBr7a0jUb83xX8_gP7CtRvp_2NymLIe4,6054
|
3
|
-
cryptocom/ccxt/cryptocom.py,sha256=
|
3
|
+
cryptocom/ccxt/cryptocom.py,sha256=XFAMUXE335fakbD3FB3Eaii9fwwTpGKhl8oNd8LNad0,145779
|
4
4
|
cryptocom/ccxt/abstract/cryptocom.py,sha256=VdIfedBhx9Oym8fQ06c4Xmip7iT02hiVNBQA0E0rXU8,20915
|
5
5
|
cryptocom/ccxt/async_support/__init__.py,sha256=vrZ5eKRpmpTvlyEw5G0tJn6-ZKj2-_6TcSRAQDdSf7M,4787
|
6
|
-
cryptocom/ccxt/async_support/cryptocom.py,sha256=
|
6
|
+
cryptocom/ccxt/async_support/cryptocom.py,sha256=Yf_e0b9YbiuA-P21mISGUG8q1arflDzFYLT1yZVQfaw,146399
|
7
7
|
cryptocom/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
|
8
8
|
cryptocom/ccxt/async_support/base/exchange.py,sha256=Ozc443GgOx2zlkUwR8x3EwHScNGDvLvAN4s7oIfxGVU,117601
|
9
9
|
cryptocom/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
|
@@ -21,7 +21,7 @@ cryptocom/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5
|
|
21
21
|
cryptocom/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
|
22
22
|
cryptocom/ccxt/base/exchange.py,sha256=1y1XgdaAMiN5CyMzmwFXi-qEm3-94gOFaq7m7eyowEw,327221
|
23
23
|
cryptocom/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
|
24
|
-
cryptocom/ccxt/base/types.py,sha256=
|
24
|
+
cryptocom/ccxt/base/types.py,sha256=IbLO7Ni-plO36xlOdJQFqujSJBq0q9qll009ShZ0M_U,11468
|
25
25
|
cryptocom/ccxt/pro/__init__.py,sha256=nGGg3lmO98rzPYAPNzY_qbJqCtWC03KqRJHghVpqnYM,625
|
26
26
|
cryptocom/ccxt/pro/cryptocom.py,sha256=HxORVyDV1R0ILS-fl8ikRvF0D7pW9AqPaZNxVVeOTYI,60160
|
27
27
|
cryptocom/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
|
@@ -283,6 +283,6 @@ cryptocom/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayA
|
|
283
283
|
cryptocom/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
|
284
284
|
cryptocom/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
285
285
|
cryptocom/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
|
286
|
-
crypto_com_sdk-0.0.
|
287
|
-
crypto_com_sdk-0.0.
|
288
|
-
crypto_com_sdk-0.0.
|
286
|
+
crypto_com_sdk-0.0.51.dist-info/METADATA,sha256=38QNdDnoQQKijDmgvXZsO7lKsCe5nJ9RaE14I6XqUIo,14851
|
287
|
+
crypto_com_sdk-0.0.51.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
288
|
+
crypto_com_sdk-0.0.51.dist-info/RECORD,,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.cryptocom import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -69,7 +69,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
69
69
|
'fetchClosedOrders': 'emulated',
|
70
70
|
'fetchCrossBorrowRate': False,
|
71
71
|
'fetchCrossBorrowRates': False,
|
72
|
-
'fetchCurrencies':
|
72
|
+
'fetchCurrencies': True,
|
73
73
|
'fetchDepositAddress': True,
|
74
74
|
'fetchDepositAddresses': False,
|
75
75
|
'fetchDepositAddressesByNetwork': True,
|
@@ -526,6 +526,113 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
526
526
|
},
|
527
527
|
})
|
528
528
|
|
529
|
+
async def fetch_currencies(self, params={}) -> Currencies:
|
530
|
+
"""
|
531
|
+
fetches all available currencies on an exchange
|
532
|
+
|
533
|
+
https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
|
534
|
+
|
535
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
536
|
+
:returns dict: an associative dictionary of currencies
|
537
|
+
"""
|
538
|
+
# self endpoint requires authentication
|
539
|
+
if not self.check_required_credentials(False):
|
540
|
+
return None
|
541
|
+
response = await self.v1PrivatePostPrivateGetCurrencyNetworks(params)
|
542
|
+
#
|
543
|
+
# {
|
544
|
+
# "id": "1747502328559",
|
545
|
+
# "method": "private/get-currency-networks",
|
546
|
+
# "code": "0",
|
547
|
+
# "result": {
|
548
|
+
# "update_time": "1747502281000",
|
549
|
+
# "currency_map": {
|
550
|
+
# "USDT": {
|
551
|
+
# "full_name": "Tether USD",
|
552
|
+
# "default_network": "ETH",
|
553
|
+
# "network_list": [
|
554
|
+
# {
|
555
|
+
# "network_id": "ETH",
|
556
|
+
# "withdrawal_fee": "10.00000000",
|
557
|
+
# "withdraw_enabled": True,
|
558
|
+
# "min_withdrawal_amount": "20.0",
|
559
|
+
# "deposit_enabled": True,
|
560
|
+
# "confirmation_required": "32"
|
561
|
+
# },
|
562
|
+
# {
|
563
|
+
# "network_id": "CRONOS",
|
564
|
+
# "withdrawal_fee": "0.18000000",
|
565
|
+
# "withdraw_enabled": True,
|
566
|
+
# "min_withdrawal_amount": "0.36",
|
567
|
+
# "deposit_enabled": True,
|
568
|
+
# "confirmation_required": "15"
|
569
|
+
# },
|
570
|
+
# {
|
571
|
+
# "network_id": "SOL",
|
572
|
+
# "withdrawal_fee": "5.31000000",
|
573
|
+
# "withdraw_enabled": True,
|
574
|
+
# "min_withdrawal_amount": "10.62",
|
575
|
+
# "deposit_enabled": True,
|
576
|
+
# "confirmation_required": "1"
|
577
|
+
# }
|
578
|
+
# ]
|
579
|
+
# }
|
580
|
+
# }
|
581
|
+
# }
|
582
|
+
# }
|
583
|
+
#
|
584
|
+
resultData = self.safe_dict(response, 'result', {})
|
585
|
+
currencyMap = self.safe_dict(resultData, 'currency_map', {})
|
586
|
+
keys = list(currencyMap.keys())
|
587
|
+
result: dict = {}
|
588
|
+
for i in range(0, len(keys)):
|
589
|
+
key = keys[i]
|
590
|
+
currency = currencyMap[key]
|
591
|
+
id = key
|
592
|
+
code = self.safe_currency_code(id)
|
593
|
+
networks: dict = {}
|
594
|
+
chains = self.safe_list(currency, 'network_list', [])
|
595
|
+
for j in range(0, len(chains)):
|
596
|
+
chain = chains[j]
|
597
|
+
networkId = self.safe_string(chain, 'network_id')
|
598
|
+
network = self.network_id_to_code(networkId)
|
599
|
+
networks[network] = {
|
600
|
+
'info': chain,
|
601
|
+
'id': networkId,
|
602
|
+
'network': network,
|
603
|
+
'active': None,
|
604
|
+
'deposit': self.safe_bool(chain, 'deposit_enabled', False),
|
605
|
+
'withdraw': self.safe_bool(chain, 'withdraw_enabled', False),
|
606
|
+
'fee': self.safe_number(chain, 'withdrawal_fee'),
|
607
|
+
'precision': None,
|
608
|
+
'limits': {
|
609
|
+
'withdraw': {
|
610
|
+
'min': self.safe_number(chain, 'min_withdrawal_amount'),
|
611
|
+
'max': None,
|
612
|
+
},
|
613
|
+
},
|
614
|
+
}
|
615
|
+
result[code] = self.safe_currency_structure({
|
616
|
+
'info': currency,
|
617
|
+
'id': id,
|
618
|
+
'code': code,
|
619
|
+
'name': self.safe_string(currency, 'full_name'),
|
620
|
+
'active': None,
|
621
|
+
'deposit': None,
|
622
|
+
'withdraw': None,
|
623
|
+
'fee': None,
|
624
|
+
'precision': None,
|
625
|
+
'limits': {
|
626
|
+
'amount': {
|
627
|
+
'min': None,
|
628
|
+
'max': None,
|
629
|
+
},
|
630
|
+
},
|
631
|
+
'type': 'crypto', # only crypto now
|
632
|
+
'networks': networks,
|
633
|
+
})
|
634
|
+
return result
|
635
|
+
|
529
636
|
async def fetch_markets(self, params={}) -> List[Market]:
|
530
637
|
"""
|
531
638
|
|
cryptocom/ccxt/base/types.py
CHANGED
cryptocom/ccxt/cryptocom.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.cryptocom import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -69,7 +69,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
69
69
|
'fetchClosedOrders': 'emulated',
|
70
70
|
'fetchCrossBorrowRate': False,
|
71
71
|
'fetchCrossBorrowRates': False,
|
72
|
-
'fetchCurrencies':
|
72
|
+
'fetchCurrencies': True,
|
73
73
|
'fetchDepositAddress': True,
|
74
74
|
'fetchDepositAddresses': False,
|
75
75
|
'fetchDepositAddressesByNetwork': True,
|
@@ -526,6 +526,113 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
526
526
|
},
|
527
527
|
})
|
528
528
|
|
529
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
530
|
+
"""
|
531
|
+
fetches all available currencies on an exchange
|
532
|
+
|
533
|
+
https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
|
534
|
+
|
535
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
536
|
+
:returns dict: an associative dictionary of currencies
|
537
|
+
"""
|
538
|
+
# self endpoint requires authentication
|
539
|
+
if not self.check_required_credentials(False):
|
540
|
+
return None
|
541
|
+
response = self.v1PrivatePostPrivateGetCurrencyNetworks(params)
|
542
|
+
#
|
543
|
+
# {
|
544
|
+
# "id": "1747502328559",
|
545
|
+
# "method": "private/get-currency-networks",
|
546
|
+
# "code": "0",
|
547
|
+
# "result": {
|
548
|
+
# "update_time": "1747502281000",
|
549
|
+
# "currency_map": {
|
550
|
+
# "USDT": {
|
551
|
+
# "full_name": "Tether USD",
|
552
|
+
# "default_network": "ETH",
|
553
|
+
# "network_list": [
|
554
|
+
# {
|
555
|
+
# "network_id": "ETH",
|
556
|
+
# "withdrawal_fee": "10.00000000",
|
557
|
+
# "withdraw_enabled": True,
|
558
|
+
# "min_withdrawal_amount": "20.0",
|
559
|
+
# "deposit_enabled": True,
|
560
|
+
# "confirmation_required": "32"
|
561
|
+
# },
|
562
|
+
# {
|
563
|
+
# "network_id": "CRONOS",
|
564
|
+
# "withdrawal_fee": "0.18000000",
|
565
|
+
# "withdraw_enabled": True,
|
566
|
+
# "min_withdrawal_amount": "0.36",
|
567
|
+
# "deposit_enabled": True,
|
568
|
+
# "confirmation_required": "15"
|
569
|
+
# },
|
570
|
+
# {
|
571
|
+
# "network_id": "SOL",
|
572
|
+
# "withdrawal_fee": "5.31000000",
|
573
|
+
# "withdraw_enabled": True,
|
574
|
+
# "min_withdrawal_amount": "10.62",
|
575
|
+
# "deposit_enabled": True,
|
576
|
+
# "confirmation_required": "1"
|
577
|
+
# }
|
578
|
+
# ]
|
579
|
+
# }
|
580
|
+
# }
|
581
|
+
# }
|
582
|
+
# }
|
583
|
+
#
|
584
|
+
resultData = self.safe_dict(response, 'result', {})
|
585
|
+
currencyMap = self.safe_dict(resultData, 'currency_map', {})
|
586
|
+
keys = list(currencyMap.keys())
|
587
|
+
result: dict = {}
|
588
|
+
for i in range(0, len(keys)):
|
589
|
+
key = keys[i]
|
590
|
+
currency = currencyMap[key]
|
591
|
+
id = key
|
592
|
+
code = self.safe_currency_code(id)
|
593
|
+
networks: dict = {}
|
594
|
+
chains = self.safe_list(currency, 'network_list', [])
|
595
|
+
for j in range(0, len(chains)):
|
596
|
+
chain = chains[j]
|
597
|
+
networkId = self.safe_string(chain, 'network_id')
|
598
|
+
network = self.network_id_to_code(networkId)
|
599
|
+
networks[network] = {
|
600
|
+
'info': chain,
|
601
|
+
'id': networkId,
|
602
|
+
'network': network,
|
603
|
+
'active': None,
|
604
|
+
'deposit': self.safe_bool(chain, 'deposit_enabled', False),
|
605
|
+
'withdraw': self.safe_bool(chain, 'withdraw_enabled', False),
|
606
|
+
'fee': self.safe_number(chain, 'withdrawal_fee'),
|
607
|
+
'precision': None,
|
608
|
+
'limits': {
|
609
|
+
'withdraw': {
|
610
|
+
'min': self.safe_number(chain, 'min_withdrawal_amount'),
|
611
|
+
'max': None,
|
612
|
+
},
|
613
|
+
},
|
614
|
+
}
|
615
|
+
result[code] = self.safe_currency_structure({
|
616
|
+
'info': currency,
|
617
|
+
'id': id,
|
618
|
+
'code': code,
|
619
|
+
'name': self.safe_string(currency, 'full_name'),
|
620
|
+
'active': None,
|
621
|
+
'deposit': None,
|
622
|
+
'withdraw': None,
|
623
|
+
'fee': None,
|
624
|
+
'precision': None,
|
625
|
+
'limits': {
|
626
|
+
'amount': {
|
627
|
+
'min': None,
|
628
|
+
'max': None,
|
629
|
+
},
|
630
|
+
},
|
631
|
+
'type': 'crypto', # only crypto now
|
632
|
+
'networks': networks,
|
633
|
+
})
|
634
|
+
return result
|
635
|
+
|
529
636
|
def fetch_markets(self, params={}) -> List[Market]:
|
530
637
|
"""
|
531
638
|
|
File without changes
|