ccxt 4.3.44__py2.py3-none-any.whl → 4.3.46__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 +3 -1
- ccxt/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/abstract/bitstamp.py +18 -2
- ccxt/abstract/kucoin.py +14 -0
- ccxt/abstract/kucoinfutures.py +14 -0
- ccxt/abstract/mexc.py +2 -0
- ccxt/abstract/oxfun.py +34 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +2 -0
- ccxt/async_support/bingx.py +26 -18
- ccxt/async_support/bitmart.py +4 -0
- ccxt/async_support/bitstamp.py +18 -2
- ccxt/async_support/bitteam.py +6 -8
- ccxt/async_support/coinmetro.py +9 -18
- ccxt/async_support/hyperliquid.py +31 -23
- ccxt/async_support/idex.py +1 -0
- ccxt/async_support/kucoin.py +27 -1
- ccxt/async_support/luno.py +9 -1
- ccxt/async_support/mexc.py +8 -6
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/oxfun.py +2773 -0
- ccxt/async_support/tokocrypto.py +9 -11
- ccxt/async_support/wavesexchange.py +119 -105
- ccxt/async_support/woofipro.py +1 -0
- ccxt/async_support/xt.py +1 -1
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +2 -0
- ccxt/bingx.py +26 -18
- ccxt/bitmart.py +4 -0
- ccxt/bitstamp.py +18 -2
- ccxt/bitteam.py +6 -8
- ccxt/coinmetro.py +9 -18
- ccxt/hyperliquid.py +31 -23
- ccxt/idex.py +1 -0
- ccxt/kucoin.py +27 -1
- ccxt/luno.py +9 -1
- ccxt/mexc.py +8 -6
- ccxt/okx.py +1 -0
- ccxt/oxfun.py +2772 -0
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/binanceus.py +0 -8
- ccxt/pro/oxfun.py +950 -0
- ccxt/test/test_async.py +17 -1
- ccxt/test/test_sync.py +17 -1
- ccxt/tokocrypto.py +9 -11
- ccxt/wavesexchange.py +119 -105
- ccxt/woofipro.py +1 -0
- ccxt/xt.py +1 -1
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/METADATA +131 -131
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/RECORD +56 -52
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/WHEEL +0 -0
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hyperliquid import ImplicitAPI
|
8
8
|
import asyncio
|
9
|
-
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -32,6 +32,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
32
32
|
'rateLimit': 50, # 1200 requests per minute, 20 request per second
|
33
33
|
'certified': False,
|
34
34
|
'pro': True,
|
35
|
+
'dex': True,
|
35
36
|
'has': {
|
36
37
|
'CORS': None,
|
37
38
|
'spot': True,
|
@@ -949,11 +950,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
949
950
|
signature = self.sign_message(msg, self.privateKey)
|
950
951
|
return signature
|
951
952
|
|
952
|
-
def
|
953
|
+
def sign_user_signed_action(self, messageTypes, message):
|
953
954
|
zeroAddress = self.safe_string(self.options, 'zeroAddress')
|
955
|
+
chainId = 421614 # check self out
|
954
956
|
domain: dict = {
|
955
957
|
'chainId': chainId,
|
956
|
-
'name': '
|
958
|
+
'name': 'HyperliquidSignTransaction',
|
957
959
|
'verifyingContract': zeroAddress,
|
958
960
|
'version': '1',
|
959
961
|
}
|
@@ -962,28 +964,26 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
962
964
|
return signature
|
963
965
|
|
964
966
|
def build_transfer_sig(self, message):
|
965
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
966
|
-
chainId = 421614 if (isSandboxMode) else 42161
|
967
967
|
messageTypes: dict = {
|
968
|
-
'
|
968
|
+
'HyperliquidTransaction:UsdSend': [
|
969
|
+
{'name': 'hyperliquidChain', 'type': 'string'},
|
969
970
|
{'name': 'destination', 'type': 'string'},
|
970
971
|
{'name': 'amount', 'type': 'string'},
|
971
972
|
{'name': 'time', 'type': 'uint64'},
|
972
973
|
],
|
973
974
|
}
|
974
|
-
return self.
|
975
|
+
return self.sign_user_signed_action(messageTypes, message)
|
975
976
|
|
976
977
|
def build_withdraw_sig(self, message):
|
977
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
978
|
-
chainId = 421614 if (isSandboxMode) else 42161
|
979
978
|
messageTypes: dict = {
|
980
|
-
'
|
979
|
+
'HyperliquidTransaction:Withdraw': [
|
980
|
+
{'name': 'hyperliquidChain', 'type': 'string'},
|
981
981
|
{'name': 'destination', 'type': 'string'},
|
982
|
-
{'name': '
|
982
|
+
{'name': 'amount', 'type': 'string'},
|
983
983
|
{'name': 'time', 'type': 'uint64'},
|
984
984
|
],
|
985
985
|
}
|
986
|
-
return self.
|
986
|
+
return self.sign_user_signed_action(messageTypes, message)
|
987
987
|
|
988
988
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
989
989
|
"""
|
@@ -2277,8 +2277,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2277
2277
|
if code is not None:
|
2278
2278
|
code = code.upper()
|
2279
2279
|
if code != 'USDC':
|
2280
|
-
raise NotSupported(self.id + '
|
2280
|
+
raise NotSupported(self.id + 'transfer() only support USDC')
|
2281
2281
|
payload: dict = {
|
2282
|
+
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2282
2283
|
'destination': toAccount,
|
2283
2284
|
'amount': self.number_to_string(amount),
|
2284
2285
|
'time': nonce,
|
@@ -2286,9 +2287,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2286
2287
|
sig = self.build_transfer_sig(payload)
|
2287
2288
|
request: dict = {
|
2288
2289
|
'action': {
|
2289
|
-
'
|
2290
|
-
'
|
2291
|
-
'
|
2290
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
2291
|
+
'signatureChainId': '0x66eee', # check self out
|
2292
|
+
'destination': toAccount,
|
2293
|
+
'amount': str(amount),
|
2294
|
+
'time': nonce,
|
2295
|
+
'type': 'usdSend',
|
2292
2296
|
},
|
2293
2297
|
'nonce': nonce,
|
2294
2298
|
'signature': sig,
|
@@ -2296,7 +2300,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2296
2300
|
response = await self.privatePostExchange(self.extend(request, params))
|
2297
2301
|
return response
|
2298
2302
|
|
2299
|
-
async def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2303
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2300
2304
|
"""
|
2301
2305
|
make a withdrawal(only support USDC)
|
2302
2306
|
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
@@ -2314,25 +2318,29 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2314
2318
|
code = code.upper()
|
2315
2319
|
if code != 'USDC':
|
2316
2320
|
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2317
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
2321
|
+
isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
2318
2322
|
nonce = self.milliseconds()
|
2319
2323
|
payload: dict = {
|
2324
|
+
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2320
2325
|
'destination': address,
|
2321
|
-
'
|
2326
|
+
'amount': str(amount),
|
2322
2327
|
'time': nonce,
|
2323
2328
|
}
|
2324
2329
|
sig = self.build_withdraw_sig(payload)
|
2325
2330
|
request: dict = {
|
2326
2331
|
'action': {
|
2327
|
-
'
|
2328
|
-
'
|
2329
|
-
'
|
2332
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
2333
|
+
'signatureChainId': '0x66eee', # check self out
|
2334
|
+
'destination': address,
|
2335
|
+
'amount': str(amount),
|
2336
|
+
'time': nonce,
|
2337
|
+
'type': 'withdraw3',
|
2330
2338
|
},
|
2331
2339
|
'nonce': nonce,
|
2332
2340
|
'signature': sig,
|
2333
2341
|
}
|
2334
2342
|
response = await self.privatePostExchange(self.extend(request, params))
|
2335
|
-
return response
|
2343
|
+
return self.parse_transaction(response)
|
2336
2344
|
|
2337
2345
|
def format_vault_address(self, address: Str = None):
|
2338
2346
|
if address is None:
|
ccxt/async_support/idex.py
CHANGED
ccxt/async_support/kucoin.py
CHANGED
@@ -141,6 +141,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
141
141
|
'futuresPublic': 'https://api-futures.kucoin.com',
|
142
142
|
'webExchange': 'https://kucoin.com/_api',
|
143
143
|
'broker': 'https://api-broker.kucoin.com',
|
144
|
+
'earn': 'https://api.kucoin.com',
|
144
145
|
},
|
145
146
|
'www': 'https://www.kucoin.com',
|
146
147
|
'doc': [
|
@@ -408,6 +409,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
408
409
|
'broker/nd/account': 2,
|
409
410
|
'broker/nd/account/apikey': 2,
|
410
411
|
'broker/nd/rebase/download': 3,
|
412
|
+
'broker/nd/transfer/detail': 1,
|
413
|
+
'broker/nd/deposit/detail': 1,
|
414
|
+
'broker/nd/withdraw/detail': 1,
|
411
415
|
},
|
412
416
|
'post': {
|
413
417
|
'broker/nd/transfer': 1,
|
@@ -419,6 +423,25 @@ class kucoin(Exchange, ImplicitAPI):
|
|
419
423
|
'broker/nd/account/apikey': 3,
|
420
424
|
},
|
421
425
|
},
|
426
|
+
'earn': {
|
427
|
+
'get': {
|
428
|
+
'otc-loan/loan': 1,
|
429
|
+
'otc-loan/accounts': 1,
|
430
|
+
'earn/redeem-preview': 7.5, # 5EW
|
431
|
+
'earn/saving/products': 7.5, # 5EW
|
432
|
+
'earn/hold-assets': 7.5, # 5EW
|
433
|
+
'earn/promotion/products': 7.5, # 5EW
|
434
|
+
'earn/kcs-staking/products': 7.5, # 5EW
|
435
|
+
'earn/staking/products': 7.5, # 5EW
|
436
|
+
'earn/eth-staking/products': 7.5, # 5EW
|
437
|
+
},
|
438
|
+
'post': {
|
439
|
+
'earn/orders': 7.5, # 5EW
|
440
|
+
},
|
441
|
+
'delete': {
|
442
|
+
'earn/orders': 7.5, # 5EW
|
443
|
+
},
|
444
|
+
},
|
422
445
|
},
|
423
446
|
'timeframes': {
|
424
447
|
'1m': '1min',
|
@@ -4507,6 +4530,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4507
4530
|
endpoint = '/api/' + version + '/' + self.implode_params(path, params)
|
4508
4531
|
if api == 'webExchange':
|
4509
4532
|
endpoint = '/' + self.implode_params(path, params)
|
4533
|
+
if api == 'earn':
|
4534
|
+
endpoint = '/api/v1/' + self.implode_params(path, params)
|
4510
4535
|
query = self.omit(params, self.extract_params(path))
|
4511
4536
|
endpart = ''
|
4512
4537
|
headers = headers if (headers is not None) else {}
|
@@ -4522,7 +4547,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4522
4547
|
isFuturePrivate = (api == 'futuresPrivate')
|
4523
4548
|
isPrivate = (api == 'private')
|
4524
4549
|
isBroker = (api == 'broker')
|
4525
|
-
|
4550
|
+
isEarn = (api == 'earn')
|
4551
|
+
if isPrivate or isFuturePrivate or isBroker or isEarn:
|
4526
4552
|
self.check_required_credentials()
|
4527
4553
|
timestamp = str(self.nonce())
|
4528
4554
|
headers = self.extend({
|
ccxt/async_support/luno.py
CHANGED
@@ -897,7 +897,15 @@ class luno(Exchange, ImplicitAPI):
|
|
897
897
|
request: dict = {
|
898
898
|
'order_id': id,
|
899
899
|
}
|
900
|
-
|
900
|
+
response = await self.privatePostStoporder(self.extend(request, params))
|
901
|
+
#
|
902
|
+
# {
|
903
|
+
# "success": True
|
904
|
+
# }
|
905
|
+
#
|
906
|
+
return self.safe_order({
|
907
|
+
'info': response,
|
908
|
+
})
|
901
909
|
|
902
910
|
async def fetch_ledger_by_entries(self, code: Str = None, entry=None, limit=None, params={}):
|
903
911
|
# by default without entry number or limit number, return most recent entry
|
ccxt/async_support/mexc.py
CHANGED
@@ -235,6 +235,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
235
235
|
'sub-account/margin': 1,
|
236
236
|
'batchOrders': 10,
|
237
237
|
'capital/withdraw/apply': 1,
|
238
|
+
'capital/withdraw': 1,
|
238
239
|
'capital/transfer': 1,
|
239
240
|
'capital/transfer/internal': 1,
|
240
241
|
'capital/deposit/address': 1,
|
@@ -253,6 +254,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
253
254
|
'margin/order': 1,
|
254
255
|
'margin/openOrders': 1,
|
255
256
|
'userDataStream': 1,
|
257
|
+
'capital/withdraw': 1,
|
256
258
|
},
|
257
259
|
},
|
258
260
|
},
|
@@ -1069,7 +1071,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1069
1071
|
chains = self.safe_value(currency, 'networkList', [])
|
1070
1072
|
for j in range(0, len(chains)):
|
1071
1073
|
chain = chains[j]
|
1072
|
-
networkId = self.
|
1074
|
+
networkId = self.safe_string_2(chain, 'network', 'netWork')
|
1073
1075
|
network = self.network_id_to_code(networkId)
|
1074
1076
|
isDepositEnabled = self.safe_bool(chain, 'depositEnable', False)
|
1075
1077
|
isWithdrawEnabled = self.safe_bool(chain, 'withdrawEnable', False)
|
@@ -4894,7 +4896,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4894
4896
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
4895
4897
|
"""
|
4896
4898
|
make a withdrawal
|
4897
|
-
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
|
4899
|
+
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
4898
4900
|
:param str code: unified currency code
|
4899
4901
|
:param float amount: the amount to withdraw
|
4900
4902
|
:param str address: the address to withdraw to
|
@@ -4904,7 +4906,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4904
4906
|
"""
|
4905
4907
|
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
4906
4908
|
networks = self.safe_value(self.options, 'networks', {})
|
4907
|
-
network = self.safe_string_2(params, 'network', '
|
4909
|
+
network = self.safe_string_2(params, 'network', 'netWork') # self line allows the user to specify either ERC20 or ETH
|
4908
4910
|
network = self.safe_string(networks, network, network) # handle ETH > ERC-20 alias
|
4909
4911
|
self.check_address(address)
|
4910
4912
|
await self.load_markets()
|
@@ -4917,9 +4919,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4917
4919
|
if tag is not None:
|
4918
4920
|
request['memo'] = tag
|
4919
4921
|
if network is not None:
|
4920
|
-
request['
|
4921
|
-
params = self.omit(params, ['network', '
|
4922
|
-
response = await self.
|
4922
|
+
request['netWork'] = network
|
4923
|
+
params = self.omit(params, ['network', 'netWork'])
|
4924
|
+
response = await self.spotPrivatePostCapitalWithdraw(self.extend(request, params))
|
4923
4925
|
#
|
4924
4926
|
# {
|
4925
4927
|
# "id":"7213fea8e94b4a5593d507237e5a555b"
|
ccxt/async_support/okx.py
CHANGED
@@ -2386,6 +2386,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2386
2386
|
:see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
2387
2387
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
2388
2388
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2389
|
+
:param str [params.type]: wallet type, ['funding' or 'trading'] default is 'trading'
|
2389
2390
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
2390
2391
|
"""
|
2391
2392
|
await self.load_markets()
|