ccxt 4.2.16 → 4.2.17

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.
package/dist/cjs/ccxt.js CHANGED
@@ -169,7 +169,7 @@ var woo$1 = require('./src/pro/woo.js');
169
169
 
170
170
  //-----------------------------------------------------------------------------
171
171
  // this is updated by vss.js when building
172
- const version = '4.2.16';
172
+ const version = '4.2.17';
173
173
  Exchange["default"].ccxtVersion = version;
174
174
  const exchanges = {
175
175
  'ace': ace,
@@ -170,7 +170,7 @@ var woo$1 = require('./src/pro/woo.js');
170
170
 
171
171
  //-----------------------------------------------------------------------------
172
172
  // this is updated by vss.js when building
173
- const version = '4.2.15';
173
+ const version = '4.2.16';
174
174
  Exchange["default"].ccxtVersion = version;
175
175
  const exchanges = {
176
176
  'ace': ace,
@@ -222,6 +222,7 @@ class binance extends binance$1 {
222
222
  'margin/allPairs': 0.1,
223
223
  'margin/priceIndex': 1,
224
224
  // these endpoints require this.apiKey + this.secret
225
+ 'spot/delist-schedule': 0.1,
225
226
  'asset/assetDividend': 1,
226
227
  'asset/dribblet': 0.1,
227
228
  'asset/transfer': 0.1,
@@ -148,6 +148,9 @@ class coinlist extends coinlist$1 {
148
148
  'v1/symbols/{symbol}/auctions/{auction_code}': 1,
149
149
  'v1/time': 1,
150
150
  'v1/assets': 1,
151
+ 'v1/leaderboard': 1,
152
+ 'v1/affiliate/{competition_code}': 1,
153
+ 'v1/competition/{competition_id}': 1,
151
154
  },
152
155
  },
153
156
  'private': {
@@ -155,6 +158,7 @@ class coinlist extends coinlist$1 {
155
158
  'v1/fees': 1,
156
159
  'v1/accounts': 1,
157
160
  'v1/accounts/{trader_id}': 1,
161
+ 'v1/accounts/{trader_id}/alias': 1,
158
162
  'v1/accounts/{trader_id}/ledger': 1,
159
163
  'v1/accounts/{trader_id}/wallets': 1,
160
164
  'v1/accounts/{trader_id}/wallet-ledger': 1,
@@ -167,7 +171,9 @@ class coinlist extends coinlist$1 {
167
171
  'v1/balances': 1,
168
172
  'v1/transfers': 1,
169
173
  'v1/user': 1,
170
- 'v1/credits': 1, // not unified
174
+ 'v1/credits': 1,
175
+ 'v1/positions': 1,
176
+ 'v1/accounts/{trader_id}/competitions': 1,
171
177
  },
172
178
  'post': {
173
179
  'v1/keys': 1,
@@ -178,7 +184,9 @@ class coinlist extends coinlist$1 {
178
184
  'v1/transfers/from-wallet': 1,
179
185
  'v1/transfers/internal-transfer': 1,
180
186
  'v1/transfers/withdrawal-request': 1,
181
- 'v1/orders/bulk': 1, // not unified
187
+ 'v1/orders/bulk': 1,
188
+ 'v1/accounts/{trader_id}/competitions': 1,
189
+ 'v1/accounts/{trader_id}/create-competition': 1,
182
190
  },
183
191
  'patch': {
184
192
  'v1/orders/{order_id}': 1,
@@ -996,10 +996,10 @@ class coinsph extends coinsph$1 {
996
996
  'currency': this.safeCurrencyCode(feeCurrencyId),
997
997
  };
998
998
  }
999
- const isBuyer = this.safeString2(trade, 'isBuyer', 'isBuyerMaker', undefined);
999
+ const isBuyer = this.safeValue2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1000
1000
  let side = undefined;
1001
1001
  if (isBuyer !== undefined) {
1002
- side = (isBuyer === 'true') ? 'buy' : 'sell';
1002
+ side = (isBuyer === true) ? 'buy' : 'sell';
1003
1003
  }
1004
1004
  const isMaker = this.safeString2(trade, 'isMaker', undefined);
1005
1005
  let takerOrMaker = undefined;
@@ -1081,7 +1081,7 @@ class binance extends binance$1 {
1081
1081
  const isSpot = ((client.url.indexOf('/stream') > -1) || (client.url.indexOf('/testnet.binance') > -1));
1082
1082
  const marketType = (isSpot) ? 'spot' : 'contract';
1083
1083
  let rawTickers = [];
1084
- const newTickers = [];
1084
+ const newTickers = {};
1085
1085
  if (Array.isArray(message)) {
1086
1086
  rawTickers = message;
1087
1087
  }
@@ -1093,7 +1093,7 @@ class binance extends binance$1 {
1093
1093
  const result = this.parseWsTicker(ticker, marketType);
1094
1094
  const symbol = result['symbol'];
1095
1095
  this.tickers[symbol] = result;
1096
- newTickers.push(result);
1096
+ newTickers[symbol] = result;
1097
1097
  }
1098
1098
  const messageHashes = this.findMessageHashes(client, 'tickers::');
1099
1099
  for (let i = 0; i < messageHashes.length; i++) {
@@ -307,7 +307,8 @@ class hitbtc extends hitbtc$1 {
307
307
  'symbols': [market['id']],
308
308
  },
309
309
  };
310
- return await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
310
+ const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
311
+ return this.safeValue(result, symbol);
311
312
  }
312
313
  async watchTickers(symbols = undefined, params = {}) {
313
314
  /**
@@ -390,16 +391,16 @@ class hitbtc extends hitbtc$1 {
390
391
  const data = this.safeValue(message, 'data', {});
391
392
  const marketIds = Object.keys(data);
392
393
  const channel = this.safeString(message, 'ch');
393
- const newTickers = [];
394
+ const newTickers = {};
394
395
  for (let i = 0; i < marketIds.length; i++) {
395
396
  const marketId = marketIds[i];
396
397
  const market = this.safeMarket(marketId);
397
398
  const symbol = market['symbol'];
398
399
  const ticker = this.parseWsTicker(data[marketId], market);
399
400
  this.tickers[symbol] = ticker;
400
- newTickers.push(ticker);
401
+ newTickers[symbol] = ticker;
401
402
  const messageHash = channel + '::' + symbol;
402
- client.resolve(this.tickers[symbol], messageHash);
403
+ client.resolve(newTickers, messageHash);
403
404
  }
404
405
  const messageHashes = this.findMessageHashes(client, channel + '::');
405
406
  for (let i = 0; i < messageHashes.length; i++) {
@@ -258,7 +258,9 @@ class kucoin extends kucoin$1 {
258
258
  const messageHash = 'ticker:' + symbol;
259
259
  client.resolve(ticker, messageHash);
260
260
  // watchTickers
261
- client.resolve(ticker, 'tickers');
261
+ const allTickers = {};
262
+ allTickers[symbol] = ticker;
263
+ client.resolve(allTickers, 'tickers');
262
264
  const messageHashes = this.findMessageHashes(client, 'tickers::');
263
265
  for (let i = 0; i < messageHashes.length; i++) {
264
266
  const currentMessageHash = messageHashes[i];
@@ -940,7 +940,7 @@ class poloniex extends poloniex$1 {
940
940
  // }
941
941
  //
942
942
  const data = this.safeValue(message, 'data', []);
943
- const newTickers = [];
943
+ const newTickers = {};
944
944
  for (let i = 0; i < data.length; i++) {
945
945
  const item = data[i];
946
946
  const marketId = this.safeString(item, 'symbol');
@@ -948,7 +948,7 @@ class poloniex extends poloniex$1 {
948
948
  const ticker = this.parseTicker(item);
949
949
  const symbol = ticker['symbol'];
950
950
  this.tickers[symbol] = ticker;
951
- newTickers.push(ticker);
951
+ newTickers[symbol] = ticker;
952
952
  }
953
953
  }
954
954
  const messageHashes = this.findMessageHashes(client, 'ticker::');
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.15";
7
+ declare const version = "4.2.16";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.16';
41
+ const version = '4.2.17';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -8,6 +8,7 @@ interface Exchange {
8
8
  sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
9
9
  sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
10
10
  sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
11
+ sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
11
12
  sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
12
13
  sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
13
14
  sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -8,6 +8,7 @@ interface binance {
8
8
  sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
9
9
  sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
10
10
  sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
11
+ sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
11
12
  sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
12
13
  sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
13
14
  sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -8,6 +8,7 @@ interface binance {
8
8
  sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
9
9
  sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
10
10
  sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
11
+ sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
11
12
  sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
12
13
  sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
13
14
  sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -8,6 +8,7 @@ interface binance {
8
8
  sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
9
9
  sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
10
10
  sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
11
+ sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
11
12
  sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
12
13
  sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
13
14
  sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -12,9 +12,13 @@ interface Exchange {
12
12
  publicGetV1SymbolsSymbolAuctionsAuctionCode(params?: {}): Promise<implicitReturnType>;
13
13
  publicGetV1Time(params?: {}): Promise<implicitReturnType>;
14
14
  publicGetV1Assets(params?: {}): Promise<implicitReturnType>;
15
+ publicGetV1Leaderboard(params?: {}): Promise<implicitReturnType>;
16
+ publicGetV1AffiliateCompetitionCode(params?: {}): Promise<implicitReturnType>;
17
+ publicGetV1CompetitionCompetitionId(params?: {}): Promise<implicitReturnType>;
15
18
  privateGetV1Fees(params?: {}): Promise<implicitReturnType>;
16
19
  privateGetV1Accounts(params?: {}): Promise<implicitReturnType>;
17
20
  privateGetV1AccountsTraderId(params?: {}): Promise<implicitReturnType>;
21
+ privateGetV1AccountsTraderIdAlias(params?: {}): Promise<implicitReturnType>;
18
22
  privateGetV1AccountsTraderIdLedger(params?: {}): Promise<implicitReturnType>;
19
23
  privateGetV1AccountsTraderIdWallets(params?: {}): Promise<implicitReturnType>;
20
24
  privateGetV1AccountsTraderIdWalletLedger(params?: {}): Promise<implicitReturnType>;
@@ -28,6 +32,8 @@ interface Exchange {
28
32
  privateGetV1Transfers(params?: {}): Promise<implicitReturnType>;
29
33
  privateGetV1User(params?: {}): Promise<implicitReturnType>;
30
34
  privateGetV1Credits(params?: {}): Promise<implicitReturnType>;
35
+ privateGetV1Positions(params?: {}): Promise<implicitReturnType>;
36
+ privateGetV1AccountsTraderIdCompetitions(params?: {}): Promise<implicitReturnType>;
31
37
  privatePostV1Keys(params?: {}): Promise<implicitReturnType>;
32
38
  privatePostV1Orders(params?: {}): Promise<implicitReturnType>;
33
39
  privatePostV1OrdersCancelAllAfter(params?: {}): Promise<implicitReturnType>;
@@ -37,6 +43,8 @@ interface Exchange {
37
43
  privatePostV1TransfersInternalTransfer(params?: {}): Promise<implicitReturnType>;
38
44
  privatePostV1TransfersWithdrawalRequest(params?: {}): Promise<implicitReturnType>;
39
45
  privatePostV1OrdersBulk(params?: {}): Promise<implicitReturnType>;
46
+ privatePostV1AccountsTraderIdCompetitions(params?: {}): Promise<implicitReturnType>;
47
+ privatePostV1AccountsTraderIdCreateCompetition(params?: {}): Promise<implicitReturnType>;
40
48
  privatePatchV1OrdersOrderId(params?: {}): Promise<implicitReturnType>;
41
49
  privatePatchV1OrdersBulk(params?: {}): Promise<implicitReturnType>;
42
50
  privateDeleteV1KeysKey(params?: {}): Promise<implicitReturnType>;
package/js/src/binance.js CHANGED
@@ -225,6 +225,7 @@ export default class binance extends Exchange {
225
225
  'margin/allPairs': 0.1,
226
226
  'margin/priceIndex': 1,
227
227
  // these endpoints require this.apiKey + this.secret
228
+ 'spot/delist-schedule': 0.1,
228
229
  'asset/assetDividend': 1,
229
230
  'asset/dribblet': 0.1,
230
231
  'asset/transfer': 0.1,
@@ -151,6 +151,9 @@ export default class coinlist extends Exchange {
151
151
  'v1/symbols/{symbol}/auctions/{auction_code}': 1,
152
152
  'v1/time': 1,
153
153
  'v1/assets': 1,
154
+ 'v1/leaderboard': 1,
155
+ 'v1/affiliate/{competition_code}': 1,
156
+ 'v1/competition/{competition_id}': 1,
154
157
  },
155
158
  },
156
159
  'private': {
@@ -158,6 +161,7 @@ export default class coinlist extends Exchange {
158
161
  'v1/fees': 1,
159
162
  'v1/accounts': 1,
160
163
  'v1/accounts/{trader_id}': 1,
164
+ 'v1/accounts/{trader_id}/alias': 1,
161
165
  'v1/accounts/{trader_id}/ledger': 1,
162
166
  'v1/accounts/{trader_id}/wallets': 1,
163
167
  'v1/accounts/{trader_id}/wallet-ledger': 1,
@@ -170,7 +174,9 @@ export default class coinlist extends Exchange {
170
174
  'v1/balances': 1,
171
175
  'v1/transfers': 1,
172
176
  'v1/user': 1,
173
- 'v1/credits': 1, // not unified
177
+ 'v1/credits': 1,
178
+ 'v1/positions': 1,
179
+ 'v1/accounts/{trader_id}/competitions': 1,
174
180
  },
175
181
  'post': {
176
182
  'v1/keys': 1,
@@ -181,7 +187,9 @@ export default class coinlist extends Exchange {
181
187
  'v1/transfers/from-wallet': 1,
182
188
  'v1/transfers/internal-transfer': 1,
183
189
  'v1/transfers/withdrawal-request': 1,
184
- 'v1/orders/bulk': 1, // not unified
190
+ 'v1/orders/bulk': 1,
191
+ 'v1/accounts/{trader_id}/competitions': 1,
192
+ 'v1/accounts/{trader_id}/create-competition': 1,
185
193
  },
186
194
  'patch': {
187
195
  'v1/orders/{order_id}': 1,
package/js/src/coinsph.js CHANGED
@@ -999,10 +999,10 @@ export default class coinsph extends Exchange {
999
999
  'currency': this.safeCurrencyCode(feeCurrencyId),
1000
1000
  };
1001
1001
  }
1002
- const isBuyer = this.safeString2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1002
+ const isBuyer = this.safeValue2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1003
1003
  let side = undefined;
1004
1004
  if (isBuyer !== undefined) {
1005
- side = (isBuyer === 'true') ? 'buy' : 'sell';
1005
+ side = (isBuyer === true) ? 'buy' : 'sell';
1006
1006
  }
1007
1007
  const isMaker = this.safeString2(trade, 'isMaker', undefined);
1008
1008
  let takerOrMaker = undefined;
@@ -1084,7 +1084,7 @@ export default class binance extends binanceRest {
1084
1084
  const isSpot = ((client.url.indexOf('/stream') > -1) || (client.url.indexOf('/testnet.binance') > -1));
1085
1085
  const marketType = (isSpot) ? 'spot' : 'contract';
1086
1086
  let rawTickers = [];
1087
- const newTickers = [];
1087
+ const newTickers = {};
1088
1088
  if (Array.isArray(message)) {
1089
1089
  rawTickers = message;
1090
1090
  }
@@ -1096,7 +1096,7 @@ export default class binance extends binanceRest {
1096
1096
  const result = this.parseWsTicker(ticker, marketType);
1097
1097
  const symbol = result['symbol'];
1098
1098
  this.tickers[symbol] = result;
1099
- newTickers.push(result);
1099
+ newTickers[symbol] = result;
1100
1100
  }
1101
1101
  const messageHashes = this.findMessageHashes(client, 'tickers::');
1102
1102
  for (let i = 0; i < messageHashes.length; i++) {
@@ -310,7 +310,8 @@ export default class hitbtc extends hitbtcRest {
310
310
  'symbols': [market['id']],
311
311
  },
312
312
  };
313
- return await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
313
+ const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
314
+ return this.safeValue(result, symbol);
314
315
  }
315
316
  async watchTickers(symbols = undefined, params = {}) {
316
317
  /**
@@ -393,16 +394,16 @@ export default class hitbtc extends hitbtcRest {
393
394
  const data = this.safeValue(message, 'data', {});
394
395
  const marketIds = Object.keys(data);
395
396
  const channel = this.safeString(message, 'ch');
396
- const newTickers = [];
397
+ const newTickers = {};
397
398
  for (let i = 0; i < marketIds.length; i++) {
398
399
  const marketId = marketIds[i];
399
400
  const market = this.safeMarket(marketId);
400
401
  const symbol = market['symbol'];
401
402
  const ticker = this.parseWsTicker(data[marketId], market);
402
403
  this.tickers[symbol] = ticker;
403
- newTickers.push(ticker);
404
+ newTickers[symbol] = ticker;
404
405
  const messageHash = channel + '::' + symbol;
405
- client.resolve(this.tickers[symbol], messageHash);
406
+ client.resolve(newTickers, messageHash);
406
407
  }
407
408
  const messageHashes = this.findMessageHashes(client, channel + '::');
408
409
  for (let i = 0; i < messageHashes.length; i++) {
@@ -261,7 +261,9 @@ export default class kucoin extends kucoinRest {
261
261
  const messageHash = 'ticker:' + symbol;
262
262
  client.resolve(ticker, messageHash);
263
263
  // watchTickers
264
- client.resolve(ticker, 'tickers');
264
+ const allTickers = {};
265
+ allTickers[symbol] = ticker;
266
+ client.resolve(allTickers, 'tickers');
265
267
  const messageHashes = this.findMessageHashes(client, 'tickers::');
266
268
  for (let i = 0; i < messageHashes.length; i++) {
267
269
  const currentMessageHash = messageHashes[i];
@@ -943,7 +943,7 @@ export default class poloniex extends poloniexRest {
943
943
  // }
944
944
  //
945
945
  const data = this.safeValue(message, 'data', []);
946
- const newTickers = [];
946
+ const newTickers = {};
947
947
  for (let i = 0; i < data.length; i++) {
948
948
  const item = data[i];
949
949
  const marketId = this.safeString(item, 'symbol');
@@ -951,7 +951,7 @@ export default class poloniex extends poloniexRest {
951
951
  const ticker = this.parseTicker(item);
952
952
  const symbol = ticker['symbol'];
953
953
  this.tickers[symbol] = ticker;
954
- newTickers.push(ticker);
954
+ newTickers[symbol] = ticker;
955
955
  }
956
956
  }
957
957
  const messageHashes = this.findMessageHashes(client, 'ticker::');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.16",
3
+ "version": "4.2.17",
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",