ccxt 4.2.59__py2.py3-none-any.whl → 4.2.60__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/blofin.py +1 -0
- ccxt/abstract/kraken.py +37 -37
- ccxt/abstract/wazirx.py +6 -1
- ccxt/ascendex.py +10 -12
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +10 -12
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +37 -1
- ccxt/async_support/bitfinex2.py +20 -3
- ccxt/async_support/bitget.py +7 -2
- ccxt/async_support/bitmart.py +40 -23
- ccxt/async_support/blofin.py +52 -2
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/htx.py +3 -1
- ccxt/async_support/kraken.py +42 -39
- ccxt/async_support/kucoinfutures.py +1 -0
- ccxt/async_support/wazirx.py +6 -1
- ccxt/async_support/woo.py +146 -74
- ccxt/base/exchange.py +1 -1
- ccxt/bingx.py +37 -1
- ccxt/bitfinex2.py +20 -3
- ccxt/bitget.py +7 -2
- ccxt/bitmart.py +40 -23
- ccxt/blofin.py +52 -2
- ccxt/hitbtc.py +1 -1
- ccxt/htx.py +3 -1
- ccxt/kraken.py +42 -39
- ccxt/kucoinfutures.py +1 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +11 -2
- ccxt/pro/deribit.py +1 -1
- ccxt/wazirx.py +6 -1
- ccxt/woo.py +146 -74
- {ccxt-4.2.59.dist-info → ccxt-4.2.60.dist-info}/METADATA +4 -4
- {ccxt-4.2.59.dist-info → ccxt-4.2.60.dist-info}/RECORD +38 -38
- {ccxt-4.2.59.dist-info → ccxt-4.2.60.dist-info}/WHEEL +0 -0
- {ccxt-4.2.59.dist-info → ccxt-4.2.60.dist-info}/top_level.txt +0 -0
ccxt/async_support/htx.py
CHANGED
@@ -2507,7 +2507,9 @@ class htx(Exchange, ImplicitAPI):
|
|
2507
2507
|
amountString = self.safe_string(trade, 'trade_volume', amountString)
|
2508
2508
|
costString = self.safe_string(trade, 'trade_turnover')
|
2509
2509
|
fee = None
|
2510
|
-
feeCost = self.
|
2510
|
+
feeCost = self.safe_string(trade, 'filled-fees')
|
2511
|
+
if feeCost is None:
|
2512
|
+
feeCost = Precise.string_neg(self.safe_string(trade, 'trade_fee'))
|
2511
2513
|
feeCurrencyId = self.safe_string_2(trade, 'fee-currency', 'fee_asset')
|
2512
2514
|
feeCurrency = self.safe_currency_code(feeCurrencyId)
|
2513
2515
|
filledPoints = self.safe_string(trade, 'filled-points')
|
ccxt/async_support/kraken.py
CHANGED
@@ -39,7 +39,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
39
39
|
'name': 'Kraken',
|
40
40
|
'countries': ['US'],
|
41
41
|
'version': '0',
|
42
|
-
|
42
|
+
# rate-limits: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
|
43
|
+
# for public: 1 req/s
|
44
|
+
# for private: every second 0.33 weight added to your allowed capacity(some private endpoints need 1 weight, some need 2)
|
45
|
+
'rateLimit': 1000,
|
43
46
|
'certified': False,
|
44
47
|
'pro': True,
|
45
48
|
'has': {
|
@@ -169,7 +172,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
169
172
|
},
|
170
173
|
'public': {
|
171
174
|
'get': {
|
172
|
-
#
|
175
|
+
# rate-limits explained in comment in the top of self file
|
173
176
|
'Assets': 1,
|
174
177
|
'AssetPairs': 1,
|
175
178
|
'Depth': 1,
|
@@ -185,48 +188,48 @@ class kraken(Exchange, ImplicitAPI):
|
|
185
188
|
'post': {
|
186
189
|
'AddOrder': 0,
|
187
190
|
'AddOrderBatch': 0,
|
188
|
-
'AddExport':
|
189
|
-
'Balance':
|
190
|
-
'CancelAll':
|
191
|
-
'CancelAllOrdersAfter':
|
191
|
+
'AddExport': 3,
|
192
|
+
'Balance': 3,
|
193
|
+
'CancelAll': 3,
|
194
|
+
'CancelAllOrdersAfter': 3,
|
192
195
|
'CancelOrder': 0,
|
193
196
|
'CancelOrderBatch': 0,
|
194
|
-
'ClosedOrders':
|
195
|
-
'DepositAddresses':
|
196
|
-
'DepositMethods':
|
197
|
-
'DepositStatus':
|
197
|
+
'ClosedOrders': 3,
|
198
|
+
'DepositAddresses': 3,
|
199
|
+
'DepositMethods': 3,
|
200
|
+
'DepositStatus': 3,
|
198
201
|
'EditOrder': 0,
|
199
|
-
'ExportStatus':
|
200
|
-
'GetWebSocketsToken':
|
201
|
-
'Ledgers':
|
202
|
-
'OpenOrders':
|
203
|
-
'OpenPositions':
|
204
|
-
'QueryLedgers':
|
205
|
-
'QueryOrders':
|
206
|
-
'QueryTrades':
|
207
|
-
'RetrieveExport':
|
208
|
-
'RemoveExport':
|
209
|
-
'BalanceEx':
|
210
|
-
'TradeBalance':
|
211
|
-
'TradesHistory':
|
212
|
-
'TradeVolume':
|
213
|
-
'Withdraw':
|
214
|
-
'WithdrawCancel':
|
215
|
-
'WithdrawInfo':
|
216
|
-
'WithdrawMethods':
|
217
|
-
'WithdrawAddresses':
|
218
|
-
'WithdrawStatus':
|
219
|
-
'WalletTransfer':
|
202
|
+
'ExportStatus': 3,
|
203
|
+
'GetWebSocketsToken': 3,
|
204
|
+
'Ledgers': 6,
|
205
|
+
'OpenOrders': 3,
|
206
|
+
'OpenPositions': 3,
|
207
|
+
'QueryLedgers': 3,
|
208
|
+
'QueryOrders': 3,
|
209
|
+
'QueryTrades': 3,
|
210
|
+
'RetrieveExport': 3,
|
211
|
+
'RemoveExport': 3,
|
212
|
+
'BalanceEx': 3,
|
213
|
+
'TradeBalance': 3,
|
214
|
+
'TradesHistory': 6,
|
215
|
+
'TradeVolume': 3,
|
216
|
+
'Withdraw': 3,
|
217
|
+
'WithdrawCancel': 3,
|
218
|
+
'WithdrawInfo': 3,
|
219
|
+
'WithdrawMethods': 3,
|
220
|
+
'WithdrawAddresses': 3,
|
221
|
+
'WithdrawStatus': 3,
|
222
|
+
'WalletTransfer': 3,
|
220
223
|
# sub accounts
|
221
|
-
'CreateSubaccount':
|
222
|
-
'AccountTransfer':
|
224
|
+
'CreateSubaccount': 3,
|
225
|
+
'AccountTransfer': 3,
|
223
226
|
# earn
|
224
|
-
'Earn/Allocate':
|
225
|
-
'Earn/Deallocate':
|
226
|
-
'Earn/AllocateStatus':
|
227
|
-
'Earn/DeallocateStatus':
|
228
|
-
'Earn/Strategies':
|
229
|
-
'Earn/Allocations':
|
227
|
+
'Earn/Allocate': 3,
|
228
|
+
'Earn/Deallocate': 3,
|
229
|
+
'Earn/AllocateStatus': 3,
|
230
|
+
'Earn/DeallocateStatus': 3,
|
231
|
+
'Earn/Strategies': 3,
|
232
|
+
'Earn/Allocations': 3,
|
230
233
|
},
|
231
234
|
},
|
232
235
|
},
|
ccxt/async_support/wazirx.py
CHANGED
@@ -121,7 +121,7 @@ class wazirx(Exchange, ImplicitAPI):
|
|
121
121
|
'public': {
|
122
122
|
'get': {
|
123
123
|
'exchangeInfo': 1,
|
124
|
-
'depth':
|
124
|
+
'depth': 0.5,
|
125
125
|
'ping': 1,
|
126
126
|
'systemStatus': 1,
|
127
127
|
'tickers/24hr': 1,
|
@@ -140,6 +140,11 @@ class wazirx(Exchange, ImplicitAPI):
|
|
140
140
|
'openOrders': 1,
|
141
141
|
'order': 0.5,
|
142
142
|
'myTrades': 0.5,
|
143
|
+
'coins': 12,
|
144
|
+
'crypto/withdraws': 12,
|
145
|
+
'crypto/deposits/address': 60,
|
146
|
+
'sub_account/fund_transfer/history': 1,
|
147
|
+
'sub_account/accounts': 1,
|
143
148
|
},
|
144
149
|
'post': {
|
145
150
|
'order': 0.1,
|
ccxt/async_support/woo.py
CHANGED
@@ -93,10 +93,10 @@ class woo(Exchange, ImplicitAPI):
|
|
93
93
|
'fetchPositionMode': False,
|
94
94
|
'fetchPositions': True,
|
95
95
|
'fetchPremiumIndexOHLCV': False,
|
96
|
-
'fetchStatus':
|
96
|
+
'fetchStatus': True,
|
97
97
|
'fetchTicker': False,
|
98
98
|
'fetchTickers': False,
|
99
|
-
'fetchTime':
|
99
|
+
'fetchTime': True,
|
100
100
|
'fetchTrades': True,
|
101
101
|
'fetchTradingFee': False,
|
102
102
|
'fetchTradingFees': True,
|
@@ -333,6 +333,60 @@ class woo(Exchange, ImplicitAPI):
|
|
333
333
|
'precisionMode': TICK_SIZE,
|
334
334
|
})
|
335
335
|
|
336
|
+
async def fetch_status(self, params={}):
|
337
|
+
"""
|
338
|
+
the latest known information on the availability of the exchange API
|
339
|
+
:see: https://docs.woo.org/#get-system-maintenance-status-public
|
340
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
341
|
+
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
342
|
+
"""
|
343
|
+
response = await self.v1PublicGetSystemInfo(params)
|
344
|
+
#
|
345
|
+
# {
|
346
|
+
# "success": True,
|
347
|
+
# "data": {
|
348
|
+
# "status": "0",
|
349
|
+
# "msg": "System is functioning properly."
|
350
|
+
# },
|
351
|
+
# "timestamp": "1709274106602"
|
352
|
+
# }
|
353
|
+
#
|
354
|
+
data = self.safe_dict(response, 'data', {})
|
355
|
+
status = self.safe_string(data, 'status')
|
356
|
+
if status is None:
|
357
|
+
status = 'error'
|
358
|
+
elif status == '0':
|
359
|
+
status = 'ok'
|
360
|
+
else:
|
361
|
+
status = 'maintenance'
|
362
|
+
return {
|
363
|
+
'status': status,
|
364
|
+
'updated': None,
|
365
|
+
'eta': None,
|
366
|
+
'url': None,
|
367
|
+
'info': response,
|
368
|
+
}
|
369
|
+
|
370
|
+
async def fetch_time(self, params={}):
|
371
|
+
"""
|
372
|
+
fetches the current integer timestamp in milliseconds from the exchange server
|
373
|
+
:see: https://docs.woo.org/#get-system-maintenance-status-public
|
374
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
375
|
+
:returns int: the current integer timestamp in milliseconds from the exchange server
|
376
|
+
"""
|
377
|
+
response = await self.v1PublicGetSystemInfo(params)
|
378
|
+
#
|
379
|
+
# {
|
380
|
+
# "success": True,
|
381
|
+
# "data": {
|
382
|
+
# "status": "0",
|
383
|
+
# "msg": "System is functioning properly."
|
384
|
+
# },
|
385
|
+
# "timestamp": "1709274106602"
|
386
|
+
# }
|
387
|
+
#
|
388
|
+
return self.safe_integer(response, 'timestamp')
|
389
|
+
|
336
390
|
async def fetch_markets(self, params={}):
|
337
391
|
"""
|
338
392
|
retrieves data on all markets for woo
|
@@ -361,7 +415,7 @@ class woo(Exchange, ImplicitAPI):
|
|
361
415
|
# "success": True
|
362
416
|
# }
|
363
417
|
#
|
364
|
-
data = self.
|
418
|
+
data = self.safe_list(response, 'rows', [])
|
365
419
|
return self.parse_markets(data)
|
366
420
|
|
367
421
|
def parse_market(self, market) -> Market:
|
@@ -603,7 +657,7 @@ class woo(Exchange, ImplicitAPI):
|
|
603
657
|
# "timestamp": 1673323685109
|
604
658
|
# }
|
605
659
|
#
|
606
|
-
data = self.
|
660
|
+
data = self.safe_dict(response, 'data', {})
|
607
661
|
maker = self.safe_string(data, 'makerFeeRate')
|
608
662
|
taker = self.safe_string(data, 'takerFeeRate')
|
609
663
|
result = {}
|
@@ -687,7 +741,7 @@ class woo(Exchange, ImplicitAPI):
|
|
687
741
|
# "success": True
|
688
742
|
# }
|
689
743
|
#
|
690
|
-
tokenRows = self.
|
744
|
+
tokenRows = self.safe_list(tokenResponse, 'rows', [])
|
691
745
|
networksByCurrencyId = self.group_by(tokenRows, 'balance_token')
|
692
746
|
currencyIds = list(networksByCurrencyId.keys())
|
693
747
|
for i in range(0, len(currencyIds)):
|
@@ -831,7 +885,7 @@ class woo(Exchange, ImplicitAPI):
|
|
831
885
|
:param str [params.trailingTriggerPrice]: the price to trigger a trailing order, default uses the price argument
|
832
886
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
833
887
|
"""
|
834
|
-
reduceOnly = self.
|
888
|
+
reduceOnly = self.safe_bool_2(params, 'reduceOnly', 'reduce_only')
|
835
889
|
params = self.omit(params, ['reduceOnly', 'reduce_only'])
|
836
890
|
orderType = type.upper()
|
837
891
|
await self.load_markets()
|
@@ -975,9 +1029,9 @@ class woo(Exchange, ImplicitAPI):
|
|
975
1029
|
# },
|
976
1030
|
# "timestamp": "1686149372216"
|
977
1031
|
# }
|
978
|
-
data = self.
|
1032
|
+
data = self.safe_dict(response, 'data')
|
979
1033
|
if data is not None:
|
980
|
-
rows = self.
|
1034
|
+
rows = self.safe_list(data, 'rows', [])
|
981
1035
|
return self.parse_order(rows[0], market)
|
982
1036
|
order = self.parse_order(response, market)
|
983
1037
|
order['type'] = type
|
@@ -1062,7 +1116,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1062
1116
|
# "timestamp": 0
|
1063
1117
|
# }
|
1064
1118
|
#
|
1065
|
-
data = self.
|
1119
|
+
data = self.safe_dict(response, 'data', {})
|
1066
1120
|
return self.parse_order(data, market)
|
1067
1121
|
|
1068
1122
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1124,8 +1178,8 @@ class woo(Exchange, ImplicitAPI):
|
|
1124
1178
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1125
1179
|
"""
|
1126
1180
|
await self.load_markets()
|
1127
|
-
stop = self.
|
1128
|
-
params = self.omit(params, 'stop')
|
1181
|
+
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
1182
|
+
params = self.omit(params, ['stop', 'trigger'])
|
1129
1183
|
if stop:
|
1130
1184
|
return await self.v3PrivateDeleteAlgoOrdersPending(params)
|
1131
1185
|
if symbol is None:
|
@@ -1155,8 +1209,8 @@ class woo(Exchange, ImplicitAPI):
|
|
1155
1209
|
"""
|
1156
1210
|
await self.load_markets()
|
1157
1211
|
market = self.market(symbol) if (symbol is not None) else None
|
1158
|
-
stop = self.
|
1159
|
-
params = self.omit(params, 'stop')
|
1212
|
+
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
1213
|
+
params = self.omit(params, ['stop', 'trigger'])
|
1160
1214
|
request = {}
|
1161
1215
|
clientOrderId = self.safe_string_2(params, 'clOrdID', 'clientOrderId')
|
1162
1216
|
response = None
|
@@ -1225,9 +1279,9 @@ class woo(Exchange, ImplicitAPI):
|
|
1225
1279
|
await self.load_markets()
|
1226
1280
|
request = {}
|
1227
1281
|
market: Market = None
|
1228
|
-
stop = self.
|
1282
|
+
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
1229
1283
|
trailing = self.safe_bool(params, 'trailing', False)
|
1230
|
-
params = self.omit(params, ['stop', 'trailing'])
|
1284
|
+
params = self.omit(params, ['stop', 'trailing', 'trigger'])
|
1231
1285
|
if symbol is not None:
|
1232
1286
|
market = self.market(symbol)
|
1233
1287
|
request['symbol'] = market['id']
|
@@ -1277,7 +1331,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1277
1331
|
# }
|
1278
1332
|
#
|
1279
1333
|
data = self.safe_value(response, 'data', response)
|
1280
|
-
orders = self.
|
1334
|
+
orders = self.safe_list(data, 'rows')
|
1281
1335
|
return self.parse_orders(orders, market, since, limit, params)
|
1282
1336
|
|
1283
1337
|
def parse_time_in_force(self, timeInForce):
|
@@ -1377,7 +1431,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1377
1431
|
'type': orderType,
|
1378
1432
|
'timeInForce': self.parse_time_in_force(orderType),
|
1379
1433
|
'postOnly': None, # TO_DO
|
1380
|
-
'reduceOnly': self.
|
1434
|
+
'reduceOnly': self.safe_bool(order, 'reduce_only'),
|
1381
1435
|
'side': side,
|
1382
1436
|
'price': price,
|
1383
1437
|
'stopPrice': stopPrice,
|
@@ -1524,7 +1578,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1524
1578
|
# }
|
1525
1579
|
# }
|
1526
1580
|
#
|
1527
|
-
rows = self.
|
1581
|
+
rows = self.safe_list(response, 'rows', [])
|
1528
1582
|
return self.parse_ohlcvs(rows, market, timeframe, since, limit)
|
1529
1583
|
|
1530
1584
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1574,7 +1628,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1574
1628
|
# }
|
1575
1629
|
# ]
|
1576
1630
|
# }
|
1577
|
-
trades = self.
|
1631
|
+
trades = self.safe_list(response, 'rows', [])
|
1578
1632
|
return self.parse_trades(trades, market, since, limit, params)
|
1579
1633
|
|
1580
1634
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1618,7 +1672,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1618
1672
|
# ...
|
1619
1673
|
# ]
|
1620
1674
|
# }
|
1621
|
-
trades = self.
|
1675
|
+
trades = self.safe_list(response, 'rows', [])
|
1622
1676
|
return self.parse_trades(trades, market, since, limit, params)
|
1623
1677
|
|
1624
1678
|
async def fetch_accounts(self, params={}):
|
@@ -1644,7 +1698,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1644
1698
|
# "success": True
|
1645
1699
|
# }
|
1646
1700
|
#
|
1647
|
-
rows = self.
|
1701
|
+
rows = self.safe_list(response, 'rows', [])
|
1648
1702
|
return self.parse_accounts(rows, params)
|
1649
1703
|
|
1650
1704
|
def parse_account(self, account):
|
@@ -1696,14 +1750,14 @@ class woo(Exchange, ImplicitAPI):
|
|
1696
1750
|
# "timestamp": 1673323746259
|
1697
1751
|
# }
|
1698
1752
|
#
|
1699
|
-
data = self.
|
1753
|
+
data = self.safe_dict(response, 'data')
|
1700
1754
|
return self.parse_balance(data)
|
1701
1755
|
|
1702
1756
|
def parse_balance(self, response) -> Balances:
|
1703
1757
|
result = {
|
1704
1758
|
'info': response,
|
1705
1759
|
}
|
1706
|
-
balances = self.
|
1760
|
+
balances = self.safe_list(response, 'holding', [])
|
1707
1761
|
for i in range(0, len(balances)):
|
1708
1762
|
balance = balances[i]
|
1709
1763
|
code = self.safe_currency_code(self.safe_string(balance, 'token'))
|
@@ -1959,6 +2013,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1959
2013
|
|
1960
2014
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1961
2015
|
"""
|
2016
|
+
:see: https://docs.woo.org/#get-transfer-history
|
1962
2017
|
transfer currency internally between wallets on the same account
|
1963
2018
|
:param str code: unified currency code
|
1964
2019
|
:param float amount: amount to transfer
|
@@ -1971,7 +2026,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1971
2026
|
currency = self.currency(code)
|
1972
2027
|
request = {
|
1973
2028
|
'token': currency['id'],
|
1974
|
-
'amount': self.
|
2029
|
+
'amount': self.parse_to_numeric(amount),
|
1975
2030
|
'from_application_id': fromAccount,
|
1976
2031
|
'to_application_id': toAccount,
|
1977
2032
|
}
|
@@ -1983,7 +2038,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1983
2038
|
# }
|
1984
2039
|
#
|
1985
2040
|
transfer = self.parse_transfer(response, currency)
|
1986
|
-
transferOptions = self.
|
2041
|
+
transferOptions = self.safe_dict(self.options, 'transfer', {})
|
1987
2042
|
fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
|
1988
2043
|
if fillResponseFromRequest:
|
1989
2044
|
transfer['amount'] = amount
|
@@ -1994,41 +2049,68 @@ class woo(Exchange, ImplicitAPI):
|
|
1994
2049
|
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1995
2050
|
"""
|
1996
2051
|
fetch a history of internal transfers made on an account
|
2052
|
+
:see: https://docs.woo.org/#get-transfer-history
|
1997
2053
|
:param str code: unified currency code of the currency transferred
|
1998
2054
|
:param int [since]: the earliest time in ms to fetch transfers for
|
1999
2055
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
2000
2056
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2057
|
+
:param int [params.until]: the latest time in ms to fetch entries for
|
2001
2058
|
:returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
|
2002
2059
|
"""
|
2003
|
-
request = {
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2060
|
+
request = {}
|
2061
|
+
if limit is not None:
|
2062
|
+
request['size'] = limit
|
2063
|
+
if since is not None:
|
2064
|
+
request['start_t'] = since
|
2065
|
+
until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
|
2066
|
+
params = self.omit(params, ['until', 'till'])
|
2067
|
+
if until is not None:
|
2068
|
+
request['end_t'] = until
|
2069
|
+
response = await self.v1PrivateGetAssetMainSubTransferHistory(self.extend(request, params))
|
2070
|
+
#
|
2071
|
+
# {
|
2072
|
+
# "rows": [
|
2073
|
+
# {
|
2074
|
+
# "id": 46704,
|
2075
|
+
# "token": "USDT",
|
2076
|
+
# "amount": 30000.00000000,
|
2077
|
+
# "status": "COMPLETED",
|
2078
|
+
# "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
|
2079
|
+
# "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
|
2080
|
+
# "from_user": "LeverageLow",
|
2081
|
+
# "to_user": "dev",
|
2082
|
+
# "created_time": "1709022325.427",
|
2083
|
+
# "updated_time": "1709022325.542"
|
2084
|
+
# }
|
2085
|
+
# ],
|
2086
|
+
# "meta": {
|
2087
|
+
# "total": 50,
|
2088
|
+
# "records_per_page": 25,
|
2089
|
+
# "current_page": 1
|
2090
|
+
# },
|
2091
|
+
# "success": True
|
2092
|
+
# }
|
2093
|
+
#
|
2094
|
+
data = self.safe_list(response, 'rows', [])
|
2095
|
+
return self.parse_transfers(data, None, since, limit, params)
|
2008
2096
|
|
2009
2097
|
def parse_transfer(self, transfer, currency: Currency = None):
|
2010
2098
|
#
|
2011
|
-
#
|
2012
|
-
#
|
2013
|
-
#
|
2014
|
-
#
|
2015
|
-
#
|
2016
|
-
#
|
2017
|
-
#
|
2018
|
-
#
|
2019
|
-
#
|
2020
|
-
#
|
2021
|
-
#
|
2022
|
-
#
|
2023
|
-
#
|
2024
|
-
# "amount": 1000,
|
2025
|
-
# "tx_id": "0x8a74c517bc104c8ebad0c3c3f64b1f302ed5f8bca598ae4459c63419038106b6",
|
2026
|
-
# "fee_token": null,
|
2027
|
-
# "fee_amount": null,
|
2028
|
-
# "status": "CONFIRMING"
|
2029
|
-
# }
|
2099
|
+
# fetchTransfers
|
2100
|
+
# {
|
2101
|
+
# "id": 46704,
|
2102
|
+
# "token": "USDT",
|
2103
|
+
# "amount": 30000.00000000,
|
2104
|
+
# "status": "COMPLETED",
|
2105
|
+
# "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
|
2106
|
+
# "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
|
2107
|
+
# "from_user": "LeverageLow",
|
2108
|
+
# "to_user": "dev",
|
2109
|
+
# "created_time": "1709022325.427",
|
2110
|
+
# "updated_time": "1709022325.542"
|
2111
|
+
# }
|
2030
2112
|
#
|
2031
|
-
#
|
2113
|
+
# transfer
|
2032
2114
|
# {
|
2033
2115
|
# "success": True,
|
2034
2116
|
# "id": 200
|
@@ -2037,19 +2119,8 @@ class woo(Exchange, ImplicitAPI):
|
|
2037
2119
|
networkizedCode = self.safe_string(transfer, 'token')
|
2038
2120
|
currencyDefined = self.get_currency_from_chaincode(networkizedCode, currency)
|
2039
2121
|
code = currencyDefined['code']
|
2040
|
-
movementDirection = self.safe_string_lower(transfer, 'token_side')
|
2041
|
-
if movementDirection == 'withdraw':
|
2042
|
-
movementDirection = 'withdrawal'
|
2043
|
-
fromAccount: Str = None
|
2044
|
-
toAccount: Str = None
|
2045
|
-
if movementDirection == 'withdraw':
|
2046
|
-
fromAccount = None
|
2047
|
-
toAccount = 'spot'
|
2048
|
-
elif movementDirection == 'deposit':
|
2049
|
-
fromAccount = 'spot'
|
2050
|
-
toAccount = None
|
2051
2122
|
timestamp = self.safe_timestamp(transfer, 'created_time')
|
2052
|
-
success = self.
|
2123
|
+
success = self.safe_bool(transfer, 'success')
|
2053
2124
|
status: Str = None
|
2054
2125
|
if success is not None:
|
2055
2126
|
status = 'ok' if success else 'failed'
|
@@ -2059,8 +2130,8 @@ class woo(Exchange, ImplicitAPI):
|
|
2059
2130
|
'datetime': self.iso8601(timestamp),
|
2060
2131
|
'currency': code,
|
2061
2132
|
'amount': self.safe_number(transfer, 'amount'),
|
2062
|
-
'fromAccount':
|
2063
|
-
'toAccount':
|
2133
|
+
'fromAccount': self.safe_string(transfer, 'from_application_id'),
|
2134
|
+
'toAccount': self.safe_string(transfer, 'to_application_id'),
|
2064
2135
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'status', status)),
|
2065
2136
|
'info': transfer,
|
2066
2137
|
}
|
@@ -2095,11 +2166,11 @@ class woo(Exchange, ImplicitAPI):
|
|
2095
2166
|
}
|
2096
2167
|
if tag is not None:
|
2097
2168
|
request['extra'] = tag
|
2098
|
-
networks = self.
|
2099
|
-
currencyNetworks = self.
|
2169
|
+
networks = self.safe_dict(self.options, 'networks', {})
|
2170
|
+
currencyNetworks = self.safe_dict(currency, 'networks', {})
|
2100
2171
|
network = self.safe_string_upper(params, 'network')
|
2101
2172
|
networkId = self.safe_string(networks, network, network)
|
2102
|
-
coinNetwork = self.
|
2173
|
+
coinNetwork = self.safe_dict(currencyNetworks, networkId, {})
|
2103
2174
|
coinNetworkId = self.safe_string(coinNetwork, 'id')
|
2104
2175
|
if coinNetworkId is None:
|
2105
2176
|
raise BadRequest(self.id + ' withdraw() require network parameter')
|
@@ -2212,7 +2283,8 @@ class woo(Exchange, ImplicitAPI):
|
|
2212
2283
|
if method == 'POST' or method == 'PUT' or method == 'DELETE':
|
2213
2284
|
body = auth
|
2214
2285
|
else:
|
2215
|
-
|
2286
|
+
if params:
|
2287
|
+
url += '?' + auth
|
2216
2288
|
auth += '|' + ts
|
2217
2289
|
headers['content-type'] = 'application/x-www-form-urlencoded'
|
2218
2290
|
headers['x-api-signature'] = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
|
@@ -2225,7 +2297,7 @@ class woo(Exchange, ImplicitAPI):
|
|
2225
2297
|
# 400 Bad Request {"success":false,"code":-1012,"message":"Amount is required for buy market orders when margin disabled."}
|
2226
2298
|
# {"code":"-1011","message":"The system is under maintenance.","success":false}
|
2227
2299
|
#
|
2228
|
-
success = self.
|
2300
|
+
success = self.safe_bool(response, 'success')
|
2229
2301
|
errorCode = self.safe_string(response, 'code')
|
2230
2302
|
if not success:
|
2231
2303
|
feedback = self.id + ' ' + self.json(response)
|
@@ -2298,7 +2370,7 @@ class woo(Exchange, ImplicitAPI):
|
|
2298
2370
|
# "success":true
|
2299
2371
|
# }
|
2300
2372
|
#
|
2301
|
-
result = self.
|
2373
|
+
result = self.safe_list(response, 'rows', [])
|
2302
2374
|
return self.parse_incomes(result, market, since, limit)
|
2303
2375
|
|
2304
2376
|
def parse_funding_rate(self, fundingRate, market: Market = None):
|
@@ -2379,7 +2451,7 @@ class woo(Exchange, ImplicitAPI):
|
|
2379
2451
|
# "timestamp":1653633985646
|
2380
2452
|
# }
|
2381
2453
|
#
|
2382
|
-
rows = self.
|
2454
|
+
rows = self.safe_list(response, 'rows', [])
|
2383
2455
|
result = self.parse_funding_rates(rows)
|
2384
2456
|
return self.filter_by_array(result, 'symbol', symbols)
|
2385
2457
|
|
@@ -2428,7 +2500,7 @@ class woo(Exchange, ImplicitAPI):
|
|
2428
2500
|
# "timestamp":1653640814885
|
2429
2501
|
# }
|
2430
2502
|
#
|
2431
|
-
result = self.
|
2503
|
+
result = self.safe_list(response, 'rows')
|
2432
2504
|
rates = []
|
2433
2505
|
for i in range(0, len(result)):
|
2434
2506
|
entry = result[i]
|
@@ -2582,8 +2654,8 @@ class woo(Exchange, ImplicitAPI):
|
|
2582
2654
|
# "timestamp": 1673323880342
|
2583
2655
|
# }
|
2584
2656
|
#
|
2585
|
-
result = self.
|
2586
|
-
positions = self.
|
2657
|
+
result = self.safe_dict(response, 'data', {})
|
2658
|
+
positions = self.safe_list(result, 'positions', [])
|
2587
2659
|
return self.parse_positions(positions, symbols)
|
2588
2660
|
|
2589
2661
|
def parse_position(self, position, market: Market = None):
|