Last active
November 5, 2024 04:33
-
-
Save LTNMinh/0bfc712d6276b79c13d06de45bf69712 to your computer and use it in GitHub Desktop.
Revisions
-
LTNMinh revised this gist
Nov 5, 2024 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -85,11 +85,14 @@ tsc ## 6. Try to debug with breakpoint. Add lauch.json in vscode ``` { "version": "0.2.0", "configurations":[{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/js/main.js", }] } ``` -
LTNMinh revised this gist
Nov 5, 2024 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,4 +82,14 @@ main() tsc ``` ## 6. Try to debug with breakpoint. Add lauch.json in vscode ``` [{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/js/main.js", }] ``` -
LTNMinh created this gist
Nov 5, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,85 @@ # How to debug cctx using Devcontainer ## 1. Create Devcontainer In your project. Create .devcontainer folder Create devcontainer.json inside .devcontainer folder ``` { "name": "TypeScript Dev Container", "build": { "dockerfile": "../Dockerfile", "context": "../" }, "customizations": { "vscode": { "settings": { "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib" // Path to TypeScript SDK }, "extensions": [ "ms-vscode.vscode-typescript-tslint-plugin", // TypeScript/TSLint support "esbenp.prettier-vscode", // Prettier for code formatting "dbaeumer.vscode-eslint" // ESLint support ] } } } ``` Use vscode or intelliji to open in dev container ## 2. Add you exchange file and build the project After add new exchange file, you should build the project. ``` npm run build ``` This will make exchange file compiles and usable in the next step. ## 3. Add new file main inside folder ts/ ``` // ts/main.js import ccxt from "./ccxt.js"; async function main() { const keystore = { "uid": "REPLACE WITH YOUR APP ID", "login": "REPLACE WITH YOUR SESSION ID", "apiKey": "REPLACE WITH YOUR SERVER PUBLIC KEY", "password": "REPLACE WITH YOUR SESSION PRIVATE KEY", "privateKey": "REPLACE WITH YOUR SPEND PRIVATE KEY", "secret": "REPLACE WITH YOUR OAUTH SECRET" } const exchange = new ccxt.your_new_exchange_here(keystore); // You code go here } main() ``` ## 4. Modify tsconfig.json ``` { "compilerOptions": { ... "sourceMap": true, // Uncomment this line. ... } .... } ``` ## 5. Build the ts file. ``` tsc ``` ## 6. Try to debug with breakpoint.