ccxt 4.3.68__py2.py3-none-any.whl → 4.3.69__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 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +2 -2
- ccxt/async_support/bingx.py +129 -73
- ccxt/async_support/bitget.py +2 -2
- ccxt/async_support/bitmart.py +2 -2
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/bybit.py +2 -2
- ccxt/async_support/coinbaseinternational.py +72 -1
- ccxt/async_support/coinex.py +2 -2
- ccxt/async_support/coinlist.py +2 -2
- ccxt/async_support/deribit.py +2 -2
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/hyperliquid.py +0 -2
- ccxt/async_support/kucoin.py +11 -5
- ccxt/async_support/latoken.py +2 -2
- ccxt/async_support/mexc.py +2 -2
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/oxfun.py +1 -1
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/poloniex.py +33 -33
- ccxt/async_support/poloniexfutures.py +26 -26
- ccxt/async_support/woo.py +2 -2
- ccxt/base/exchange.py +329 -117
- ccxt/base/types.py +21 -3
- ccxt/binance.py +2 -2
- ccxt/bingx.py +129 -73
- ccxt/bitget.py +2 -2
- ccxt/bitmart.py +2 -2
- ccxt/bitrue.py +2 -2
- ccxt/btcbox.py +1 -1
- ccxt/bybit.py +2 -2
- ccxt/coinbaseinternational.py +72 -1
- ccxt/coinex.py +2 -2
- ccxt/coinlist.py +2 -2
- ccxt/deribit.py +2 -2
- ccxt/digifinex.py +2 -2
- ccxt/hyperliquid.py +0 -2
- ccxt/kucoin.py +11 -5
- ccxt/latoken.py +2 -2
- ccxt/mexc.py +2 -2
- ccxt/okx.py +2 -2
- ccxt/oxfun.py +1 -1
- ccxt/phemex.py +2 -2
- ccxt/poloniex.py +33 -33
- ccxt/poloniexfutures.py +26 -26
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/poloniex.py +13 -13
- ccxt/pro/poloniexfutures.py +5 -5
- ccxt/woo.py +2 -2
- {ccxt-4.3.68.dist-info → ccxt-4.3.69.dist-info}/METADATA +6 -6
- {ccxt-4.3.68.dist-info → ccxt-4.3.69.dist-info}/RECORD +57 -57
- {ccxt-4.3.68.dist-info → ccxt-4.3.69.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.68.dist-info → ccxt-4.3.69.dist-info}/WHEEL +0 -0
- {ccxt-4.3.68.dist-info → ccxt-4.3.69.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -7801,7 +7801,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7801
7801
|
#
|
7802
7802
|
return self.parse_transfer(response, currency)
|
7803
7803
|
|
7804
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
7804
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
7805
7805
|
"""
|
7806
7806
|
fetch a history of internal transfers made on an account
|
7807
7807
|
:see: https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
ccxt/async_support/bingx.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bingx import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import numbers
|
11
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -1111,7 +1111,27 @@ class bingx(Exchange, ImplicitAPI):
|
|
1111
1111
|
# "s": "BTC-USDT"
|
1112
1112
|
# }
|
1113
1113
|
#
|
1114
|
-
|
1114
|
+
# inverse swap fetchMyTrades
|
1115
|
+
#
|
1116
|
+
# {
|
1117
|
+
# "orderId": "1817441228670648320",
|
1118
|
+
# "symbol": "SOL-USD",
|
1119
|
+
# "type": "MARKET",
|
1120
|
+
# "side": "BUY",
|
1121
|
+
# "positionSide": "LONG",
|
1122
|
+
# "tradeId": "97244554",
|
1123
|
+
# "volume": "2",
|
1124
|
+
# "tradePrice": "182.652",
|
1125
|
+
# "amount": "20.00000000",
|
1126
|
+
# "realizedPnl": "0.00000000",
|
1127
|
+
# "commission": "-0.00005475",
|
1128
|
+
# "currency": "SOL",
|
1129
|
+
# "buyer": True,
|
1130
|
+
# "maker": False,
|
1131
|
+
# "tradeTime": 1722146730000
|
1132
|
+
# }
|
1133
|
+
#
|
1134
|
+
time = self.safe_integer_n(trade, ['time', 'filledTm', 'T', 'tradeTime'])
|
1115
1135
|
datetimeId = self.safe_string(trade, 'filledTm')
|
1116
1136
|
if datetimeId is not None:
|
1117
1137
|
time = self.parse8601(datetimeId)
|
@@ -1122,8 +1142,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
1122
1142
|
currencyId = self.safe_string_n(trade, ['currency', 'N', 'commissionAsset'])
|
1123
1143
|
currencyCode = self.safe_currency_code(currencyId)
|
1124
1144
|
m = self.safe_bool(trade, 'm')
|
1125
|
-
marketId = self.
|
1126
|
-
isBuyerMaker = self.
|
1145
|
+
marketId = self.safe_string_2(trade, 's', 'symbol')
|
1146
|
+
isBuyerMaker = self.safe_bool_n(trade, ['buyerMaker', 'isBuyerMaker', 'maker'])
|
1127
1147
|
takeOrMaker = None
|
1128
1148
|
if (isBuyerMaker is not None) or (m is not None):
|
1129
1149
|
takeOrMaker = 'maker' if (isBuyerMaker or m) else 'taker'
|
@@ -1154,7 +1174,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1154
1174
|
'type': self.safe_string_lower(trade, 'o'),
|
1155
1175
|
'side': self.parse_order_side(side),
|
1156
1176
|
'takerOrMaker': takeOrMaker,
|
1157
|
-
'price': self.
|
1177
|
+
'price': self.safe_string_n(trade, ['price', 'p', 'tradePrice']),
|
1158
1178
|
'amount': amount,
|
1159
1179
|
'cost': cost,
|
1160
1180
|
'fee': {
|
@@ -3985,7 +4005,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3985
4005
|
'status': None,
|
3986
4006
|
}
|
3987
4007
|
|
3988
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
4008
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
3989
4009
|
"""
|
3990
4010
|
fetch a history of internal transfers made on an account
|
3991
4011
|
:see: https://bingx-api.github.io/docs/#/spot/account-api.html#Query%20User%20Universal%20Transfer%20History%20(USER_DATA)
|
@@ -4597,93 +4617,129 @@ class bingx(Exchange, ImplicitAPI):
|
|
4597
4617
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4598
4618
|
"""
|
4599
4619
|
fetch all trades made by the user
|
4600
|
-
:see: https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%
|
4601
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
4620
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
|
4621
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
4622
|
+
:see: https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
|
4602
4623
|
:param str [symbol]: unified market symbol
|
4603
4624
|
:param int [since]: the earliest time in ms to fetch trades for
|
4604
4625
|
:param int [limit]: the maximum number of trades structures to retrieve
|
4605
4626
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4606
4627
|
:param int [params.until]: timestamp in ms for the ending date filter, default is None
|
4607
4628
|
:param str params['trandingUnit']: COIN(directly represent assets such and ETH) or CONT(represents the number of contract sheets)
|
4629
|
+
:param str params['orderId']: the order id required for inverse swap
|
4608
4630
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
4609
4631
|
"""
|
4610
4632
|
if symbol is None:
|
4611
4633
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
4612
4634
|
await self.load_markets()
|
4613
4635
|
market = self.market(symbol)
|
4614
|
-
|
4615
|
-
response = None
|
4616
|
-
request: dict = {
|
4617
|
-
'symbol': market['id'],
|
4618
|
-
}
|
4619
|
-
if since is not None:
|
4620
|
-
startTimeReq = 'startTime' if market['spot'] else 'startTs'
|
4621
|
-
request[startTimeReq] = since
|
4622
|
-
elif market['swap']:
|
4623
|
-
request['startTs'] = now - 7776000000 # 90 days
|
4624
|
-
until = self.safe_integer(params, 'until')
|
4625
|
-
params = self.omit(params, 'until')
|
4626
|
-
if until is not None:
|
4627
|
-
endTimeReq = 'endTime' if market['spot'] else 'endTs'
|
4628
|
-
request[endTimeReq] = until
|
4629
|
-
elif market['swap']:
|
4630
|
-
request['endTs'] = now
|
4636
|
+
request: dict = {}
|
4631
4637
|
fills = None
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4635
|
-
|
4638
|
+
response = None
|
4639
|
+
subType = None
|
4640
|
+
subType, params = self.handle_sub_type_and_params('fetchMyTrades', market, params)
|
4641
|
+
if subType == 'inverse':
|
4642
|
+
orderId = self.safe_string(params, 'orderId')
|
4643
|
+
if orderId is None:
|
4644
|
+
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires an orderId argument for inverse swap trades')
|
4645
|
+
response = await self.cswapV1PrivateGetTradeAllFillOrders(self.extend(request, params))
|
4646
|
+
fills = self.safe_list(response, 'data', [])
|
4636
4647
|
#
|
4637
4648
|
# {
|
4638
4649
|
# "code": 0,
|
4639
4650
|
# "msg": "",
|
4640
|
-
# "
|
4641
|
-
# "data":
|
4642
|
-
#
|
4643
|
-
#
|
4644
|
-
#
|
4645
|
-
#
|
4646
|
-
#
|
4647
|
-
#
|
4648
|
-
#
|
4649
|
-
#
|
4650
|
-
#
|
4651
|
-
#
|
4652
|
-
#
|
4653
|
-
#
|
4654
|
-
#
|
4655
|
-
#
|
4656
|
-
#
|
4657
|
-
#
|
4651
|
+
# "timestamp": 1722147756019,
|
4652
|
+
# "data": [
|
4653
|
+
# {
|
4654
|
+
# "orderId": "1817441228670648320",
|
4655
|
+
# "symbol": "SOL-USD",
|
4656
|
+
# "type": "MARKET",
|
4657
|
+
# "side": "BUY",
|
4658
|
+
# "positionSide": "LONG",
|
4659
|
+
# "tradeId": "97244554",
|
4660
|
+
# "volume": "2",
|
4661
|
+
# "tradePrice": "182.652",
|
4662
|
+
# "amount": "20.00000000",
|
4663
|
+
# "realizedPnl": "0.00000000",
|
4664
|
+
# "commission": "-0.00005475",
|
4665
|
+
# "currency": "SOL",
|
4666
|
+
# "buyer": True,
|
4667
|
+
# "maker": False,
|
4668
|
+
# "tradeTime": 1722146730000
|
4669
|
+
# }
|
4670
|
+
# ]
|
4658
4671
|
# }
|
4659
4672
|
#
|
4660
4673
|
else:
|
4661
|
-
|
4662
|
-
|
4663
|
-
|
4664
|
-
|
4665
|
-
|
4666
|
-
|
4667
|
-
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4679
|
-
|
4680
|
-
|
4681
|
-
|
4682
|
-
|
4683
|
-
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4674
|
+
request['symbol'] = market['id']
|
4675
|
+
now = self.milliseconds()
|
4676
|
+
if since is not None:
|
4677
|
+
startTimeReq = 'startTime' if market['spot'] else 'startTs'
|
4678
|
+
request[startTimeReq] = since
|
4679
|
+
elif market['swap']:
|
4680
|
+
request['startTs'] = now - 7776000000 # 90 days
|
4681
|
+
until = self.safe_integer(params, 'until')
|
4682
|
+
params = self.omit(params, 'until')
|
4683
|
+
if until is not None:
|
4684
|
+
endTimeReq = 'endTime' if market['spot'] else 'endTs'
|
4685
|
+
request[endTimeReq] = until
|
4686
|
+
elif market['swap']:
|
4687
|
+
request['endTs'] = now
|
4688
|
+
if market['spot']:
|
4689
|
+
response = await self.spotV1PrivateGetTradeMyTrades(self.extend(request, params))
|
4690
|
+
data = self.safe_dict(response, 'data', {})
|
4691
|
+
fills = self.safe_list(data, 'fills', [])
|
4692
|
+
#
|
4693
|
+
# {
|
4694
|
+
# "code": 0,
|
4695
|
+
# "msg": "",
|
4696
|
+
# "debugMsg": "",
|
4697
|
+
# "data": {
|
4698
|
+
# "fills": [
|
4699
|
+
# {
|
4700
|
+
# "symbol": "LTC-USDT",
|
4701
|
+
# "id": 36237072,
|
4702
|
+
# "orderId": 1674069326895775744,
|
4703
|
+
# "price": "85.891",
|
4704
|
+
# "qty": "0.0582",
|
4705
|
+
# "quoteQty": "4.9988562000000005",
|
4706
|
+
# "commission": -0.00005820000000000001,
|
4707
|
+
# "commissionAsset": "LTC",
|
4708
|
+
# "time": 1687964205000,
|
4709
|
+
# "isBuyer": True,
|
4710
|
+
# "isMaker": False
|
4711
|
+
# }
|
4712
|
+
# ]
|
4713
|
+
# }
|
4714
|
+
# }
|
4715
|
+
#
|
4716
|
+
else:
|
4717
|
+
tradingUnit = self.safe_string_upper(params, 'tradingUnit', 'CONT')
|
4718
|
+
params = self.omit(params, 'tradingUnit')
|
4719
|
+
request['tradingUnit'] = tradingUnit
|
4720
|
+
response = await self.swapV2PrivateGetTradeAllFillOrders(self.extend(request, params))
|
4721
|
+
data = self.safe_dict(response, 'data', {})
|
4722
|
+
fills = self.safe_list(data, 'fill_orders', [])
|
4723
|
+
#
|
4724
|
+
# {
|
4725
|
+
# "code": "0",
|
4726
|
+
# "msg": '',
|
4727
|
+
# "data": {fill_orders: [
|
4728
|
+
# {
|
4729
|
+
# "volume": "0.1",
|
4730
|
+
# "price": "106.75",
|
4731
|
+
# "amount": "10.6750",
|
4732
|
+
# "commission": "-0.0053",
|
4733
|
+
# "currency": "USDT",
|
4734
|
+
# "orderId": "1676213270274379776",
|
4735
|
+
# "liquidatedPrice": "0.00",
|
4736
|
+
# "liquidatedMarginRatio": "0.00",
|
4737
|
+
# "filledTime": "2023-07-04T20:56:01.000+0800"
|
4738
|
+
# }
|
4739
|
+
# ]
|
4740
|
+
# }
|
4741
|
+
# }
|
4742
|
+
#
|
4687
4743
|
return self.parse_trades(fills, market, since, limit, params)
|
4688
4744
|
|
4689
4745
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
ccxt/async_support/bitget.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bitget import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -6820,7 +6820,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6820
6820
|
'info': interest,
|
6821
6821
|
}, market)
|
6822
6822
|
|
6823
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
6823
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
6824
6824
|
"""
|
6825
6825
|
fetch a history of internal transfers made on an account
|
6826
6826
|
:see: https://www.bitget.com/api-doc/spot/account/Get-Account-TransferRecords
|
ccxt/async_support/bitmart.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitmart import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, 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 AuthenticationError
|
@@ -3819,7 +3819,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3819
3819
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'state')),
|
3820
3820
|
}
|
3821
3821
|
|
3822
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
3822
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
3823
3823
|
"""
|
3824
3824
|
fetch a history of internal transfers made on an account, only transfers between spot and swap are supported
|
3825
3825
|
:see: https://developer-pro.bitmart.com/en/futures/#get-transfer-list-signed
|
ccxt/async_support/bitrue.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bitrue import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -2728,7 +2728,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2728
2728
|
'status': 'ok',
|
2729
2729
|
}
|
2730
2730
|
|
2731
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
2731
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
2732
2732
|
"""
|
2733
2733
|
fetch a history of internal transfers made on an account
|
2734
2734
|
:see: https://www.bitrue.com/api-docs#get-future-account-transfer-history-list-user_data-hmac-sha256
|
ccxt/async_support/btcbox.py
CHANGED
@@ -648,7 +648,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
648
648
|
'nonce': nonce,
|
649
649
|
}, params)
|
650
650
|
request = self.urlencode(query)
|
651
|
-
secret = self.hash(self.encode(self.secret), '
|
651
|
+
secret = self.hash(self.encode(self.secret), 'md5')
|
652
652
|
query['signature'] = self.hmac(self.encode(request), self.encode(secret), hashlib.sha256)
|
653
653
|
body = self.urlencode(query)
|
654
654
|
headers = {
|
ccxt/async_support/bybit.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bybit import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, LeverageTier, LeverageTiers, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, LeverageTier, LeverageTiers, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -6719,7 +6719,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6719
6719
|
'status': status,
|
6720
6720
|
})
|
6721
6721
|
|
6722
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
6722
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
6723
6723
|
"""
|
6724
6724
|
fetch a history of internal transfers made on an account
|
6725
6725
|
:see: https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
@@ -74,7 +74,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
74
74
|
'fetchCrossBorrowRates': False,
|
75
75
|
'fetchCurrencies': True,
|
76
76
|
'fetchDeposits': True,
|
77
|
-
'fetchFundingHistory':
|
77
|
+
'fetchFundingHistory': True,
|
78
78
|
'fetchFundingRate': False,
|
79
79
|
'fetchFundingRateHistory': True,
|
80
80
|
'fetchFundingRates': False,
|
@@ -433,6 +433,77 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
433
433
|
'previousFundingDatetime': None,
|
434
434
|
}
|
435
435
|
|
436
|
+
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
437
|
+
"""
|
438
|
+
fetch the history of funding payments paid and received on self account
|
439
|
+
:see: https://docs.cdp.coinbase.com/intx/reference/gettransfers
|
440
|
+
:param str [symbol]: unified market symbol
|
441
|
+
:param int [since]: the earliest time in ms to fetch funding history for
|
442
|
+
:param int [limit]: the maximum number of funding history structures to retrieve
|
443
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
444
|
+
:returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
|
445
|
+
"""
|
446
|
+
await self.load_markets()
|
447
|
+
request: dict = {
|
448
|
+
'type': 'FUNDING',
|
449
|
+
}
|
450
|
+
market: Market = None
|
451
|
+
if symbol is not None:
|
452
|
+
market = self.market(symbol)
|
453
|
+
portfolios = None
|
454
|
+
portfolios, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'portfolios')
|
455
|
+
if portfolios is not None:
|
456
|
+
request['portfolios'] = portfolios
|
457
|
+
if since is not None:
|
458
|
+
request['time_from'] = self.iso8601(since)
|
459
|
+
if limit is not None:
|
460
|
+
request['result_limit'] = limit
|
461
|
+
else:
|
462
|
+
request['result_limit'] = 100
|
463
|
+
response = await self.v1PrivateGetTransfers(self.extend(request, params))
|
464
|
+
fundings = self.safe_list(response, 'results', [])
|
465
|
+
return self.parse_incomes(fundings, market, since, limit)
|
466
|
+
|
467
|
+
def parse_income(self, income, market: Market = None):
|
468
|
+
#
|
469
|
+
# {
|
470
|
+
# "amount":"0.0008",
|
471
|
+
# "asset":"USDC",
|
472
|
+
# "created_at":"2024-02-22T16:00:00Z",
|
473
|
+
# "from_portfolio":{
|
474
|
+
# "id":"13yuk1fs-1-0",
|
475
|
+
# "name":"Eng Test Portfolio - 2",
|
476
|
+
# "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
|
477
|
+
# },
|
478
|
+
# "instrument_id":"149264164756389888",
|
479
|
+
# "instrument_symbol":"ETH-PERP",
|
480
|
+
# "position_id":"1xy4v51m-1-2",
|
481
|
+
# "status":"PROCESSED",
|
482
|
+
# "to_portfolio":{
|
483
|
+
# "name":"CB_FUND"
|
484
|
+
# },
|
485
|
+
# "transfer_type":"FUNDING",
|
486
|
+
# "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
|
487
|
+
# "updated_at":"2024-02-22T16:00:00Z"
|
488
|
+
# }
|
489
|
+
#
|
490
|
+
marketId = self.safe_string(income, 'symbol')
|
491
|
+
market = self.safe_market(marketId, market, None, 'contract')
|
492
|
+
datetime = self.safe_integer(income, 'created_at')
|
493
|
+
timestamp = self.parse8601(datetime)
|
494
|
+
currencyId = self.safe_string(income, 'asset')
|
495
|
+
code = self.safe_currency_code(currencyId)
|
496
|
+
return {
|
497
|
+
'info': income,
|
498
|
+
'symbol': market['symbol'],
|
499
|
+
'code': code,
|
500
|
+
'timestamp': timestamp,
|
501
|
+
'datetime': self.iso8601(timestamp),
|
502
|
+
'id': self.safe_string(income, 'transfer_uuid'),
|
503
|
+
'amount': self.safe_number(income, 'amount'),
|
504
|
+
'rate': None,
|
505
|
+
}
|
506
|
+
|
436
507
|
async def create_deposit_address(self, code: str, params={}):
|
437
508
|
"""
|
438
509
|
create a currency deposit address
|
ccxt/async_support/coinex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinex import ImplicitAPI
|
8
8
|
import asyncio
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -4680,7 +4680,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4680
4680
|
'status': self.parse_transfer_status(self.safe_string_2(transfer, 'code', 'status')),
|
4681
4681
|
}
|
4682
4682
|
|
4683
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
4683
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
4684
4684
|
"""
|
4685
4685
|
fetch a history of internal transfers made on an account
|
4686
4686
|
:see: https://docs.coinex.com/api/v2/assets/transfer/http/list-transfer-history
|
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 Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -1703,7 +1703,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1703
1703
|
transfer = self.parse_transfer(response, currency)
|
1704
1704
|
return transfer
|
1705
1705
|
|
1706
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
1706
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
1707
1707
|
"""
|
1708
1708
|
fetch a history of internal transfers between CoinList.co and CoinList Pro. It does not return external deposits or withdrawals
|
1709
1709
|
:see: https://trade-docs.coinlist.co/?javascript--nodejs#list-transfers
|
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 Account, Balances, Currencies, Currency, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2618,7 +2618,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2618
2618
|
})
|
2619
2619
|
return result
|
2620
2620
|
|
2621
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
2621
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
2622
2622
|
"""
|
2623
2623
|
fetch a history of internal transfers made on an account
|
2624
2624
|
:see: https://docs.deribit.com/#private-get_transfers
|
ccxt/async_support/digifinex.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.digifinex import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -3462,7 +3462,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3462
3462
|
# }
|
3463
3463
|
#
|
3464
3464
|
|
3465
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
3465
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
3466
3466
|
"""
|
3467
3467
|
fetch the transfer history, only transfers between spot and swap accounts are supported
|
3468
3468
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#transferrecord
|
@@ -817,8 +817,6 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
817
817
|
until = self.safe_integer(params, 'until', self.milliseconds())
|
818
818
|
if since is None:
|
819
819
|
since = 0
|
820
|
-
if limit is None:
|
821
|
-
limit = 500
|
822
820
|
params = self.omit(params, ['until'])
|
823
821
|
request: dict = {
|
824
822
|
'type': 'candleSnapshot',
|
ccxt/async_support/kucoin.py
CHANGED
@@ -1514,20 +1514,26 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1514
1514
|
},
|
1515
1515
|
'networks': {},
|
1516
1516
|
}
|
1517
|
-
isWithdrawEnabled = self.safe_bool(fee, 'isWithdrawEnabled')
|
1517
|
+
isWithdrawEnabled = self.safe_bool(fee, 'isWithdrawEnabled', True)
|
1518
|
+
minFee = None
|
1518
1519
|
if isWithdrawEnabled:
|
1519
|
-
result['withdraw']['fee'] = self.safe_number_2(fee, 'withdrawalMinFee', 'withdrawMinFee')
|
1520
1520
|
result['withdraw']['percentage'] = False
|
1521
|
-
|
1522
|
-
|
1521
|
+
chains = self.safe_list(fee, 'chains', [])
|
1522
|
+
for i in range(0, len(chains)):
|
1523
|
+
chain = chains[i]
|
1524
|
+
networkId = self.safe_string(chain, 'chainId')
|
1523
1525
|
networkCode = self.network_id_to_code(networkId, self.safe_string(currency, 'code'))
|
1526
|
+
withdrawFee = self.safe_string(chain, 'withdrawalMinFee')
|
1527
|
+
if minFee is None or (Precise.string_lt(withdrawFee, minFee)):
|
1528
|
+
minFee = withdrawFee
|
1524
1529
|
result['networks'][networkCode] = {
|
1525
|
-
'withdraw':
|
1530
|
+
'withdraw': self.parse_number(withdrawFee),
|
1526
1531
|
'deposit': {
|
1527
1532
|
'fee': None,
|
1528
1533
|
'percentage': None,
|
1529
1534
|
},
|
1530
1535
|
}
|
1536
|
+
result['withdraw']['fee'] = self.parse_number(minFee)
|
1531
1537
|
return result
|
1532
1538
|
|
1533
1539
|
def is_futures_method(self, methodName, params):
|
ccxt/async_support/latoken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.latoken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, 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 AuthenticationError
|
@@ -1476,7 +1476,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
1476
1476
|
}
|
1477
1477
|
return self.safe_string(types, type, type)
|
1478
1478
|
|
1479
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) ->
|
1479
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
1480
1480
|
"""
|
1481
1481
|
fetch a history of internal transfers made on an account
|
1482
1482
|
:see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
|