ccxt 4.3.57__py2.py3-none-any.whl → 4.3.59__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 +5 -5
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/btcbox.py +1 -0
- ccxt/abstract/kucoin.py +1 -0
- ccxt/abstract/kucoinfutures.py +1 -0
- ccxt/abstract/upbit.py +3 -0
- ccxt/abstract/xt.py +1 -0
- ccxt/alpaca.py +5 -1
- ccxt/async_support/__init__.py +5 -5
- ccxt/async_support/alpaca.py +5 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/client.py +1 -0
- ccxt/async_support/bigone.py +19 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +116 -26
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmart.py +1 -0
- ccxt/async_support/btcbox.py +145 -8
- ccxt/async_support/bybit.py +2 -2
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinmate.py +28 -32
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/deribit.py +15 -1
- ccxt/async_support/digifinex.py +30 -7
- ccxt/async_support/gate.py +22 -18
- ccxt/async_support/htx.py +10 -8
- ccxt/async_support/hyperliquid.py +106 -2
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +3 -0
- ccxt/async_support/latoken.py +5 -1
- ccxt/async_support/mexc.py +11 -11
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +3 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +139 -45
- ccxt/async_support/woo.py +2 -1
- ccxt/async_support/xt.py +70 -7
- ccxt/base/errors.py +23 -23
- ccxt/base/exchange.py +9 -9
- ccxt/bigone.py +19 -1
- ccxt/binance.py +1 -1
- ccxt/bingx.py +116 -26
- ccxt/bitget.py +1 -1
- ccxt/bitmart.py +1 -0
- ccxt/btcbox.py +145 -8
- ccxt/bybit.py +2 -2
- ccxt/cex.py +1 -1
- ccxt/coinmate.py +28 -32
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/deribit.py +15 -1
- ccxt/digifinex.py +30 -7
- ccxt/gate.py +22 -18
- ccxt/htx.py +10 -8
- ccxt/hyperliquid.py +106 -2
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +3 -0
- ccxt/latoken.py +5 -1
- ccxt/mexc.py +11 -11
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +3 -1
- ccxt/phemex.py +1 -1
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/binance.py +11 -13
- ccxt/pro/bingx.py +11 -8
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/htx.py +1 -1
- ccxt/pro/hyperliquid.py +1 -1
- ccxt/pro/okx.py +3 -3
- ccxt/pro/xt.py +1043 -0
- ccxt/probit.py +1 -1
- ccxt/test/tests_async.py +2 -2
- ccxt/test/tests_helpers.py +1 -1
- ccxt/test/tests_sync.py +2 -2
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +139 -45
- ccxt/woo.py +2 -1
- ccxt/xt.py +70 -7
- {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/METADATA +5 -5
- {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/RECORD +91 -90
- {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/WHEEL +0 -0
- {ccxt-4.3.57.dist-info → ccxt-4.3.59.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, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -106,7 +106,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
106
106
|
'fetchTickers': False,
|
107
107
|
'fetchTime': False,
|
108
108
|
'fetchTrades': True,
|
109
|
-
'fetchTradingFee':
|
109
|
+
'fetchTradingFee': True,
|
110
110
|
'fetchTradingFees': False,
|
111
111
|
'fetchTransfer': False,
|
112
112
|
'fetchTransfers': False,
|
@@ -2382,6 +2382,110 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2382
2382
|
'fee': None,
|
2383
2383
|
}
|
2384
2384
|
|
2385
|
+
async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
2386
|
+
"""
|
2387
|
+
fetch the trading fees for a market
|
2388
|
+
:param str symbol: unified market symbol
|
2389
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2390
|
+
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
2391
|
+
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
2392
|
+
"""
|
2393
|
+
await self.load_markets()
|
2394
|
+
userAddress = None
|
2395
|
+
userAddress, params = self.handle_public_address('fetchTradingFee', params)
|
2396
|
+
market = self.market(symbol)
|
2397
|
+
request: dict = {
|
2398
|
+
'type': 'userFees',
|
2399
|
+
'user': userAddress,
|
2400
|
+
}
|
2401
|
+
response = await self.publicPostInfo(self.extend(request, params))
|
2402
|
+
#
|
2403
|
+
# {
|
2404
|
+
# "dailyUserVlm": [
|
2405
|
+
# {
|
2406
|
+
# "date": "2024-07-08",
|
2407
|
+
# "userCross": "0.0",
|
2408
|
+
# "userAdd": "0.0",
|
2409
|
+
# "exchange": "90597185.23639999"
|
2410
|
+
# }
|
2411
|
+
# ],
|
2412
|
+
# "feeSchedule": {
|
2413
|
+
# "cross": "0.00035",
|
2414
|
+
# "add": "0.0001",
|
2415
|
+
# "tiers": {
|
2416
|
+
# "vip": [
|
2417
|
+
# {
|
2418
|
+
# "ntlCutoff": "5000000.0",
|
2419
|
+
# "cross": "0.0003",
|
2420
|
+
# "add": "0.00005"
|
2421
|
+
# }
|
2422
|
+
# ],
|
2423
|
+
# "mm": [
|
2424
|
+
# {
|
2425
|
+
# "makerFractionCutoff": "0.005",
|
2426
|
+
# "add": "-0.00001"
|
2427
|
+
# }
|
2428
|
+
# ]
|
2429
|
+
# },
|
2430
|
+
# "referralDiscount": "0.04"
|
2431
|
+
# },
|
2432
|
+
# "userCrossRate": "0.00035",
|
2433
|
+
# "userAddRate": "0.0001",
|
2434
|
+
# "activeReferralDiscount": "0.0"
|
2435
|
+
# }
|
2436
|
+
#
|
2437
|
+
data: dict = {
|
2438
|
+
'userCrossRate': self.safe_string(response, 'userCrossRate'),
|
2439
|
+
'userAddRate': self.safe_string(response, 'userAddRate'),
|
2440
|
+
}
|
2441
|
+
return self.parse_trading_fee(data, market)
|
2442
|
+
|
2443
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
2444
|
+
#
|
2445
|
+
# {
|
2446
|
+
# "dailyUserVlm": [
|
2447
|
+
# {
|
2448
|
+
# "date": "2024-07-08",
|
2449
|
+
# "userCross": "0.0",
|
2450
|
+
# "userAdd": "0.0",
|
2451
|
+
# "exchange": "90597185.23639999"
|
2452
|
+
# }
|
2453
|
+
# ],
|
2454
|
+
# "feeSchedule": {
|
2455
|
+
# "cross": "0.00035",
|
2456
|
+
# "add": "0.0001",
|
2457
|
+
# "tiers": {
|
2458
|
+
# "vip": [
|
2459
|
+
# {
|
2460
|
+
# "ntlCutoff": "5000000.0",
|
2461
|
+
# "cross": "0.0003",
|
2462
|
+
# "add": "0.00005"
|
2463
|
+
# }
|
2464
|
+
# ],
|
2465
|
+
# "mm": [
|
2466
|
+
# {
|
2467
|
+
# "makerFractionCutoff": "0.005",
|
2468
|
+
# "add": "-0.00001"
|
2469
|
+
# }
|
2470
|
+
# ]
|
2471
|
+
# },
|
2472
|
+
# "referralDiscount": "0.04"
|
2473
|
+
# },
|
2474
|
+
# "userCrossRate": "0.00035",
|
2475
|
+
# "userAddRate": "0.0001",
|
2476
|
+
# "activeReferralDiscount": "0.0"
|
2477
|
+
# }
|
2478
|
+
#
|
2479
|
+
symbol = self.safe_symbol(None, market)
|
2480
|
+
return {
|
2481
|
+
'info': fee,
|
2482
|
+
'symbol': symbol,
|
2483
|
+
'maker': self.safe_number(fee, 'userAddRate'),
|
2484
|
+
'taker': self.safe_number(fee, 'userCrossRate'),
|
2485
|
+
'percentage': None,
|
2486
|
+
'tierBased': None,
|
2487
|
+
}
|
2488
|
+
|
2385
2489
|
def format_vault_address(self, address: Str = None):
|
2386
2490
|
if address is None:
|
2387
2491
|
return None
|
ccxt/async_support/kraken.py
CHANGED
@@ -19,13 +19,13 @@ from ccxt.base.errors import InsufficientFunds
|
|
19
19
|
from ccxt.base.errors import InvalidAddress
|
20
20
|
from ccxt.base.errors import InvalidOrder
|
21
21
|
from ccxt.base.errors import OrderNotFound
|
22
|
-
from ccxt.base.errors import CancelPending
|
23
22
|
from ccxt.base.errors import NotSupported
|
24
23
|
from ccxt.base.errors import DDoSProtection
|
25
24
|
from ccxt.base.errors import RateLimitExceeded
|
26
25
|
from ccxt.base.errors import ExchangeNotAvailable
|
27
26
|
from ccxt.base.errors import OnMaintenance
|
28
27
|
from ccxt.base.errors import InvalidNonce
|
28
|
+
from ccxt.base.errors import CancelPending
|
29
29
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
30
30
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
31
31
|
from ccxt.base.precise import Precise
|
ccxt/async_support/kucoin.py
CHANGED
@@ -260,6 +260,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
260
260
|
'purchase/orders': 10, # 10SW
|
261
261
|
# broker
|
262
262
|
'broker/api/rebase/download': 3,
|
263
|
+
# affiliate
|
264
|
+
'affiliate/inviter/statistics': 30,
|
263
265
|
},
|
264
266
|
'post': {
|
265
267
|
# account
|
@@ -701,6 +703,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
701
703
|
'redeem/orders': 'v3',
|
702
704
|
'purchase/orders': 'v3',
|
703
705
|
'margin/symbols': 'v3',
|
706
|
+
'affiliate/inviter/statistics': 'v2',
|
704
707
|
},
|
705
708
|
'POST': {
|
706
709
|
# account
|
ccxt/async_support/latoken.py
CHANGED
@@ -1344,7 +1344,11 @@ class latoken(Exchange, ImplicitAPI):
|
|
1344
1344
|
# "status":"SUCCESS"
|
1345
1345
|
# }
|
1346
1346
|
#
|
1347
|
-
return
|
1347
|
+
return [
|
1348
|
+
self.safe_order({
|
1349
|
+
'info': response,
|
1350
|
+
}),
|
1351
|
+
]
|
1348
1352
|
|
1349
1353
|
async def fetch_transactions(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1350
1354
|
"""
|
ccxt/async_support/mexc.py
CHANGED
@@ -810,24 +810,24 @@ class mexc(Exchange, ImplicitAPI):
|
|
810
810
|
'commonCurrencies': {
|
811
811
|
'BEYONDPROTOCOL': 'BEYOND',
|
812
812
|
'BIFI': 'BIFIF',
|
813
|
-
'BYN': '
|
813
|
+
'BYN': 'BEYONDFI',
|
814
814
|
'COFI': 'COFIX', # conflict with CoinFi
|
815
|
-
'DFI': '
|
816
|
-
'DFT': '
|
815
|
+
'DFI': 'DFISTARTER',
|
816
|
+
'DFT': 'DFUTURE',
|
817
817
|
'DRK': 'DRK',
|
818
|
-
'EGC': '
|
818
|
+
'EGC': 'EGORASCREDIT',
|
819
819
|
'FLUX1': 'FLUX', # switched places
|
820
820
|
'FLUX': 'FLUX1', # switched places
|
821
|
-
'FREE': '
|
821
|
+
'FREE': 'FREEROSSDAO', # conflict with FREE Coin
|
822
822
|
'GAS': 'GASDAO',
|
823
823
|
'GASNEO': 'GAS',
|
824
|
-
'GMT': '
|
824
|
+
'GMT': 'GMTTOKEN', # Conflict with GMT(STEPN)
|
825
825
|
'STEPN': 'GMT', # Conflict with GMT Token
|
826
|
-
'HERO': '
|
827
|
-
'MIMO': '
|
828
|
-
'PROS': '
|
829
|
-
'SIN': '
|
830
|
-
'SOUL': '
|
826
|
+
'HERO': 'STEPHERO', # conflict with Metahero
|
827
|
+
'MIMO': 'MIMOSA',
|
828
|
+
'PROS': 'PROSFINANCE', # conflict with Prosper
|
829
|
+
'SIN': 'SINCITYTOKEN',
|
830
|
+
'SOUL': 'SOULSWAP',
|
831
831
|
},
|
832
832
|
'exceptions': {
|
833
833
|
'exact': {
|
ccxt/async_support/novadax.py
CHANGED
@@ -19,9 +19,9 @@ from ccxt.base.errors import BadSymbol
|
|
19
19
|
from ccxt.base.errors import InsufficientFunds
|
20
20
|
from ccxt.base.errors import InvalidOrder
|
21
21
|
from ccxt.base.errors import OrderNotFound
|
22
|
-
from ccxt.base.errors import CancelPending
|
23
22
|
from ccxt.base.errors import RateLimitExceeded
|
24
23
|
from ccxt.base.errors import OnMaintenance
|
24
|
+
from ccxt.base.errors import CancelPending
|
25
25
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
26
26
|
from ccxt.base.precise import Precise
|
27
27
|
|
ccxt/async_support/okcoin.py
CHANGED
@@ -20,7 +20,6 @@ from ccxt.base.errors import InsufficientFunds
|
|
20
20
|
from ccxt.base.errors import InvalidAddress
|
21
21
|
from ccxt.base.errors import InvalidOrder
|
22
22
|
from ccxt.base.errors import OrderNotFound
|
23
|
-
from ccxt.base.errors import CancelPending
|
24
23
|
from ccxt.base.errors import NotSupported
|
25
24
|
from ccxt.base.errors import NetworkError
|
26
25
|
from ccxt.base.errors import RateLimitExceeded
|
@@ -28,6 +27,7 @@ from ccxt.base.errors import ExchangeNotAvailable
|
|
28
27
|
from ccxt.base.errors import OnMaintenance
|
29
28
|
from ccxt.base.errors import InvalidNonce
|
30
29
|
from ccxt.base.errors import RequestTimeout
|
30
|
+
from ccxt.base.errors import CancelPending
|
31
31
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
32
32
|
from ccxt.base.precise import Precise
|
33
33
|
|
ccxt/async_support/okx.py
CHANGED
@@ -22,7 +22,6 @@ from ccxt.base.errors import InsufficientFunds
|
|
22
22
|
from ccxt.base.errors import InvalidAddress
|
23
23
|
from ccxt.base.errors import InvalidOrder
|
24
24
|
from ccxt.base.errors import OrderNotFound
|
25
|
-
from ccxt.base.errors import CancelPending
|
26
25
|
from ccxt.base.errors import ContractUnavailable
|
27
26
|
from ccxt.base.errors import NotSupported
|
28
27
|
from ccxt.base.errors import NetworkError
|
@@ -32,6 +31,7 @@ from ccxt.base.errors import ExchangeNotAvailable
|
|
32
31
|
from ccxt.base.errors import OnMaintenance
|
33
32
|
from ccxt.base.errors import InvalidNonce
|
34
33
|
from ccxt.base.errors import RequestTimeout
|
34
|
+
from ccxt.base.errors import CancelPending
|
35
35
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
36
36
|
from ccxt.base.precise import Precise
|
37
37
|
|
@@ -6859,6 +6859,8 @@ class okx(Exchange, ImplicitAPI):
|
|
6859
6859
|
depositWithdrawFees[code] = self.deposit_withdraw_fee({})
|
6860
6860
|
depositWithdrawFees[code]['info'][currencyId] = feeInfo
|
6861
6861
|
chain = self.safe_string(feeInfo, 'chain')
|
6862
|
+
if chain is None:
|
6863
|
+
continue
|
6862
6864
|
chainSplit = chain.split('-')
|
6863
6865
|
networkId = self.safe_value(chainSplit, 1)
|
6864
6866
|
withdrawFee = self.safe_number(feeInfo, 'minFee')
|
ccxt/async_support/phemex.py
CHANGED
@@ -19,10 +19,10 @@ from ccxt.base.errors import BadSymbol
|
|
19
19
|
from ccxt.base.errors import InsufficientFunds
|
20
20
|
from ccxt.base.errors import InvalidOrder
|
21
21
|
from ccxt.base.errors import OrderNotFound
|
22
|
-
from ccxt.base.errors import CancelPending
|
23
22
|
from ccxt.base.errors import DuplicateOrderId
|
24
23
|
from ccxt.base.errors import DDoSProtection
|
25
24
|
from ccxt.base.errors import RateLimitExceeded
|
25
|
+
from ccxt.base.errors import CancelPending
|
26
26
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
27
27
|
from ccxt.base.precise import Precise
|
28
28
|
|
ccxt/async_support/probit.py
CHANGED
@@ -14,13 +14,13 @@ from ccxt.base.errors import ArgumentsRequired
|
|
14
14
|
from ccxt.base.errors import BadRequest
|
15
15
|
from ccxt.base.errors import BadSymbol
|
16
16
|
from ccxt.base.errors import MarketClosed
|
17
|
-
from ccxt.base.errors import BadResponse
|
18
17
|
from ccxt.base.errors import InsufficientFunds
|
19
18
|
from ccxt.base.errors import InvalidAddress
|
20
19
|
from ccxt.base.errors import InvalidOrder
|
21
20
|
from ccxt.base.errors import DDoSProtection
|
22
21
|
from ccxt.base.errors import RateLimitExceeded
|
23
22
|
from ccxt.base.errors import ExchangeNotAvailable
|
23
|
+
from ccxt.base.errors import BadResponse
|
24
24
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
25
25
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
26
26
|
from ccxt.base.precise import Precise
|
ccxt/async_support/tokocrypto.py
CHANGED
@@ -17,7 +17,6 @@ from ccxt.base.errors import ArgumentsRequired
|
|
17
17
|
from ccxt.base.errors import BadRequest
|
18
18
|
from ccxt.base.errors import BadSymbol
|
19
19
|
from ccxt.base.errors import MarginModeAlreadySet
|
20
|
-
from ccxt.base.errors import BadResponse
|
21
20
|
from ccxt.base.errors import InsufficientFunds
|
22
21
|
from ccxt.base.errors import InvalidOrder
|
23
22
|
from ccxt.base.errors import OrderNotFound
|
@@ -30,6 +29,7 @@ from ccxt.base.errors import ExchangeNotAvailable
|
|
30
29
|
from ccxt.base.errors import OnMaintenance
|
31
30
|
from ccxt.base.errors import InvalidNonce
|
32
31
|
from ccxt.base.errors import RequestTimeout
|
32
|
+
from ccxt.base.errors import BadResponse
|
33
33
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
34
34
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
35
35
|
from ccxt.base.precise import Precise
|
ccxt/async_support/upbit.py
CHANGED
@@ -134,6 +134,9 @@ class upbit(Exchange, ImplicitAPI):
|
|
134
134
|
'orders/chance',
|
135
135
|
'order',
|
136
136
|
'orders',
|
137
|
+
'orders/closed',
|
138
|
+
'orders/open',
|
139
|
+
'orders/uuids',
|
137
140
|
'withdraws',
|
138
141
|
'withdraw',
|
139
142
|
'withdraws/chance',
|
@@ -1392,6 +1395,28 @@ class upbit(Exchange, ImplicitAPI):
|
|
1392
1395
|
# ],
|
1393
1396
|
# }
|
1394
1397
|
#
|
1398
|
+
# fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders
|
1399
|
+
#
|
1400
|
+
# {
|
1401
|
+
# "uuid": "637fd66-d019-4d77-bee6-8e0cff28edd9",
|
1402
|
+
# "side": "ask",
|
1403
|
+
# "ord_type": "limit",
|
1404
|
+
# "price": "1.5",
|
1405
|
+
# "state": "wait",
|
1406
|
+
# "market": "SGD-XRP",
|
1407
|
+
# "created_at": "2024-06-05T09:37:10Z",
|
1408
|
+
# "volume": "10",
|
1409
|
+
# "remaining_volume": "10",
|
1410
|
+
# "reserved_fee": "0",
|
1411
|
+
# "remaining_fee": "0",
|
1412
|
+
# "paid_fee": "0",
|
1413
|
+
# "locked": "10",
|
1414
|
+
# "executed_volume": "0",
|
1415
|
+
# "executed_funds": "0",
|
1416
|
+
# "trades_count": 0,
|
1417
|
+
# "time_in_force": "ioc"
|
1418
|
+
# }
|
1419
|
+
#
|
1395
1420
|
id = self.safe_string(order, 'uuid')
|
1396
1421
|
side = self.safe_string(order, 'side')
|
1397
1422
|
if side == 'bid':
|
@@ -1453,7 +1478,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
1453
1478
|
'lastTradeTimestamp': lastTradeTimestamp,
|
1454
1479
|
'symbol': market['symbol'],
|
1455
1480
|
'type': type,
|
1456
|
-
'timeInForce':
|
1481
|
+
'timeInForce': self.safe_string_upper(order, 'time_in_force'),
|
1457
1482
|
'postOnly': None,
|
1458
1483
|
'side': side,
|
1459
1484
|
'price': price,
|
@@ -1469,77 +1494,149 @@ class upbit(Exchange, ImplicitAPI):
|
|
1469
1494
|
'trades': trades,
|
1470
1495
|
})
|
1471
1496
|
|
1472
|
-
async def
|
1497
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1498
|
+
"""
|
1499
|
+
fetch all unfilled currently open orders
|
1500
|
+
:see: https://global-docs.upbit.com/reference/open-order
|
1501
|
+
:param str symbol: unified market symbol
|
1502
|
+
:param int [since]: the earliest time in ms to fetch open orders for
|
1503
|
+
:param int [limit]: the maximum number of open order structures to retrieve
|
1504
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1505
|
+
:param str [params.state]: default is 'wait', set to 'watch' for stop limit orders
|
1506
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1507
|
+
"""
|
1473
1508
|
await self.load_markets()
|
1474
|
-
request: dict = {
|
1475
|
-
# 'market': self.market_id(symbol),
|
1476
|
-
'state': state,
|
1477
|
-
# 'page': 1,
|
1478
|
-
# 'order_by': 'asc',
|
1479
|
-
}
|
1509
|
+
request: dict = {}
|
1480
1510
|
market = None
|
1481
1511
|
if symbol is not None:
|
1482
1512
|
market = self.market(symbol)
|
1483
1513
|
request['market'] = market['id']
|
1484
|
-
|
1514
|
+
if limit is not None:
|
1515
|
+
request['limit'] = limit
|
1516
|
+
response = await self.privateGetOrdersOpen(self.extend(request, params))
|
1485
1517
|
#
|
1486
1518
|
# [
|
1487
1519
|
# {
|
1488
|
-
# "uuid": "
|
1489
|
-
# "side": "
|
1520
|
+
# "uuid": "637fd66-d019-4d77-bee6-8e0cff28edd9",
|
1521
|
+
# "side": "ask",
|
1490
1522
|
# "ord_type": "limit",
|
1491
|
-
# "price": "
|
1492
|
-
# "state": "
|
1493
|
-
# "market": "
|
1494
|
-
# "created_at": "
|
1495
|
-
# "volume": "
|
1496
|
-
# "remaining_volume": "
|
1497
|
-
# "reserved_fee": "
|
1498
|
-
# "remaining_fee": "
|
1499
|
-
# "paid_fee": "
|
1500
|
-
# "locked": "
|
1501
|
-
# "executed_volume": "
|
1502
|
-
# "
|
1503
|
-
#
|
1523
|
+
# "price": "1.5",
|
1524
|
+
# "state": "wait",
|
1525
|
+
# "market": "SGD-XRP",
|
1526
|
+
# "created_at": "2024-06-05T09:37:10Z",
|
1527
|
+
# "volume": "10",
|
1528
|
+
# "remaining_volume": "10",
|
1529
|
+
# "reserved_fee": "0",
|
1530
|
+
# "remaining_fee": "0",
|
1531
|
+
# "paid_fee": "0",
|
1532
|
+
# "locked": "10",
|
1533
|
+
# "executed_volume": "0",
|
1534
|
+
# "executed_funds": "0",
|
1535
|
+
# "trades_count": 0
|
1536
|
+
# }
|
1504
1537
|
# ]
|
1505
1538
|
#
|
1506
1539
|
return self.parse_orders(response, market, since, limit)
|
1507
1540
|
|
1508
|
-
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1509
|
-
"""
|
1510
|
-
:see: https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%EC%A1%B0%ED%9A%8C
|
1511
|
-
fetch all unfilled currently open orders
|
1512
|
-
:param str symbol: unified market symbol
|
1513
|
-
:param int [since]: the earliest time in ms to fetch open orders for
|
1514
|
-
:param int [limit]: the maximum number of open orders structures to retrieve
|
1515
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1516
|
-
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1517
|
-
"""
|
1518
|
-
return await self.fetch_orders_by_state('wait', symbol, since, limit, params)
|
1519
|
-
|
1520
1541
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1521
1542
|
"""
|
1522
|
-
:see: https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%EC%A1%B0%ED%9A%8C
|
1523
1543
|
fetches information on multiple closed orders made by the user
|
1544
|
+
:see: https://global-docs.upbit.com/reference/closed-order
|
1524
1545
|
:param str symbol: unified market symbol of the market orders were made in
|
1525
1546
|
:param int [since]: the earliest time in ms to fetch orders for
|
1526
1547
|
:param int [limit]: the maximum number of order structures to retrieve
|
1527
1548
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1549
|
+
:param int [params.until]: timestamp in ms of the latest order
|
1528
1550
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1529
1551
|
"""
|
1530
|
-
|
1552
|
+
await self.load_markets()
|
1553
|
+
request: dict = {
|
1554
|
+
'state': 'done',
|
1555
|
+
}
|
1556
|
+
market = None
|
1557
|
+
if symbol is not None:
|
1558
|
+
market = self.market(symbol)
|
1559
|
+
request['market'] = market['id']
|
1560
|
+
if since is not None:
|
1561
|
+
request['start_time'] = since
|
1562
|
+
if limit is not None:
|
1563
|
+
request['limit'] = limit
|
1564
|
+
request, params = self.handle_until_option('end_time', request, params)
|
1565
|
+
response = await self.privateGetOrdersClosed(self.extend(request, params))
|
1566
|
+
#
|
1567
|
+
# [
|
1568
|
+
# {
|
1569
|
+
# "uuid": "637fd66-d019-4d77-bee6-8e0cff28edd9",
|
1570
|
+
# "side": "ask",
|
1571
|
+
# "ord_type": "limit",
|
1572
|
+
# "price": "1.5",
|
1573
|
+
# "state": "done",
|
1574
|
+
# "market": "SGD-XRP",
|
1575
|
+
# "created_at": "2024-06-05T09:37:10Z",
|
1576
|
+
# "volume": "10",
|
1577
|
+
# "remaining_volume": "10",
|
1578
|
+
# "reserved_fee": "0",
|
1579
|
+
# "remaining_fee": "0",
|
1580
|
+
# "paid_fee": "0",
|
1581
|
+
# "locked": "10",
|
1582
|
+
# "executed_volume": "0",
|
1583
|
+
# "executed_funds": "0",
|
1584
|
+
# "trades_count": 0,
|
1585
|
+
# "time_in_force": "ioc"
|
1586
|
+
# }
|
1587
|
+
# ]
|
1588
|
+
#
|
1589
|
+
return self.parse_orders(response, market, since, limit)
|
1531
1590
|
|
1532
1591
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1533
1592
|
"""
|
1534
|
-
:see: https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%EC%A1%B0%ED%9A%8C
|
1535
1593
|
fetches information on multiple canceled orders made by the user
|
1594
|
+
:see: https://global-docs.upbit.com/reference/closed-order
|
1536
1595
|
:param str symbol: unified market symbol of the market orders were made in
|
1537
1596
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
1538
1597
|
:param int [limit]: max number of orders to return, default is None
|
1539
1598
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1599
|
+
:param int [params.until]: timestamp in ms of the latest order
|
1540
1600
|
:returns dict: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1541
1601
|
"""
|
1542
|
-
|
1602
|
+
await self.load_markets()
|
1603
|
+
request: dict = {
|
1604
|
+
'state': 'cancel',
|
1605
|
+
}
|
1606
|
+
market = None
|
1607
|
+
if symbol is not None:
|
1608
|
+
market = self.market(symbol)
|
1609
|
+
request['market'] = market['id']
|
1610
|
+
if since is not None:
|
1611
|
+
request['start_time'] = since
|
1612
|
+
if limit is not None:
|
1613
|
+
request['limit'] = limit
|
1614
|
+
request, params = self.handle_until_option('end_time', request, params)
|
1615
|
+
response = await self.privateGetOrdersClosed(self.extend(request, params))
|
1616
|
+
#
|
1617
|
+
# [
|
1618
|
+
# {
|
1619
|
+
# "uuid": "637fd66-d019-4d77-bee6-8e0cff28edd9",
|
1620
|
+
# "side": "ask",
|
1621
|
+
# "ord_type": "limit",
|
1622
|
+
# "price": "1.5",
|
1623
|
+
# "state": "cancel",
|
1624
|
+
# "market": "SGD-XRP",
|
1625
|
+
# "created_at": "2024-06-05T09:37:10Z",
|
1626
|
+
# "volume": "10",
|
1627
|
+
# "remaining_volume": "10",
|
1628
|
+
# "reserved_fee": "0",
|
1629
|
+
# "remaining_fee": "0",
|
1630
|
+
# "paid_fee": "0",
|
1631
|
+
# "locked": "10",
|
1632
|
+
# "executed_volume": "0",
|
1633
|
+
# "executed_funds": "0",
|
1634
|
+
# "trades_count": 0,
|
1635
|
+
# "time_in_force": "ioc"
|
1636
|
+
# }
|
1637
|
+
# ]
|
1638
|
+
#
|
1639
|
+
return self.parse_orders(response, market, since, limit)
|
1543
1640
|
|
1544
1641
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1545
1642
|
"""
|
@@ -1793,11 +1890,8 @@ class upbit(Exchange, ImplicitAPI):
|
|
1793
1890
|
if (method != 'GET') and (method != 'DELETE'):
|
1794
1891
|
body = self.json(params)
|
1795
1892
|
headers['Content-Type'] = 'application/json'
|
1796
|
-
|
1797
|
-
|
1798
|
-
else:
|
1799
|
-
if hasQuery:
|
1800
|
-
auth = self.urlencode(self.keysort(query))
|
1893
|
+
if hasQuery:
|
1894
|
+
auth = self.urlencode(query)
|
1801
1895
|
if auth is not None:
|
1802
1896
|
hash = self.hash(self.encode(auth), 'sha512')
|
1803
1897
|
request['query_hash'] = hash
|
ccxt/async_support/woo.py
CHANGED
@@ -15,6 +15,7 @@ from ccxt.base.errors import ArgumentsRequired
|
|
15
15
|
from ccxt.base.errors import BadRequest
|
16
16
|
from ccxt.base.errors import InvalidOrder
|
17
17
|
from ccxt.base.errors import NotSupported
|
18
|
+
from ccxt.base.errors import OperationFailed
|
18
19
|
from ccxt.base.errors import RateLimitExceeded
|
19
20
|
from ccxt.base.errors import OnMaintenance
|
20
21
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -316,7 +317,7 @@ class woo(Exchange, ImplicitAPI):
|
|
316
317
|
'commonCurrencies': {},
|
317
318
|
'exceptions': {
|
318
319
|
'exact': {
|
319
|
-
'-1000':
|
320
|
+
'-1000': OperationFailed, # {"code": -1000, "message": "An unknown error occurred while processing the request"} or {"success":false,"code":"-1000","message":"An internal error has occurred. We are unable to process your request. Please try again later."}
|
320
321
|
'-1001': AuthenticationError, # {"code": -1001, "message": "The api key or secret is in wrong format"}
|
321
322
|
'-1002': AuthenticationError, # {"code": -1002, "message": "API key or secret is invalid, it may because key have insufficient permission or the key is expired/revoked."}
|
322
323
|
'-1003': RateLimitExceeded, # {"code": -1003, "message": "Rate limit exceed."}
|