ccxt 4.4.35__py2.py3-none-any.whl → 4.4.37__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 -3
- ccxt/abstract/bitfinex.py +136 -65
- ccxt/abstract/bitfinex1.py +69 -0
- ccxt/abstract/bitopro.py +1 -0
- ccxt/abstract/bybit.py +15 -0
- ccxt/abstract/defx.py +69 -0
- ccxt/abstract/deribit.py +1 -0
- ccxt/abstract/gate.py +14 -0
- ccxt/abstract/gateio.py +14 -0
- ccxt/async_support/__init__.py +5 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bitfinex.py +3005 -1084
- ccxt/async_support/bitfinex1.py +1704 -0
- ccxt/async_support/bitfinex2.py +18 -13
- ccxt/async_support/bitmex.py +103 -1
- ccxt/async_support/bitopro.py +21 -4
- ccxt/async_support/bitso.py +2 -1
- ccxt/async_support/bybit.py +21 -1
- ccxt/async_support/coinbase.py +86 -0
- ccxt/async_support/defx.py +1981 -0
- ccxt/async_support/deribit.py +27 -12
- ccxt/async_support/gate.py +15 -1
- ccxt/async_support/htx.py +11 -2
- ccxt/async_support/hyperliquid.py +124 -14
- ccxt/async_support/kraken.py +39 -41
- ccxt/async_support/paradex.py +2 -2
- ccxt/base/exchange.py +6 -2
- ccxt/bitfinex.py +3005 -1084
- ccxt/bitfinex1.py +1703 -0
- ccxt/bitfinex2.py +18 -13
- ccxt/bitmex.py +103 -1
- ccxt/bitopro.py +21 -4
- ccxt/bitso.py +2 -1
- ccxt/bybit.py +21 -1
- ccxt/coinbase.py +86 -0
- ccxt/defx.py +1980 -0
- ccxt/deribit.py +27 -12
- ccxt/gate.py +15 -1
- ccxt/htx.py +11 -2
- ccxt/hyperliquid.py +124 -14
- ccxt/kraken.py +39 -41
- ccxt/paradex.py +2 -2
- ccxt/pro/__init__.py +5 -3
- ccxt/pro/bitfinex.py +725 -274
- ccxt/pro/bitfinex1.py +635 -0
- ccxt/pro/defx.py +832 -0
- ccxt/pro/probit.py +1 -0
- ccxt/test/tests_async.py +15 -1
- ccxt/test/tests_sync.py +15 -1
- {ccxt-4.4.35.dist-info → ccxt-4.4.37.dist-info}/METADATA +11 -10
- {ccxt-4.4.35.dist-info → ccxt-4.4.37.dist-info}/RECORD +54 -47
- ccxt/abstract/bitfinex2.py +0 -140
- {ccxt-4.4.35.dist-info → ccxt-4.4.37.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.35.dist-info → ccxt-4.4.37.dist-info}/WHEEL +0 -0
- {ccxt-4.4.35.dist-info → ccxt-4.4.37.dist-info}/top_level.txt +0 -0
ccxt/bitfinex2.py
CHANGED
@@ -15,7 +15,6 @@ from ccxt.base.errors import ArgumentsRequired
|
|
15
15
|
from ccxt.base.errors import BadRequest
|
16
16
|
from ccxt.base.errors import BadSymbol
|
17
17
|
from ccxt.base.errors import InsufficientFunds
|
18
|
-
from ccxt.base.errors import InvalidAddress
|
19
18
|
from ccxt.base.errors import InvalidOrder
|
20
19
|
from ccxt.base.errors import OrderNotFound
|
21
20
|
from ccxt.base.errors import NotSupported
|
@@ -432,12 +431,10 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
432
431
|
'temporarily_unavailable': ExchangeNotAvailable,
|
433
432
|
},
|
434
433
|
'broad': {
|
435
|
-
'address': InvalidAddress,
|
436
434
|
'available balance is only': InsufficientFunds,
|
437
435
|
'not enough exchange balance': InsufficientFunds,
|
438
436
|
'Order not found': OrderNotFound,
|
439
437
|
'symbol: invalid': BadSymbol,
|
440
|
-
'Invalid order': InvalidOrder,
|
441
438
|
},
|
442
439
|
},
|
443
440
|
'commonCurrencies': {
|
@@ -781,7 +778,10 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
781
778
|
name = self.safe_string(label, 1)
|
782
779
|
pool = self.safe_value(indexed['pool'], id, [])
|
783
780
|
rawType = self.safe_string(pool, 1)
|
784
|
-
|
781
|
+
isCryptoCoin = (rawType is not None) or (id in indexed['explorer']) # "hacky" solution
|
782
|
+
type = None
|
783
|
+
if isCryptoCoin:
|
784
|
+
type = 'crypto'
|
785
785
|
feeValues = self.safe_value(indexed['fees'], id, [])
|
786
786
|
fees = self.safe_value(feeValues, 1, [])
|
787
787
|
fee = self.safe_number(fees, 1)
|
@@ -1680,7 +1680,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1680
1680
|
raise ExchangeError(self.id + ' ' + response[6] + ': ' + errorText + '(#' + errorCode + ')')
|
1681
1681
|
orders = self.safe_list(response, 4, [])
|
1682
1682
|
order = self.safe_list(orders, 0)
|
1683
|
-
|
1683
|
+
newOrder = {'result': order}
|
1684
|
+
return self.parse_order(newOrder, market)
|
1684
1685
|
|
1685
1686
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
1686
1687
|
"""
|
@@ -1776,6 +1777,9 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1776
1777
|
self.load_markets()
|
1777
1778
|
cid = self.safe_value_2(params, 'cid', 'clientOrderId') # client order id
|
1778
1779
|
request = None
|
1780
|
+
market = None
|
1781
|
+
if symbol is not None:
|
1782
|
+
market = self.market(symbol)
|
1779
1783
|
if cid is not None:
|
1780
1784
|
cidDate = self.safe_value(params, 'cidDate') # client order id date
|
1781
1785
|
if cidDate is None:
|
@@ -1791,8 +1795,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1791
1795
|
}
|
1792
1796
|
response = self.privatePostAuthWOrderCancel(self.extend(request, params))
|
1793
1797
|
order = self.safe_value(response, 4)
|
1794
|
-
|
1795
|
-
return self.parse_order(
|
1798
|
+
newOrder = {'result': order}
|
1799
|
+
return self.parse_order(newOrder, market)
|
1796
1800
|
|
1797
1801
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1798
1802
|
"""
|
@@ -2293,6 +2297,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2293
2297
|
status = 'failed'
|
2294
2298
|
tag = self.safe_string(data, 3)
|
2295
2299
|
type = 'withdrawal'
|
2300
|
+
networkId = self.safe_string(data, 2)
|
2301
|
+
network = self.network_id_to_code(networkId.upper()) # withdraw returns in lowercase
|
2296
2302
|
elif transactionLength == 22:
|
2297
2303
|
id = self.safe_string(transaction, 0)
|
2298
2304
|
currencyId = self.safe_string(transaction, 1)
|
@@ -2589,10 +2595,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2589
2595
|
text = self.safe_string(response, 7)
|
2590
2596
|
if text != 'success':
|
2591
2597
|
self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
|
2592
|
-
|
2593
|
-
return self.extend(transaction, {
|
2594
|
-
'address': address,
|
2595
|
-
})
|
2598
|
+
return self.parse_transaction(response, currency)
|
2596
2599
|
|
2597
2600
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
2598
2601
|
"""
|
@@ -3501,7 +3504,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
3501
3504
|
# ]
|
3502
3505
|
#
|
3503
3506
|
order = self.safe_list(response, 0)
|
3504
|
-
|
3507
|
+
newOrder = {'result': order}
|
3508
|
+
return self.parse_order(newOrder, market)
|
3505
3509
|
|
3506
3510
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3507
3511
|
"""
|
@@ -3616,4 +3620,5 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
3616
3620
|
errorText = response[7]
|
3617
3621
|
raise ExchangeError(self.id + ' ' + response[6] + ': ' + errorText + '(#' + errorCode + ')')
|
3618
3622
|
order = self.safe_list(response, 4, [])
|
3619
|
-
|
3623
|
+
newOrder = {'result': order}
|
3624
|
+
return self.parse_order(newOrder, market)
|
ccxt/bitmex.py
CHANGED
@@ -286,6 +286,108 @@ class bitmex(Exchange, ImplicitAPI):
|
|
286
286
|
'SOL': 'sol',
|
287
287
|
'ADA': 'ada',
|
288
288
|
},
|
289
|
+
'features': {
|
290
|
+
'default': {
|
291
|
+
'sandbox': True,
|
292
|
+
'createOrder': {
|
293
|
+
'marginMode': True,
|
294
|
+
'triggerPrice': True,
|
295
|
+
'triggerPriceType': {
|
296
|
+
'last': True,
|
297
|
+
'mark': True,
|
298
|
+
},
|
299
|
+
'triggerDirection': True,
|
300
|
+
'stopLossPrice': False,
|
301
|
+
'takeProfitPrice': False,
|
302
|
+
'attachedStopLossTakeProfit': None,
|
303
|
+
'timeInForce': {
|
304
|
+
'IOC': True,
|
305
|
+
'FOK': True,
|
306
|
+
'PO': True,
|
307
|
+
'GTD': False,
|
308
|
+
},
|
309
|
+
'hedged': False,
|
310
|
+
'trailing': True,
|
311
|
+
'marketBuyRequiresPrice': False,
|
312
|
+
'marketBuyByCost': False,
|
313
|
+
# exchange-supported features
|
314
|
+
# 'selfTradePrevention': True,
|
315
|
+
# 'twap': False,
|
316
|
+
# 'iceberg': False,
|
317
|
+
# 'oco': False,
|
318
|
+
},
|
319
|
+
'createOrders': None,
|
320
|
+
'fetchMyTrades': {
|
321
|
+
'marginMode': False,
|
322
|
+
'limit': 500,
|
323
|
+
'daysBack': None,
|
324
|
+
'untilDays': 1000000,
|
325
|
+
},
|
326
|
+
'fetchOrder': {
|
327
|
+
'marginMode': False,
|
328
|
+
'trigger': False,
|
329
|
+
'trailing': False,
|
330
|
+
},
|
331
|
+
'fetchOpenOrders': {
|
332
|
+
'marginMode': False,
|
333
|
+
'limit': 500,
|
334
|
+
'trigger': False,
|
335
|
+
'trailing': False,
|
336
|
+
},
|
337
|
+
'fetchOrders': {
|
338
|
+
'marginMode': False,
|
339
|
+
'limit': 500,
|
340
|
+
'daysBack': None,
|
341
|
+
'untilDays': 1000000,
|
342
|
+
'trigger': False,
|
343
|
+
'trailing': False,
|
344
|
+
},
|
345
|
+
'fetchClosedOrders': {
|
346
|
+
'marginMode': False,
|
347
|
+
'limit': 500,
|
348
|
+
'daysBackClosed': None,
|
349
|
+
'daysBackCanceled': None,
|
350
|
+
'untilDays': 1000000,
|
351
|
+
'trigger': False,
|
352
|
+
'trailing': False,
|
353
|
+
},
|
354
|
+
'fetchOHLCV': {
|
355
|
+
'limit': 10000,
|
356
|
+
},
|
357
|
+
},
|
358
|
+
'spot': {
|
359
|
+
'extends': 'default',
|
360
|
+
'createOrder': {
|
361
|
+
'triggerPriceType': {
|
362
|
+
'index': False,
|
363
|
+
},
|
364
|
+
},
|
365
|
+
},
|
366
|
+
'forDeriv': {
|
367
|
+
'extends': 'default',
|
368
|
+
'createOrder': {
|
369
|
+
'triggerPriceType': {
|
370
|
+
'index': True,
|
371
|
+
},
|
372
|
+
},
|
373
|
+
},
|
374
|
+
'swap': {
|
375
|
+
'linear': {
|
376
|
+
'extends': 'forDeriv',
|
377
|
+
},
|
378
|
+
'inverse': {
|
379
|
+
'extends': 'forDeriv',
|
380
|
+
},
|
381
|
+
},
|
382
|
+
'future': {
|
383
|
+
'linear': {
|
384
|
+
'extends': 'forDeriv',
|
385
|
+
},
|
386
|
+
'inverse': {
|
387
|
+
'extends': 'forDeriv',
|
388
|
+
},
|
389
|
+
},
|
390
|
+
},
|
289
391
|
},
|
290
392
|
'commonCurrencies': {
|
291
393
|
'USDt': 'USDT',
|
@@ -991,7 +1093,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
991
1093
|
if since is not None:
|
992
1094
|
request['startTime'] = self.iso8601(since)
|
993
1095
|
if limit is not None:
|
994
|
-
request['count'] = limit
|
1096
|
+
request['count'] = min(500, limit)
|
995
1097
|
until = self.safe_integer_2(params, 'until', 'endTime')
|
996
1098
|
if until is not None:
|
997
1099
|
params = self.omit(params, ['until'])
|
ccxt/bitopro.py
CHANGED
@@ -153,6 +153,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
153
153
|
'wallet/withdraw/{currency}/id/{id}': 1,
|
154
154
|
'wallet/depositHistory/{currency}': 1,
|
155
155
|
'wallet/withdrawHistory/{currency}': 1,
|
156
|
+
'orders/open': 1,
|
156
157
|
},
|
157
158
|
'post': {
|
158
159
|
'orders/{pair}': 1 / 2, # 1200/m => 20/s => 10/20 = 1/2
|
@@ -1248,10 +1249,26 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1248
1249
|
return self.parse_orders(orders, market, since, limit)
|
1249
1250
|
|
1250
1251
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1252
|
+
"""
|
1253
|
+
fetch all unfilled currently open orders
|
1254
|
+
|
1255
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_open_orders_data.md
|
1256
|
+
|
1257
|
+
:param str symbol: unified market symbol
|
1258
|
+
:param int [since]: the earliest time in ms to fetch open orders for
|
1259
|
+
:param int [limit]: the maximum number of open orders structures to retrieve
|
1260
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1261
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1262
|
+
"""
|
1263
|
+
self.load_markets()
|
1264
|
+
request: dict = {}
|
1265
|
+
market = None
|
1266
|
+
if symbol is not None:
|
1267
|
+
market = self.market(symbol)
|
1268
|
+
request['pair'] = market['id']
|
1269
|
+
response = self.privateGetOrdersOpen(self.extend(request, params))
|
1270
|
+
orders = self.safe_list(response, 'data', [])
|
1271
|
+
return self.parse_orders(orders, market, since, limit)
|
1255
1272
|
|
1256
1273
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1257
1274
|
"""
|
ccxt/bitso.py
CHANGED
@@ -1683,6 +1683,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1683
1683
|
if api == 'private':
|
1684
1684
|
self.check_required_credentials()
|
1685
1685
|
nonce = str(self.nonce())
|
1686
|
+
endpoint = '/api' + endpoint
|
1686
1687
|
request = ''.join([nonce, method, endpoint])
|
1687
1688
|
if method != 'GET' and method != 'DELETE':
|
1688
1689
|
if query:
|
@@ -1692,7 +1693,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1692
1693
|
auth = self.apiKey + ':' + nonce + ':' + signature
|
1693
1694
|
headers = {
|
1694
1695
|
'Authorization': 'Bitso ' + auth,
|
1695
|
-
'Content-Type': 'application/json',
|
1696
|
+
# 'Content-Type': 'application/json',
|
1696
1697
|
}
|
1697
1698
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1698
1699
|
|
ccxt/bybit.py
CHANGED
@@ -257,6 +257,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
257
257
|
'v5/spot-cross-margin-trade/data': 5,
|
258
258
|
'v5/spot-cross-margin-trade/pledge-token': 5,
|
259
259
|
'v5/spot-cross-margin-trade/borrow-token': 5,
|
260
|
+
# crypto loan
|
261
|
+
'v5/crypto-loan/collateral-data': 5,
|
262
|
+
'v5/crypto-loan/loanable-data': 5,
|
260
263
|
# institutional lending
|
261
264
|
'v5/ins-loan/product-infos': 5,
|
262
265
|
'v5/ins-loan/ensure-tokens-convert': 5,
|
@@ -384,6 +387,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
384
387
|
'v5/user/aff-customer-info': 5,
|
385
388
|
'v5/user/del-submember': 5,
|
386
389
|
'v5/user/submembers': 5,
|
390
|
+
# affilate
|
391
|
+
'v5/affiliate/aff-user-list': 5,
|
387
392
|
# spot leverage token
|
388
393
|
'v5/spot-lever-token/order-record': 1, # 50/s => cost = 50 / 50 = 1
|
389
394
|
# spot margin trade
|
@@ -393,6 +398,13 @@ class bybit(Exchange, ImplicitAPI):
|
|
393
398
|
'v5/spot-cross-margin-trade/account': 1, # 50/s => cost = 50 / 50 = 1
|
394
399
|
'v5/spot-cross-margin-trade/orders': 1, # 50/s => cost = 50 / 50 = 1
|
395
400
|
'v5/spot-cross-margin-trade/repay-history': 1, # 50/s => cost = 50 / 50 = 1
|
401
|
+
# crypto loan
|
402
|
+
'v5/crypto-loan/borrowable-collateralisable-number': 5,
|
403
|
+
'v5/crypto-loan/ongoing-orders': 5,
|
404
|
+
'v5/crypto-loan/repayment-history': 5,
|
405
|
+
'v5/crypto-loan/borrow-history': 5,
|
406
|
+
'v5/crypto-loan/max-collateral-amount': 5,
|
407
|
+
'v5/crypto-loan/adjustment-history': 5,
|
396
408
|
# institutional lending
|
397
409
|
'v5/ins-loan/product-infos': 5,
|
398
410
|
'v5/ins-loan/ensure-tokens-convert': 5,
|
@@ -404,7 +416,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
404
416
|
'v5/lending/history-order': 5,
|
405
417
|
'v5/lending/account': 5,
|
406
418
|
# broker
|
407
|
-
'v5/broker/earning-record': 5,
|
419
|
+
'v5/broker/earning-record': 5, # deprecated
|
408
420
|
'v5/broker/earnings-info': 5,
|
409
421
|
'v5/broker/account-info': 5,
|
410
422
|
'v5/broker/asset/query-sub-member-deposit-record': 10,
|
@@ -525,6 +537,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
525
537
|
'v5/spot-cross-margin-trade/loan': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
526
538
|
'v5/spot-cross-margin-trade/repay': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
527
539
|
'v5/spot-cross-margin-trade/switch': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
540
|
+
# crypto loan
|
541
|
+
'v5/crypto-loan/borrow': 5,
|
542
|
+
'v5/crypto-loan/repay': 5,
|
543
|
+
'v5/crypto-loan/adjust-ltv': 5,
|
528
544
|
# institutional lending
|
529
545
|
'v5/ins-loan/association-uid': 5,
|
530
546
|
# c2c lending
|
@@ -535,6 +551,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
535
551
|
'v5/account/set-collateral-switch-batch': 5,
|
536
552
|
# demo trading
|
537
553
|
'v5/account/demo-apply-money': 5,
|
554
|
+
# broker
|
555
|
+
'v5/broker/award/info': 5,
|
556
|
+
'v5/broker/award/distribute-award': 5,
|
557
|
+
'v5/broker/award/distribution-record': 5,
|
538
558
|
},
|
539
559
|
},
|
540
560
|
},
|
ccxt/coinbase.py
CHANGED
@@ -88,6 +88,8 @@ class coinbase(Exchange, ImplicitAPI):
|
|
88
88
|
'fetchDepositAddress': 'emulated',
|
89
89
|
'fetchDepositAddresses': False,
|
90
90
|
'fetchDepositAddressesByNetwork': True,
|
91
|
+
'fetchDepositMethodId': True,
|
92
|
+
'fetchDepositMethodIds': True,
|
91
93
|
'fetchDeposits': True,
|
92
94
|
'fetchDepositsWithdrawals': True,
|
93
95
|
'fetchFundingHistory': False,
|
@@ -4102,6 +4104,90 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4102
4104
|
data = self.safe_dict(response, 'data', {})
|
4103
4105
|
return self.parse_transaction(data)
|
4104
4106
|
|
4107
|
+
def fetch_deposit_method_ids(self, params={}):
|
4108
|
+
"""
|
4109
|
+
fetch the deposit id for a fiat currency associated with self account
|
4110
|
+
|
4111
|
+
https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethods
|
4112
|
+
|
4113
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4114
|
+
:returns dict: an array of `deposit id structures <https://docs.ccxt.com/#/?id=deposit-id-structure>`
|
4115
|
+
"""
|
4116
|
+
self.load_markets()
|
4117
|
+
response = self.v3PrivateGetBrokeragePaymentMethods(params)
|
4118
|
+
#
|
4119
|
+
# {
|
4120
|
+
# "payment_methods": [
|
4121
|
+
# {
|
4122
|
+
# "id": "21b39a5d-f7b46876fb2e",
|
4123
|
+
# "type": "COINBASE_FIAT_ACCOUNT",
|
4124
|
+
# "name": "CAD Wallet",
|
4125
|
+
# "currency": "CAD",
|
4126
|
+
# "verified": True,
|
4127
|
+
# "allow_buy": False,
|
4128
|
+
# "allow_sell": True,
|
4129
|
+
# "allow_deposit": False,
|
4130
|
+
# "allow_withdraw": False,
|
4131
|
+
# "created_at": "2023-06-29T19:58:46Z",
|
4132
|
+
# "updated_at": "2023-10-30T20:25:01Z"
|
4133
|
+
# }
|
4134
|
+
# ]
|
4135
|
+
# }
|
4136
|
+
#
|
4137
|
+
result = self.safe_list(response, 'payment_methods', [])
|
4138
|
+
return self.parse_deposit_method_ids(result)
|
4139
|
+
|
4140
|
+
def fetch_deposit_method_id(self, id: str, params={}):
|
4141
|
+
"""
|
4142
|
+
fetch the deposit id for a fiat currency associated with self account
|
4143
|
+
|
4144
|
+
https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethod
|
4145
|
+
|
4146
|
+
:param str id: the deposit payment method id
|
4147
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4148
|
+
:returns dict: a `deposit id structure <https://docs.ccxt.com/#/?id=deposit-id-structure>`
|
4149
|
+
"""
|
4150
|
+
self.load_markets()
|
4151
|
+
request: dict = {
|
4152
|
+
'payment_method_id': id,
|
4153
|
+
}
|
4154
|
+
response = self.v3PrivateGetBrokeragePaymentMethodsPaymentMethodId(self.extend(request, params))
|
4155
|
+
#
|
4156
|
+
# {
|
4157
|
+
# "payment_method": {
|
4158
|
+
# "id": "21b39a5d-f7b46876fb2e",
|
4159
|
+
# "type": "COINBASE_FIAT_ACCOUNT",
|
4160
|
+
# "name": "CAD Wallet",
|
4161
|
+
# "currency": "CAD",
|
4162
|
+
# "verified": True,
|
4163
|
+
# "allow_buy": False,
|
4164
|
+
# "allow_sell": True,
|
4165
|
+
# "allow_deposit": False,
|
4166
|
+
# "allow_withdraw": False,
|
4167
|
+
# "created_at": "2023-06-29T19:58:46Z",
|
4168
|
+
# "updated_at": "2023-10-30T20:25:01Z"
|
4169
|
+
# }
|
4170
|
+
# }
|
4171
|
+
#
|
4172
|
+
result = self.safe_dict(response, 'payment_method', {})
|
4173
|
+
return self.parse_deposit_method_id(result)
|
4174
|
+
|
4175
|
+
def parse_deposit_method_ids(self, ids, params={}):
|
4176
|
+
result = []
|
4177
|
+
for i in range(0, len(ids)):
|
4178
|
+
id = self.extend(self.parse_deposit_method_id(ids[i]), params)
|
4179
|
+
result.append(id)
|
4180
|
+
return result
|
4181
|
+
|
4182
|
+
def parse_deposit_method_id(self, depositId):
|
4183
|
+
return {
|
4184
|
+
'info': depositId,
|
4185
|
+
'id': self.safe_string(depositId, 'id'),
|
4186
|
+
'currency': self.safe_string(depositId, 'currency'),
|
4187
|
+
'verified': self.safe_bool(depositId, 'verified'),
|
4188
|
+
'tag': self.safe_string(depositId, 'name'),
|
4189
|
+
}
|
4190
|
+
|
4105
4191
|
def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
4106
4192
|
"""
|
4107
4193
|
fetch a quote for converting from one currency to another
|