ccxt 4.2.21 β 4.2.23
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 +574 -81
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/binance.js +14 -3
- package/dist/cjs/src/bitfinex2.js +89 -0
- package/dist/cjs/src/bitget.js +11 -1
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bybit.js +57 -9
- package/dist/cjs/src/coinbasepro.js +1 -0
- package/dist/cjs/src/coinex.js +60 -14
- package/dist/cjs/src/deribit.js +164 -0
- package/dist/cjs/src/okcoin.js +3 -0
- package/dist/cjs/src/okx.js +81 -31
- package/dist/cjs/src/phemex.js +17 -5
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/bequant.js +6 -1
- package/dist/cjs/src/pro/binance.js +8 -5
- package/dist/cjs/src/pro/binancecoinm.js +6 -1
- package/dist/cjs/src/pro/binanceus.js +6 -1
- package/dist/cjs/src/pro/bitcoincom.js +6 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitrue.js +6 -1
- package/dist/cjs/src/pro/hitbtc.js +6 -0
- package/dist/cjs/src/pro/okx.js +23 -5
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +3 -0
- package/js/src/abstract/binancecoinm.d.ts +3 -0
- package/js/src/abstract/binanceus.d.ts +4 -0
- package/js/src/abstract/binanceusdm.d.ts +3 -0
- package/js/src/bigone.js +1 -0
- package/js/src/binance.js +14 -3
- package/js/src/bitfinex2.d.ts +2 -0
- package/js/src/bitfinex2.js +89 -0
- package/js/src/bitget.js +11 -1
- package/js/src/bitrue.js +1 -0
- package/js/src/bybit.d.ts +2 -1
- package/js/src/bybit.js +57 -9
- package/js/src/coinbasepro.js +1 -0
- package/js/src/coinex.d.ts +1 -0
- package/js/src/coinex.js +60 -14
- package/js/src/deribit.d.ts +6 -1
- package/js/src/deribit.js +164 -0
- package/js/src/okcoin.js +3 -0
- package/js/src/okx.js +81 -31
- package/js/src/phemex.js +17 -5
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/bequant.js +6 -1
- package/js/src/pro/binance.js +8 -5
- package/js/src/pro/binancecoinm.js +6 -1
- package/js/src/pro/binanceus.js +6 -1
- package/js/src/pro/bitcoincom.js +6 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitrue.js +6 -1
- package/js/src/pro/hitbtc.js +6 -0
- package/js/src/pro/okx.js +23 -5
- package/js/src/woo.js +1 -1
- package/jsdoc2md.js +38 -16
- package/package.json +4 -1
- package/skip-tests.json +4 -0
package/js/src/pro/okx.js
CHANGED
|
@@ -853,13 +853,15 @@ export default class okx extends okxRest {
|
|
|
853
853
|
/**
|
|
854
854
|
* @method
|
|
855
855
|
* @name okx#watchMyTrades
|
|
856
|
-
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
857
856
|
* @description watches information on multiple trades made by the user
|
|
857
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
858
858
|
* @param {string} [symbol] unified market symbol of the market trades were made in
|
|
859
859
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
860
860
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
861
861
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
862
862
|
* @param {bool} [params.stop] true if fetching trigger or conditional trades
|
|
863
|
+
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
864
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
863
865
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
864
866
|
*/
|
|
865
867
|
// By default, receive order updates from any instrument type
|
|
@@ -881,7 +883,14 @@ export default class okx extends okxRest {
|
|
|
881
883
|
if (type === 'future') {
|
|
882
884
|
type = 'futures';
|
|
883
885
|
}
|
|
884
|
-
|
|
886
|
+
let uppercaseType = type.toUpperCase();
|
|
887
|
+
let marginMode = undefined;
|
|
888
|
+
[marginMode, params] = this.handleMarginModeAndParams('watchMyTrades', params);
|
|
889
|
+
if (uppercaseType === 'SPOT') {
|
|
890
|
+
if (marginMode !== undefined) {
|
|
891
|
+
uppercaseType = 'MARGIN';
|
|
892
|
+
}
|
|
893
|
+
}
|
|
885
894
|
const request = {
|
|
886
895
|
'instType': uppercaseType,
|
|
887
896
|
};
|
|
@@ -1014,13 +1023,15 @@ export default class okx extends okxRest {
|
|
|
1014
1023
|
/**
|
|
1015
1024
|
* @method
|
|
1016
1025
|
* @name okx#watchOrders
|
|
1017
|
-
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
1018
1026
|
* @description watches information on multiple orders made by the user
|
|
1019
|
-
* @
|
|
1027
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
1028
|
+
* @param {string} [symbol] unified market symbol of the market the orders were made in
|
|
1020
1029
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1021
1030
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1022
1031
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1023
1032
|
* @param {bool} [params.stop] true if fetching trigger or conditional orders
|
|
1033
|
+
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1034
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1024
1035
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1025
1036
|
*/
|
|
1026
1037
|
let type = undefined;
|
|
@@ -1039,7 +1050,14 @@ export default class okx extends okxRest {
|
|
|
1039
1050
|
if (type === 'future') {
|
|
1040
1051
|
type = 'futures';
|
|
1041
1052
|
}
|
|
1042
|
-
|
|
1053
|
+
let uppercaseType = type.toUpperCase();
|
|
1054
|
+
let marginMode = undefined;
|
|
1055
|
+
[marginMode, params] = this.handleMarginModeAndParams('watchOrders', params);
|
|
1056
|
+
if (uppercaseType === 'SPOT') {
|
|
1057
|
+
if (marginMode !== undefined) {
|
|
1058
|
+
uppercaseType = 'MARGIN';
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1043
1061
|
const request = {
|
|
1044
1062
|
'instType': uppercaseType,
|
|
1045
1063
|
};
|
package/js/src/woo.js
CHANGED
|
@@ -61,7 +61,7 @@ export default class woo extends Exchange {
|
|
|
61
61
|
'fetchClosedOrder': false,
|
|
62
62
|
'fetchClosedOrders': false,
|
|
63
63
|
'fetchCurrencies': true,
|
|
64
|
-
'fetchDepositAddress':
|
|
64
|
+
'fetchDepositAddress': true,
|
|
65
65
|
'fetchDeposits': true,
|
|
66
66
|
'fetchDepositsWithdrawals': true,
|
|
67
67
|
'fetchFundingHistory': true,
|
package/jsdoc2md.js
CHANGED
|
@@ -29,9 +29,12 @@ const findByExtensionSync = (dir, ext) => {
|
|
|
29
29
|
// Get all files to read js docs
|
|
30
30
|
const inputFiles = findByExtensionSync('js/src', 'js')
|
|
31
31
|
const proInputFiles = findByExtensionSync('js/src/pro', 'js');
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
32
|
+
const basePartials = './wiki/basePartials/'
|
|
33
|
+
const basePartial = fs.readdirSync (basePartials).map (file => basePartials + file)
|
|
34
|
+
const exchangePartials = './wiki/exchangePartials/'
|
|
35
|
+
const exchangePartial = fs.readdirSync (exchangePartials).map (file => exchangePartials + file)
|
|
36
|
+
const outputFolder = './wiki/'
|
|
37
|
+
const outputFile = './wiki/baseSpec.md'
|
|
35
38
|
const helper = './wiki/helpers.cjs'
|
|
36
39
|
|
|
37
40
|
console.log ('π° loading js docs...')
|
|
@@ -54,6 +57,7 @@ proTemplateData.forEach((proData) => {
|
|
|
54
57
|
console.log ('π° rendering docs for each exchange...')
|
|
55
58
|
const template = fs.readFileSync ('./wiki/spec.hbs', 'utf8')
|
|
56
59
|
|
|
60
|
+
const outputByExchange = await Promise.all (templateData.map (data => jsdoc2md.render ({ template, data, partial: exchangePartial, helper })))
|
|
57
61
|
// Group docs by method
|
|
58
62
|
const groupedByMethod = templateData.reduce((acc, arr) => {
|
|
59
63
|
arr.filter(obj => obj.kind === 'function' && !obj.ignore).forEach(obj => {
|
|
@@ -79,21 +83,39 @@ const groupedByMethod = templateData.reduce((acc, arr) => {
|
|
|
79
83
|
|
|
80
84
|
const templateDataGroupedByMethod = Object.values(groupedByMethod).sort((a, b) =>a[0].name < b[0].name ? -1 : 1)
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
|
|
87
|
+
const baseOutput = await Promise.all (templateDataGroupedByMethod.map (data => jsdoc2md.render ({ template, data, partial: basePartial, helper})))
|
|
83
88
|
|
|
84
89
|
console.log ('π° creating index of exchange functions')
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
const exchangeLinks = []
|
|
91
|
+
outputByExchange.forEach ((output, i) => {
|
|
92
|
+
const name = templateData[i][0].id
|
|
93
|
+
const fileName = 'exchanges/' + name + '.md'
|
|
94
|
+
fs.writeFileSync (outputFolder + fileName, output)
|
|
95
|
+
exchangeLinks.push (`\t- [${name}](${fileName})`)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
fs.writeFileSync (outputFile, baseOutput.join ('\n---\n'))
|
|
100
|
+
|
|
101
|
+
const sidebar =
|
|
102
|
+
`
|
|
103
|
+
- [Install](Install.md)
|
|
104
|
+
- [Examples](Examples.md)
|
|
105
|
+
- [Manual](Manual.md)
|
|
106
|
+
- [CCXT Pro](ccxt.pro.manual.md)
|
|
107
|
+
- [Contributing](CONTRIBUTING.md)
|
|
108
|
+
- [Supported Exchanges](Exchange-Markets.md)
|
|
109
|
+
- [Exchanges By Country](Exchange-Markets-By-Country.md)
|
|
110
|
+
- [API Spec By Method](baseSpec.md)
|
|
111
|
+
- API Spec by Exchange
|
|
112
|
+
${exchangeLinks.join('\n')}
|
|
113
|
+
- [Changelog](CHANGELOG.md)
|
|
114
|
+
- [Awesome](Awesome.md)
|
|
115
|
+
`
|
|
116
|
+
fs.writeFileSync('./wiki/_sidebar.md', sidebar);
|
|
117
|
+
|
|
97
118
|
console.log ('π° finished rendering docs! π πΆβπ«')
|
|
98
119
|
|
|
99
120
|
})()
|
|
121
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.23",
|
|
4
4
|
"description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
|
|
5
5
|
"unpkg": "dist/ccxt.browser.js",
|
|
6
6
|
"type": "module",
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"readme": "README.md",
|
|
24
24
|
"scripts": {
|
|
25
|
+
"instrument": "nyc instrument js/ jsInstrumented/",
|
|
26
|
+
"nyc-coverage": "nyc --reporter=html --reporter=lcov --exclude='js/src/pro/**' --exclude='js/src/base/**' --exclude='js/src/test/**' --exclude='js/src/abstract/**' --exclude='js/src/static_dependencies' node jsInstrumented/src/test/test.js --requestTests --responseTests",
|
|
27
|
+
"coverage-js": "npm run instrument && npm run nyc-coverage && rm -rf jsInstrumented",
|
|
25
28
|
"docker": "docker-compose run --rm ccxt",
|
|
26
29
|
"fixTSBug": "node build/fixTSBug",
|
|
27
30
|
"build-docs": "node jsdoc2md.js && node examples2md.js",
|
package/skip-tests.json
CHANGED