ccxt 4.4.82 → 4.4.86
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/README.md +6 -9
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +6 -17
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/apex.js +2 -1
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +15 -2
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bitget.js +6 -7
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitrue.js +14 -35
- package/dist/cjs/src/bitso.js +33 -0
- package/dist/cjs/src/bitstamp.js +33 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/blofin.js +154 -13
- package/dist/cjs/src/btcbox.js +25 -5
- package/dist/cjs/src/bybit.js +16 -40
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbase.js +58 -46
- package/dist/cjs/src/coinbaseexchange.js +142 -32
- package/dist/cjs/src/coincatch.js +14 -67
- package/dist/cjs/src/coinex.js +29 -32
- package/dist/cjs/src/coinlist.js +16 -15
- package/dist/cjs/src/coinmetro.js +22 -11
- package/dist/cjs/src/coinone.js +8 -10
- package/dist/cjs/src/coinsph.js +126 -1
- package/dist/cjs/src/cryptocom.js +111 -1
- package/dist/cjs/src/cryptomus.js +43 -89
- package/dist/cjs/src/delta.js +76 -36
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +46 -10
- package/dist/cjs/src/ellipx.js +175 -79
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gemini.js +3 -5
- package/dist/cjs/src/hitbtc.js +56 -69
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +20 -44
- package/dist/cjs/src/hyperliquid.js +6 -6
- package/dist/cjs/src/kraken.js +29 -24
- package/dist/cjs/src/kucoinfutures.js +6 -0
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +9 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +124 -4
- package/dist/cjs/src/pro/binance.js +32 -33
- package/dist/cjs/src/pro/bithumb.js +5 -3
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/kraken.js +289 -79
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +304 -7
- package/dist/cjs/src/pro/poloniex.js +6 -2
- package/examples/js/cli.js +127 -13
- package/js/ccxt.d.ts +8 -20
- package/js/ccxt.js +6 -14
- package/js/src/abstract/blofin.d.ts +8 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/apex.js +2 -1
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.d.ts +15 -1
- package/js/src/base/Exchange.js +15 -2
- package/js/src/base/types.d.ts +3 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bitget.js +6 -7
- package/js/src/bitmart.js +1 -1
- package/js/src/bitrue.js +14 -35
- package/js/src/bitso.js +33 -0
- package/js/src/bitstamp.js +33 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/blofin.d.ts +42 -2
- package/js/src/blofin.js +154 -13
- package/js/src/btcbox.js +25 -5
- package/js/src/bybit.js +16 -40
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.js +58 -46
- package/js/src/coinbaseexchange.js +142 -32
- package/js/src/coincatch.js +14 -67
- package/js/src/coinex.js +28 -29
- package/js/src/coinlist.js +16 -15
- package/js/src/coinmetro.js +22 -11
- package/js/src/coinone.js +8 -10
- package/js/src/coinsph.d.ts +10 -1
- package/js/src/coinsph.js +126 -1
- package/js/src/cryptocom.d.ts +10 -1
- package/js/src/cryptocom.js +111 -1
- package/js/src/cryptomus.js +43 -89
- package/js/src/delta.js +76 -36
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +46 -10
- package/js/src/ellipx.d.ts +2 -3
- package/js/src/ellipx.js +175 -80
- package/js/src/gate.js +1 -1
- package/js/src/gemini.js +3 -5
- package/js/src/hitbtc.js +56 -69
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +20 -44
- package/js/src/hyperliquid.js +6 -6
- package/js/src/kraken.js +29 -24
- package/js/src/kucoinfutures.d.ts +1 -0
- package/js/src/kucoinfutures.js +6 -0
- package/js/src/lbank.js +1 -1
- package/js/src/mexc.js +2 -2
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.js +9 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.d.ts +12 -1
- package/js/src/paradex.js +124 -4
- package/js/src/pro/binance.d.ts +26 -26
- package/js/src/pro/binance.js +32 -33
- package/js/src/pro/bithumb.js +5 -3
- package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
- package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
- package/js/src/pro/kraken.d.ts +7 -6
- package/js/src/pro/kraken.js +290 -80
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.d.ts +58 -0
- package/js/src/pro/mexc.js +304 -7
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -2
- package/package.json +1 -1
- package/js/src/abstract/bl3p.d.ts +0 -22
- package/js/src/abstract/huobijp.js +0 -11
- package/js/src/abstract/idex.d.ts +0 -29
- package/js/src/abstract/idex.js +0 -11
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/abstract/kuna.js +0 -11
- package/js/src/bl3p.d.ts +0 -116
- package/js/src/bl3p.js +0 -552
- package/js/src/idex.d.ts +0 -312
- package/js/src/idex.js +0 -1961
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- package/js/src/pro/idex.d.ts +0 -81
- package/js/src/pro/idex.js +0 -720
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{bl3p.js → bittrade.js} +0 -0
package/js/src/paradex.js
CHANGED
|
@@ -75,6 +75,7 @@ export default class paradex extends Exchange {
|
|
|
75
75
|
'fetchFundingRate': false,
|
|
76
76
|
'fetchFundingRateHistory': false,
|
|
77
77
|
'fetchFundingRates': false,
|
|
78
|
+
'fetchGreeks': true,
|
|
78
79
|
'fetchIndexOHLCV': false,
|
|
79
80
|
'fetchIsolatedBorrowRate': false,
|
|
80
81
|
'fetchIsolatedBorrowRates': false,
|
|
@@ -557,15 +558,16 @@ export default class paradex extends Exchange {
|
|
|
557
558
|
let expiry = this.safeInteger(market, 'expiry_at');
|
|
558
559
|
const optionType = this.safeString(market, 'option_type');
|
|
559
560
|
const strikePrice = this.safeString(market, 'strike_price');
|
|
561
|
+
const takerFee = this.parseNumber('0.0003');
|
|
562
|
+
let makerFee = this.parseNumber('-0.00005');
|
|
560
563
|
if (isOption) {
|
|
561
564
|
const optionTypeSuffix = (optionType === 'CALL') ? 'C' : 'P';
|
|
562
565
|
symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix;
|
|
566
|
+
makerFee = this.parseNumber('0.0003');
|
|
563
567
|
}
|
|
564
568
|
else {
|
|
565
569
|
expiry = undefined;
|
|
566
570
|
}
|
|
567
|
-
const takerFee = this.parseNumber('0.0003');
|
|
568
|
-
const makerFee = this.parseNumber('-0.00005');
|
|
569
571
|
return this.safeMarketStructure({
|
|
570
572
|
'id': marketId,
|
|
571
573
|
'symbol': symbol,
|
|
@@ -1258,7 +1260,11 @@ export default class paradex extends Exchange {
|
|
|
1258
1260
|
const price = this.safeString(order, 'price');
|
|
1259
1261
|
const amount = this.safeString(order, 'size');
|
|
1260
1262
|
const orderType = this.safeString(order, 'type');
|
|
1261
|
-
const
|
|
1263
|
+
const cancelReason = this.safeString(order, 'cancel_reason');
|
|
1264
|
+
let status = this.safeString(order, 'status');
|
|
1265
|
+
if (cancelReason !== undefined) {
|
|
1266
|
+
status = 'canceled';
|
|
1267
|
+
}
|
|
1262
1268
|
const side = this.safeStringLower(order, 'side');
|
|
1263
1269
|
const average = this.omitZero(this.safeString(order, 'avg_fill_price'));
|
|
1264
1270
|
const remaining = this.omitZero(this.safeString(order, 'remaining_size'));
|
|
@@ -1278,7 +1284,7 @@ export default class paradex extends Exchange {
|
|
|
1278
1284
|
'status': this.parseOrderStatus(status),
|
|
1279
1285
|
'symbol': symbol,
|
|
1280
1286
|
'type': this.parseOrderType(orderType),
|
|
1281
|
-
'timeInForce': this.parseTimeInForce(this.safeString(order, '
|
|
1287
|
+
'timeInForce': this.parseTimeInForce(this.safeString(order, 'instruction')),
|
|
1282
1288
|
'postOnly': undefined,
|
|
1283
1289
|
'reduceOnly': reduceOnly,
|
|
1284
1290
|
'side': side,
|
|
@@ -2348,6 +2354,120 @@ export default class paradex extends Exchange {
|
|
|
2348
2354
|
};
|
|
2349
2355
|
return await this.privatePostAccountMarginMarket(this.extend(request, params));
|
|
2350
2356
|
}
|
|
2357
|
+
/**
|
|
2358
|
+
* @method
|
|
2359
|
+
* @name paradex#fetchGreeks
|
|
2360
|
+
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
2361
|
+
* @see https://docs.api.testnet.paradex.trade/#list-available-markets-summary
|
|
2362
|
+
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
2363
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2364
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
2365
|
+
*/
|
|
2366
|
+
async fetchGreeks(symbol, params = {}) {
|
|
2367
|
+
await this.loadMarkets();
|
|
2368
|
+
const market = this.market(symbol);
|
|
2369
|
+
const request = {
|
|
2370
|
+
'market': market['id'],
|
|
2371
|
+
};
|
|
2372
|
+
const response = await this.publicGetMarketsSummary(this.extend(request, params));
|
|
2373
|
+
//
|
|
2374
|
+
// {
|
|
2375
|
+
// "results": [
|
|
2376
|
+
// {
|
|
2377
|
+
// "symbol": "BTC-USD-114000-P",
|
|
2378
|
+
// "mark_price": "10835.66892602",
|
|
2379
|
+
// "mark_iv": "0.71781855",
|
|
2380
|
+
// "delta": "-0.98726024",
|
|
2381
|
+
// "greeks": {
|
|
2382
|
+
// "delta": "-0.9872602390817709",
|
|
2383
|
+
// "gamma": "0.000004560958862297231",
|
|
2384
|
+
// "vega": "227.11344863639806",
|
|
2385
|
+
// "rho": "-302.0617972461581",
|
|
2386
|
+
// "vanna": "0.06609830491614832",
|
|
2387
|
+
// "volga": "925.9501532805552"
|
|
2388
|
+
// },
|
|
2389
|
+
// "last_traded_price": "10551.5",
|
|
2390
|
+
// "bid": "10794.9",
|
|
2391
|
+
// "bid_iv": "0.05",
|
|
2392
|
+
// "ask": "10887.3",
|
|
2393
|
+
// "ask_iv": "0.8783283",
|
|
2394
|
+
// "last_iv": "0.05",
|
|
2395
|
+
// "volume_24h": "0",
|
|
2396
|
+
// "total_volume": "195240.72672261014",
|
|
2397
|
+
// "created_at": 1747644009995,
|
|
2398
|
+
// "underlying_price": "103164.79162649",
|
|
2399
|
+
// "open_interest": "0",
|
|
2400
|
+
// "funding_rate": "0.000004464241170536191",
|
|
2401
|
+
// "price_change_rate_24h": "0.074915",
|
|
2402
|
+
// "future_funding_rate": "0.0001"
|
|
2403
|
+
// }
|
|
2404
|
+
// ]
|
|
2405
|
+
// }
|
|
2406
|
+
//
|
|
2407
|
+
const data = this.safeList(response, 'results', []);
|
|
2408
|
+
const greeks = this.safeDict(data, 0, {});
|
|
2409
|
+
return this.parseGreeks(greeks, market);
|
|
2410
|
+
}
|
|
2411
|
+
parseGreeks(greeks, market = undefined) {
|
|
2412
|
+
//
|
|
2413
|
+
// {
|
|
2414
|
+
// "symbol": "BTC-USD-114000-P",
|
|
2415
|
+
// "mark_price": "10835.66892602",
|
|
2416
|
+
// "mark_iv": "0.71781855",
|
|
2417
|
+
// "delta": "-0.98726024",
|
|
2418
|
+
// "greeks": {
|
|
2419
|
+
// "delta": "-0.9872602390817709",
|
|
2420
|
+
// "gamma": "0.000004560958862297231",
|
|
2421
|
+
// "vega": "227.11344863639806",
|
|
2422
|
+
// "rho": "-302.0617972461581",
|
|
2423
|
+
// "vanna": "0.06609830491614832",
|
|
2424
|
+
// "volga": "925.9501532805552"
|
|
2425
|
+
// },
|
|
2426
|
+
// "last_traded_price": "10551.5",
|
|
2427
|
+
// "bid": "10794.9",
|
|
2428
|
+
// "bid_iv": "0.05",
|
|
2429
|
+
// "ask": "10887.3",
|
|
2430
|
+
// "ask_iv": "0.8783283",
|
|
2431
|
+
// "last_iv": "0.05",
|
|
2432
|
+
// "volume_24h": "0",
|
|
2433
|
+
// "total_volume": "195240.72672261014",
|
|
2434
|
+
// "created_at": 1747644009995,
|
|
2435
|
+
// "underlying_price": "103164.79162649",
|
|
2436
|
+
// "open_interest": "0",
|
|
2437
|
+
// "funding_rate": "0.000004464241170536191",
|
|
2438
|
+
// "price_change_rate_24h": "0.074915",
|
|
2439
|
+
// "future_funding_rate": "0.0001"
|
|
2440
|
+
// }
|
|
2441
|
+
//
|
|
2442
|
+
const marketId = this.safeString(greeks, 'symbol');
|
|
2443
|
+
market = this.safeMarket(marketId, market, undefined, 'option');
|
|
2444
|
+
const symbol = market['symbol'];
|
|
2445
|
+
const timestamp = this.safeInteger(greeks, 'created_at');
|
|
2446
|
+
const greeksData = this.safeDict(greeks, 'greeks', {});
|
|
2447
|
+
return {
|
|
2448
|
+
'symbol': symbol,
|
|
2449
|
+
'timestamp': timestamp,
|
|
2450
|
+
'datetime': this.iso8601(timestamp),
|
|
2451
|
+
'delta': this.safeNumber(greeksData, 'delta'),
|
|
2452
|
+
'gamma': this.safeNumber(greeksData, 'gamma'),
|
|
2453
|
+
'theta': undefined,
|
|
2454
|
+
'vega': this.safeNumber(greeksData, 'vega'),
|
|
2455
|
+
'rho': this.safeNumber(greeksData, 'rho'),
|
|
2456
|
+
'vanna': this.safeNumber(greeksData, 'vanna'),
|
|
2457
|
+
'volga': this.safeNumber(greeksData, 'volga'),
|
|
2458
|
+
'bidSize': undefined,
|
|
2459
|
+
'askSize': undefined,
|
|
2460
|
+
'bidImpliedVolatility': this.safeNumber(greeks, 'bid_iv'),
|
|
2461
|
+
'askImpliedVolatility': this.safeNumber(greeks, 'ask_iv'),
|
|
2462
|
+
'markImpliedVolatility': this.safeNumber(greeks, 'mark_iv'),
|
|
2463
|
+
'bidPrice': this.safeNumber(greeks, 'bid'),
|
|
2464
|
+
'askPrice': this.safeNumber(greeks, 'ask'),
|
|
2465
|
+
'markPrice': this.safeNumber(greeks, 'mark_price'),
|
|
2466
|
+
'lastPrice': this.safeNumber(greeks, 'last_traded_price'),
|
|
2467
|
+
'underlyingPrice': this.safeNumber(greeks, 'underlying_price'),
|
|
2468
|
+
'info': greeks,
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2351
2471
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
2352
2472
|
let url = this.implodeHostname(this.urls['api'][this.version]) + '/' + this.implodeParams(path, params);
|
|
2353
2473
|
const query = this.omit(params, this.extractParams(path));
|
package/js/src/pro/binance.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ export default class binance extends binanceRest {
|
|
|
271
271
|
* @method
|
|
272
272
|
* @name binance#fetchOrderBookWs
|
|
273
273
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
274
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
274
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book
|
|
275
275
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
|
|
276
276
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
277
277
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -292,8 +292,8 @@ export default class binance extends binanceRest {
|
|
|
292
292
|
* @method
|
|
293
293
|
* @name binance#watchTradesForSymbols
|
|
294
294
|
* @description get the list of most recent trades for a list of symbols
|
|
295
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
296
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
295
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
296
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
297
297
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
298
298
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
299
299
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
@@ -308,8 +308,8 @@ export default class binance extends binanceRest {
|
|
|
308
308
|
* @method
|
|
309
309
|
* @name binance#unWatchTradesForSymbols
|
|
310
310
|
* @description unsubscribes from the trades channel
|
|
311
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
312
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
311
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
312
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
313
313
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
314
314
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
315
315
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
@@ -322,8 +322,8 @@ export default class binance extends binanceRest {
|
|
|
322
322
|
* @method
|
|
323
323
|
* @name binance#unWatchTrades
|
|
324
324
|
* @description unsubscribes from the trades channel
|
|
325
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
326
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
325
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
326
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
327
327
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
328
328
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
329
329
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -336,8 +336,8 @@ export default class binance extends binanceRest {
|
|
|
336
336
|
* @method
|
|
337
337
|
* @name binance#watchTrades
|
|
338
338
|
* @description get the list of most recent trades for a particular symbol
|
|
339
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
340
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
339
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
340
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
341
341
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
342
342
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
343
343
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -354,7 +354,7 @@ export default class binance extends binanceRest {
|
|
|
354
354
|
* @method
|
|
355
355
|
* @name binance#watchOHLCV
|
|
356
356
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
357
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
357
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
358
358
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
359
359
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
360
360
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -370,7 +370,7 @@ export default class binance extends binanceRest {
|
|
|
370
370
|
* @method
|
|
371
371
|
* @name binance#watchOHLCVForSymbols
|
|
372
372
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
373
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
373
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
374
374
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
375
375
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
376
376
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
@@ -385,7 +385,7 @@ export default class binance extends binanceRest {
|
|
|
385
385
|
* @method
|
|
386
386
|
* @name binance#unWatchOHLCVForSymbols
|
|
387
387
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
388
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
388
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
389
389
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
390
390
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
391
391
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
@@ -398,7 +398,7 @@ export default class binance extends binanceRest {
|
|
|
398
398
|
* @method
|
|
399
399
|
* @name binance#unWatchOHLCV
|
|
400
400
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
401
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
401
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
402
402
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
403
403
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
404
404
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -424,7 +424,7 @@ export default class binance extends binanceRest {
|
|
|
424
424
|
* @method
|
|
425
425
|
* @name binance#fetchOHLCVWs
|
|
426
426
|
* @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
427
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
427
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
428
428
|
* @param {string} symbol unified symbol of the market to query OHLCV data for
|
|
429
429
|
* @param {string} timeframe the length of time each candle represents
|
|
430
430
|
* @param {int} since timestamp in ms of the earliest candle to fetch
|
|
@@ -525,7 +525,7 @@ export default class binance extends binanceRest {
|
|
|
525
525
|
* @method
|
|
526
526
|
* @name binance#watchBidsAsks
|
|
527
527
|
* @description watches best bid & ask for symbols
|
|
528
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
528
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker
|
|
529
529
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
530
530
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
531
531
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
@@ -550,7 +550,7 @@ export default class binance extends binanceRest {
|
|
|
550
550
|
* @name binance#fetchBalanceWs
|
|
551
551
|
* @description fetch balance and get the amount of funds available for trading or funds locked in orders
|
|
552
552
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
|
|
553
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
553
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data
|
|
554
554
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
|
|
555
555
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
556
556
|
* @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
|
|
@@ -601,7 +601,7 @@ export default class binance extends binanceRest {
|
|
|
601
601
|
* @method
|
|
602
602
|
* @name binance#createOrderWs
|
|
603
603
|
* @description create a trade order
|
|
604
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
604
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade
|
|
605
605
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
|
|
606
606
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
|
|
607
607
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -621,7 +621,7 @@ export default class binance extends binanceRest {
|
|
|
621
621
|
* @method
|
|
622
622
|
* @name binance#editOrderWs
|
|
623
623
|
* @description edit a trade order
|
|
624
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
624
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade
|
|
625
625
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
|
|
626
626
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
|
|
627
627
|
* @param {string} id order id
|
|
@@ -639,7 +639,7 @@ export default class binance extends binanceRest {
|
|
|
639
639
|
* @method
|
|
640
640
|
* @name binance#cancelOrderWs
|
|
641
641
|
* @description cancel multiple orders
|
|
642
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
642
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade
|
|
643
643
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
|
|
644
644
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
|
|
645
645
|
* @param {string} id order id
|
|
@@ -653,7 +653,7 @@ export default class binance extends binanceRest {
|
|
|
653
653
|
* @method
|
|
654
654
|
* @name binance#cancelAllOrdersWs
|
|
655
655
|
* @description cancel all open orders in a market
|
|
656
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
656
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade
|
|
657
657
|
* @param {string} [symbol] unified market symbol of the market to cancel orders in
|
|
658
658
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
659
659
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -663,7 +663,7 @@ export default class binance extends binanceRest {
|
|
|
663
663
|
* @method
|
|
664
664
|
* @name binance#fetchOrderWs
|
|
665
665
|
* @description fetches information on an order made by the user
|
|
666
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
666
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-user_data
|
|
667
667
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
|
|
668
668
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
|
|
669
669
|
* @param {string} id order id
|
|
@@ -676,7 +676,7 @@ export default class binance extends binanceRest {
|
|
|
676
676
|
* @method
|
|
677
677
|
* @name binance#fetchOrdersWs
|
|
678
678
|
* @description fetches information on multiple orders made by the user
|
|
679
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
679
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
|
|
680
680
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
681
681
|
* @param {int|undefined} [since] the earliest time in ms to fetch orders for
|
|
682
682
|
* @param {int|undefined} [limit] the maximum number of order structures to retrieve
|
|
@@ -692,7 +692,7 @@ export default class binance extends binanceRest {
|
|
|
692
692
|
* @method
|
|
693
693
|
* @name binance#fetchClosedOrdersWs
|
|
694
694
|
* @description fetch closed orders
|
|
695
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
695
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
|
|
696
696
|
* @param {string} symbol unified market symbol
|
|
697
697
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
698
698
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -704,7 +704,7 @@ export default class binance extends binanceRest {
|
|
|
704
704
|
* @method
|
|
705
705
|
* @name binance#fetchOpenOrdersWs
|
|
706
706
|
* @description fetch all unfilled currently open orders
|
|
707
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
707
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data
|
|
708
708
|
* @param {string} symbol unified market symbol
|
|
709
709
|
* @param {int|undefined} [since] the earliest time in ms to fetch open orders for
|
|
710
710
|
* @param {int|undefined} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -750,7 +750,7 @@ export default class binance extends binanceRest {
|
|
|
750
750
|
* @method
|
|
751
751
|
* @name binance#fetchMyTradesWs
|
|
752
752
|
* @description fetch all trades made by the user
|
|
753
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
753
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data
|
|
754
754
|
* @param {string} symbol unified market symbol
|
|
755
755
|
* @param {int|undefined} [since] the earliest time in ms to fetch trades for
|
|
756
756
|
* @param {int|undefined} [limit] the maximum number of trades structures to retrieve
|
|
@@ -764,7 +764,7 @@ export default class binance extends binanceRest {
|
|
|
764
764
|
* @method
|
|
765
765
|
* @name binance#fetchTradesWs
|
|
766
766
|
* @description fetch all trades made by the user
|
|
767
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
767
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
768
768
|
* @param {string} symbol unified market symbol
|
|
769
769
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
770
770
|
* @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000
|
package/js/src/pro/binance.js
CHANGED
|
@@ -740,7 +740,7 @@ export default class binance extends binanceRest {
|
|
|
740
740
|
* @method
|
|
741
741
|
* @name binance#fetchOrderBookWs
|
|
742
742
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
743
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
743
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book
|
|
744
744
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
|
|
745
745
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
746
746
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -830,6 +830,7 @@ export default class binance extends binanceRest {
|
|
|
830
830
|
orderbook.reset(snapshot);
|
|
831
831
|
// unroll the accumulated deltas
|
|
832
832
|
const messages = orderbook.cache;
|
|
833
|
+
orderbook.cache = [];
|
|
833
834
|
for (let i = 0; i < messages.length; i++) {
|
|
834
835
|
const messageItem = messages[i];
|
|
835
836
|
const U = this.safeInteger(messageItem, 'U');
|
|
@@ -903,10 +904,8 @@ export default class binance extends binanceRest {
|
|
|
903
904
|
// ]
|
|
904
905
|
// }
|
|
905
906
|
//
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
const isSpot = isTestnetSpot || isSpotMainNet;
|
|
909
|
-
const marketType = isSpot ? 'spot' : 'contract';
|
|
907
|
+
const isSpot = (client.url.indexOf('/stream') > -1);
|
|
908
|
+
const marketType = (isSpot) ? 'spot' : 'contract';
|
|
910
909
|
const marketId = this.safeString(message, 's');
|
|
911
910
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
912
911
|
const symbol = market['symbol'];
|
|
@@ -1043,8 +1042,8 @@ export default class binance extends binanceRest {
|
|
|
1043
1042
|
* @method
|
|
1044
1043
|
* @name binance#watchTradesForSymbols
|
|
1045
1044
|
* @description get the list of most recent trades for a list of symbols
|
|
1046
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1047
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1045
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
1046
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
1048
1047
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1049
1048
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1050
1049
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
@@ -1106,8 +1105,8 @@ export default class binance extends binanceRest {
|
|
|
1106
1105
|
* @method
|
|
1107
1106
|
* @name binance#unWatchTradesForSymbols
|
|
1108
1107
|
* @description unsubscribes from the trades channel
|
|
1109
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1110
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1108
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
1109
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
1111
1110
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1112
1111
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1113
1112
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
@@ -1168,8 +1167,8 @@ export default class binance extends binanceRest {
|
|
|
1168
1167
|
* @method
|
|
1169
1168
|
* @name binance#unWatchTrades
|
|
1170
1169
|
* @description unsubscribes from the trades channel
|
|
1171
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1172
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1170
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
1171
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
1173
1172
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1174
1173
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1175
1174
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -1185,8 +1184,8 @@ export default class binance extends binanceRest {
|
|
|
1185
1184
|
* @method
|
|
1186
1185
|
* @name binance#watchTrades
|
|
1187
1186
|
* @description get the list of most recent trades for a particular symbol
|
|
1188
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1189
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1187
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
|
|
1188
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
1190
1189
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1191
1190
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
|
|
1192
1191
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -1365,7 +1364,7 @@ export default class binance extends binanceRest {
|
|
|
1365
1364
|
handleTrade(client, message) {
|
|
1366
1365
|
// the trade streams push raw trade information in real-time
|
|
1367
1366
|
// each trade has a unique buyer and seller
|
|
1368
|
-
const isSpot = (
|
|
1367
|
+
const isSpot = (client.url.indexOf('/stream') > -1);
|
|
1369
1368
|
const marketType = (isSpot) ? 'spot' : 'contract';
|
|
1370
1369
|
const marketId = this.safeString(message, 's');
|
|
1371
1370
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
@@ -1385,7 +1384,7 @@ export default class binance extends binanceRest {
|
|
|
1385
1384
|
* @method
|
|
1386
1385
|
* @name binance#watchOHLCV
|
|
1387
1386
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1388
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1387
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
1389
1388
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1390
1389
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1391
1390
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -1408,7 +1407,7 @@ export default class binance extends binanceRest {
|
|
|
1408
1407
|
* @method
|
|
1409
1408
|
* @name binance#watchOHLCVForSymbols
|
|
1410
1409
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1411
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1410
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
1412
1411
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1413
1412
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1414
1413
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
@@ -1474,7 +1473,7 @@ export default class binance extends binanceRest {
|
|
|
1474
1473
|
* @method
|
|
1475
1474
|
* @name binance#unWatchOHLCVForSymbols
|
|
1476
1475
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1477
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1476
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
1478
1477
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1479
1478
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1480
1479
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
@@ -1541,7 +1540,7 @@ export default class binance extends binanceRest {
|
|
|
1541
1540
|
* @method
|
|
1542
1541
|
* @name binance#unWatchOHLCV
|
|
1543
1542
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1544
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1543
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
1545
1544
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1546
1545
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
|
|
1547
1546
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -1607,7 +1606,7 @@ export default class binance extends binanceRest {
|
|
|
1607
1606
|
this.safeFloat(kline, 'c'),
|
|
1608
1607
|
this.safeFloat(kline, 'v'),
|
|
1609
1608
|
];
|
|
1610
|
-
const isSpot = (
|
|
1609
|
+
const isSpot = (client.url.indexOf('/stream') > -1);
|
|
1611
1610
|
const marketType = (isSpot) ? 'spot' : 'contract';
|
|
1612
1611
|
const symbol = this.safeSymbol(marketId, undefined, undefined, marketType);
|
|
1613
1612
|
const messageHash = 'ohlcv::' + symbol + '::' + unifiedTimeframe;
|
|
@@ -1666,7 +1665,7 @@ export default class binance extends binanceRest {
|
|
|
1666
1665
|
* @method
|
|
1667
1666
|
* @name binance#fetchOHLCVWs
|
|
1668
1667
|
* @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1669
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1668
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
|
|
1670
1669
|
* @param {string} symbol unified symbol of the market to query OHLCV data for
|
|
1671
1670
|
* @param {string} timeframe the length of time each candle represents
|
|
1672
1671
|
* @param {int} since timestamp in ms of the earliest candle to fetch
|
|
@@ -1952,7 +1951,7 @@ export default class binance extends binanceRest {
|
|
|
1952
1951
|
* @method
|
|
1953
1952
|
* @name binance#watchBidsAsks
|
|
1954
1953
|
* @description watches best bid & ask for symbols
|
|
1955
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
1954
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker
|
|
1956
1955
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
1957
1956
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
1958
1957
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
@@ -2252,7 +2251,7 @@ export default class binance extends binanceRest {
|
|
|
2252
2251
|
this.handleTickersAndBidsAsks(client, message, 'tickers');
|
|
2253
2252
|
}
|
|
2254
2253
|
handleTickersAndBidsAsks(client, message, methodType) {
|
|
2255
|
-
const isSpot = (
|
|
2254
|
+
const isSpot = (client.url.indexOf('/stream') > -1);
|
|
2256
2255
|
const marketType = (isSpot) ? 'spot' : 'contract';
|
|
2257
2256
|
const isBidAsk = (methodType === 'bidasks');
|
|
2258
2257
|
let channelName = undefined;
|
|
@@ -2511,7 +2510,7 @@ export default class binance extends binanceRest {
|
|
|
2511
2510
|
* @name binance#fetchBalanceWs
|
|
2512
2511
|
* @description fetch balance and get the amount of funds available for trading or funds locked in orders
|
|
2513
2512
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
|
|
2514
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
2513
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data
|
|
2515
2514
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
|
|
2516
2515
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2517
2516
|
* @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
|
|
@@ -2881,7 +2880,7 @@ export default class binance extends binanceRest {
|
|
|
2881
2880
|
* @method
|
|
2882
2881
|
* @name binance#createOrderWs
|
|
2883
2882
|
* @description create a trade order
|
|
2884
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
2883
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade
|
|
2885
2884
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
|
|
2886
2885
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
|
|
2887
2886
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -3030,7 +3029,7 @@ export default class binance extends binanceRest {
|
|
|
3030
3029
|
* @method
|
|
3031
3030
|
* @name binance#editOrderWs
|
|
3032
3031
|
* @description edit a trade order
|
|
3033
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3032
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade
|
|
3034
3033
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
|
|
3035
3034
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
|
|
3036
3035
|
* @param {string} id order id
|
|
@@ -3188,7 +3187,7 @@ export default class binance extends binanceRest {
|
|
|
3188
3187
|
* @method
|
|
3189
3188
|
* @name binance#cancelOrderWs
|
|
3190
3189
|
* @description cancel multiple orders
|
|
3191
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3190
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade
|
|
3192
3191
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
|
|
3193
3192
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
|
|
3194
3193
|
* @param {string} id order id
|
|
@@ -3235,7 +3234,7 @@ export default class binance extends binanceRest {
|
|
|
3235
3234
|
* @method
|
|
3236
3235
|
* @name binance#cancelAllOrdersWs
|
|
3237
3236
|
* @description cancel all open orders in a market
|
|
3238
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3237
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade
|
|
3239
3238
|
* @param {string} [symbol] unified market symbol of the market to cancel orders in
|
|
3240
3239
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3241
3240
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -3270,7 +3269,7 @@ export default class binance extends binanceRest {
|
|
|
3270
3269
|
* @method
|
|
3271
3270
|
* @name binance#fetchOrderWs
|
|
3272
3271
|
* @description fetches information on an order made by the user
|
|
3273
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3272
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-user_data
|
|
3274
3273
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
|
|
3275
3274
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
|
|
3276
3275
|
* @param {string} id order id
|
|
@@ -3318,7 +3317,7 @@ export default class binance extends binanceRest {
|
|
|
3318
3317
|
* @method
|
|
3319
3318
|
* @name binance#fetchOrdersWs
|
|
3320
3319
|
* @description fetches information on multiple orders made by the user
|
|
3321
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3320
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
|
|
3322
3321
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
3323
3322
|
* @param {int|undefined} [since] the earliest time in ms to fetch orders for
|
|
3324
3323
|
* @param {int|undefined} [limit] the maximum number of order structures to retrieve
|
|
@@ -3363,7 +3362,7 @@ export default class binance extends binanceRest {
|
|
|
3363
3362
|
* @method
|
|
3364
3363
|
* @name binance#fetchClosedOrdersWs
|
|
3365
3364
|
* @description fetch closed orders
|
|
3366
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3365
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
|
|
3367
3366
|
* @param {string} symbol unified market symbol
|
|
3368
3367
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
3369
3368
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -3385,7 +3384,7 @@ export default class binance extends binanceRest {
|
|
|
3385
3384
|
* @method
|
|
3386
3385
|
* @name binance#fetchOpenOrdersWs
|
|
3387
3386
|
* @description fetch all unfilled currently open orders
|
|
3388
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3387
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data
|
|
3389
3388
|
* @param {string} symbol unified market symbol
|
|
3390
3389
|
* @param {int|undefined} [since] the earliest time in ms to fetch open orders for
|
|
3391
3390
|
* @param {int|undefined} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -3948,7 +3947,7 @@ export default class binance extends binanceRest {
|
|
|
3948
3947
|
* @method
|
|
3949
3948
|
* @name binance#fetchMyTradesWs
|
|
3950
3949
|
* @description fetch all trades made by the user
|
|
3951
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
3950
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data
|
|
3952
3951
|
* @param {string} symbol unified market symbol
|
|
3953
3952
|
* @param {int|undefined} [since] the earliest time in ms to fetch trades for
|
|
3954
3953
|
* @param {int|undefined} [limit] the maximum number of trades structures to retrieve
|
|
@@ -4001,7 +4000,7 @@ export default class binance extends binanceRest {
|
|
|
4001
4000
|
* @method
|
|
4002
4001
|
* @name binance#fetchTradesWs
|
|
4003
4002
|
* @description fetch all trades made by the user
|
|
4004
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/
|
|
4003
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
|
|
4005
4004
|
* @param {string} symbol unified market symbol
|
|
4006
4005
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
4007
4006
|
* @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000
|