ccxt 4.1.23 → 4.1.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.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +78 -33
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +4 -29
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/krakenfutures.js +72 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -14
- package/js/src/abstract/binancecoinm.d.ts +1 -14
- package/js/src/abstract/binanceus.d.ts +1 -14
- package/js/src/abstract/binanceusdm.d.ts +1 -14
- package/js/src/binance.js +4 -29
- package/js/src/bitmart.js +1 -1
- package/js/src/krakenfutures.d.ts +1 -0
- package/js/src/krakenfutures.js +72 -2
- package/package.json +1 -1
- package/js/src/bkex.d.ts +0 -95
- package/js/src/bkex.js +0 -1962
- package/js/src/pro/btcex.d.ts +0 -32
- package/js/src/pro/btcex.js +0 -776
- package/js/src/pro/ripio.d.ts +0 -18
- package/js/src/pro/ripio.js +0 -296
- package/js/src/pro/zb.d.ts +0 -22
- package/js/src/pro/zb.js +0 -605
package/dist/cjs/ccxt.js
CHANGED
|
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
180
180
|
|
|
181
181
|
//-----------------------------------------------------------------------------
|
|
182
182
|
// this is updated by vss.js when building
|
|
183
|
-
const version = '4.1.
|
|
183
|
+
const version = '4.1.24';
|
|
184
184
|
Exchange["default"].ccxtVersion = version;
|
|
185
185
|
const exchanges = {
|
|
186
186
|
'ace': ace,
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -156,7 +156,6 @@ class binance extends binance$1 {
|
|
|
156
156
|
'v1': 'https://testnet.binance.vision/api/v1',
|
|
157
157
|
},
|
|
158
158
|
'api': {
|
|
159
|
-
'wapi': 'https://api.binance.com/wapi/v3',
|
|
160
159
|
'sapi': 'https://api.binance.com/sapi/v1',
|
|
161
160
|
'sapiV2': 'https://api.binance.com/sapi/v2',
|
|
162
161
|
'sapiV3': 'https://api.binance.com/sapi/v3',
|
|
@@ -600,27 +599,6 @@ class binance extends binance$1 {
|
|
|
600
599
|
'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
|
|
601
600
|
},
|
|
602
601
|
},
|
|
603
|
-
// deprecated
|
|
604
|
-
'wapi': {
|
|
605
|
-
'post': {
|
|
606
|
-
'withdraw': 1,
|
|
607
|
-
'sub-account/transfer': 1,
|
|
608
|
-
},
|
|
609
|
-
'get': {
|
|
610
|
-
'depositHistory': 1,
|
|
611
|
-
'withdrawHistory': 1,
|
|
612
|
-
'depositAddress': 1,
|
|
613
|
-
'accountStatus': 1,
|
|
614
|
-
'systemStatus': 1,
|
|
615
|
-
'apiTradingStatus': 1,
|
|
616
|
-
'userAssetDribbletLog': 1,
|
|
617
|
-
'tradeFee': 1,
|
|
618
|
-
'assetDetail': 1,
|
|
619
|
-
'sub-account/list': 1,
|
|
620
|
-
'sub-account/transfer/history': 1,
|
|
621
|
-
'sub-account/assets': 1,
|
|
622
|
-
},
|
|
623
|
-
},
|
|
624
602
|
'dapiPublic': {
|
|
625
603
|
'get': {
|
|
626
604
|
'ping': 1,
|
|
@@ -734,6 +712,7 @@ class binance extends binance$1 {
|
|
|
734
712
|
},
|
|
735
713
|
'fapiData': {
|
|
736
714
|
'get': {
|
|
715
|
+
'delivery-price': 1,
|
|
737
716
|
'openInterestHist': 1,
|
|
738
717
|
'topLongShortAccountRatio': 1,
|
|
739
718
|
'topLongShortPositionRatio': 1,
|
|
@@ -8414,9 +8393,6 @@ class binance extends binance$1 {
|
|
|
8414
8393
|
}
|
|
8415
8394
|
let url = this.urls['api'][api];
|
|
8416
8395
|
url += '/' + path;
|
|
8417
|
-
if (api === 'wapi') {
|
|
8418
|
-
url += '.html';
|
|
8419
|
-
}
|
|
8420
8396
|
if (path === 'historicalTrades') {
|
|
8421
8397
|
if (this.apiKey) {
|
|
8422
8398
|
headers = {
|
|
@@ -8443,7 +8419,7 @@ class binance extends binance$1 {
|
|
|
8443
8419
|
throw new errors.AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
|
|
8444
8420
|
}
|
|
8445
8421
|
}
|
|
8446
|
-
else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === '
|
|
8422
|
+
else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'papi')) {
|
|
8447
8423
|
this.checkRequiredCredentials();
|
|
8448
8424
|
if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
|
|
8449
8425
|
// inject in implicit API calls
|
|
@@ -8505,7 +8481,7 @@ class binance extends binance$1 {
|
|
|
8505
8481
|
headers = {
|
|
8506
8482
|
'X-MBX-APIKEY': this.apiKey,
|
|
8507
8483
|
};
|
|
8508
|
-
if ((method === 'GET') || (method === 'DELETE')
|
|
8484
|
+
if ((method === 'GET') || (method === 'DELETE')) {
|
|
8509
8485
|
url += '?' + query;
|
|
8510
8486
|
}
|
|
8511
8487
|
else {
|
|
@@ -8541,7 +8517,6 @@ class binance extends binance$1 {
|
|
|
8541
8517
|
if (response === undefined) {
|
|
8542
8518
|
return undefined; // fallback to default error handler
|
|
8543
8519
|
}
|
|
8544
|
-
// check success value for wapi endpoints
|
|
8545
8520
|
// response in format {'msg': 'The coin does not exist.', 'success': true/false}
|
|
8546
8521
|
const success = this.safeValue(response, 'success', true);
|
|
8547
8522
|
if (!success) {
|
|
@@ -8632,7 +8607,7 @@ class binance extends binance$1 {
|
|
|
8632
8607
|
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}, context = {}) {
|
|
8633
8608
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
8634
8609
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
8635
|
-
if (
|
|
8610
|
+
if (api === 'private') {
|
|
8636
8611
|
this.options['hasAlreadyAuthenticatedSuccessfully'] = true;
|
|
8637
8612
|
}
|
|
8638
8613
|
return response;
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -32,6 +32,7 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
32
32
|
'option': false,
|
|
33
33
|
'cancelAllOrders': true,
|
|
34
34
|
'cancelOrder': true,
|
|
35
|
+
'cancelOrders': true,
|
|
35
36
|
'createMarketOrder': false,
|
|
36
37
|
'createOrder': true,
|
|
37
38
|
'editOrder': true,
|
|
@@ -962,6 +963,70 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
962
963
|
}
|
|
963
964
|
return this.extend({ 'info': response }, order);
|
|
964
965
|
}
|
|
966
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
967
|
+
/**
|
|
968
|
+
* @method
|
|
969
|
+
* @name krakenfutures#cancelOrders
|
|
970
|
+
* @description cancel multiple orders
|
|
971
|
+
* @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
|
|
972
|
+
* @param {[string]} ids order ids
|
|
973
|
+
* @param {string} [symbol] unified market symbol
|
|
974
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
975
|
+
*
|
|
976
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
977
|
+
* @param {[string]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
|
|
978
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
979
|
+
*/
|
|
980
|
+
await this.loadMarkets();
|
|
981
|
+
const orders = [];
|
|
982
|
+
const clientOrderIds = this.safeValue(params, 'clientOrderIds', []);
|
|
983
|
+
const clientOrderIdsLength = clientOrderIds.length;
|
|
984
|
+
if (clientOrderIdsLength > 0) {
|
|
985
|
+
for (let i = 0; i < clientOrderIds.length; i++) {
|
|
986
|
+
orders.push({ 'order': 'cancel', 'cliOrdId': clientOrderIds[i] });
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
for (let i = 0; i < ids.length; i++) {
|
|
991
|
+
orders.push({ 'order': 'cancel', 'order_id': ids[i] });
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
const request = {
|
|
995
|
+
'batchOrder': orders,
|
|
996
|
+
};
|
|
997
|
+
const response = await this.privatePostBatchorder(this.extend(request, params));
|
|
998
|
+
// {
|
|
999
|
+
// result: 'success',
|
|
1000
|
+
// serverTime: '2023-10-23T16:36:51.327Z',
|
|
1001
|
+
// batchStatus: [
|
|
1002
|
+
// {
|
|
1003
|
+
// status: 'cancelled',
|
|
1004
|
+
// order_id: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1005
|
+
// orderEvents: [
|
|
1006
|
+
// {
|
|
1007
|
+
// uid: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1008
|
+
// order: {
|
|
1009
|
+
// orderId: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1010
|
+
// cliOrdId: null,
|
|
1011
|
+
// type: 'lmt',
|
|
1012
|
+
// symbol: 'PF_LTCUSD',
|
|
1013
|
+
// side: 'buy',
|
|
1014
|
+
// quantity: '0.10000000000',
|
|
1015
|
+
// filled: '0E-11',
|
|
1016
|
+
// limitPrice: '50.00000000000',
|
|
1017
|
+
// reduceOnly: false,
|
|
1018
|
+
// timestamp: '2023-10-20T10:29:13.005Z',
|
|
1019
|
+
// lastUpdateTimestamp: '2023-10-20T10:29:13.005Z'
|
|
1020
|
+
// },
|
|
1021
|
+
// type: 'CANCEL'
|
|
1022
|
+
// }
|
|
1023
|
+
// ]
|
|
1024
|
+
// }
|
|
1025
|
+
// ]
|
|
1026
|
+
// }
|
|
1027
|
+
const batchStatus = this.safeValue(response, 'batchStatus', []);
|
|
1028
|
+
return this.parseOrders(batchStatus);
|
|
1029
|
+
}
|
|
965
1030
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
966
1031
|
/**
|
|
967
1032
|
* @method
|
|
@@ -2148,7 +2213,11 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
2148
2213
|
params = this.omit(params, this.extractParams(path));
|
|
2149
2214
|
let query = endpoint;
|
|
2150
2215
|
let postData = '';
|
|
2151
|
-
if (
|
|
2216
|
+
if (path === 'batchorder') {
|
|
2217
|
+
postData = 'json=' + this.json(params);
|
|
2218
|
+
body = postData;
|
|
2219
|
+
}
|
|
2220
|
+
else if (Object.keys(params).length) {
|
|
2152
2221
|
postData = this.urlencode(params);
|
|
2153
2222
|
query += '?' + postData;
|
|
2154
2223
|
}
|
|
@@ -2163,7 +2232,8 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
2163
2232
|
const secret = this.base64ToBinary(this.secret); // 3
|
|
2164
2233
|
const signature = this.hmac(hash, secret, sha512.sha512, 'base64'); // 4-5
|
|
2165
2234
|
headers = {
|
|
2166
|
-
'Content-Type': 'application/
|
|
2235
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
2236
|
+
'Accept': 'application/json',
|
|
2167
2237
|
'APIKey': this.apiKey,
|
|
2168
2238
|
'Authent': signature,
|
|
2169
2239
|
};
|
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation } 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.1.
|
|
7
|
+
declare const version = "4.1.23";
|
|
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.1.
|
|
41
|
+
const version = '4.1.24';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -354,20 +354,6 @@ interface Exchange {
|
|
|
354
354
|
sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
355
355
|
sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
|
|
356
356
|
sapiV4GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
357
|
-
wapiPostWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
358
|
-
wapiPostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
359
|
-
wapiGetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
360
|
-
wapiGetWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
361
|
-
wapiGetDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
362
|
-
wapiGetAccountStatus(params?: {}): Promise<implicitReturnType>;
|
|
363
|
-
wapiGetSystemStatus(params?: {}): Promise<implicitReturnType>;
|
|
364
|
-
wapiGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
365
|
-
wapiGetUserAssetDribbletLog(params?: {}): Promise<implicitReturnType>;
|
|
366
|
-
wapiGetTradeFee(params?: {}): Promise<implicitReturnType>;
|
|
367
|
-
wapiGetAssetDetail(params?: {}): Promise<implicitReturnType>;
|
|
368
|
-
wapiGetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
369
|
-
wapiGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
370
|
-
wapiGetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
371
357
|
dapiPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
372
358
|
dapiPublicGetTime(params?: {}): Promise<implicitReturnType>;
|
|
373
359
|
dapiPublicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -453,6 +439,7 @@ interface Exchange {
|
|
|
453
439
|
fapiPublicGetConstituents(params?: {}): Promise<implicitReturnType>;
|
|
454
440
|
fapiPublicGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
455
441
|
fapiPublicGetLvtKlines(params?: {}): Promise<implicitReturnType>;
|
|
442
|
+
fapiDataGetDeliveryPrice(params?: {}): Promise<implicitReturnType>;
|
|
456
443
|
fapiDataGetOpenInterestHist(params?: {}): Promise<implicitReturnType>;
|
|
457
444
|
fapiDataGetTopLongShortAccountRatio(params?: {}): Promise<implicitReturnType>;
|
|
458
445
|
fapiDataGetTopLongShortPositionRatio(params?: {}): Promise<implicitReturnType>;
|
|
@@ -354,20 +354,6 @@ interface binance {
|
|
|
354
354
|
sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
355
355
|
sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
|
|
356
356
|
sapiV4GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
357
|
-
wapiPostWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
358
|
-
wapiPostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
359
|
-
wapiGetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
360
|
-
wapiGetWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
361
|
-
wapiGetDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
362
|
-
wapiGetAccountStatus(params?: {}): Promise<implicitReturnType>;
|
|
363
|
-
wapiGetSystemStatus(params?: {}): Promise<implicitReturnType>;
|
|
364
|
-
wapiGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
365
|
-
wapiGetUserAssetDribbletLog(params?: {}): Promise<implicitReturnType>;
|
|
366
|
-
wapiGetTradeFee(params?: {}): Promise<implicitReturnType>;
|
|
367
|
-
wapiGetAssetDetail(params?: {}): Promise<implicitReturnType>;
|
|
368
|
-
wapiGetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
369
|
-
wapiGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
370
|
-
wapiGetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
371
357
|
dapiPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
372
358
|
dapiPublicGetTime(params?: {}): Promise<implicitReturnType>;
|
|
373
359
|
dapiPublicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -453,6 +439,7 @@ interface binance {
|
|
|
453
439
|
fapiPublicGetConstituents(params?: {}): Promise<implicitReturnType>;
|
|
454
440
|
fapiPublicGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
455
441
|
fapiPublicGetLvtKlines(params?: {}): Promise<implicitReturnType>;
|
|
442
|
+
fapiDataGetDeliveryPrice(params?: {}): Promise<implicitReturnType>;
|
|
456
443
|
fapiDataGetOpenInterestHist(params?: {}): Promise<implicitReturnType>;
|
|
457
444
|
fapiDataGetTopLongShortAccountRatio(params?: {}): Promise<implicitReturnType>;
|
|
458
445
|
fapiDataGetTopLongShortPositionRatio(params?: {}): Promise<implicitReturnType>;
|
|
@@ -354,20 +354,6 @@ interface binance {
|
|
|
354
354
|
sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
355
355
|
sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
|
|
356
356
|
sapiV4GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
357
|
-
wapiPostWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
358
|
-
wapiPostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
359
|
-
wapiGetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
360
|
-
wapiGetWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
361
|
-
wapiGetDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
362
|
-
wapiGetAccountStatus(params?: {}): Promise<implicitReturnType>;
|
|
363
|
-
wapiGetSystemStatus(params?: {}): Promise<implicitReturnType>;
|
|
364
|
-
wapiGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
365
|
-
wapiGetUserAssetDribbletLog(params?: {}): Promise<implicitReturnType>;
|
|
366
|
-
wapiGetTradeFee(params?: {}): Promise<implicitReturnType>;
|
|
367
|
-
wapiGetAssetDetail(params?: {}): Promise<implicitReturnType>;
|
|
368
|
-
wapiGetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
369
|
-
wapiGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
370
|
-
wapiGetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
371
357
|
dapiPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
372
358
|
dapiPublicGetTime(params?: {}): Promise<implicitReturnType>;
|
|
373
359
|
dapiPublicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -453,6 +439,7 @@ interface binance {
|
|
|
453
439
|
fapiPublicGetConstituents(params?: {}): Promise<implicitReturnType>;
|
|
454
440
|
fapiPublicGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
455
441
|
fapiPublicGetLvtKlines(params?: {}): Promise<implicitReturnType>;
|
|
442
|
+
fapiDataGetDeliveryPrice(params?: {}): Promise<implicitReturnType>;
|
|
456
443
|
fapiDataGetOpenInterestHist(params?: {}): Promise<implicitReturnType>;
|
|
457
444
|
fapiDataGetTopLongShortAccountRatio(params?: {}): Promise<implicitReturnType>;
|
|
458
445
|
fapiDataGetTopLongShortPositionRatio(params?: {}): Promise<implicitReturnType>;
|
|
@@ -354,20 +354,6 @@ interface binance {
|
|
|
354
354
|
sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
355
355
|
sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
|
|
356
356
|
sapiV4GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
357
|
-
wapiPostWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
358
|
-
wapiPostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
359
|
-
wapiGetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
360
|
-
wapiGetWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
361
|
-
wapiGetDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
362
|
-
wapiGetAccountStatus(params?: {}): Promise<implicitReturnType>;
|
|
363
|
-
wapiGetSystemStatus(params?: {}): Promise<implicitReturnType>;
|
|
364
|
-
wapiGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
365
|
-
wapiGetUserAssetDribbletLog(params?: {}): Promise<implicitReturnType>;
|
|
366
|
-
wapiGetTradeFee(params?: {}): Promise<implicitReturnType>;
|
|
367
|
-
wapiGetAssetDetail(params?: {}): Promise<implicitReturnType>;
|
|
368
|
-
wapiGetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
369
|
-
wapiGetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
370
|
-
wapiGetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
371
357
|
dapiPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
372
358
|
dapiPublicGetTime(params?: {}): Promise<implicitReturnType>;
|
|
373
359
|
dapiPublicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -453,6 +439,7 @@ interface binance {
|
|
|
453
439
|
fapiPublicGetConstituents(params?: {}): Promise<implicitReturnType>;
|
|
454
440
|
fapiPublicGetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
455
441
|
fapiPublicGetLvtKlines(params?: {}): Promise<implicitReturnType>;
|
|
442
|
+
fapiDataGetDeliveryPrice(params?: {}): Promise<implicitReturnType>;
|
|
456
443
|
fapiDataGetOpenInterestHist(params?: {}): Promise<implicitReturnType>;
|
|
457
444
|
fapiDataGetTopLongShortAccountRatio(params?: {}): Promise<implicitReturnType>;
|
|
458
445
|
fapiDataGetTopLongShortPositionRatio(params?: {}): Promise<implicitReturnType>;
|
package/js/src/binance.js
CHANGED
|
@@ -159,7 +159,6 @@ export default class binance extends Exchange {
|
|
|
159
159
|
'v1': 'https://testnet.binance.vision/api/v1',
|
|
160
160
|
},
|
|
161
161
|
'api': {
|
|
162
|
-
'wapi': 'https://api.binance.com/wapi/v3',
|
|
163
162
|
'sapi': 'https://api.binance.com/sapi/v1',
|
|
164
163
|
'sapiV2': 'https://api.binance.com/sapi/v2',
|
|
165
164
|
'sapiV3': 'https://api.binance.com/sapi/v3',
|
|
@@ -603,27 +602,6 @@ export default class binance extends Exchange {
|
|
|
603
602
|
'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
|
|
604
603
|
},
|
|
605
604
|
},
|
|
606
|
-
// deprecated
|
|
607
|
-
'wapi': {
|
|
608
|
-
'post': {
|
|
609
|
-
'withdraw': 1,
|
|
610
|
-
'sub-account/transfer': 1,
|
|
611
|
-
},
|
|
612
|
-
'get': {
|
|
613
|
-
'depositHistory': 1,
|
|
614
|
-
'withdrawHistory': 1,
|
|
615
|
-
'depositAddress': 1,
|
|
616
|
-
'accountStatus': 1,
|
|
617
|
-
'systemStatus': 1,
|
|
618
|
-
'apiTradingStatus': 1,
|
|
619
|
-
'userAssetDribbletLog': 1,
|
|
620
|
-
'tradeFee': 1,
|
|
621
|
-
'assetDetail': 1,
|
|
622
|
-
'sub-account/list': 1,
|
|
623
|
-
'sub-account/transfer/history': 1,
|
|
624
|
-
'sub-account/assets': 1,
|
|
625
|
-
},
|
|
626
|
-
},
|
|
627
605
|
'dapiPublic': {
|
|
628
606
|
'get': {
|
|
629
607
|
'ping': 1,
|
|
@@ -737,6 +715,7 @@ export default class binance extends Exchange {
|
|
|
737
715
|
},
|
|
738
716
|
'fapiData': {
|
|
739
717
|
'get': {
|
|
718
|
+
'delivery-price': 1,
|
|
740
719
|
'openInterestHist': 1,
|
|
741
720
|
'topLongShortAccountRatio': 1,
|
|
742
721
|
'topLongShortPositionRatio': 1,
|
|
@@ -8417,9 +8396,6 @@ export default class binance extends Exchange {
|
|
|
8417
8396
|
}
|
|
8418
8397
|
let url = this.urls['api'][api];
|
|
8419
8398
|
url += '/' + path;
|
|
8420
|
-
if (api === 'wapi') {
|
|
8421
|
-
url += '.html';
|
|
8422
|
-
}
|
|
8423
8399
|
if (path === 'historicalTrades') {
|
|
8424
8400
|
if (this.apiKey) {
|
|
8425
8401
|
headers = {
|
|
@@ -8446,7 +8422,7 @@ export default class binance extends Exchange {
|
|
|
8446
8422
|
throw new AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
|
|
8447
8423
|
}
|
|
8448
8424
|
}
|
|
8449
|
-
else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === '
|
|
8425
|
+
else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'papi')) {
|
|
8450
8426
|
this.checkRequiredCredentials();
|
|
8451
8427
|
if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
|
|
8452
8428
|
// inject in implicit API calls
|
|
@@ -8508,7 +8484,7 @@ export default class binance extends Exchange {
|
|
|
8508
8484
|
headers = {
|
|
8509
8485
|
'X-MBX-APIKEY': this.apiKey,
|
|
8510
8486
|
};
|
|
8511
|
-
if ((method === 'GET') || (method === 'DELETE')
|
|
8487
|
+
if ((method === 'GET') || (method === 'DELETE')) {
|
|
8512
8488
|
url += '?' + query;
|
|
8513
8489
|
}
|
|
8514
8490
|
else {
|
|
@@ -8544,7 +8520,6 @@ export default class binance extends Exchange {
|
|
|
8544
8520
|
if (response === undefined) {
|
|
8545
8521
|
return undefined; // fallback to default error handler
|
|
8546
8522
|
}
|
|
8547
|
-
// check success value for wapi endpoints
|
|
8548
8523
|
// response in format {'msg': 'The coin does not exist.', 'success': true/false}
|
|
8549
8524
|
const success = this.safeValue(response, 'success', true);
|
|
8550
8525
|
if (!success) {
|
|
@@ -8635,7 +8610,7 @@ export default class binance extends Exchange {
|
|
|
8635
8610
|
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}, context = {}) {
|
|
8636
8611
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
8637
8612
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
8638
|
-
if (
|
|
8613
|
+
if (api === 'private') {
|
|
8639
8614
|
this.options['hasAlreadyAuthenticatedSuccessfully'] = true;
|
|
8640
8615
|
}
|
|
8641
8616
|
return response;
|
package/js/src/bitmart.js
CHANGED
|
@@ -2099,7 +2099,7 @@ export default class bitmart extends Exchange {
|
|
|
2099
2099
|
'7': 'canceling',
|
|
2100
2100
|
'8': 'canceled',
|
|
2101
2101
|
'new': 'open',
|
|
2102
|
-
'partially_filled': '
|
|
2102
|
+
'partially_filled': 'open',
|
|
2103
2103
|
'filled': 'filled',
|
|
2104
2104
|
'partially_canceled': 'canceled',
|
|
2105
2105
|
},
|
|
@@ -17,6 +17,7 @@ export default class krakenfutures extends Exchange {
|
|
|
17
17
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
|
|
18
18
|
editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
|
|
19
19
|
cancelOrder(id: string, symbol?: string, params?: {}): Promise<any>;
|
|
20
|
+
cancelOrders(ids: string[], symbol?: string, params?: {}): Promise<import("./base/types.js").Order[]>;
|
|
20
21
|
cancelAllOrders(symbol?: string, params?: {}): Promise<any>;
|
|
21
22
|
fetchOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
|
|
22
23
|
parseOrderType(orderType: any): string;
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class krakenfutures extends Exchange {
|
|
|
35
35
|
'option': false,
|
|
36
36
|
'cancelAllOrders': true,
|
|
37
37
|
'cancelOrder': true,
|
|
38
|
+
'cancelOrders': true,
|
|
38
39
|
'createMarketOrder': false,
|
|
39
40
|
'createOrder': true,
|
|
40
41
|
'editOrder': true,
|
|
@@ -965,6 +966,70 @@ export default class krakenfutures extends Exchange {
|
|
|
965
966
|
}
|
|
966
967
|
return this.extend({ 'info': response }, order);
|
|
967
968
|
}
|
|
969
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
970
|
+
/**
|
|
971
|
+
* @method
|
|
972
|
+
* @name krakenfutures#cancelOrders
|
|
973
|
+
* @description cancel multiple orders
|
|
974
|
+
* @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
|
|
975
|
+
* @param {[string]} ids order ids
|
|
976
|
+
* @param {string} [symbol] unified market symbol
|
|
977
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
978
|
+
*
|
|
979
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
980
|
+
* @param {[string]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
|
|
981
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
982
|
+
*/
|
|
983
|
+
await this.loadMarkets();
|
|
984
|
+
const orders = [];
|
|
985
|
+
const clientOrderIds = this.safeValue(params, 'clientOrderIds', []);
|
|
986
|
+
const clientOrderIdsLength = clientOrderIds.length;
|
|
987
|
+
if (clientOrderIdsLength > 0) {
|
|
988
|
+
for (let i = 0; i < clientOrderIds.length; i++) {
|
|
989
|
+
orders.push({ 'order': 'cancel', 'cliOrdId': clientOrderIds[i] });
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
for (let i = 0; i < ids.length; i++) {
|
|
994
|
+
orders.push({ 'order': 'cancel', 'order_id': ids[i] });
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
const request = {
|
|
998
|
+
'batchOrder': orders,
|
|
999
|
+
};
|
|
1000
|
+
const response = await this.privatePostBatchorder(this.extend(request, params));
|
|
1001
|
+
// {
|
|
1002
|
+
// result: 'success',
|
|
1003
|
+
// serverTime: '2023-10-23T16:36:51.327Z',
|
|
1004
|
+
// batchStatus: [
|
|
1005
|
+
// {
|
|
1006
|
+
// status: 'cancelled',
|
|
1007
|
+
// order_id: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1008
|
+
// orderEvents: [
|
|
1009
|
+
// {
|
|
1010
|
+
// uid: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1011
|
+
// order: {
|
|
1012
|
+
// orderId: '101c2327-f12e-45f2-8445-7502b87afc0b',
|
|
1013
|
+
// cliOrdId: null,
|
|
1014
|
+
// type: 'lmt',
|
|
1015
|
+
// symbol: 'PF_LTCUSD',
|
|
1016
|
+
// side: 'buy',
|
|
1017
|
+
// quantity: '0.10000000000',
|
|
1018
|
+
// filled: '0E-11',
|
|
1019
|
+
// limitPrice: '50.00000000000',
|
|
1020
|
+
// reduceOnly: false,
|
|
1021
|
+
// timestamp: '2023-10-20T10:29:13.005Z',
|
|
1022
|
+
// lastUpdateTimestamp: '2023-10-20T10:29:13.005Z'
|
|
1023
|
+
// },
|
|
1024
|
+
// type: 'CANCEL'
|
|
1025
|
+
// }
|
|
1026
|
+
// ]
|
|
1027
|
+
// }
|
|
1028
|
+
// ]
|
|
1029
|
+
// }
|
|
1030
|
+
const batchStatus = this.safeValue(response, 'batchStatus', []);
|
|
1031
|
+
return this.parseOrders(batchStatus);
|
|
1032
|
+
}
|
|
968
1033
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
969
1034
|
/**
|
|
970
1035
|
* @method
|
|
@@ -2151,7 +2216,11 @@ export default class krakenfutures extends Exchange {
|
|
|
2151
2216
|
params = this.omit(params, this.extractParams(path));
|
|
2152
2217
|
let query = endpoint;
|
|
2153
2218
|
let postData = '';
|
|
2154
|
-
if (
|
|
2219
|
+
if (path === 'batchorder') {
|
|
2220
|
+
postData = 'json=' + this.json(params);
|
|
2221
|
+
body = postData;
|
|
2222
|
+
}
|
|
2223
|
+
else if (Object.keys(params).length) {
|
|
2155
2224
|
postData = this.urlencode(params);
|
|
2156
2225
|
query += '?' + postData;
|
|
2157
2226
|
}
|
|
@@ -2166,7 +2235,8 @@ export default class krakenfutures extends Exchange {
|
|
|
2166
2235
|
const secret = this.base64ToBinary(this.secret); // 3
|
|
2167
2236
|
const signature = this.hmac(hash, secret, sha512, 'base64'); // 4-5
|
|
2168
2237
|
headers = {
|
|
2169
|
-
'Content-Type': 'application/
|
|
2238
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
2239
|
+
'Accept': 'application/json',
|
|
2170
2240
|
'APIKey': this.apiKey,
|
|
2171
2241
|
'Authent': signature,
|
|
2172
2242
|
};
|
package/package.json
CHANGED