ccxt 4.2.74__py2.py3-none-any.whl → 4.2.75__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/tradeogre.py +16 -0
- ccxt/ascendex.py +5 -4
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/ascendex.py +5 -4
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bitmart.py +2 -0
- ccxt/async_support/coinbase.py +4 -4
- ccxt/async_support/coinbasepro.py +2 -2
- ccxt/async_support/coinex.py +4 -3
- ccxt/async_support/coinlist.py +2 -2
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/currencycom.py +2 -2
- ccxt/async_support/deribit.py +2 -2
- ccxt/async_support/gate.py +1 -0
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/huobijp.py +2 -2
- ccxt/async_support/kraken.py +3 -3
- ccxt/async_support/kucoin.py +3 -3
- ccxt/async_support/luno.py +2 -2
- ccxt/async_support/mexc.py +2 -2
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +2 -2
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/tradeogre.py +598 -0
- ccxt/async_support/woo.py +2 -2
- ccxt/base/exchange.py +3 -3
- ccxt/base/types.py +8 -1
- ccxt/bitmart.py +2 -0
- ccxt/coinbase.py +4 -4
- ccxt/coinbasepro.py +2 -2
- ccxt/coinex.py +4 -3
- ccxt/coinlist.py +2 -2
- ccxt/cryptocom.py +2 -2
- ccxt/currencycom.py +2 -2
- ccxt/deribit.py +2 -2
- ccxt/gate.py +1 -0
- ccxt/htx.py +2 -2
- ccxt/huobijp.py +2 -2
- ccxt/kraken.py +3 -3
- ccxt/kucoin.py +3 -3
- ccxt/luno.py +2 -2
- ccxt/mexc.py +2 -2
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +2 -2
- ccxt/okx.py +2 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/tradeogre.py +598 -0
- ccxt/woo.py +2 -2
- {ccxt-4.2.74.dist-info → ccxt-4.2.75.dist-info}/METADATA +9 -8
- {ccxt-4.2.74.dist-info → ccxt-4.2.75.dist-info}/RECORD +53 -50
- {ccxt-4.2.74.dist-info → ccxt-4.2.75.dist-info}/WHEEL +0 -0
- {ccxt-4.2.74.dist-info → ccxt-4.2.75.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
# ----------------------------------------------------------------------------
|
24
24
|
|
25
|
-
__version__ = '4.2.
|
25
|
+
__version__ = '4.2.75'
|
26
26
|
|
27
27
|
# ----------------------------------------------------------------------------
|
28
28
|
|
@@ -173,6 +173,7 @@ from ccxt.poloniexfutures import poloniexfutures # noqa: F4
|
|
173
173
|
from ccxt.probit import probit # noqa: F401
|
174
174
|
from ccxt.timex import timex # noqa: F401
|
175
175
|
from ccxt.tokocrypto import tokocrypto # noqa: F401
|
176
|
+
from ccxt.tradeogre import tradeogre # noqa: F401
|
176
177
|
from ccxt.upbit import upbit # noqa: F401
|
177
178
|
from ccxt.wavesexchange import wavesexchange # noqa: F401
|
178
179
|
from ccxt.wazirx import wazirx # noqa: F401
|
@@ -277,6 +278,7 @@ exchanges = [
|
|
277
278
|
'probit',
|
278
279
|
'timex',
|
279
280
|
'tokocrypto',
|
281
|
+
'tradeogre',
|
280
282
|
'upbit',
|
281
283
|
'wavesexchange',
|
282
284
|
'wazirx',
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from ccxt.base.types import Entry
|
2
|
+
|
3
|
+
|
4
|
+
class ImplicitAPI:
|
5
|
+
public_get_markets = publicGetMarkets = Entry('markets', 'public', 'GET', {'cost': 1})
|
6
|
+
public_get_orders_market = publicGetOrdersMarket = Entry('orders/{market}', 'public', 'GET', {'cost': 1})
|
7
|
+
public_get_ticker_market = publicGetTickerMarket = Entry('ticker/{market}', 'public', 'GET', {'cost': 1})
|
8
|
+
public_get_history_market = publicGetHistoryMarket = Entry('history/{market}', 'public', 'GET', {'cost': 1})
|
9
|
+
private_get_account_balance = privateGetAccountBalance = Entry('account/balance', 'private', 'GET', {'cost': 1})
|
10
|
+
private_get_account_balances = privateGetAccountBalances = Entry('account/balances', 'private', 'GET', {'cost': 1})
|
11
|
+
private_get_account_order_uuid = privateGetAccountOrderUuid = Entry('account/order/{uuid}', 'private', 'GET', {'cost': 1})
|
12
|
+
private_post_order_buy = privatePostOrderBuy = Entry('order/buy', 'private', 'POST', {'cost': 1})
|
13
|
+
private_post_order_sell = privatePostOrderSell = Entry('order/sell', 'private', 'POST', {'cost': 1})
|
14
|
+
private_post_order_cancel = privatePostOrderCancel = Entry('order/cancel', 'private', 'POST', {'cost': 1})
|
15
|
+
private_post_orders = privatePostOrders = Entry('orders', 'private', 'POST', {'cost': 1})
|
16
|
+
private_post_account_orders = privatePostAccountOrders = Entry('account/orders', 'private', 'POST', {'cost': 1})
|
ccxt/ascendex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.ascendex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, Leverages, MarginMode, MarginModes, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Leverage, Leverages, MarginMode, MarginModes, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -714,7 +714,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
714
714
|
data = self.safe_value(response, 'data')
|
715
715
|
return self.safe_integer(data, 'requestReceiveAt')
|
716
716
|
|
717
|
-
def fetch_accounts(self, params={}):
|
717
|
+
def fetch_accounts(self, params={}) -> List[Account]:
|
718
718
|
"""
|
719
719
|
fetch all the accounts associated with a profile
|
720
720
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -747,7 +747,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
747
747
|
{
|
748
748
|
'id': accountGroup,
|
749
749
|
'type': None,
|
750
|
-
'
|
750
|
+
'code': None,
|
751
751
|
'info': response,
|
752
752
|
},
|
753
753
|
]
|
@@ -2590,7 +2590,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2590
2590
|
notional = self.safe_string(position, 'buyOpenOrderNotional')
|
2591
2591
|
if Precise.string_eq(notional, '0'):
|
2592
2592
|
notional = self.safe_string(position, 'sellOpenOrderNotional')
|
2593
|
-
|
2593
|
+
marginType = self.safe_string(position, 'marginType')
|
2594
|
+
marginMode = 'cross' if (marginType == 'crossed') else 'isolated'
|
2594
2595
|
collateral = None
|
2595
2596
|
if marginMode == 'isolated':
|
2596
2597
|
collateral = self.safe_string(position, 'isolatedMargin')
|
ccxt/async_support/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.2.
|
7
|
+
__version__ = '4.2.75'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -153,6 +153,7 @@ from ccxt.async_support.poloniexfutures import poloniexfutures
|
|
153
153
|
from ccxt.async_support.probit import probit # noqa: F401
|
154
154
|
from ccxt.async_support.timex import timex # noqa: F401
|
155
155
|
from ccxt.async_support.tokocrypto import tokocrypto # noqa: F401
|
156
|
+
from ccxt.async_support.tradeogre import tradeogre # noqa: F401
|
156
157
|
from ccxt.async_support.upbit import upbit # noqa: F401
|
157
158
|
from ccxt.async_support.wavesexchange import wavesexchange # noqa: F401
|
158
159
|
from ccxt.async_support.wazirx import wazirx # noqa: F401
|
@@ -257,6 +258,7 @@ exchanges = [
|
|
257
258
|
'probit',
|
258
259
|
'timex',
|
259
260
|
'tokocrypto',
|
261
|
+
'tradeogre',
|
260
262
|
'upbit',
|
261
263
|
'wavesexchange',
|
262
264
|
'wazirx',
|
ccxt/async_support/ascendex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.ascendex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, Leverages, MarginMode, MarginModes, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Leverage, Leverages, MarginMode, MarginModes, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -714,7 +714,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
714
714
|
data = self.safe_value(response, 'data')
|
715
715
|
return self.safe_integer(data, 'requestReceiveAt')
|
716
716
|
|
717
|
-
async def fetch_accounts(self, params={}):
|
717
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
718
718
|
"""
|
719
719
|
fetch all the accounts associated with a profile
|
720
720
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -747,7 +747,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
747
747
|
{
|
748
748
|
'id': accountGroup,
|
749
749
|
'type': None,
|
750
|
-
'
|
750
|
+
'code': None,
|
751
751
|
'info': response,
|
752
752
|
},
|
753
753
|
]
|
@@ -2590,7 +2590,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2590
2590
|
notional = self.safe_string(position, 'buyOpenOrderNotional')
|
2591
2591
|
if Precise.string_eq(notional, '0'):
|
2592
2592
|
notional = self.safe_string(position, 'sellOpenOrderNotional')
|
2593
|
-
|
2593
|
+
marginType = self.safe_string(position, 'marginType')
|
2594
|
+
marginMode = 'cross' if (marginType == 'crossed') else 'isolated'
|
2594
2595
|
collateral = None
|
2595
2596
|
if marginMode == 'isolated':
|
2596
2597
|
collateral = self.safe_string(position, 'isolatedMargin')
|
ccxt/async_support/bitmart.py
CHANGED
@@ -19,6 +19,7 @@ from ccxt.base.errors import InvalidAddress
|
|
19
19
|
from ccxt.base.errors import InvalidOrder
|
20
20
|
from ccxt.base.errors import OrderNotFound
|
21
21
|
from ccxt.base.errors import NotSupported
|
22
|
+
from ccxt.base.errors import NetworkError
|
22
23
|
from ccxt.base.errors import RateLimitExceeded
|
23
24
|
from ccxt.base.errors import ExchangeNotAvailable
|
24
25
|
from ccxt.base.errors import OnMaintenance
|
@@ -365,6 +366,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
365
366
|
'70000': ExchangeError, # 200, no data
|
366
367
|
'70001': BadRequest, # 200, request param can not be null
|
367
368
|
'70002': BadSymbol, # 200, symbol is invalid
|
369
|
+
'70003': NetworkError, # {"code":70003,"trace":"81a9d57b63be4819b65d3065e6a4682b.105.17105295323593915","message":"net error, please try later","data":null}
|
368
370
|
'71001': BadRequest, # 200, after is invalid
|
369
371
|
'71002': BadRequest, # 200, before is invalid
|
370
372
|
'71003': BadRequest, # 200, request after or before is invalid
|
ccxt/async_support/coinbase.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.coinbase import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -401,7 +401,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
401
401
|
#
|
402
402
|
return self.safe_timestamp_2(response, 'epoch', 'epochSeconds')
|
403
403
|
|
404
|
-
async def fetch_accounts(self, params={}):
|
404
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
405
405
|
"""
|
406
406
|
fetch all the accounts associated with a profile
|
407
407
|
:see: https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getaccounts
|
@@ -415,7 +415,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
415
415
|
return await self.fetch_accounts_v3(params)
|
416
416
|
return await self.fetch_accounts_v2(params)
|
417
417
|
|
418
|
-
async def fetch_accounts_v2(self, params={}):
|
418
|
+
async def fetch_accounts_v2(self, params={}) -> List[Account]:
|
419
419
|
await self.load_markets()
|
420
420
|
paginate = False
|
421
421
|
paginate, params = self.handle_option_and_params(params, 'fetchAccounts', 'paginate')
|
@@ -481,7 +481,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
481
481
|
accounts[lastIndex] = last
|
482
482
|
return self.parse_accounts(data, params)
|
483
483
|
|
484
|
-
async def fetch_accounts_v3(self, params={}):
|
484
|
+
async def fetch_accounts_v3(self, params={}) -> List[Account]:
|
485
485
|
await self.load_markets()
|
486
486
|
paginate = False
|
487
487
|
paginate, params = self.handle_option_and_params(params, 'fetchAccounts', 'paginate')
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbasepro import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -425,7 +425,7 @@ class coinbasepro(Exchange, ImplicitAPI):
|
|
425
425
|
}))
|
426
426
|
return result
|
427
427
|
|
428
|
-
async def fetch_accounts(self, params={}):
|
428
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
429
429
|
"""
|
430
430
|
fetch all the accounts associated with a profile
|
431
431
|
:see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
|
ccxt/async_support/coinex.py
CHANGED
@@ -147,7 +147,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
147
147
|
'perpetualPrivate': 'https://api.coinex.com/perpetual',
|
148
148
|
},
|
149
149
|
'www': 'https://www.coinex.com',
|
150
|
-
'doc': 'https://github.
|
150
|
+
'doc': 'https://viabtc.github.io/coinex_api_en_doc',
|
151
151
|
'fees': 'https://www.coinex.com/fees',
|
152
152
|
'referral': 'https://www.coinex.com/register?refer_code=yw5fz',
|
153
153
|
},
|
@@ -361,6 +361,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
361
361
|
},
|
362
362
|
'broad': {
|
363
363
|
'ip not allow visit': PermissionDenied,
|
364
|
+
'service too busy': ExchangeNotAvailable,
|
364
365
|
},
|
365
366
|
},
|
366
367
|
})
|
@@ -4814,7 +4815,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4814
4815
|
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
4815
4816
|
"""
|
4816
4817
|
create a loan to borrow margin
|
4817
|
-
:see: https://github.
|
4818
|
+
:see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account017_margin_loan
|
4818
4819
|
:param str symbol: unified market symbol, required for coinex
|
4819
4820
|
:param str code: unified currency code of the currency to borrow
|
4820
4821
|
:param float amount: the amount to borrow
|
@@ -4849,7 +4850,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4849
4850
|
async def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
4850
4851
|
"""
|
4851
4852
|
repay borrowed margin and interest
|
4852
|
-
:see: https://github.
|
4853
|
+
:see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account018_margin_flat
|
4853
4854
|
:param str symbol: unified market symbol, required for coinex
|
4854
4855
|
:param str code: unified currency code of the currency to repay
|
4855
4856
|
:param float amount: the amount to repay
|
ccxt/async_support/coinlist.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.coinlist import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -1031,7 +1031,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1031
1031
|
'taker': takerFees,
|
1032
1032
|
}
|
1033
1033
|
|
1034
|
-
async def fetch_accounts(self, params={}):
|
1034
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
1035
1035
|
"""
|
1036
1036
|
fetch all the accounts associated with a profile
|
1037
1037
|
:see: https://trade-docs.coinlist.co/?javascript--nodejs#list-accounts
|
ccxt/async_support/cryptocom.py
CHANGED
@@ -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 Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -2298,7 +2298,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2298
2298
|
}
|
2299
2299
|
return self.safe_string(ledgerType, type, type)
|
2300
2300
|
|
2301
|
-
async def fetch_accounts(self, params={}):
|
2301
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
2302
2302
|
"""
|
2303
2303
|
fetch all the accounts associated with a profile
|
2304
2304
|
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-accounts
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.currencycom import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -574,7 +574,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
574
574
|
})
|
575
575
|
return result
|
576
576
|
|
577
|
-
async def fetch_accounts(self, params={}):
|
577
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
578
578
|
"""
|
579
579
|
fetch all the accounts associated with a profile
|
580
580
|
:see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
|
ccxt/async_support/deribit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.deribit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Greeks, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -682,7 +682,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
682
682
|
'info': response,
|
683
683
|
}
|
684
684
|
|
685
|
-
async def fetch_accounts(self, params={}):
|
685
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
686
686
|
"""
|
687
687
|
fetch all the accounts associated with a profile
|
688
688
|
:see: https://docs.deribit.com/#private-get_subaccounts
|
ccxt/async_support/gate.py
CHANGED
ccxt/async_support/htx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.htx import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -2939,7 +2939,7 @@ class htx(Exchange, ImplicitAPI):
|
|
2939
2939
|
data = self.safe_value(response, 'data', [])
|
2940
2940
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
2941
2941
|
|
2942
|
-
async def fetch_accounts(self, params={}):
|
2942
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
2943
2943
|
"""
|
2944
2944
|
fetch all the accounts associated with a profile
|
2945
2945
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/huobijp.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.huobijp import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -944,7 +944,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
944
944
|
data = self.safe_value(response, 'data', [])
|
945
945
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
946
946
|
|
947
|
-
async def fetch_accounts(self, params={}):
|
947
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
948
948
|
"""
|
949
949
|
fetch all the accounts associated with a profile
|
950
950
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/kraken.py
CHANGED
@@ -2586,7 +2586,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2586
2586
|
# todo unify parsePosition/parsePositions
|
2587
2587
|
return result
|
2588
2588
|
|
2589
|
-
def
|
2589
|
+
def parse_account_type(self, account):
|
2590
2590
|
accountByType = {
|
2591
2591
|
'spot': 'Spot Wallet',
|
2592
2592
|
'swap': 'Futures Wallet',
|
@@ -2618,8 +2618,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
2618
2618
|
"""
|
2619
2619
|
await self.load_markets()
|
2620
2620
|
currency = self.currency(code)
|
2621
|
-
fromAccount = self.
|
2622
|
-
toAccount = self.
|
2621
|
+
fromAccount = self.parse_account_type(fromAccount)
|
2622
|
+
toAccount = self.parse_account_type(toAccount)
|
2623
2623
|
request = {
|
2624
2624
|
'amount': self.currency_to_precision(code, amount),
|
2625
2625
|
'from': fromAccount,
|
ccxt/async_support/kucoin.py
CHANGED
@@ -9,7 +9,7 @@ import asyncio
|
|
9
9
|
import hashlib
|
10
10
|
import math
|
11
11
|
import json
|
12
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
12
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
13
13
|
from typing import List
|
14
14
|
from ccxt.base.errors import ExchangeError
|
15
15
|
from ccxt.base.errors import PermissionDenied
|
@@ -480,7 +480,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
480
480
|
'400006': AuthenticationError,
|
481
481
|
'400007': AuthenticationError,
|
482
482
|
'400008': NotSupported,
|
483
|
-
'400100':
|
483
|
+
'400100': InsufficientFunds, # {"msg":"account.available.amount","code":"400100"}
|
484
484
|
'400200': InvalidOrder, # {"code":"400200","msg":"Forbidden to place an order"}
|
485
485
|
'400350': InvalidOrder, # {"code":"400350","msg":"Upper limit for holding: 10,000USDT, you can still buy 10,000USDT worth of coin."}
|
486
486
|
'400370': InvalidOrder, # {"code":"400370","msg":"Max. price: 0.02500000000000000000"}
|
@@ -1227,7 +1227,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1227
1227
|
}
|
1228
1228
|
return result
|
1229
1229
|
|
1230
|
-
async def fetch_accounts(self, params={}):
|
1230
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
1231
1231
|
"""
|
1232
1232
|
fetch all the accounts associated with a profile
|
1233
1233
|
:see: https://docs.kucoin.com/#list-accounts
|
ccxt/async_support/luno.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.luno import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
8
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -268,7 +268,7 @@ class luno(Exchange, ImplicitAPI):
|
|
268
268
|
})
|
269
269
|
return result
|
270
270
|
|
271
|
-
async def fetch_accounts(self, params={}):
|
271
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
272
272
|
"""
|
273
273
|
fetch all the accounts associated with a profile
|
274
274
|
:see: https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
|
ccxt/async_support/mexc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.mexc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, IndexType, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, IndexType, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -3319,7 +3319,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3319
3319
|
return self.safe_value(response, 'data')
|
3320
3320
|
return None
|
3321
3321
|
|
3322
|
-
async def fetch_accounts(self, params={}):
|
3322
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
3323
3323
|
"""
|
3324
3324
|
fetch all the accounts associated with a profile
|
3325
3325
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/ndax.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.ndax import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import BadSymbol
|
@@ -962,7 +962,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
962
962
|
#
|
963
963
|
return self.parse_trades(response, market, since, limit)
|
964
964
|
|
965
|
-
async def fetch_accounts(self, params={}):
|
965
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
966
966
|
"""
|
967
967
|
fetch all the accounts associated with a profile
|
968
968
|
:see: https://apidoc.ndax.io/#getuseraccounts
|
ccxt/async_support/novadax.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.novadax import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -1185,7 +1185,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1185
1185
|
#
|
1186
1186
|
return self.parse_transaction(response, currency)
|
1187
1187
|
|
1188
|
-
async def fetch_accounts(self, params={}):
|
1188
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
1189
1189
|
"""
|
1190
1190
|
fetch all the accounts associated with a profile
|
1191
1191
|
:see: https://doc.novadax.com/en-US/#get-sub-account-list
|
ccxt/async_support/okx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.okx import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currency, Greeks, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, Greeks, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -1276,7 +1276,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1276
1276
|
first = self.safe_value(data, 0, {})
|
1277
1277
|
return self.safe_integer(first, 'ts')
|
1278
1278
|
|
1279
|
-
async def fetch_accounts(self, params={}):
|
1279
|
+
async def fetch_accounts(self, params={}) -> List[Account]:
|
1280
1280
|
"""
|
1281
1281
|
fetch all the accounts associated with a profile
|
1282
1282
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
|