Skip to content

Commit 4c989da

Browse files
committed
Merge branch 'master' of github.com:ccxt/ccxt into appveyor-build-sh-updates
2 parents 8a6103a + 4103d8d commit 4c989da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3460
-759
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ script:
3838
echo "Publishing";
3939
npm config set git-tag-version=false && NPM_VERSION=$(npm version patch);
4040
npm run vss && npm run copy-python-files;
41-
npm list -g standard-version --depth=0 || npm install -g [email protected];
42-
standard-version --skip.bump --skip.commit --skip.tag;
41+
./change.sh > CHANGELOG.md;
4342
env COMMIT_MESSAGE=${NPM_VERSION:1} GITHUB_TOKEN=${GITHUB_TOKEN} SHOULD_TAG=${SHOULD_DEPLOY} ./build/push.sh;
4443
cd python && env PYPI_TOKEN=${PYPI_TOKEN} ./deploy.sh && cd ..;
4544
else

CHANGELOG.md

+1,799-559
Large diffs are not rendered by default.

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ Current feature list:
2121

2222
## Sponsored Promotion
2323

24-
[![Join the CCXT x Gate.io Campaign: Win 100% Trading Fee Discount and VIP Upgrade on Gate.io](https://user-images.githubusercontent.com/1294454/233369442-eff6bee8-daab-4fcf-93d1-88563908bc12.jpg)](https://github.com/ccxt/ccxt/issues/17273)
24+
[![Bitget + CCXT Trading Competition](https://github.com/ccxt/ccxt/assets/1294454/60aeae70-6f72-4c4b-8f09-1963eb6909ab)]([https://www.bitget.com/en/ctc?id=a48057a03408549cba00ecdd8ba6d8fe](https://github.com/ccxt/ccxt/issues/17983)
2525

26+
[![Bitget + CCXT Messi Merch](https://github.com/ccxt/ccxt/assets/1294454/99eb5ce0-88bd-4ba0-aae1-9662b34b3cb3)]([https://www.bitget.com/en/ctc?id=a48057a03408549cba00ecdd8ba6d8fe](https://github.com/ccxt/ccxt/issues/17983)
2627

2728

2829

@@ -218,13 +219,13 @@ console.log(version, Object.keys(exchanges));
218219

219220
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
220221

221-
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].3/dist/ccxt.browser.js
222-
* unpkg: https://unpkg.com/[email protected].3/dist/ccxt.browser.js
222+
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].5/dist/ccxt.browser.js
223+
* unpkg: https://unpkg.com/[email protected].5/dist/ccxt.browser.js
223224

224225
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
225226

226227
```HTML
227-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/ccxt.browser.js"></script>
228+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].5/dist/ccxt.browser.js"></script>
228229
```
229230

230231
Creates a global `ccxt` object:

change.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
previous_tag=0
3+
for current_tag in $(git tag --sort=-creatordate)
4+
do
5+
major_version=$(echo ${current_tag} | cut -d '.' -f 1)
6+
major_version=$(echo "$major_version" | sed -e "s/v//")
7+
if [ "$major_version" -ge 3 ] ;then
8+
if [ "$previous_tag" != 0 ]; then
9+
tag_date=$(git log -1 --pretty=format:'%ad' --date=short ${previous_tag})
10+
printf "## ${previous_tag} (${tag_date})\n\n"
11+
git log ${current_tag}...${previous_tag} --pretty=format:'* %s [%h](https://github.com/ccxt/ccxt/commits/%H)' --reverse | grep -v Merge | grep -v skip | grep -v '-'
12+
# print $commits
13+
printf "\n\n"
14+
fi
15+
previous_tag=${current_tag}
16+
fi
17+
18+
done

composer.json

-5
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@
212212
"email": "[email protected]",
213213
"homepage": "https://github.com/kroitor",
214214
"role": "Developer"
215-
}, {
216-
"name": "Vitaly Gordon",
217-
"email": "[email protected]",
218-
"homepage": "https://github.com/xpl",
219-
"role": "Developer"
220215
}, {
221216
"name": "Carlo Revelli",
222217
"email": "[email protected]",

dist/ccxt.browser.js

+61-20
Original file line numberDiff line numberDiff line change
@@ -33987,6 +33987,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
3398733987
if (quote === 'USDT') {
3398833988
minCost = this.safeNumber(market, 'minTradeUSDT');
3398933989
}
33990+
const contractSize = contract ? 1 : undefined;
3399033991
return {
3399133992
'id': marketId,
3399233993
'symbol': symbol,
@@ -34008,7 +34009,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
3400834009
'inverse': inverse,
3400934010
'taker': this.safeNumber(market, 'takerFeeRate'),
3401034011
'maker': this.safeNumber(market, 'makerFeeRate'),
34011-
'contractSize': 1,
34012+
'contractSize': contractSize,
3401234013
'expiry': expiry,
3401334014
'expiryDatetime': expiryDatetime,
3401434015
'strike': undefined,
@@ -69104,6 +69105,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
6910469105
'v5/order/spot-borrow-check': 2.5,
6910569106
'v5/order/realtime': 2.5,
6910669107
'v5/position/list': 2.5,
69108+
'v5/position/switch-mode': 2.5,
6910769109
'v5/execution/list': 2.5,
6910869110
'v5/position/closed-pnl': 2.5,
6910969111
'v5/account/wallet-balance': 2.5,
@@ -76386,7 +76388,22 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
7638676388
return await this[method](this.extend(request, params));
7638776389
}
7638876390
async setPositionMode(hedged, symbol = undefined, params = {}) {
76391+
/**
76392+
* @method
76393+
* @name bybit#setPositionMode
76394+
* @description set hedged to true or false for a market
76395+
* @see https://bybit-exchange.github.io/docs/v5/position/position-mode
76396+
* @see https://bybit-exchange.github.io/docs/derivatives/contract/position-mode
76397+
* @param {bool} hedged
76398+
* @param {string|undefined} symbol used for unified account with inverse market
76399+
* @param {object} params extra parameters specific to the bybit api endpoint
76400+
* @returns {object} response from the exchange
76401+
*/
7638976402
await this.loadMarkets();
76403+
let market = undefined;
76404+
if (symbol !== undefined) {
76405+
market = this.market(symbol);
76406+
}
7639076407
let mode = undefined;
7639176408
if (hedged) {
7639276409
mode = 3;
@@ -76401,10 +76418,26 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
7640176418
request['coin'] = 'USDT';
7640276419
}
7640376420
else {
76404-
const market = this.market(symbol);
7640576421
request['symbol'] = market['id'];
7640676422
}
76423+
const enableUnified = await this.isUnifiedEnabled();
76424+
let response = undefined;
76425+
if (enableUnified[1] || enableUnified[0]) {
76426+
if (symbol !== undefined) {
76427+
request['category'] = market['linear'] ? 'linear' : 'inverse';
76428+
}
76429+
else {
76430+
let subType = undefined;
76431+
[subType, params] = this.handleSubTypeAndParams('setPositionMode', market, params);
76432+
request['category'] = subType;
76433+
}
76434+
response = await this.privatePostV5PositionSwitchMode(this.extend(request, params));
76435+
}
76436+
else {
76437+
response = await this.privatePostContractV3PrivatePositionSwitchMode(this.extend(request, params));
76438+
}
7640776439
//
76440+
// contract v3
7640876441
// {
7640976442
// "ret_code": 0,
7641076443
// "ret_msg": "ok",
@@ -76417,7 +76450,15 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
7641776450
// "rate_limit": 75
7641876451
// }
7641976452
//
76420-
return await this.privatePostContractV3PrivatePositionSwitchMode(this.extend(request, params));
76453+
// v5
76454+
// {
76455+
// "retCode": 0,
76456+
// "retMsg": "OK",
76457+
// "result": {},
76458+
// "retExtInfo": {},
76459+
// "time": 1675249072814
76460+
// }
76461+
return response;
7642176462
}
7642276463
async fetchDerivativesOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
7642376464
await this.loadMarkets();
@@ -203572,7 +203613,7 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
203572203613
messageHash += ':' + symbol;
203573203614
}
203574203615
else {
203575-
message['params'] = this.ids;
203616+
message['params'] = [];
203576203617
}
203577203618
const url = this.urls['api']['ws'][type];
203578203619
const request = this.deepExtend(message, query);
@@ -203878,14 +203919,14 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
203878203919
// id: 1
203879203920
// }
203880203921
//
203881-
const future = this.safeValue(client.futures, 'authenticated');
203882-
if (future !== undefined) {
203883-
future.resolve(true);
203884-
}
203922+
const messageHashSpot = 'authenticated:spot';
203923+
const messageHashSwap = 'authenticated:swap';
203924+
client.resolve(message, messageHashSpot);
203925+
client.resolve(message, messageHashSwap);
203885203926
return message;
203886203927
}
203887203928
handleSubscriptionStatus(client, message) {
203888-
const id = this.safeString(message, 'id');
203929+
const id = this.safeInteger(message, 'id');
203889203930
const subscription = this.safeValue(client.subscriptions, id);
203890203931
if (subscription !== undefined) {
203891203932
const futureIndex = this.safeString(subscription, 'future');
@@ -203904,11 +203945,10 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
203904203945
const time = this.milliseconds();
203905203946
if (type === 'spot') {
203906203947
const messageHash = 'authenticated:spot';
203907-
const authenticated = this.safeValue(client.futures, messageHash);
203908-
if (authenticated !== undefined) {
203909-
return;
203948+
let future = this.safeValue(client.subscriptions, messageHash);
203949+
if (future !== undefined) {
203950+
return future;
203910203951
}
203911-
const future = client.future(messageHash);
203912203952
const requestId = this.requestId();
203913203953
const subscribe = {
203914203954
'id': requestId,
@@ -203925,16 +203965,16 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
203925203965
],
203926203966
'id': requestId,
203927203967
};
203928-
this.spawn(this.watch, url, messageHash, request, requestId, subscribe);
203968+
future = this.watch(url, messageHash, request, requestId, subscribe);
203969+
client.subscriptions[messageHash] = future;
203929203970
return future;
203930203971
}
203931203972
else {
203932203973
const messageHash = 'authenticated:swap';
203933-
const authenticated = this.safeValue(client.futures, messageHash);
203934-
if (authenticated !== undefined) {
203935-
return;
203974+
let future = this.safeValue(client.subscriptions, messageHash);
203975+
if (future !== undefined) {
203976+
return future;
203936203977
}
203937-
const future = client.future('authenticated:swap');
203938203978
const requestId = this.requestId();
203939203979
const subscribe = {
203940203980
'id': requestId,
@@ -203951,7 +203991,8 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
203951203991
],
203952203992
'id': requestId,
203953203993
};
203954-
this.spawn(this.watch, url, messageHash, request, requestId, subscribe);
203994+
future = this.watch(url, messageHash, request, requestId, subscribe);
203995+
client.subscriptions[messageHash] = future;
203955203996
return future;
203956203997
}
203957203998
}
@@ -267973,7 +268014,7 @@ SOFTWARE.
267973268014

267974268015
//-----------------------------------------------------------------------------
267975268016
// this is updated by vss.js when building
267976-
const version = '3.1.3';
268017+
const version = '3.1.5';
267977268018
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
267978268019
//-----------------------------------------------------------------------------
267979268020

dist/ccxt.browser.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)