ccxt 4.2.43 → 4.2.45
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 +1489 -463
- package/dist/ccxt.browser.min.js +6 -6
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +54 -0
- package/dist/cjs/src/binance.js +627 -51
- package/dist/cjs/src/bingx.js +46 -6
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/blofin.js +2 -1
- package/dist/cjs/src/bybit.js +96 -43
- package/dist/cjs/src/coinbase.js +221 -41
- package/dist/cjs/src/deribit.js +1 -1
- package/dist/cjs/src/krakenfutures.js +3 -2
- package/dist/cjs/src/kucoin.js +9 -5
- package/dist/cjs/src/mexc.js +348 -266
- package/dist/cjs/src/pro/gate.js +76 -42
- package/dist/cjs/src/pro/hitbtc.js +1 -0
- package/dist/cjs/src/probit.js +3 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinbase.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +54 -0
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +627 -51
- package/js/src/bingx.d.ts +2 -1
- package/js/src/bingx.js +46 -6
- package/js/src/bitstamp.js +1 -1
- package/js/src/blofin.js +2 -1
- package/js/src/bybit.d.ts +4 -1
- package/js/src/bybit.js +96 -43
- package/js/src/coinbase.d.ts +10 -4
- package/js/src/coinbase.js +221 -41
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/deribit.js +1 -1
- package/js/src/krakenfutures.js +3 -2
- package/js/src/kucoin.js +9 -5
- package/js/src/mexc.d.ts +4 -5
- package/js/src/mexc.js +348 -266
- package/js/src/pro/gate.d.ts +4 -0
- package/js/src/pro/gate.js +76 -42
- package/js/src/pro/hitbtc.js +1 -0
- package/js/src/probit.js +3 -3
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/package.json +1 -1
- package/skip-tests.json +2 -0
package/js/src/bingx.d.ts
CHANGED
|
@@ -95,7 +95,8 @@ export default class bingx extends Exchange {
|
|
|
95
95
|
toAccount: string;
|
|
96
96
|
status: string;
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<{}>;
|
|
99
|
+
fetchDepositAddress(code: string, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
99
100
|
parseDepositAddress(depositAddress: any, currency?: Currency): {
|
|
100
101
|
currency: string;
|
|
101
102
|
address: string;
|
package/js/src/bingx.js
CHANGED
|
@@ -53,6 +53,7 @@ export default class bingx extends Exchange {
|
|
|
53
53
|
'fetchClosedOrders': true,
|
|
54
54
|
'fetchCurrencies': true,
|
|
55
55
|
'fetchDepositAddress': true,
|
|
56
|
+
'fetchDepositAddressesByNetwork': true,
|
|
56
57
|
'fetchDeposits': true,
|
|
57
58
|
'fetchDepositWithdrawFee': 'emulated',
|
|
58
59
|
'fetchDepositWithdrawFees': true,
|
|
@@ -388,7 +389,9 @@ export default class bingx extends Exchange {
|
|
|
388
389
|
},
|
|
389
390
|
'broad': {},
|
|
390
391
|
},
|
|
391
|
-
'commonCurrencies': {
|
|
392
|
+
'commonCurrencies': {
|
|
393
|
+
'SNOW': 'Snowman', // Snowman vs SnowSwap conflict
|
|
394
|
+
},
|
|
392
395
|
'options': {
|
|
393
396
|
'defaultType': 'spot',
|
|
394
397
|
'accountsByType': {
|
|
@@ -403,6 +406,13 @@ export default class bingx extends Exchange {
|
|
|
403
406
|
},
|
|
404
407
|
'recvWindow': 5 * 1000,
|
|
405
408
|
'broker': 'CCXT',
|
|
409
|
+
'defaultNetworks': {
|
|
410
|
+
'ETH': 'ETH',
|
|
411
|
+
'USDT': 'ERC20',
|
|
412
|
+
'USDC': 'ERC20',
|
|
413
|
+
'BTC': 'BTC',
|
|
414
|
+
'LTC': 'LTC',
|
|
415
|
+
},
|
|
406
416
|
},
|
|
407
417
|
});
|
|
408
418
|
}
|
|
@@ -3086,15 +3096,15 @@ export default class bingx extends Exchange {
|
|
|
3086
3096
|
'status': status,
|
|
3087
3097
|
};
|
|
3088
3098
|
}
|
|
3089
|
-
async
|
|
3099
|
+
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
3090
3100
|
/**
|
|
3091
3101
|
* @method
|
|
3092
|
-
* @name bingx#
|
|
3093
|
-
* @description fetch the deposit
|
|
3094
|
-
* @see https://bingx-api.github.io/docs/#/common/
|
|
3102
|
+
* @name bingx#fetchDepositAddressesByNetwork
|
|
3103
|
+
* @description fetch the deposit addresses for a currency associated with this account
|
|
3104
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
3095
3105
|
* @param {string} code unified currency code
|
|
3096
3106
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3097
|
-
* @returns {object}
|
|
3107
|
+
* @returns {object} a dictionary [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}, indexed by the network
|
|
3098
3108
|
*/
|
|
3099
3109
|
await this.loadMarkets();
|
|
3100
3110
|
const currency = this.currency(code);
|
|
@@ -3129,6 +3139,36 @@ export default class bingx extends Exchange {
|
|
|
3129
3139
|
const parsed = this.parseDepositAddresses(data, [currency['code']], false);
|
|
3130
3140
|
return this.indexBy(parsed, 'network');
|
|
3131
3141
|
}
|
|
3142
|
+
async fetchDepositAddress(code, params = {}) {
|
|
3143
|
+
/**
|
|
3144
|
+
* @method
|
|
3145
|
+
* @name bingx#fetchDepositAddress
|
|
3146
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
3147
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
3148
|
+
* @param {string} code unified currency code
|
|
3149
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3150
|
+
* @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency
|
|
3151
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3152
|
+
*/
|
|
3153
|
+
const network = this.safeString(params, 'network');
|
|
3154
|
+
params = this.omit(params, ['network']);
|
|
3155
|
+
const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
|
|
3156
|
+
if (network !== undefined) {
|
|
3157
|
+
return this.safeDict(addressStructures, network);
|
|
3158
|
+
}
|
|
3159
|
+
else {
|
|
3160
|
+
const options = this.safeDict(this.options, 'defaultNetworks');
|
|
3161
|
+
const defaultNetworkForCurrency = this.safeString(options, code);
|
|
3162
|
+
if (defaultNetworkForCurrency !== undefined) {
|
|
3163
|
+
return this.safeDict(addressStructures, defaultNetworkForCurrency);
|
|
3164
|
+
}
|
|
3165
|
+
else {
|
|
3166
|
+
const keys = Object.keys(addressStructures);
|
|
3167
|
+
const key = this.safeString(keys, 0);
|
|
3168
|
+
return this.safeDict(addressStructures, key);
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3132
3172
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3133
3173
|
//
|
|
3134
3174
|
// {
|
package/js/src/bitstamp.js
CHANGED
|
@@ -821,7 +821,7 @@ export default class bitstamp extends Exchange {
|
|
|
821
821
|
for (let i = 0; i < ids.length; i++) {
|
|
822
822
|
const id = ids[i];
|
|
823
823
|
if (id.indexOf('_') < 0) {
|
|
824
|
-
const value = this.
|
|
824
|
+
const value = this.safeInteger(transaction, id);
|
|
825
825
|
if ((value !== undefined) && (value !== 0)) {
|
|
826
826
|
return id;
|
|
827
827
|
}
|
package/js/src/blofin.js
CHANGED
|
@@ -958,7 +958,8 @@ export default class blofin extends Exchange {
|
|
|
958
958
|
const request = {};
|
|
959
959
|
let response = undefined;
|
|
960
960
|
if (accountType !== undefined) {
|
|
961
|
-
const
|
|
961
|
+
const options = this.safeDict(this.options, 'accountsByType', {});
|
|
962
|
+
const parsedAccountType = this.safeString(options, accountType, accountType);
|
|
962
963
|
request['accountType'] = parsedAccountType;
|
|
963
964
|
response = await this.privateGetAssetBalances(this.extend(request, params));
|
|
964
965
|
}
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -56,7 +56,6 @@ export default class bybit extends Exchange {
|
|
|
56
56
|
parseOrderStatus(status: any): string;
|
|
57
57
|
parseTimeInForce(timeInForce: any): string;
|
|
58
58
|
parseOrder(order: any, market?: Market): Order;
|
|
59
|
-
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
60
59
|
createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
|
|
61
60
|
createMarketSellOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
|
|
62
61
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
@@ -70,7 +69,11 @@ export default class bybit extends Exchange {
|
|
|
70
69
|
cancelAllUsdcOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
71
70
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
72
71
|
fetchUsdcOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
72
|
+
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
73
73
|
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
74
|
+
fetchClosedOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
75
|
+
fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
76
|
+
fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
74
77
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
75
78
|
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
76
79
|
fetchUsdcOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/bybit.js
CHANGED
|
@@ -59,7 +59,9 @@ export default class bybit extends Exchange {
|
|
|
59
59
|
'fetchBorrowInterest': false,
|
|
60
60
|
'fetchBorrowRateHistories': false,
|
|
61
61
|
'fetchBorrowRateHistory': false,
|
|
62
|
+
'fetchCanceledAndClosedOrders': true,
|
|
62
63
|
'fetchCanceledOrders': true,
|
|
64
|
+
'fetchClosedOrder': true,
|
|
63
65
|
'fetchClosedOrders': true,
|
|
64
66
|
'fetchCrossBorrowRate': true,
|
|
65
67
|
'fetchCrossBorrowRates': false,
|
|
@@ -87,10 +89,11 @@ export default class bybit extends Exchange {
|
|
|
87
89
|
'fetchOHLCV': true,
|
|
88
90
|
'fetchOpenInterest': true,
|
|
89
91
|
'fetchOpenInterestHistory': true,
|
|
92
|
+
'fetchOpenOrder': true,
|
|
90
93
|
'fetchOpenOrders': true,
|
|
91
|
-
'fetchOrder':
|
|
94
|
+
'fetchOrder': false,
|
|
92
95
|
'fetchOrderBook': true,
|
|
93
|
-
'fetchOrders':
|
|
96
|
+
'fetchOrders': false,
|
|
94
97
|
'fetchOrderTrades': true,
|
|
95
98
|
'fetchPosition': true,
|
|
96
99
|
'fetchPositions': true,
|
|
@@ -3444,35 +3447,6 @@ export default class bybit extends Exchange {
|
|
|
3444
3447
|
'trades': undefined,
|
|
3445
3448
|
}, market);
|
|
3446
3449
|
}
|
|
3447
|
-
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
3448
|
-
/**
|
|
3449
|
-
* @method
|
|
3450
|
-
* @name bybit#fetchOrder
|
|
3451
|
-
* @description fetches information on an order made by the user
|
|
3452
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
3453
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3454
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3455
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3456
|
-
*/
|
|
3457
|
-
if (symbol === undefined) {
|
|
3458
|
-
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
3459
|
-
}
|
|
3460
|
-
await this.loadMarkets();
|
|
3461
|
-
const request = {
|
|
3462
|
-
'orderId': id,
|
|
3463
|
-
};
|
|
3464
|
-
const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
3465
|
-
const length = result.length;
|
|
3466
|
-
if (length === 0) {
|
|
3467
|
-
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
3468
|
-
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
3469
|
-
throw new OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
3470
|
-
}
|
|
3471
|
-
if (length > 1) {
|
|
3472
|
-
throw new InvalidOrder(this.id + ' returned more than one order');
|
|
3473
|
-
}
|
|
3474
|
-
return this.safeValue(result, 0);
|
|
3475
|
-
}
|
|
3476
3450
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
3477
3451
|
/**
|
|
3478
3452
|
* @method
|
|
@@ -4508,29 +4482,99 @@ export default class bybit extends Exchange {
|
|
|
4508
4482
|
const data = this.safeValue(result, 'dataList', []);
|
|
4509
4483
|
return this.parseOrders(data, market, since, limit);
|
|
4510
4484
|
}
|
|
4485
|
+
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4486
|
+
throw new NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update, please use fetchOpenOrder or fetchClosedOrder');
|
|
4487
|
+
}
|
|
4511
4488
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4489
|
+
throw new NotSupported(this.id + ' fetchOrders() is not supported after the 5/02 update, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders');
|
|
4490
|
+
}
|
|
4491
|
+
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4492
|
+
/**
|
|
4493
|
+
* @method
|
|
4494
|
+
* @name bybit#fetchClosedOrder
|
|
4495
|
+
* @description fetches information on a closed order made by the user
|
|
4496
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4497
|
+
* @param {string} id order id
|
|
4498
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4499
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4500
|
+
* @param {boolean} [params.stop] set to true for fetching a closed stop order
|
|
4501
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4502
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4503
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4504
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4505
|
+
*/
|
|
4506
|
+
await this.loadMarkets();
|
|
4507
|
+
const request = {
|
|
4508
|
+
'orderId': id,
|
|
4509
|
+
};
|
|
4510
|
+
const result = await this.fetchClosedOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4511
|
+
const length = result.length;
|
|
4512
|
+
if (length === 0) {
|
|
4513
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4514
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4515
|
+
throw new OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4516
|
+
}
|
|
4517
|
+
if (length > 1) {
|
|
4518
|
+
throw new InvalidOrder(this.id + ' returned more than one order');
|
|
4519
|
+
}
|
|
4520
|
+
return this.safeValue(result, 0);
|
|
4521
|
+
}
|
|
4522
|
+
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
4523
|
+
/**
|
|
4524
|
+
* @method
|
|
4525
|
+
* @name bybit#fetchOpenOrder
|
|
4526
|
+
* @description fetches information on an open order made by the user
|
|
4527
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4528
|
+
* @param {string} id order id
|
|
4529
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4530
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4531
|
+
* @param {boolean} [params.stop] set to true for fetching an open stop order
|
|
4532
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4533
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4534
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4535
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4536
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4537
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4538
|
+
*/
|
|
4539
|
+
await this.loadMarkets();
|
|
4540
|
+
const request = {
|
|
4541
|
+
'orderId': id,
|
|
4542
|
+
};
|
|
4543
|
+
const result = await this.fetchOpenOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4544
|
+
const length = result.length;
|
|
4545
|
+
if (length === 0) {
|
|
4546
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4547
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4548
|
+
throw new OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4549
|
+
}
|
|
4550
|
+
if (length > 1) {
|
|
4551
|
+
throw new InvalidOrder(this.id + ' returned more than one order');
|
|
4552
|
+
}
|
|
4553
|
+
return this.safeValue(result, 0);
|
|
4554
|
+
}
|
|
4555
|
+
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4512
4556
|
/**
|
|
4513
4557
|
* @method
|
|
4514
|
-
* @name bybit#
|
|
4515
|
-
* @description fetches information on multiple orders made by the user
|
|
4558
|
+
* @name bybit#fetchCanceledAndClosedOrders
|
|
4559
|
+
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4516
4560
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4517
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4561
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4518
4562
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4519
4563
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4520
4564
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4521
|
-
* @param {boolean} [params.stop] true
|
|
4565
|
+
* @param {boolean} [params.stop] set to true for fetching stop orders
|
|
4522
4566
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4523
4567
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4524
4568
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4525
4569
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4526
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
4570
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4527
4571
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4528
4572
|
*/
|
|
4529
4573
|
await this.loadMarkets();
|
|
4530
4574
|
let paginate = false;
|
|
4531
|
-
[paginate, params] = this.handleOptionAndParams(params, '
|
|
4575
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
|
|
4532
4576
|
if (paginate) {
|
|
4533
|
-
return await this.fetchPaginatedCallCursor('
|
|
4577
|
+
return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
4534
4578
|
}
|
|
4535
4579
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4536
4580
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4543,7 +4587,7 @@ export default class bybit extends Exchange {
|
|
|
4543
4587
|
request['symbol'] = market['id'];
|
|
4544
4588
|
}
|
|
4545
4589
|
let type = undefined;
|
|
4546
|
-
[type, params] = this.getBybitType('
|
|
4590
|
+
[type, params] = this.getBybitType('fetchCanceledAndClosedOrders', market, params);
|
|
4547
4591
|
if (((type === 'option') || isUsdcSettled) && !isUnifiedAccount) {
|
|
4548
4592
|
return await this.fetchUsdcOrders(symbol, since, limit, params);
|
|
4549
4593
|
}
|
|
@@ -4625,17 +4669,23 @@ export default class bybit extends Exchange {
|
|
|
4625
4669
|
* @name bybit#fetchClosedOrders
|
|
4626
4670
|
* @description fetches information on multiple closed orders made by the user
|
|
4627
4671
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4628
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4672
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4629
4673
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4630
4674
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4631
4675
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4676
|
+
* @param {boolean} [params.stop] set to true for fetching closed stop orders
|
|
4677
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4678
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4679
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4680
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4681
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4632
4682
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4633
4683
|
*/
|
|
4634
4684
|
await this.loadMarkets();
|
|
4635
4685
|
const request = {
|
|
4636
4686
|
'orderStatus': 'Filled',
|
|
4637
4687
|
};
|
|
4638
|
-
return await this.
|
|
4688
|
+
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4639
4689
|
}
|
|
4640
4690
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4641
4691
|
/**
|
|
@@ -4643,20 +4693,23 @@ export default class bybit extends Exchange {
|
|
|
4643
4693
|
* @name bybit#fetchCanceledOrders
|
|
4644
4694
|
* @description fetches information on multiple canceled orders made by the user
|
|
4645
4695
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4646
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4696
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4647
4697
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4648
4698
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4649
4699
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4650
4700
|
* @param {boolean} [params.stop] true if stop order
|
|
4651
4701
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4652
4702
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4703
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4704
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4705
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4653
4706
|
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4654
4707
|
*/
|
|
4655
4708
|
await this.loadMarkets();
|
|
4656
4709
|
const request = {
|
|
4657
4710
|
'orderStatus': 'Cancelled',
|
|
4658
4711
|
};
|
|
4659
|
-
return await this.
|
|
4712
|
+
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4660
4713
|
}
|
|
4661
4714
|
async fetchUsdcOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4662
4715
|
await this.loadMarkets();
|
package/js/src/coinbase.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export default class coinbase extends Exchange {
|
|
|
33
33
|
fetchMarkets(params?: {}): Promise<any>;
|
|
34
34
|
fetchMarketsV2(params?: {}): Promise<any[]>;
|
|
35
35
|
fetchMarketsV3(params?: {}): Promise<any[]>;
|
|
36
|
-
fetchCurrenciesFromCache(params?: {}): Promise<any
|
|
36
|
+
fetchCurrenciesFromCache(params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
37
37
|
fetchCurrencies(params?: {}): Promise<{}>;
|
|
38
38
|
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
39
39
|
fetchTickersV2(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Dictionary<Ticker>>;
|
|
@@ -68,9 +68,7 @@ export default class coinbase extends Exchange {
|
|
|
68
68
|
prepareAccountRequest(limit?: Int, params?: {}): {
|
|
69
69
|
account_id: string;
|
|
70
70
|
};
|
|
71
|
-
prepareAccountRequestWithCurrencyCode(code?: Str, limit?: Int, params?: {}): Promise<{
|
|
72
|
-
account_id: string;
|
|
73
|
-
}>;
|
|
71
|
+
prepareAccountRequestWithCurrencyCode(code?: Str, limit?: Int, params?: {}): Promise<{}[]>;
|
|
74
72
|
createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
|
|
75
73
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
76
74
|
parseOrder(order: any, market?: Market): Order;
|
|
@@ -93,6 +91,14 @@ export default class coinbase extends Exchange {
|
|
|
93
91
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
94
92
|
fetchBidsAsks(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Dictionary<Ticker>>;
|
|
95
93
|
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
94
|
+
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<{}>;
|
|
95
|
+
parseDepositAddress(depositAddress: any, currency?: Currency): {
|
|
96
|
+
info: any;
|
|
97
|
+
currency: string;
|
|
98
|
+
address: string;
|
|
99
|
+
tag: string;
|
|
100
|
+
network: string;
|
|
101
|
+
};
|
|
96
102
|
sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
|
|
97
103
|
url: string;
|
|
98
104
|
method: string;
|