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
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.
// 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()
{
"compilerOptions": {
...
"sourceMap": true, // Uncomment this line.
...
}
....
}
tsc
Add lauch.json in vscode
{
"version": "0.2.0",
"configurations":[{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/js/main.js",
}]
}