ccxt 4.3.23__py2.py3-none-any.whl → 4.3.27__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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.23'
25
+ __version__ = '4.3.27'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -119,8 +119,9 @@ from ccxt.btcturk import btcturk # noqa: F4
119
119
  from ccxt.bybit import bybit # noqa: F401
120
120
  from ccxt.cex import cex # noqa: F401
121
121
  from ccxt.coinbase import coinbase # noqa: F401
122
+ from ccxt.coinbaseadvanced import coinbaseadvanced # noqa: F401
123
+ from ccxt.coinbaseexchange import coinbaseexchange # noqa: F401
122
124
  from ccxt.coinbaseinternational import coinbaseinternational # noqa: F401
123
- from ccxt.coinbasepro import coinbasepro # noqa: F401
124
125
  from ccxt.coincheck import coincheck # noqa: F401
125
126
  from ccxt.coinex import coinex # noqa: F401
126
127
  from ccxt.coinlist import coinlist # noqa: F401
@@ -225,8 +226,9 @@ exchanges = [
225
226
  'bybit',
226
227
  'cex',
227
228
  'coinbase',
229
+ 'coinbaseadvanced',
230
+ 'coinbaseexchange',
228
231
  'coinbaseinternational',
229
- 'coinbasepro',
230
232
  'coincheck',
231
233
  'coinex',
232
234
  'coinlist',
@@ -0,0 +1,94 @@
1
+ from ccxt.base.types import Entry
2
+
3
+
4
+ class ImplicitAPI:
5
+ v2_public_get_currencies = v2PublicGetCurrencies = Entry('currencies', ['v2', 'public'], 'GET', {'cost': 10.6})
6
+ v2_public_get_currencies_crypto = v2PublicGetCurrenciesCrypto = Entry('currencies/crypto', ['v2', 'public'], 'GET', {'cost': 10.6})
7
+ v2_public_get_time = v2PublicGetTime = Entry('time', ['v2', 'public'], 'GET', {'cost': 10.6})
8
+ v2_public_get_exchange_rates = v2PublicGetExchangeRates = Entry('exchange-rates', ['v2', 'public'], 'GET', {'cost': 10.6})
9
+ v2_public_get_users_user_id = v2PublicGetUsersUserId = Entry('users/{user_id}', ['v2', 'public'], 'GET', {'cost': 10.6})
10
+ v2_public_get_prices_symbol_buy = v2PublicGetPricesSymbolBuy = Entry('prices/{symbol}/buy', ['v2', 'public'], 'GET', {'cost': 10.6})
11
+ v2_public_get_prices_symbol_sell = v2PublicGetPricesSymbolSell = Entry('prices/{symbol}/sell', ['v2', 'public'], 'GET', {'cost': 10.6})
12
+ v2_public_get_prices_symbol_spot = v2PublicGetPricesSymbolSpot = Entry('prices/{symbol}/spot', ['v2', 'public'], 'GET', {'cost': 10.6})
13
+ v2_private_get_accounts = v2PrivateGetAccounts = Entry('accounts', ['v2', 'private'], 'GET', {'cost': 10.6})
14
+ v2_private_get_accounts_account_id = v2PrivateGetAccountsAccountId = Entry('accounts/{account_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
15
+ v2_private_get_accounts_account_id_addresses = v2PrivateGetAccountsAccountIdAddresses = Entry('accounts/{account_id}/addresses', ['v2', 'private'], 'GET', {'cost': 10.6})
16
+ v2_private_get_accounts_account_id_addresses_address_id = v2PrivateGetAccountsAccountIdAddressesAddressId = Entry('accounts/{account_id}/addresses/{address_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
17
+ v2_private_get_accounts_account_id_addresses_address_id_transactions = v2PrivateGetAccountsAccountIdAddressesAddressIdTransactions = Entry('accounts/{account_id}/addresses/{address_id}/transactions', ['v2', 'private'], 'GET', {'cost': 10.6})
18
+ v2_private_get_accounts_account_id_transactions = v2PrivateGetAccountsAccountIdTransactions = Entry('accounts/{account_id}/transactions', ['v2', 'private'], 'GET', {'cost': 10.6})
19
+ v2_private_get_accounts_account_id_transactions_transaction_id = v2PrivateGetAccountsAccountIdTransactionsTransactionId = Entry('accounts/{account_id}/transactions/{transaction_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
20
+ v2_private_get_accounts_account_id_buys = v2PrivateGetAccountsAccountIdBuys = Entry('accounts/{account_id}/buys', ['v2', 'private'], 'GET', {'cost': 10.6})
21
+ v2_private_get_accounts_account_id_buys_buy_id = v2PrivateGetAccountsAccountIdBuysBuyId = Entry('accounts/{account_id}/buys/{buy_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
22
+ v2_private_get_accounts_account_id_sells = v2PrivateGetAccountsAccountIdSells = Entry('accounts/{account_id}/sells', ['v2', 'private'], 'GET', {'cost': 10.6})
23
+ v2_private_get_accounts_account_id_sells_sell_id = v2PrivateGetAccountsAccountIdSellsSellId = Entry('accounts/{account_id}/sells/{sell_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
24
+ v2_private_get_accounts_account_id_deposits = v2PrivateGetAccountsAccountIdDeposits = Entry('accounts/{account_id}/deposits', ['v2', 'private'], 'GET', {'cost': 10.6})
25
+ v2_private_get_accounts_account_id_deposits_deposit_id = v2PrivateGetAccountsAccountIdDepositsDepositId = Entry('accounts/{account_id}/deposits/{deposit_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
26
+ v2_private_get_accounts_account_id_withdrawals = v2PrivateGetAccountsAccountIdWithdrawals = Entry('accounts/{account_id}/withdrawals', ['v2', 'private'], 'GET', {'cost': 10.6})
27
+ v2_private_get_accounts_account_id_withdrawals_withdrawal_id = v2PrivateGetAccountsAccountIdWithdrawalsWithdrawalId = Entry('accounts/{account_id}/withdrawals/{withdrawal_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
28
+ v2_private_get_payment_methods = v2PrivateGetPaymentMethods = Entry('payment-methods', ['v2', 'private'], 'GET', {'cost': 10.6})
29
+ v2_private_get_payment_methods_payment_method_id = v2PrivateGetPaymentMethodsPaymentMethodId = Entry('payment-methods/{payment_method_id}', ['v2', 'private'], 'GET', {'cost': 10.6})
30
+ v2_private_get_user = v2PrivateGetUser = Entry('user', ['v2', 'private'], 'GET', {'cost': 10.6})
31
+ v2_private_get_user_auth = v2PrivateGetUserAuth = Entry('user/auth', ['v2', 'private'], 'GET', {'cost': 10.6})
32
+ v2_private_post_accounts = v2PrivatePostAccounts = Entry('accounts', ['v2', 'private'], 'POST', {'cost': 10.6})
33
+ v2_private_post_accounts_account_id_primary = v2PrivatePostAccountsAccountIdPrimary = Entry('accounts/{account_id}/primary', ['v2', 'private'], 'POST', {'cost': 10.6})
34
+ v2_private_post_accounts_account_id_addresses = v2PrivatePostAccountsAccountIdAddresses = Entry('accounts/{account_id}/addresses', ['v2', 'private'], 'POST', {'cost': 10.6})
35
+ v2_private_post_accounts_account_id_transactions = v2PrivatePostAccountsAccountIdTransactions = Entry('accounts/{account_id}/transactions', ['v2', 'private'], 'POST', {'cost': 10.6})
36
+ v2_private_post_accounts_account_id_transactions_transaction_id_complete = v2PrivatePostAccountsAccountIdTransactionsTransactionIdComplete = Entry('accounts/{account_id}/transactions/{transaction_id}/complete', ['v2', 'private'], 'POST', {'cost': 10.6})
37
+ v2_private_post_accounts_account_id_transactions_transaction_id_resend = v2PrivatePostAccountsAccountIdTransactionsTransactionIdResend = Entry('accounts/{account_id}/transactions/{transaction_id}/resend', ['v2', 'private'], 'POST', {'cost': 10.6})
38
+ v2_private_post_accounts_account_id_buys = v2PrivatePostAccountsAccountIdBuys = Entry('accounts/{account_id}/buys', ['v2', 'private'], 'POST', {'cost': 10.6})
39
+ v2_private_post_accounts_account_id_buys_buy_id_commit = v2PrivatePostAccountsAccountIdBuysBuyIdCommit = Entry('accounts/{account_id}/buys/{buy_id}/commit', ['v2', 'private'], 'POST', {'cost': 10.6})
40
+ v2_private_post_accounts_account_id_sells = v2PrivatePostAccountsAccountIdSells = Entry('accounts/{account_id}/sells', ['v2', 'private'], 'POST', {'cost': 10.6})
41
+ v2_private_post_accounts_account_id_sells_sell_id_commit = v2PrivatePostAccountsAccountIdSellsSellIdCommit = Entry('accounts/{account_id}/sells/{sell_id}/commit', ['v2', 'private'], 'POST', {'cost': 10.6})
42
+ v2_private_post_accounts_account_id_deposits = v2PrivatePostAccountsAccountIdDeposits = Entry('accounts/{account_id}/deposits', ['v2', 'private'], 'POST', {'cost': 10.6})
43
+ v2_private_post_accounts_account_id_deposits_deposit_id_commit = v2PrivatePostAccountsAccountIdDepositsDepositIdCommit = Entry('accounts/{account_id}/deposits/{deposit_id}/commit', ['v2', 'private'], 'POST', {'cost': 10.6})
44
+ v2_private_post_accounts_account_id_withdrawals = v2PrivatePostAccountsAccountIdWithdrawals = Entry('accounts/{account_id}/withdrawals', ['v2', 'private'], 'POST', {'cost': 10.6})
45
+ v2_private_post_accounts_account_id_withdrawals_withdrawal_id_commit = v2PrivatePostAccountsAccountIdWithdrawalsWithdrawalIdCommit = Entry('accounts/{account_id}/withdrawals/{withdrawal_id}/commit', ['v2', 'private'], 'POST', {'cost': 10.6})
46
+ v2_private_put_accounts_account_id = v2PrivatePutAccountsAccountId = Entry('accounts/{account_id}', ['v2', 'private'], 'PUT', {'cost': 10.6})
47
+ v2_private_put_user = v2PrivatePutUser = Entry('user', ['v2', 'private'], 'PUT', {'cost': 10.6})
48
+ v2_private_delete_accounts_id = v2PrivateDeleteAccountsId = Entry('accounts/{id}', ['v2', 'private'], 'DELETE', {'cost': 10.6})
49
+ v2_private_delete_accounts_account_id_transactions_transaction_id = v2PrivateDeleteAccountsAccountIdTransactionsTransactionId = Entry('accounts/{account_id}/transactions/{transaction_id}', ['v2', 'private'], 'DELETE', {'cost': 10.6})
50
+ v3_public_get_brokerage_time = v3PublicGetBrokerageTime = Entry('brokerage/time', ['v3', 'public'], 'GET', {'cost': 3})
51
+ v3_public_get_brokerage_market_product_book = v3PublicGetBrokerageMarketProductBook = Entry('brokerage/market/product_book', ['v3', 'public'], 'GET', {'cost': 3})
52
+ v3_public_get_brokerage_market_products = v3PublicGetBrokerageMarketProducts = Entry('brokerage/market/products', ['v3', 'public'], 'GET', {'cost': 3})
53
+ v3_public_get_brokerage_market_products_product_id = v3PublicGetBrokerageMarketProductsProductId = Entry('brokerage/market/products/{product_id}', ['v3', 'public'], 'GET', {'cost': 3})
54
+ v3_public_get_brokerage_market_products_product_id_candles = v3PublicGetBrokerageMarketProductsProductIdCandles = Entry('brokerage/market/products/{product_id}/candles', ['v3', 'public'], 'GET', {'cost': 3})
55
+ v3_public_get_brokerage_market_products_product_id_ticker = v3PublicGetBrokerageMarketProductsProductIdTicker = Entry('brokerage/market/products/{product_id}/ticker', ['v3', 'public'], 'GET', {'cost': 3})
56
+ v3_private_get_brokerage_accounts = v3PrivateGetBrokerageAccounts = Entry('brokerage/accounts', ['v3', 'private'], 'GET', {'cost': 1})
57
+ v3_private_get_brokerage_accounts_account_uuid = v3PrivateGetBrokerageAccountsAccountUuid = Entry('brokerage/accounts/{account_uuid}', ['v3', 'private'], 'GET', {'cost': 1})
58
+ v3_private_get_brokerage_orders_historical_batch = v3PrivateGetBrokerageOrdersHistoricalBatch = Entry('brokerage/orders/historical/batch', ['v3', 'private'], 'GET', {'cost': 1})
59
+ v3_private_get_brokerage_orders_historical_fills = v3PrivateGetBrokerageOrdersHistoricalFills = Entry('brokerage/orders/historical/fills', ['v3', 'private'], 'GET', {'cost': 1})
60
+ v3_private_get_brokerage_orders_historical_order_id = v3PrivateGetBrokerageOrdersHistoricalOrderId = Entry('brokerage/orders/historical/{order_id}', ['v3', 'private'], 'GET', {'cost': 1})
61
+ v3_private_get_brokerage_products = v3PrivateGetBrokerageProducts = Entry('brokerage/products', ['v3', 'private'], 'GET', {'cost': 3})
62
+ v3_private_get_brokerage_products_product_id = v3PrivateGetBrokerageProductsProductId = Entry('brokerage/products/{product_id}', ['v3', 'private'], 'GET', {'cost': 3})
63
+ v3_private_get_brokerage_products_product_id_candles = v3PrivateGetBrokerageProductsProductIdCandles = Entry('brokerage/products/{product_id}/candles', ['v3', 'private'], 'GET', {'cost': 3})
64
+ v3_private_get_brokerage_products_product_id_ticker = v3PrivateGetBrokerageProductsProductIdTicker = Entry('brokerage/products/{product_id}/ticker', ['v3', 'private'], 'GET', {'cost': 3})
65
+ v3_private_get_brokerage_best_bid_ask = v3PrivateGetBrokerageBestBidAsk = Entry('brokerage/best_bid_ask', ['v3', 'private'], 'GET', {'cost': 3})
66
+ v3_private_get_brokerage_product_book = v3PrivateGetBrokerageProductBook = Entry('brokerage/product_book', ['v3', 'private'], 'GET', {'cost': 3})
67
+ v3_private_get_brokerage_transaction_summary = v3PrivateGetBrokerageTransactionSummary = Entry('brokerage/transaction_summary', ['v3', 'private'], 'GET', {'cost': 3})
68
+ v3_private_get_brokerage_portfolios = v3PrivateGetBrokeragePortfolios = Entry('brokerage/portfolios', ['v3', 'private'], 'GET', {'cost': 1})
69
+ v3_private_get_brokerage_portfolios_portfolio_uuid = v3PrivateGetBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'GET', {'cost': 1})
70
+ v3_private_get_brokerage_convert_trade_trade_id = v3PrivateGetBrokerageConvertTradeTradeId = Entry('brokerage/convert/trade/{trade_id}', ['v3', 'private'], 'GET', {'cost': 1})
71
+ v3_private_get_brokerage_cfm_balance_summary = v3PrivateGetBrokerageCfmBalanceSummary = Entry('brokerage/cfm/balance_summary', ['v3', 'private'], 'GET', {'cost': 1})
72
+ v3_private_get_brokerage_cfm_positions = v3PrivateGetBrokerageCfmPositions = Entry('brokerage/cfm/positions', ['v3', 'private'], 'GET', {'cost': 1})
73
+ v3_private_get_brokerage_cfm_positions_product_id = v3PrivateGetBrokerageCfmPositionsProductId = Entry('brokerage/cfm/positions/{product_id}', ['v3', 'private'], 'GET', {'cost': 1})
74
+ v3_private_get_brokerage_cfm_sweeps = v3PrivateGetBrokerageCfmSweeps = Entry('brokerage/cfm/sweeps', ['v3', 'private'], 'GET', {'cost': 1})
75
+ v3_private_get_brokerage_intx_portfolio_portfolio_uuid = v3PrivateGetBrokerageIntxPortfolioPortfolioUuid = Entry('brokerage/intx/portfolio/{portfolio_uuid}', ['v3', 'private'], 'GET', {'cost': 1})
76
+ v3_private_get_brokerage_intx_positions_portfolio_uuid = v3PrivateGetBrokerageIntxPositionsPortfolioUuid = Entry('brokerage/intx/positions/{portfolio_uuid}', ['v3', 'private'], 'GET', {'cost': 1})
77
+ v3_private_get_brokerage_intx_positions_portfolio_uuid_symbol = v3PrivateGetBrokerageIntxPositionsPortfolioUuidSymbol = Entry('brokerage/intx/positions/{portfolio_uuid}/{symbol}', ['v3', 'private'], 'GET', {'cost': 1})
78
+ v3_private_get_brokerage_payment_methods = v3PrivateGetBrokeragePaymentMethods = Entry('brokerage/payment_methods', ['v3', 'private'], 'GET', {'cost': 1})
79
+ v3_private_get_brokerage_payment_methods_payment_method_id = v3PrivateGetBrokeragePaymentMethodsPaymentMethodId = Entry('brokerage/payment_methods/{payment_method_id}', ['v3', 'private'], 'GET', {'cost': 1})
80
+ v3_private_post_brokerage_orders = v3PrivatePostBrokerageOrders = Entry('brokerage/orders', ['v3', 'private'], 'POST', {'cost': 1})
81
+ v3_private_post_brokerage_orders_batch_cancel = v3PrivatePostBrokerageOrdersBatchCancel = Entry('brokerage/orders/batch_cancel', ['v3', 'private'], 'POST', {'cost': 1})
82
+ v3_private_post_brokerage_orders_edit = v3PrivatePostBrokerageOrdersEdit = Entry('brokerage/orders/edit', ['v3', 'private'], 'POST', {'cost': 1})
83
+ v3_private_post_brokerage_orders_edit_preview = v3PrivatePostBrokerageOrdersEditPreview = Entry('brokerage/orders/edit_preview', ['v3', 'private'], 'POST', {'cost': 1})
84
+ v3_private_post_brokerage_orders_preview = v3PrivatePostBrokerageOrdersPreview = Entry('brokerage/orders/preview', ['v3', 'private'], 'POST', {'cost': 1})
85
+ v3_private_post_brokerage_portfolios = v3PrivatePostBrokeragePortfolios = Entry('brokerage/portfolios', ['v3', 'private'], 'POST', {'cost': 1})
86
+ v3_private_post_brokerage_portfolios_move_funds = v3PrivatePostBrokeragePortfoliosMoveFunds = Entry('brokerage/portfolios/move_funds', ['v3', 'private'], 'POST', {'cost': 1})
87
+ v3_private_post_brokerage_convert_quote = v3PrivatePostBrokerageConvertQuote = Entry('brokerage/convert/quote', ['v3', 'private'], 'POST', {'cost': 1})
88
+ v3_private_post_brokerage_convert_trade_trade_id = v3PrivatePostBrokerageConvertTradeTradeId = Entry('brokerage/convert/trade/{trade_id}', ['v3', 'private'], 'POST', {'cost': 1})
89
+ v3_private_post_brokerage_cfm_sweeps_schedule = v3PrivatePostBrokerageCfmSweepsSchedule = Entry('brokerage/cfm/sweeps/schedule', ['v3', 'private'], 'POST', {'cost': 1})
90
+ v3_private_post_brokerage_intx_allocate = v3PrivatePostBrokerageIntxAllocate = Entry('brokerage/intx/allocate', ['v3', 'private'], 'POST', {'cost': 1})
91
+ v3_private_post_brokerage_orders_close_position = v3PrivatePostBrokerageOrdersClosePosition = Entry('brokerage/orders/close_position', ['v3', 'private'], 'POST', {'cost': 1})
92
+ v3_private_put_brokerage_portfolios_portfolio_uuid = v3PrivatePutBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'PUT', {'cost': 1})
93
+ v3_private_delete_brokerage_portfolios_portfolio_uuid = v3PrivateDeleteBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'DELETE', {'cost': 1})
94
+ v3_private_delete_brokerage_cfm_sweeps = v3PrivateDeleteBrokerageCfmSweeps = Entry('brokerage/cfm/sweeps', ['v3', 'private'], 'DELETE', {'cost': 1})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.23'
7
+ __version__ = '4.3.27'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -99,8 +99,9 @@ from ccxt.async_support.btcturk import btcturk
99
99
  from ccxt.async_support.bybit import bybit # noqa: F401
100
100
  from ccxt.async_support.cex import cex # noqa: F401
101
101
  from ccxt.async_support.coinbase import coinbase # noqa: F401
102
+ from ccxt.async_support.coinbaseadvanced import coinbaseadvanced # noqa: F401
103
+ from ccxt.async_support.coinbaseexchange import coinbaseexchange # noqa: F401
102
104
  from ccxt.async_support.coinbaseinternational import coinbaseinternational # noqa: F401
103
- from ccxt.async_support.coinbasepro import coinbasepro # noqa: F401
104
105
  from ccxt.async_support.coincheck import coincheck # noqa: F401
105
106
  from ccxt.async_support.coinex import coinex # noqa: F401
106
107
  from ccxt.async_support.coinlist import coinlist # noqa: F401
@@ -205,8 +206,9 @@ exchanges = [
205
206
  'bybit',
206
207
  'cex',
207
208
  'coinbase',
209
+ 'coinbaseadvanced',
210
+ 'coinbaseexchange',
208
211
  'coinbaseinternational',
209
- 'coinbasepro',
210
212
  'coincheck',
211
213
  'coinex',
212
214
  'coinlist',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.23'
5
+ __version__ = '4.3.27'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -839,7 +839,7 @@ class Exchange(BaseExchange):
839
839
  await self.cancelOrder(id, symbol)
840
840
  return await self.create_order(symbol, type, side, amount, price, params)
841
841
 
842
- async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
842
+ async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
843
843
  await self.cancelOrderWs(id, symbol)
844
844
  return await self.createOrderWs(symbol, type, side, amount, price, params)
845
845
 
@@ -1848,8 +1848,9 @@ class Exchange(BaseExchange):
1848
1848
  errors = 0
1849
1849
  responseLength = len(response)
1850
1850
  if self.verbose:
1851
- iteration = (i + str(1))
1852
- cursorMessage = 'Cursor pagination call ' + iteration + ' method ' + method + ' response length ' + str(responseLength) + ' cursor ' + cursorValue
1851
+ cursorString = '' if (cursorValue is None) else cursorValue
1852
+ iteration = (i + 1)
1853
+ cursorMessage = 'Cursor pagination call ' + str(iteration) + ' method ' + method + ' response length ' + str(responseLength) + ' cursor ' + cursorString
1853
1854
  self.log(cursorMessage)
1854
1855
  if responseLength == 0:
1855
1856
  break
@@ -2933,6 +2933,10 @@ class bitrue(Exchange, ImplicitAPI):
2933
2933
  signPath = signPath + '/' + version + '/' + path
2934
2934
  signMessage = timestamp + method + signPath
2935
2935
  if method == 'GET':
2936
+ keys = list(params.keys())
2937
+ keysLength = len(keys)
2938
+ if keysLength > 0:
2939
+ signMessage += '?' + self.urlencode(params)
2936
2940
  signature = self.hmac(self.encode(signMessage), self.encode(self.secret), hashlib.sha256)
2937
2941
  headers = {
2938
2942
  'X-CH-APIKEY': self.apiKey,
@@ -2945,7 +2949,7 @@ class bitrue(Exchange, ImplicitAPI):
2945
2949
  'recvWindow': recvWindow,
2946
2950
  }, params)
2947
2951
  body = self.json(query)
2948
- signMessage = signMessage + json.dumps(body)
2952
+ signMessage += body
2949
2953
  signature = self.hmac(self.encode(signMessage), self.encode(self.secret), hashlib.sha256)
2950
2954
  headers = {
2951
2955
  'Content-Type': 'application/json',
@@ -0,0 +1,17 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+
6
+ from ccxt.async_support.coinbase import coinbase
7
+ from ccxt.abstract.coinbaseadvanced import ImplicitAPI
8
+
9
+
10
+ class coinbaseadvanced(coinbase, ImplicitAPI):
11
+
12
+ def describe(self):
13
+ return self.deep_extend(super(coinbaseadvanced, self).describe(), {
14
+ 'id': 'coinbaseadvanced',
15
+ 'name': 'Coinbase Advanced',
16
+ 'alias': True,
17
+ })
@@ -4,7 +4,7 @@
4
4
  # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
- from ccxt.abstract.coinbasepro import ImplicitAPI
7
+ from ccxt.abstract.coinbaseexchange import ImplicitAPI
8
8
  import hashlib
9
9
  from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
10
10
  from typing import List
@@ -22,12 +22,12 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
22
22
  from ccxt.base.precise import Precise
23
23
 
24
24
 
25
- class coinbasepro(Exchange, ImplicitAPI):
25
+ class coinbaseexchange(Exchange, ImplicitAPI):
26
26
 
27
27
  def describe(self):
28
- return self.deep_extend(super(coinbasepro, self).describe(), {
29
- 'id': 'coinbasepro',
30
- 'name': 'Coinbase Pro(Deprecated)',
28
+ return self.deep_extend(super(coinbaseexchange, self).describe(), {
29
+ 'id': 'coinbaseexchange',
30
+ 'name': 'Coinbase Exchange',
31
31
  'countries': ['US'],
32
32
  'rateLimit': 100,
33
33
  'userAgent': self.userAgents['chrome'],
@@ -89,19 +89,19 @@ class coinbasepro(Exchange, ImplicitAPI):
89
89
  '6h': 21600,
90
90
  '1d': 86400,
91
91
  },
92
- 'hostname': 'pro.coinbase.com',
92
+ 'hostname': 'exchange.coinbase.com',
93
93
  'urls': {
94
94
  'test': {
95
- 'public': 'https://api-public.sandbox.pro.coinbase.com',
96
- 'private': 'https://api-public.sandbox.pro.coinbase.com',
95
+ 'public': 'https://api-public.sandbox.exchange.coinbase.com',
96
+ 'private': 'https://api-public.sandbox.exchange.coinbase.com',
97
97
  },
98
- 'logo': 'https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg',
98
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e',
99
99
  'api': {
100
100
  'public': 'https://api.{hostname}',
101
101
  'private': 'https://api.{hostname}',
102
102
  },
103
- 'www': 'https://pro.coinbase.com/',
104
- 'doc': 'https://docs.pro.coinbase.com',
103
+ 'www': 'https://coinbase.com/',
104
+ 'doc': 'https://docs.cloud.coinbase.com/exchange/docs/',
105
105
  'fees': [
106
106
  'https://docs.pro.coinbase.com/#fees',
107
107
  'https://support.pro.coinbase.com/customer/en/portal/articles/2945310-fees',
@@ -315,7 +315,7 @@ class coinbasepro(Exchange, ImplicitAPI):
315
315
 
316
316
  async def fetch_markets(self, params={}) -> List[Market]:
317
317
  """
318
- retrieves data on all markets for coinbasepro
318
+ retrieves data on all markets for coinbaseexchange
319
319
  :see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
320
320
  :param dict [params]: extra parameters specific to the exchange API endpoint
321
321
  :returns dict[]: an array of objects representing market data
@@ -1047,7 +1047,7 @@ class coinbasepro(Exchange, ImplicitAPI):
1047
1047
  """
1048
1048
  :see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
1049
1049
  fetches information on an order made by the user
1050
- :param str symbol: not used by coinbasepro fetchOrder
1050
+ :param str symbol: not used by coinbaseexchange fetchOrder
1051
1051
  :param dict [params]: extra parameters specific to the exchange API endpoint
1052
1052
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1053
1053
  """
@@ -458,8 +458,15 @@ class coinex(Exchange, ImplicitAPI):
458
458
  'fetchDepositAddress': {
459
459
  'fillResponseFromRequest': True,
460
460
  },
461
+ 'accountsByType': {
462
+ 'spot': 'SPOT',
463
+ 'margin': 'MARGIN',
464
+ 'swap': 'FUTURES',
465
+ },
461
466
  'accountsById': {
462
- 'spot': '0',
467
+ 'SPOT': 'spot',
468
+ 'MARGIN': 'margin',
469
+ 'FUTURES': 'swap',
463
470
  },
464
471
  'networks': {
465
472
  'BEP20': 'BSC',
@@ -3454,7 +3461,10 @@ class coinex(Exchange, ImplicitAPI):
3454
3461
  :param str [params.marginMode]: 'cross' or 'isolated' for fetching spot margin orders
3455
3462
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
3456
3463
  """
3457
- return await self.fetch_orders_by_status('pending', symbol, since, limit, params)
3464
+ openOrders = await self.fetch_orders_by_status('pending', symbol, since, limit, params)
3465
+ for i in range(0, len(openOrders)):
3466
+ openOrders[i]['status'] = 'open'
3467
+ return openOrders
3458
3468
 
3459
3469
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3460
3470
  """
@@ -4599,40 +4609,42 @@ class coinex(Exchange, ImplicitAPI):
4599
4609
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
4600
4610
  """
4601
4611
  transfer currency internally between wallets on the same account
4602
- :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account014_balance_contract_transfer
4603
- :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account013_margin_transfer
4612
+ :see: https://docs.coinex.com/api/v2/assets/transfer/http/transfer
4604
4613
  :param str code: unified currency code
4605
4614
  :param float amount: amount to transfer
4606
4615
  :param str fromAccount: account to transfer from
4607
4616
  :param str toAccount: account to transfer to
4608
4617
  :param dict [params]: extra parameters specific to the exchange API endpoint
4618
+ :param str [params.symbol]: unified ccxt symbol, required when either the fromAccount or toAccount is margin
4609
4619
  :returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
4610
4620
  """
4611
4621
  await self.load_markets()
4612
4622
  currency = self.currency(code)
4613
4623
  amountToPrecision = self.currency_to_precision(code, amount)
4624
+ accountsByType = self.safe_dict(self.options, 'accountsById', {})
4625
+ fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
4626
+ toId = self.safe_string(accountsByType, toAccount, toAccount)
4614
4627
  request = {
4628
+ 'ccy': currency['id'],
4615
4629
  'amount': amountToPrecision,
4616
- 'coin_type': currency['id'],
4630
+ 'from_account_type': fromId,
4631
+ 'to_account_type': toId,
4617
4632
  }
4618
- response = None
4619
- if (fromAccount == 'spot') and (toAccount == 'swap'):
4620
- request['transfer_side'] = 'in' # 'in' spot to swap, 'out' swap to spot
4621
- response = await self.v1PrivatePostContractBalanceTransfer(self.extend(request, params))
4622
- elif (fromAccount == 'swap') and (toAccount == 'spot'):
4623
- request['transfer_side'] = 'out' # 'in' spot to swap, 'out' swap to spot
4624
- response = await self.v1PrivatePostContractBalanceTransfer(self.extend(request, params))
4625
- else:
4626
- accountsById = self.safe_value(self.options, 'accountsById', {})
4627
- fromId = self.safe_string(accountsById, fromAccount, fromAccount)
4628
- toId = self.safe_string(accountsById, toAccount, toAccount)
4629
- # fromAccount and toAccount must be integers for margin transfers
4630
- # spot is 0, use fetchBalance() to find the margin account id
4631
- request['from_account'] = int(fromId)
4632
- request['to_account'] = int(toId)
4633
- response = await self.v1PrivatePostMarginTransfer(self.extend(request, params))
4633
+ if (fromAccount == 'margin') or (toAccount == 'margin'):
4634
+ symbol = self.safe_string(params, 'symbol')
4635
+ if symbol is None:
4636
+ raise ArgumentsRequired(self.id + ' transfer() the symbol parameter must be defined for a margin account')
4637
+ params = self.omit(params, 'symbol')
4638
+ request['market'] = self.market_id(symbol)
4639
+ if (fromAccount != 'spot') and (toAccount != 'spot'):
4640
+ raise BadRequest(self.id + ' transfer() can only be between spot and swap, or spot and margin, either the fromAccount or toAccount must be spot')
4641
+ response = await self.v2PrivatePostAssetsTransfer(self.extend(request, params))
4634
4642
  #
4635
- # {"code": 0, "data": null, "message": "Success"}
4643
+ # {
4644
+ # "code": 0,
4645
+ # "data": {},
4646
+ # "message": "OK"
4647
+ # }
4636
4648
  #
4637
4649
  return self.extend(self.parse_transfer(response, currency), {
4638
4650
  'amount': self.parse_number(amountToPrecision),
@@ -4640,158 +4652,85 @@ class coinex(Exchange, ImplicitAPI):
4640
4652
  'toAccount': toAccount,
4641
4653
  })
4642
4654
 
4643
- def parse_transfer_status(self, status: Str) -> Str:
4655
+ def parse_transfer_status(self, status):
4644
4656
  statuses = {
4645
4657
  '0': 'ok',
4646
4658
  'SUCCESS': 'ok',
4659
+ 'OK': 'ok',
4660
+ 'finished': 'ok',
4661
+ 'FINISHED': 'ok',
4647
4662
  }
4648
4663
  return self.safe_string(statuses, status, status)
4649
4664
 
4650
4665
  def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
4651
- #
4652
- # fetchTransfers Swap
4653
- #
4654
- # {
4655
- # "amount": "10",
4656
- # "asset": "USDT",
4657
- # "transfer_type": "transfer_out", # from swap to spot
4658
- # "created_at": 1651633422
4659
- # },
4660
- #
4661
- # fetchTransfers Margin
4662
- #
4663
- # {
4664
- # "id": 7580062,
4665
- # "updated_at": 1653684379,
4666
- # "user_id": 3620173,
4667
- # "from_account_id": 0,
4668
- # "to_account_id": 1,
4669
- # "asset": "BTC",
4670
- # "amount": "0.00160829",
4671
- # "balance": "0.00160829",
4672
- # "transfer_type": "IN",
4673
- # "status": "SUCCESS",
4674
- # "created_at": 1653684379
4675
- # },
4676
- #
4677
- timestamp = self.safe_timestamp(transfer, 'created_at')
4678
- transferType = self.safe_string(transfer, 'transfer_type')
4679
- fromAccount = None
4680
- toAccount = None
4681
- if transferType == 'transfer_out':
4682
- fromAccount = 'swap'
4683
- toAccount = 'spot'
4684
- elif transferType == 'transfer_in':
4685
- fromAccount = 'spot'
4686
- toAccount = 'swap'
4687
- elif transferType == 'IN':
4688
- fromAccount = 'spot'
4689
- toAccount = 'margin'
4690
- elif transferType == 'OUT':
4691
- fromAccount = 'margin'
4692
- toAccount = 'spot'
4693
- currencyId = self.safe_string(transfer, 'asset')
4694
- currencyCode = self.safe_currency_code(currencyId, currency)
4666
+ timestamp = self.safe_integer(transfer, 'created_at')
4667
+ currencyId = self.safe_string(transfer, 'ccy')
4668
+ fromId = self.safe_string(transfer, 'from_account_type')
4669
+ toId = self.safe_string(transfer, 'to_account_type')
4670
+ accountsById = self.safe_value(self.options, 'accountsById', {})
4695
4671
  return {
4696
- 'info': transfer,
4697
- 'id': self.safe_string(transfer, 'id'),
4672
+ 'id': None,
4698
4673
  'timestamp': timestamp,
4699
4674
  'datetime': self.iso8601(timestamp),
4700
- 'currency': currencyCode,
4675
+ 'currency': self.safe_currency_code(currencyId, currency),
4701
4676
  'amount': self.safe_number(transfer, 'amount'),
4702
- 'fromAccount': fromAccount,
4703
- 'toAccount': toAccount,
4677
+ 'fromAccount': self.safe_string(accountsById, fromId, fromId),
4678
+ 'toAccount': self.safe_string(accountsById, toId, toId),
4704
4679
  'status': self.parse_transfer_status(self.safe_string_2(transfer, 'code', 'status')),
4705
4680
  }
4706
4681
 
4707
4682
  async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
4708
4683
  """
4709
4684
  fetch a history of internal transfers made on an account
4710
- :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account025_margin_transfer_history
4711
- :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account024_contract_transfer_history
4685
+ :see: https://docs.coinex.com/api/v2/assets/transfer/http/list-transfer-history
4712
4686
  :param str code: unified currency code of the currency transferred
4713
4687
  :param int [since]: the earliest time in ms to fetch transfers for
4714
- :param int [limit]: the maximum number of transfers structures to retrieve
4688
+ :param int [limit]: the maximum number of transfer structures to retrieve
4715
4689
  :param dict [params]: extra parameters specific to the exchange API endpoint
4690
+ :param str [params.marginMode]: 'cross' or 'isolated' for fetching transfers to and from your margin account
4716
4691
  :returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
4717
4692
  """
4718
4693
  await self.load_markets()
4719
- currency = None
4694
+ if code is None:
4695
+ raise ArgumentsRequired(self.id + ' fetchTransfers() requires a code argument')
4696
+ currency = self.currency(code)
4720
4697
  request = {
4721
- 'page': 1,
4722
- # 'limit': limit,
4723
- # 'asset': 'USDT',
4724
- # 'start_time': since,
4725
- # 'end_time': 1515806440,
4726
- # 'transfer_type': 'transfer_in', # transfer_in: from Spot to Swap Account, transfer_out: from Swap to Spot Account
4698
+ 'ccy': currency['id'],
4727
4699
  }
4728
- page = self.safe_integer(params, 'page')
4729
- if page is not None:
4730
- request['page'] = page
4731
- if code is not None:
4732
- currency = self.currency(code)
4733
- request['asset'] = currency['id']
4734
- if since is not None:
4735
- request['start_time'] = since
4736
- if limit is not None:
4737
- request['limit'] = limit
4738
- else:
4739
- request['limit'] = 100
4740
- params = self.omit(params, 'page')
4741
4700
  marginMode = None
4742
4701
  marginMode, params = self.handle_margin_mode_and_params('fetchTransfers', params)
4743
- response = None
4744
4702
  if marginMode is not None:
4745
- response = await self.v1PrivateGetMarginTransferHistory(self.extend(request, params))
4703
+ request['transfer_type'] = 'MARGIN'
4746
4704
  else:
4747
- response = await self.v1PrivateGetContractTransferHistory(self.extend(request, params))
4748
- #
4749
- # Swap
4705
+ request['transfer_type'] = 'FUTURES'
4706
+ if since is not None:
4707
+ request['start_time'] = since
4708
+ if limit is not None:
4709
+ request['limit'] = limit
4710
+ request, params = self.handle_until_option('end_time', request, params)
4711
+ response = await self.v2PrivateGetAssetsTransferHistory(self.extend(request, params))
4750
4712
  #
4751
4713
  # {
4752
- # "code": 0,
4753
- # "data": {
4754
- # "records": [
4755
- # {
4756
- # "amount": "10",
4757
- # "asset": "USDT",
4758
- # "transfer_type": "transfer_out",
4759
- # "created_at": 1651633422
4760
- # },
4761
- # ],
4762
- # "total": 5
4714
+ # "data": [
4715
+ # {
4716
+ # "created_at": 1715848480646,
4717
+ # "from_account_type": "SPOT",
4718
+ # "to_account_type": "FUTURES",
4719
+ # "ccy": "USDT",
4720
+ # "amount": "10",
4721
+ # "status": "finished"
4722
+ # },
4723
+ # ],
4724
+ # "pagination": {
4725
+ # "total": 8,
4726
+ # "has_next": False
4763
4727
  # },
4764
- # "message": "Success"
4765
- # }
4766
- #
4767
- # Margin
4768
- #
4769
- # {
4770
4728
  # "code": 0,
4771
- # "data": {
4772
- # "records": [
4773
- # {
4774
- # "id": 7580062,
4775
- # "updated_at": 1653684379,
4776
- # "user_id": 3620173,
4777
- # "from_account_id": 0,
4778
- # "to_account_id": 1,
4779
- # "asset": "BTC",
4780
- # "amount": "0.00160829",
4781
- # "balance": "0.00160829",
4782
- # "transfer_type": "IN",
4783
- # "status": "SUCCESS",
4784
- # "created_at": 1653684379
4785
- # }
4786
- # ],
4787
- # "total": 1
4788
- # },
4789
- # "message": "Success"
4729
+ # "message": "OK"
4790
4730
  # }
4791
4731
  #
4792
- data = self.safe_value(response, 'data', {})
4793
- transfers = self.safe_list(data, 'records', [])
4794
- return self.parse_transfers(transfers, currency, since, limit)
4732
+ data = self.safe_list(response, 'data', [])
4733
+ return self.parse_transfers(data, currency, since, limit)
4795
4734
 
4796
4735
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4797
4736
  """