Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ws exchange.has is sorted #22280

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion build/transpile.js
Expand Up @@ -1101,14 +1101,21 @@ class Transpiler {
return false // capabilities not found
}
let capabilities = found[0].split (lineBreak);
const sortingOrder = {
let sortingOrder = { // appear at top of has
'CORS': 'undefined,',
'spot': 'true,',
'margin': 'undefined,',
'swap': 'undefined,',
'future': 'undefined,',
'option': 'undefined,',
// then everything else
};
const websocketRegex = /\'ws\': true,/;
const isWebsocket = websocketRegex.exec (found[0]);
if (isWebsocket) { // if it's a websocket file
sortingOrder = {
'ws': 'true,',
};
}
const features = {}
let indentation = ' ' // 16 spaces
Expand Down
2 changes: 1 addition & 1 deletion build/transpile.sh
Expand Up @@ -14,7 +14,7 @@ exchange_name="$1"

# Check if the first argument was provided
if [ -z "$exchange_name" ]; then
echo "Exchange name not provided provided."
echo "Exchange name not provided."
exit 1
fi

Expand Down
4 changes: 0 additions & 4 deletions build/transpileWS.js
Expand Up @@ -115,10 +115,6 @@ class CCXTProTranspiler extends Transpiler {
]
}

sortExchangeCapabilities (code) {
return false
}

exportTypeScriptClassNames (file, classes) {

log.bright.cyan ('Exporting WS TypeScript class names →', file.yellow)
Expand Down