ccxt 4.3.23 → 4.3.24

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.
@@ -5,21 +5,21 @@
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
- import Exchange from './abstract/coinbasepro.js';
8
+ import Exchange from './abstract/coinbaseexchange.js';
9
9
  import { InsufficientFunds, ArgumentsRequired, ExchangeError, InvalidOrder, InvalidAddress, AuthenticationError, OrderNotFound, OnMaintenance, PermissionDenied, RateLimitExceeded } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
11
  import { TICK_SIZE } from './base/functions/number.js';
12
12
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
13
13
  // ----------------------------------------------------------------------------
14
14
  /**
15
- * @class coinbasepro
15
+ * @class coinbaseexchange
16
16
  * @augments Exchange
17
17
  */
18
- export default class coinbasepro extends Exchange {
18
+ export default class coinbaseexchange extends Exchange {
19
19
  describe() {
20
20
  return this.deepExtend(super.describe(), {
21
- 'id': 'coinbasepro',
22
- 'name': 'Coinbase Pro(Deprecated)',
21
+ 'id': 'coinbaseexchange',
22
+ 'name': 'Coinbase Exchange',
23
23
  'countries': ['US'],
24
24
  'rateLimit': 100,
25
25
  'userAgent': this.userAgents['chrome'],
@@ -81,19 +81,19 @@ export default class coinbasepro extends Exchange {
81
81
  '6h': 21600,
82
82
  '1d': 86400,
83
83
  },
84
- 'hostname': 'pro.coinbase.com',
84
+ 'hostname': 'exchange.coinbase.com',
85
85
  'urls': {
86
86
  'test': {
87
- 'public': 'https://api-public.sandbox.pro.coinbase.com',
88
- 'private': 'https://api-public.sandbox.pro.coinbase.com',
87
+ 'public': 'https://api-public.sandbox.exchange.coinbase.com',
88
+ 'private': 'https://api-public.sandbox.exchange.coinbase.com',
89
89
  },
90
- 'logo': 'https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg',
90
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e',
91
91
  'api': {
92
92
  'public': 'https://api.{hostname}',
93
93
  'private': 'https://api.{hostname}',
94
94
  },
95
- 'www': 'https://pro.coinbase.com/',
96
- 'doc': 'https://docs.pro.coinbase.com',
95
+ 'www': 'https://coinbase.com/',
96
+ 'doc': 'https://docs.cloud.coinbase.com/exchange/docs/',
97
97
  'fees': [
98
98
  'https://docs.pro.coinbase.com/#fees',
99
99
  'https://support.pro.coinbase.com/customer/en/portal/articles/2945310-fees',
@@ -240,7 +240,7 @@ export default class coinbasepro extends Exchange {
240
240
  async fetchCurrencies(params = {}) {
241
241
  /**
242
242
  * @method
243
- * @name coinbasepro#fetchCurrencies
243
+ * @name coinbaseexchange#fetchCurrencies
244
244
  * @description fetches all available currencies on an exchange
245
245
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcurrencies
246
246
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -311,8 +311,8 @@ export default class coinbasepro extends Exchange {
311
311
  async fetchMarkets(params = {}) {
312
312
  /**
313
313
  * @method
314
- * @name coinbasepro#fetchMarkets
315
- * @description retrieves data on all markets for coinbasepro
314
+ * @name coinbaseexchange#fetchMarkets
315
+ * @description retrieves data on all markets for coinbaseexchange
316
316
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
317
317
  * @param {object} [params] extra parameters specific to the exchange API endpoint
318
318
  * @returns {object[]} an array of objects representing market data
@@ -432,7 +432,7 @@ export default class coinbasepro extends Exchange {
432
432
  async fetchAccounts(params = {}) {
433
433
  /**
434
434
  * @method
435
- * @name coinbasepro#fetchAccounts
435
+ * @name coinbaseexchange#fetchAccounts
436
436
  * @description fetch all the accounts associated with a profile
437
437
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
438
438
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -498,7 +498,7 @@ export default class coinbasepro extends Exchange {
498
498
  async fetchBalance(params = {}) {
499
499
  /**
500
500
  * @method
501
- * @name coinbasepro#fetchBalance
501
+ * @name coinbaseexchange#fetchBalance
502
502
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
503
503
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
504
504
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -511,7 +511,7 @@ export default class coinbasepro extends Exchange {
511
511
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
512
512
  /**
513
513
  * @method
514
- * @name coinbasepro#fetchOrderBook
514
+ * @name coinbaseexchange#fetchOrderBook
515
515
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
516
516
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
517
517
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -631,7 +631,7 @@ export default class coinbasepro extends Exchange {
631
631
  async fetchTickers(symbols = undefined, params = {}) {
632
632
  /**
633
633
  * @method
634
- * @name coinbasepro#fetchTickers
634
+ * @name coinbaseexchange#fetchTickers
635
635
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
636
636
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproduct
637
637
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -678,7 +678,7 @@ export default class coinbasepro extends Exchange {
678
678
  async fetchTicker(symbol, params = {}) {
679
679
  /**
680
680
  * @method
681
- * @name coinbasepro#fetchTicker
681
+ * @name coinbaseexchange#fetchTicker
682
682
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
683
683
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
684
684
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -792,7 +792,7 @@ export default class coinbasepro extends Exchange {
792
792
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
793
793
  /**
794
794
  * @method
795
- * @name coinbasepro#fetchMyTrades
795
+ * @name coinbaseexchange#fetchMyTrades
796
796
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
797
797
  * @description fetch all trades made by the user
798
798
  * @param {string} symbol unified market symbol
@@ -833,7 +833,7 @@ export default class coinbasepro extends Exchange {
833
833
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
834
834
  /**
835
835
  * @method
836
- * @name coinbasepro#fetchTrades
836
+ * @name coinbaseexchange#fetchTrades
837
837
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
838
838
  * @description get the list of most recent trades for a particular symbol
839
839
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -867,7 +867,7 @@ export default class coinbasepro extends Exchange {
867
867
  async fetchTradingFees(params = {}) {
868
868
  /**
869
869
  * @method
870
- * @name coinbasepro#fetchTradingFees
870
+ * @name coinbaseexchange#fetchTradingFees
871
871
  * @description fetch the trading fees for multiple markets
872
872
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfees
873
873
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -921,7 +921,7 @@ export default class coinbasepro extends Exchange {
921
921
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
922
922
  /**
923
923
  * @method
924
- * @name coinbasepro#fetchOHLCV
924
+ * @name coinbaseexchange#fetchOHLCV
925
925
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
926
926
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
927
927
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -987,7 +987,7 @@ export default class coinbasepro extends Exchange {
987
987
  async fetchTime(params = {}) {
988
988
  /**
989
989
  * @method
990
- * @name coinbasepro#fetchTime
990
+ * @name coinbaseexchange#fetchTime
991
991
  * @description fetches the current integer timestamp in milliseconds from the exchange server
992
992
  * @param {object} [params] extra parameters specific to the exchange API endpoint
993
993
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
@@ -1090,10 +1090,10 @@ export default class coinbasepro extends Exchange {
1090
1090
  async fetchOrder(id, symbol = undefined, params = {}) {
1091
1091
  /**
1092
1092
  * @method
1093
- * @name coinbasepro#fetchOrder
1093
+ * @name coinbaseexchange#fetchOrder
1094
1094
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
1095
1095
  * @description fetches information on an order made by the user
1096
- * @param {string} symbol not used by coinbasepro fetchOrder
1096
+ * @param {string} symbol not used by coinbaseexchange fetchOrder
1097
1097
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1098
1098
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1099
1099
  */
@@ -1116,7 +1116,7 @@ export default class coinbasepro extends Exchange {
1116
1116
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
1117
1117
  /**
1118
1118
  * @method
1119
- * @name coinbasepro#fetchOrderTrades
1119
+ * @name coinbaseexchange#fetchOrderTrades
1120
1120
  * @description fetch all the trades made from a single order
1121
1121
  * @param {string} id order id
1122
1122
  * @param {string} symbol unified market symbol
@@ -1139,7 +1139,7 @@ export default class coinbasepro extends Exchange {
1139
1139
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1140
1140
  /**
1141
1141
  * @method
1142
- * @name coinbasepro#fetchOrders
1142
+ * @name coinbaseexchange#fetchOrders
1143
1143
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1144
1144
  * @description fetches information on multiple orders made by the user
1145
1145
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1157,7 +1157,7 @@ export default class coinbasepro extends Exchange {
1157
1157
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1158
1158
  /**
1159
1159
  * @method
1160
- * @name coinbasepro#fetchOpenOrders
1160
+ * @name coinbaseexchange#fetchOpenOrders
1161
1161
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1162
1162
  * @description fetch all unfilled currently open orders
1163
1163
  * @param {string} symbol unified market symbol
@@ -1197,7 +1197,7 @@ export default class coinbasepro extends Exchange {
1197
1197
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1198
1198
  /**
1199
1199
  * @method
1200
- * @name coinbasepro#fetchClosedOrders
1200
+ * @name coinbaseexchange#fetchClosedOrders
1201
1201
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
1202
1202
  * @description fetches information on multiple closed orders made by the user
1203
1203
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1215,7 +1215,7 @@ export default class coinbasepro extends Exchange {
1215
1215
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1216
1216
  /**
1217
1217
  * @method
1218
- * @name coinbasepro#createOrder
1218
+ * @name coinbaseexchange#createOrder
1219
1219
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
1220
1220
  * @description create a trade order
1221
1221
  * @param {string} symbol unified symbol of the market to create an order in
@@ -1311,7 +1311,7 @@ export default class coinbasepro extends Exchange {
1311
1311
  async cancelOrder(id, symbol = undefined, params = {}) {
1312
1312
  /**
1313
1313
  * @method
1314
- * @name coinbasepro#cancelOrder
1314
+ * @name coinbaseexchange#cancelOrder
1315
1315
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
1316
1316
  * @description cancels an open order
1317
1317
  * @param {string} id order id
@@ -1344,7 +1344,7 @@ export default class coinbasepro extends Exchange {
1344
1344
  async cancelAllOrders(symbol = undefined, params = {}) {
1345
1345
  /**
1346
1346
  * @method
1347
- * @name coinbasepro#cancelAllOrders
1347
+ * @name coinbaseexchange#cancelAllOrders
1348
1348
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
1349
1349
  * @description cancel all open orders
1350
1350
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
@@ -1366,7 +1366,7 @@ export default class coinbasepro extends Exchange {
1366
1366
  async withdraw(code, amount, address, tag = undefined, params = {}) {
1367
1367
  /**
1368
1368
  * @method
1369
- * @name coinbasepro#withdraw
1369
+ * @name coinbaseexchange#withdraw
1370
1370
  * @description make a withdrawal
1371
1371
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
1372
1372
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcoinbaseaccount
@@ -1492,7 +1492,7 @@ export default class coinbasepro extends Exchange {
1492
1492
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1493
1493
  /**
1494
1494
  * @method
1495
- * @name coinbasepro#fetchLedger
1495
+ * @name coinbaseexchange#fetchLedger
1496
1496
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
1497
1497
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
1498
1498
  * @param {string} code unified currency code, default is undefined
@@ -1543,7 +1543,7 @@ export default class coinbasepro extends Exchange {
1543
1543
  async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1544
1544
  /**
1545
1545
  * @method
1546
- * @name coinbasepro#fetchDepositsWithdrawals
1546
+ * @name coinbaseexchange#fetchDepositsWithdrawals
1547
1547
  * @description fetch history of deposits and withdrawals
1548
1548
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1549
1549
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1651,7 +1651,7 @@ export default class coinbasepro extends Exchange {
1651
1651
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1652
1652
  /**
1653
1653
  * @method
1654
- * @name coinbasepro#fetchDeposits
1654
+ * @name coinbaseexchange#fetchDeposits
1655
1655
  * @description fetch all deposits made to an account
1656
1656
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1657
1657
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1666,7 +1666,7 @@ export default class coinbasepro extends Exchange {
1666
1666
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1667
1667
  /**
1668
1668
  * @method
1669
- * @name coinbasepro#fetchWithdrawals
1669
+ * @name coinbaseexchange#fetchWithdrawals
1670
1670
  * @description fetch all withdrawals made from an account
1671
1671
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
1672
1672
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
@@ -1778,7 +1778,7 @@ export default class coinbasepro extends Exchange {
1778
1778
  async createDepositAddress(code, params = {}) {
1779
1779
  /**
1780
1780
  * @method
1781
- * @name coinbasepro#createDepositAddress
1781
+ * @name coinbaseexchange#createDepositAddress
1782
1782
  * @description create a currency deposit address
1783
1783
  * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
1784
1784
  * @param {string} code unified currency code of the currency for the deposit address
@@ -121,7 +121,7 @@ export default class coinex extends Exchange {
121
121
  fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
122
122
  parseTransaction(transaction: any, currency?: Currency): Transaction;
123
123
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
124
- parseTransferStatus(status: Str): Str;
124
+ parseTransferStatus(status: any): string;
125
125
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
126
126
  fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntries>;
127
127
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
package/js/src/coinex.js CHANGED
@@ -448,7 +448,9 @@ export default class coinex extends Exchange {
448
448
  'fillResponseFromRequest': true,
449
449
  },
450
450
  'accountsById': {
451
- 'spot': '0',
451
+ 'spot': 'SPOT',
452
+ 'margin': 'MARGIN',
453
+ 'swap': 'FUTURES',
452
454
  },
453
455
  'networks': {
454
456
  'BEP20': 'BSC',
@@ -3654,7 +3656,11 @@ export default class coinex extends Exchange {
3654
3656
  * @param {string} [params.marginMode] 'cross' or 'isolated' for fetching spot margin orders
3655
3657
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3656
3658
  */
3657
- return await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
3659
+ const openOrders = await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
3660
+ for (let i = 0; i < openOrders.length; i++) {
3661
+ openOrders[i]['status'] = 'open';
3662
+ }
3663
+ return openOrders;
3658
3664
  }
3659
3665
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3660
3666
  /**
@@ -4886,43 +4892,45 @@ export default class coinex extends Exchange {
4886
4892
  * @method
4887
4893
  * @name coinex#transfer
4888
4894
  * @description transfer currency internally between wallets on the same account
4889
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account014_balance_contract_transfer
4890
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account013_margin_transfer
4895
+ * @see https://docs.coinex.com/api/v2/assets/transfer/http/transfer
4891
4896
  * @param {string} code unified currency code
4892
4897
  * @param {float} amount amount to transfer
4893
4898
  * @param {string} fromAccount account to transfer from
4894
4899
  * @param {string} toAccount account to transfer to
4895
4900
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4901
+ * @param {string} [params.symbol] unified ccxt symbol, required when either the fromAccount or toAccount is margin
4896
4902
  * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4897
4903
  */
4898
4904
  await this.loadMarkets();
4899
4905
  const currency = this.currency(code);
4900
4906
  const amountToPrecision = this.currencyToPrecision(code, amount);
4907
+ const accountsById = this.safeDict(this.options, 'accountsById', {});
4908
+ const fromId = this.safeString(accountsById, fromAccount, fromAccount);
4909
+ const toId = this.safeString(accountsById, toAccount, toAccount);
4901
4910
  const request = {
4911
+ 'ccy': currency['id'],
4902
4912
  'amount': amountToPrecision,
4903
- 'coin_type': currency['id'],
4913
+ 'from_account_type': fromId,
4914
+ 'to_account_type': toId,
4904
4915
  };
4905
- let response = undefined;
4906
- if ((fromAccount === 'spot') && (toAccount === 'swap')) {
4907
- request['transfer_side'] = 'in'; // 'in' spot to swap, 'out' swap to spot
4908
- response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
4909
- }
4910
- else if ((fromAccount === 'swap') && (toAccount === 'spot')) {
4911
- request['transfer_side'] = 'out'; // 'in' spot to swap, 'out' swap to spot
4912
- response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
4916
+ if ((fromAccount === 'margin') || (toAccount === 'margin')) {
4917
+ const symbol = this.safeString(params, 'symbol');
4918
+ if (symbol === undefined) {
4919
+ throw new ArgumentsRequired(this.id + ' transfer() the symbol parameter must be defined for a margin account');
4920
+ }
4921
+ params = this.omit(params, 'symbol');
4922
+ request['market'] = this.marketId(symbol);
4913
4923
  }
4914
- else {
4915
- const accountsById = this.safeValue(this.options, 'accountsById', {});
4916
- const fromId = this.safeString(accountsById, fromAccount, fromAccount);
4917
- const toId = this.safeString(accountsById, toAccount, toAccount);
4918
- // fromAccount and toAccount must be integers for margin transfers
4919
- // spot is 0, use fetchBalance() to find the margin account id
4920
- request['from_account'] = parseInt(fromId);
4921
- request['to_account'] = parseInt(toId);
4922
- response = await this.v1PrivatePostMarginTransfer(this.extend(request, params));
4924
+ if ((fromAccount !== 'spot') && (toAccount !== 'spot')) {
4925
+ throw new BadRequest(this.id + ' transfer() can only be between spot and swap, or spot and margin, either the fromAccount or toAccount must be spot');
4923
4926
  }
4927
+ const response = await this.v2PrivatePostAssetsTransfer(this.extend(request, params));
4924
4928
  //
4925
- // {"code": 0, "data": null, "message": "Success"}
4929
+ // {
4930
+ // "code": 0,
4931
+ // "data": {},
4932
+ // "message": "OK"
4933
+ // }
4926
4934
  //
4927
4935
  return this.extend(this.parseTransfer(response, currency), {
4928
4936
  'amount': this.parseNumber(amountToPrecision),
@@ -4934,67 +4942,24 @@ export default class coinex extends Exchange {
4934
4942
  const statuses = {
4935
4943
  '0': 'ok',
4936
4944
  'SUCCESS': 'ok',
4945
+ 'OK': 'ok',
4937
4946
  };
4938
4947
  return this.safeString(statuses, status, status);
4939
4948
  }
4940
4949
  parseTransfer(transfer, currency = undefined) {
4941
- //
4942
- // fetchTransfers Swap
4943
- //
4944
- // {
4945
- // "amount": "10",
4946
- // "asset": "USDT",
4947
- // "transfer_type": "transfer_out", // from swap to spot
4948
- // "created_at": 1651633422
4949
- // },
4950
- //
4951
- // fetchTransfers Margin
4952
- //
4953
- // {
4954
- // "id": 7580062,
4955
- // "updated_at": 1653684379,
4956
- // "user_id": 3620173,
4957
- // "from_account_id": 0,
4958
- // "to_account_id": 1,
4959
- // "asset": "BTC",
4960
- // "amount": "0.00160829",
4961
- // "balance": "0.00160829",
4962
- // "transfer_type": "IN",
4963
- // "status": "SUCCESS",
4964
- // "created_at": 1653684379
4965
- // },
4966
- //
4967
- const timestamp = this.safeTimestamp(transfer, 'created_at');
4968
- const transferType = this.safeString(transfer, 'transfer_type');
4969
- let fromAccount = undefined;
4970
- let toAccount = undefined;
4971
- if (transferType === 'transfer_out') {
4972
- fromAccount = 'swap';
4973
- toAccount = 'spot';
4974
- }
4975
- else if (transferType === 'transfer_in') {
4976
- fromAccount = 'spot';
4977
- toAccount = 'swap';
4978
- }
4979
- else if (transferType === 'IN') {
4980
- fromAccount = 'spot';
4981
- toAccount = 'margin';
4982
- }
4983
- else if (transferType === 'OUT') {
4984
- fromAccount = 'margin';
4985
- toAccount = 'spot';
4986
- }
4987
- const currencyId = this.safeString(transfer, 'asset');
4988
- const currencyCode = this.safeCurrencyCode(currencyId, currency);
4950
+ const timestamp = this.safeInteger(transfer, 'created_at');
4951
+ const currencyId = this.safeString(transfer, 'ccy');
4952
+ const fromId = this.safeString(transfer, 'from_account_type');
4953
+ const toId = this.safeString(transfer, 'to_account_type');
4954
+ const accountsById = this.safeValue(this.options, 'accountsById', {});
4989
4955
  return {
4990
- 'info': transfer,
4991
- 'id': this.safeString(transfer, 'id'),
4956
+ 'id': undefined,
4992
4957
  'timestamp': timestamp,
4993
4958
  'datetime': this.iso8601(timestamp),
4994
- 'currency': currencyCode,
4959
+ 'currency': this.safeCurrencyCode(currencyId, currency),
4995
4960
  'amount': this.safeNumber(transfer, 'amount'),
4996
- 'fromAccount': fromAccount,
4997
- 'toAccount': toAccount,
4961
+ 'fromAccount': this.safeString(accountsById, fromId, fromId),
4962
+ 'toAccount': this.safeString(accountsById, toId, toId),
4998
4963
  'status': this.parseTransferStatus(this.safeString2(transfer, 'code', 'status')),
4999
4964
  };
5000
4965
  }
package/js/src/kucoin.js CHANGED
@@ -4786,6 +4786,7 @@ export default class kucoin extends Exchange {
4786
4786
  const partnerSignature = this.hmac(this.encode(partnerPayload), this.encode(partnerSecret), sha256, 'base64');
4787
4787
  headers['KC-API-PARTNER-SIGN'] = partnerSignature;
4788
4788
  headers['KC-API-PARTNER'] = partnerId;
4789
+ headers['KC-API-PARTNER-VERIFY'] = 'true';
4789
4790
  }
4790
4791
  if (isBroker) {
4791
4792
  const brokerName = this.safeString(partner, 'name');
@@ -1126,7 +1126,7 @@ export default class bitget extends bitgetRest {
1126
1126
  // "executePrice": "35123", // this is limit price
1127
1127
  // "triggerType": "fill_price",
1128
1128
  // "planType": "amount",
1129
- // #### in case order had fill: ####
1129
+ // #### in case order had a partial fill: ####
1130
1130
  // fillPrice: '35123',
1131
1131
  // tradeId: '1171775539946528779',
1132
1132
  // baseVolume: '7', // field present in market order
@@ -1246,6 +1246,8 @@ export default class bitget extends bitgetRest {
1246
1246
  let totalAmount = undefined;
1247
1247
  let filledAmount = undefined;
1248
1248
  let cost = undefined;
1249
+ let remaining = undefined;
1250
+ const totalFilled = this.safeString(order, 'accBaseVolume');
1249
1251
  if (isSpot) {
1250
1252
  if (isMargin) {
1251
1253
  filledAmount = this.omitZero(this.safeString(order, 'fillTotalAmount'));
@@ -1253,7 +1255,13 @@ export default class bitget extends bitgetRest {
1253
1255
  cost = this.safeString(order, 'quoteSize');
1254
1256
  }
1255
1257
  else {
1256
- filledAmount = this.omitZero(this.safeString2(order, 'accBaseVolume', 'baseVolume'));
1258
+ const partialFillAmount = this.safeString(order, 'baseVolume');
1259
+ if (partialFillAmount !== undefined) {
1260
+ filledAmount = partialFillAmount;
1261
+ }
1262
+ else {
1263
+ filledAmount = totalFilled;
1264
+ }
1257
1265
  if (isMarketOrder) {
1258
1266
  if (isBuy) {
1259
1267
  totalAmount = accBaseVolume;
@@ -1276,6 +1284,7 @@ export default class bitget extends bitgetRest {
1276
1284
  totalAmount = this.safeString(order, 'size');
1277
1285
  cost = this.safeString(order, 'fillNotionalUsd');
1278
1286
  }
1287
+ remaining = this.omitZero(Precise.stringSub(totalAmount, totalFilled));
1279
1288
  return this.safeOrder({
1280
1289
  'info': order,
1281
1290
  'symbol': symbol,
@@ -1294,7 +1303,7 @@ export default class bitget extends bitgetRest {
1294
1303
  'cost': cost,
1295
1304
  'average': avgPrice,
1296
1305
  'filled': filledAmount,
1297
- 'remaining': undefined,
1306
+ 'remaining': remaining,
1298
1307
  'status': this.parseWsOrderStatus(rawStatus),
1299
1308
  'fee': feeObject,
1300
1309
  'trades': undefined,
@@ -1,7 +1,7 @@
1
- import coinbaseproRest from '../coinbasepro.js';
1
+ import coinbaseexchangeRest from '../coinbaseexchange.js';
2
2
  import type { Tickers, Int, Ticker, Str, Strings, OrderBook, Trade, Order } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
- export default class coinbasepro extends coinbaseproRest {
4
+ export default class coinbaseexchange extends coinbaseexchangeRest {
5
5
  describe(): any;
6
6
  authenticate(): {
7
7
  timestamp: number;
@@ -5,12 +5,12 @@
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
- import coinbaseproRest from '../coinbasepro.js';
8
+ import coinbaseexchangeRest from '../coinbaseexchange.js';
9
9
  import { AuthenticationError, ExchangeError, BadSymbol, BadRequest, ArgumentsRequired } from '../base/errors.js';
10
10
  import { ArrayCache, ArrayCacheBySymbolById } from '../base/ws/Cache.js';
11
11
  import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
12
12
  // ---------------------------------------------------------------------------
13
- export default class coinbasepro extends coinbaseproRest {
13
+ export default class coinbaseexchange extends coinbaseexchangeRest {
14
14
  describe() {
15
15
  return this.deepExtend(super.describe(), {
16
16
  'has': {
@@ -31,7 +31,7 @@ export default class coinbasepro extends coinbaseproRest {
31
31
  },
32
32
  'urls': {
33
33
  'api': {
34
- 'ws': 'wss://ws-feed.pro.coinbase.com',
34
+ 'ws': 'wss://ws-feed.exchange.coinbase.com',
35
35
  },
36
36
  'test': {
37
37
  'ws': 'wss://ws-feed-public.sandbox.exchange.coinbase.com',
@@ -112,7 +112,7 @@ export default class coinbasepro extends coinbaseproRest {
112
112
  async watchTicker(symbol, params = {}) {
113
113
  /**
114
114
  * @method
115
- * @name coinbasepro#watchTicker
115
+ * @name coinbaseexchange#watchTicker
116
116
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
117
117
  * @param {string} symbol unified symbol of the market to fetch the ticker for
118
118
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -124,7 +124,7 @@ export default class coinbasepro extends coinbaseproRest {
124
124
  async watchTickers(symbols = undefined, params = {}) {
125
125
  /**
126
126
  * @method
127
- * @name coinbasepro#watchTickers
127
+ * @name coinbaseexchange#watchTickers
128
128
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
129
129
  * @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
130
130
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -149,7 +149,7 @@ export default class coinbasepro extends coinbaseproRest {
149
149
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
150
150
  /**
151
151
  * @method
152
- * @name coinbasepro#watchTrades
152
+ * @name coinbaseexchange#watchTrades
153
153
  * @description get the list of most recent trades for a particular symbol
154
154
  * @param {string} symbol unified symbol of the market to fetch trades for
155
155
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -195,7 +195,7 @@ export default class coinbasepro extends coinbaseproRest {
195
195
  async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
196
196
  /**
197
197
  * @method
198
- * @name coinbasepro#watchMyTrades
198
+ * @name coinbaseexchange#watchMyTrades
199
199
  * @description watches information on multiple trades made by the user
200
200
  * @param {string} symbol unified market symbol of the market trades were made in
201
201
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -220,7 +220,7 @@ export default class coinbasepro extends coinbaseproRest {
220
220
  async watchMyTradesForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
221
221
  /**
222
222
  * @method
223
- * @name coinbasepro#watchMyTradesForSymbols
223
+ * @name coinbaseexchange#watchMyTradesForSymbols
224
224
  * @description watches information on multiple trades made by the user
225
225
  * @param {string[]} symbols unified symbol of the market to fetch trades for
226
226
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -244,7 +244,7 @@ export default class coinbasepro extends coinbaseproRest {
244
244
  async watchOrdersForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
245
245
  /**
246
246
  * @method
247
- * @name coinbasepro#watchOrdersForSymbols
247
+ * @name coinbaseexchange#watchOrdersForSymbols
248
248
  * @description watches information on multiple orders made by the user
249
249
  * @param {string[]} symbols unified symbol of the market to fetch orders for
250
250
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -268,7 +268,7 @@ export default class coinbasepro extends coinbaseproRest {
268
268
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
269
269
  /**
270
270
  * @method
271
- * @name coinbasepro#watchOrders
271
+ * @name coinbaseexchange#watchOrders
272
272
  * @description watches information on multiple orders made by the user
273
273
  * @param {string} symbol unified market symbol of the market orders were made in
274
274
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -293,7 +293,7 @@ export default class coinbasepro extends coinbaseproRest {
293
293
  async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
294
294
  /**
295
295
  * @method
296
- * @name coinbasepro#watchOrderBookForSymbols
296
+ * @name coinbaseexchange#watchOrderBookForSymbols
297
297
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
298
298
  * @param {string[]} symbols unified array of symbols
299
299
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -335,7 +335,7 @@ export default class coinbasepro extends coinbaseproRest {
335
335
  async watchOrderBook(symbol, limit = undefined, params = {}) {
336
336
  /**
337
337
  * @method
338
- * @name coinbasepro#watchOrderBook
338
+ * @name coinbaseexchange#watchOrderBook
339
339
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
340
340
  * @param {string} symbol unified symbol of the market to fetch the order book for
341
341
  * @param {int} [limit] the maximum amount of order book entries to return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.23",
3
+ "version": "4.3.24",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",