ccxt 4.0.87 → 4.0.89
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/CHANGELOG.md +139 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +168 -33
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +1 -0
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/cryptocom.js +1 -0
- package/dist/cjs/src/delta.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/exmo.js +82 -30
- package/dist/cjs/src/gate.js +39 -0
- package/dist/cjs/src/okx.js +39 -0
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/binance.js +1 -0
- package/js/src/bingx.js +1 -1
- package/js/src/bybit.js +1 -0
- package/js/src/cryptocom.js +1 -0
- package/js/src/delta.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/exmo.js +83 -31
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +39 -0
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +39 -0
- package/js/src/pro/bybit.js +1 -1
- package/package.json +1 -1
package/js/src/okx.js
CHANGED
|
@@ -110,6 +110,7 @@ export default class okx extends Exchange {
|
|
|
110
110
|
'fetchTransactions': false,
|
|
111
111
|
'fetchTransfer': true,
|
|
112
112
|
'fetchTransfers': true,
|
|
113
|
+
'fetchUnderlyingAssets': true,
|
|
113
114
|
'fetchVolatilityHistory': false,
|
|
114
115
|
'fetchWithdrawal': true,
|
|
115
116
|
'fetchWithdrawals': true,
|
|
@@ -6703,6 +6704,44 @@ export default class okx extends Exchange {
|
|
|
6703
6704
|
}
|
|
6704
6705
|
return result;
|
|
6705
6706
|
}
|
|
6707
|
+
async fetchUnderlyingAssets(params = {}) {
|
|
6708
|
+
/**
|
|
6709
|
+
* @method
|
|
6710
|
+
* @name okx#fetchUnderlyingAssets
|
|
6711
|
+
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
6712
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-underlying
|
|
6713
|
+
* @param {object} [params] exchange specific params
|
|
6714
|
+
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
6715
|
+
* @returns {object[]} a list of [underlying assets]{@link https://github.com/ccxt/ccxt/wiki/Manual#underlying-assets-structure}
|
|
6716
|
+
*/
|
|
6717
|
+
await this.loadMarkets();
|
|
6718
|
+
let marketType = undefined;
|
|
6719
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
|
|
6720
|
+
if ((marketType === undefined) || (marketType === 'spot')) {
|
|
6721
|
+
marketType = 'option';
|
|
6722
|
+
}
|
|
6723
|
+
if ((marketType !== 'option') && (marketType !== 'swap') && (marketType !== 'future')) {
|
|
6724
|
+
throw new NotSupported(this.id + ' fetchUnderlyingAssets() supports contract markets only');
|
|
6725
|
+
}
|
|
6726
|
+
const request = {
|
|
6727
|
+
'instType': this.convertToInstrumentType(marketType),
|
|
6728
|
+
};
|
|
6729
|
+
const response = await this.publicGetPublicUnderlying(this.extend(request, params));
|
|
6730
|
+
//
|
|
6731
|
+
// {
|
|
6732
|
+
// "code": "0",
|
|
6733
|
+
// "data": [
|
|
6734
|
+
// [
|
|
6735
|
+
// "BTC-USD",
|
|
6736
|
+
// "ETH-USD"
|
|
6737
|
+
// ]
|
|
6738
|
+
// ],
|
|
6739
|
+
// "msg": ""
|
|
6740
|
+
// }
|
|
6741
|
+
//
|
|
6742
|
+
const underlyings = this.safeValue(response, 'data', []);
|
|
6743
|
+
return underlyings[0];
|
|
6744
|
+
}
|
|
6706
6745
|
handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
6707
6746
|
if (!response) {
|
|
6708
6747
|
return undefined; // fallback to default error handler
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -707,7 +707,7 @@ export default class bybit extends bybitRest {
|
|
|
707
707
|
if (this.newUpdates) {
|
|
708
708
|
limit = trades.getLimit(symbol, limit);
|
|
709
709
|
}
|
|
710
|
-
return this.
|
|
710
|
+
return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
|
|
711
711
|
}
|
|
712
712
|
handleMyTrades(client, message) {
|
|
713
713
|
//
|
package/package.json
CHANGED