Skip to content

Commit fdf70ff

Browse files
author
github-actions
committed
[TRANSFER][BUILD][PUBLISH]
1 parent ee3a78d commit fdf70ff

90 files changed

Lines changed: 40 additions & 32328 deletions

File tree

Some content is hidden

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

‎.github/workflows/build-single-exchange.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
build_for_pypi:
99
if: ${{ github.event.repository.name != 'ccxt-python-single-exchange' && (contains(github.event.head_commit.message, '[BUILD]') || contains(github.event.head_commit.message, '[PUBLISH]')) }}
1010
runs-on: ubuntu-latest
11+
env:
12+
DO_PUBLISH: ${{ contains(github.event.head_commit.message, '[PUBLISH]') }}
1113
steps:
1214
- name: Checkout code
1315
uses: actions/checkout@v4
@@ -40,27 +42,27 @@ jobs:
4042
git push origin HEAD:main
4143
4244
- name: Set up Python
43-
if: contains(github.event.head_commit.message, '[PUBLISH]')
45+
if: env.DO_PUBLISH == 'true'
4446
uses: actions/setup-python@v4
4547
with:
4648
python-version: '3.x'
4749

4850
- name: Install dependencies
49-
if: contains(github.event.head_commit.message, '[PUBLISH]')
51+
if: env.DO_PUBLISH == 'true'
5052
run: |
5153
python -m pip install --upgrade pip
5254
pip install build twine
5355
5456
- name: PyPi package
55-
if: contains(github.event.head_commit.message, '[PUBLISH]')
57+
if: env.DO_PUBLISH == 'true'
5658
env:
5759
PYPI_API_SECRET_SP: ${{ secrets.PYPI_API_SECRET_SP }}
5860
run: |
5961
cd build
6062
npm run pypi-packager
6163
6264
- name: PyPi upload
63-
if: contains(github.event.head_commit.message, '[PUBLISH]')
65+
if: env.DO_PUBLISH == 'true'
6466
run: |
6567
cd ./temp_pypi
6668
python -m twine upload dist/*

‎README.md‎

Lines changed: 0 additions & 332 deletions
This file was deleted.

‎build/build.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class build {
198198
await this.cleanInitFile (this.destinationFolder + 'async_support/__init__.py');
199199
await this.cleanInitFile (this.destinationFolder + 'pro/__init__.py');
200200
this.editWsHeaders ();
201+
this.applyExchangeSpecificEdits ();
201202

202203
// Remove git dir now (after reading exchanges)
203204
this.createMetaPackage ();
@@ -303,6 +304,37 @@ class build {
303304
this.updateReadme(this.sortMethods(restMethods), rawMethods, wsMethods, readme);
304305
return restMethods;
305306
}
307+
308+
309+
// #############################################################
310+
// #############################################################
311+
// ########### exchange specific edits ################
312+
// #############################################################
313+
// #############################################################
314+
315+
applyExchangeSpecificEdits () {
316+
this.hyperliquidReplaceBuilderAndRef ();
317+
}
318+
319+
hyperliquidReplaceBuilderAndRef () {
320+
if (this.exchange === 'hyperliquid') {
321+
const files = [
322+
this.destinationFolder + `${this.exchange}.py`,
323+
this.destinationFolder + `async_support/${this.exchange}.py`,
324+
];
325+
for (const file of files) {
326+
const fileContent = fs.readFileSync(file, 'utf8');
327+
const newContent = regexAll (fileContent, [
328+
['0x6530512A6c89C7cfCEbC3BA7fcD9aDa5f30827a6', '0x126CcC52EdF7AEB3c48Ab3564F5F3256EA4bc3D8'],
329+
["'CCXT1'", "'HLPY'"],
330+
]);
331+
if (newContent === fileContent) {
332+
console.warn (`[replaceBuilderAndRef] no replacements made in ${file}`);
333+
}
334+
fs.writeFileSync(file, newContent);
335+
}
336+
}
337+
}
306338
}
307339

308340

‎build/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"build-single-exchange": "tsx build.ts",
88
"pypi-packager": "tsx pypi-packager.ts",
9+
910
"sample-generate": "cd ../.github/scripts/ && bash generate-exchange-skeleton.sh ../../../tmp_folder kucoin",
1011
"sample-build": "cd ../../tmp_folder/build && npm run build-single-exchange",
1112
"sample-pypi": "cd ../../tmp_folder/build && npm run pypi-packager",
@@ -16,8 +17,7 @@
1617
"dependencies": {
1718
"fs": "*",
1819
"path": "*",
19-
"semver": "^7.7.1",
20-
"typescript": "^7.0.2"
20+
"semver": "^7.7.1"
2121
},
2222
"devDependencies": {
2323
"tsx": "^4.19.3"

‎cryptocom/__init__.py‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎cryptocom/ccxt/__init__.py‎

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)