ccxt 4.2.20 β 4.2.22
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 +1405 -274
- package/dist/ccxt.browser.min.js +6 -6
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +37 -4
- package/dist/cjs/src/base/ws/WsClient.js +3 -1
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/binance.js +14 -3
- package/dist/cjs/src/bitget.js +12 -2
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bitvavo.js +271 -172
- package/dist/cjs/src/blockchaincom.js +3 -1
- package/dist/cjs/src/bybit.js +57 -9
- package/dist/cjs/src/coinbasepro.js +1 -0
- package/dist/cjs/src/coinex.js +37 -12
- package/dist/cjs/src/deribit.js +164 -0
- package/dist/cjs/src/gate.js +32 -1
- package/dist/cjs/src/novadax.js +26 -22
- package/dist/cjs/src/okcoin.js +3 -0
- package/dist/cjs/src/phemex.js +7 -3
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/bequant.js +6 -1
- package/dist/cjs/src/pro/binance.js +7 -4
- 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/bitopro.js +7 -3
- package/dist/cjs/src/pro/bitrue.js +6 -1
- package/dist/cjs/src/pro/bitvavo.js +668 -22
- package/dist/cjs/src/pro/lbank.js +1 -1
- package/dist/cjs/src/pro/okx.js +13 -3
- 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/abstract/gate.d.ts +1 -0
- package/js/src/abstract/gateio.d.ts +1 -0
- package/js/src/abstract/novadax.d.ts +5 -1
- package/js/src/abstract/phemex.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +12 -1
- package/js/src/base/Exchange.js +37 -4
- package/js/src/base/ws/WsClient.js +3 -2
- package/js/src/bigone.js +1 -0
- package/js/src/binance.js +14 -3
- package/js/src/bitget.js +12 -2
- package/js/src/bitrue.js +1 -0
- package/js/src/bitvavo.d.ts +14 -2
- package/js/src/bitvavo.js +271 -172
- package/js/src/blockchaincom.js +3 -1
- 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 +37 -12
- package/js/src/deribit.d.ts +6 -1
- package/js/src/deribit.js +164 -0
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +32 -1
- package/js/src/novadax.js +26 -22
- package/js/src/okcoin.js +3 -0
- package/js/src/phemex.js +7 -3
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/bequant.js +6 -1
- package/js/src/pro/binance.js +7 -4
- 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/bitopro.js +7 -3
- package/js/src/pro/bitrue.js +6 -1
- package/js/src/pro/bitvavo.d.ts +35 -2
- package/js/src/pro/bitvavo.js +669 -23
- package/js/src/pro/lbank.js +1 -1
- package/js/src/pro/okx.js +13 -3
- 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/lbank.js
CHANGED
|
@@ -685,7 +685,7 @@ export default class lbank extends lbankRest {
|
|
|
685
685
|
};
|
|
686
686
|
const request = this.deepExtend(subscribe, params);
|
|
687
687
|
const orderbook = await this.watch(url, messageHash, request, messageHash);
|
|
688
|
-
return orderbook.limit(
|
|
688
|
+
return orderbook.limit();
|
|
689
689
|
}
|
|
690
690
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
691
691
|
/**
|
package/js/src/pro/okx.js
CHANGED
|
@@ -1014,17 +1014,20 @@ export default class okx extends okxRest {
|
|
|
1014
1014
|
/**
|
|
1015
1015
|
* @method
|
|
1016
1016
|
* @name okx#watchOrders
|
|
1017
|
-
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
1018
1017
|
* @description watches information on multiple orders made by the user
|
|
1019
|
-
* @
|
|
1018
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
1019
|
+
* @param {string} [symbol] unified market symbol of the market the orders were made in
|
|
1020
1020
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1021
1021
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1022
1022
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1023
1023
|
* @param {bool} [params.stop] true if fetching trigger or conditional orders
|
|
1024
|
+
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1025
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1024
1026
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1025
1027
|
*/
|
|
1026
1028
|
let type = undefined;
|
|
1027
1029
|
// By default, receive order updates from any instrument type
|
|
1030
|
+
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'defaultType');
|
|
1028
1031
|
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'type', 'ANY');
|
|
1029
1032
|
const isStop = this.safeValue2(params, 'stop', 'trigger', false);
|
|
1030
1033
|
params = this.omit(params, ['stop', 'trigger']);
|
|
@@ -1039,7 +1042,14 @@ export default class okx extends okxRest {
|
|
|
1039
1042
|
if (type === 'future') {
|
|
1040
1043
|
type = 'futures';
|
|
1041
1044
|
}
|
|
1042
|
-
|
|
1045
|
+
let uppercaseType = type.toUpperCase();
|
|
1046
|
+
let marginMode = undefined;
|
|
1047
|
+
[marginMode, params] = this.handleMarginModeAndParams('watchOrders', params);
|
|
1048
|
+
if (uppercaseType === 'SPOT') {
|
|
1049
|
+
if (marginMode !== undefined) {
|
|
1050
|
+
uppercaseType = 'MARGIN';
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1043
1053
|
const request = {
|
|
1044
1054
|
'instType': uppercaseType,
|
|
1045
1055
|
};
|
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.22",
|
|
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