{"_id":"3commas-client-node","name":"3commas-client-node","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"3commas-client-node","version":"1.0.0","description":"A typescript client for 3commas for node.js. It supports also websockets","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","clean":"tsc --build --clean","watch":"tsc -w","test":"npm run test-unit && npm run test-integration && npm run test-e2e","test-unit":"mocha -r ts-node/register -u bdd --colors src/**/*.unit.{js,ts}","test-integration":"mocha -r ts-node/register -u bdd --colors test/integration/*.{js,ts}","test-e2e":"mocha -r ts-node/register -u bdd --colors test/e2e/*.{js,ts}","prepublish":"tsc"},"author":{"name":"Jacopo Maroli"},"license":"ISC","devDependencies":{"@types/async-retry":"^1.4.4","@types/chai":"^4.3.1","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","@types/node":"^17.0.36","@types/node-fetch":"github:jacopomaroli/types-node-fetch","@types/sinon-chai":"^3.2.8","@types/ws":"^8.5.3","@typescript-eslint/parser":"^5.26.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","chai-spies":"^1.0.0","dotenv":"^16.0.1","eslint":"^8.16.0","eslint-config-standard":"^17.0.0","eslint-config-typescript":"^3.0.0","eslint-plugin-chai-friendly":"^0.7.2","eslint-plugin-import":"^2.26.0","eslint-plugin-mocha":"^10.0.5","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.0.0","form-data":"^4.0.0","mocha":"^10.0.0","node-fetch":"^2.6.7","openapi-typescript-codegen":"github:huzaifahj/openapi-typescript-codegen#patch-1","sinon":"^14.0.0","sinon-chai":"^3.7.0","ts-node":"^10.8.0","typescript":"^4.7.2","ws":"^8.7.0"},"gitHead":"f0404615c15f31348bd98e41c71b3a872d871fb2","_id":"3commas-client-node@1.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-EHFUi8+HGFW64ApWCQbgurqrm/ezTGXeyLJZJmKeeukgna2lwcvU5aVQHqT6n5jLyqhH8+P7ZSKEOby7H5CA0g==","shasum":"1b099454e8ce2eac3d1993d01dbc64806b5db10c","tarball":"https://registry.npmjs.org/3commas-client-node/-/3commas-client-node-1.0.0.tgz","fileCount":230,"unpackedSize":349405,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW1xqH74Sxwwk2D6f1FZuYzK1n+3cf9XV8AxsRy9YR5wIgCMSvzIKKGvidBN0GxZvj14xd/EckBbBYy+feZHMuJ4M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilQ0rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphQw//ZK04VTYRASoAStd+MOBeoqQQRHleBcCcGobYCRPu7HcRFuCo\r\nFKUirjvA/ZiSGfMWR1WdR5ucLqVjUfstZD2HlIMrltGZGXoMeV/1nZG4WIj5\r\nKy92SbkCnPHnkn3DngCQqSWz5UCI2xBTBcwAxPP7Z6DFJTVdNw4XEL1P32X3\r\n995GBoLqTQD+6AZmXlZiMrsvlN3q6rrqbQ0fJXef5/cEp/y0uizmlYflF+6m\r\noC8/mIesUL9m/sYZ9oR/QUiNiMVJsixZjh6PHlmYeWBbNT2/17+wQPPTVsGn\r\nqkGI/QjxUQFfLgTz4YIvETOJ9tFbIDZPZtqutVhN6N3qWVzPA56XeUEsVT1u\r\nm4gzf3LwLeTfvTpK0OtkePA0Jvusw+SpJwpoXLyzPtK8bXk3OgLK9b2PM0Tc\r\nqEssloTBr2oiMw0zBg3MKce+TXe2Hk1Zki1JbDIYuzO2MOxJnkUrjfZGW3p8\r\nFN6oO6U0tTnyZPa9jNcZNm3YAHWbrT7q1MpMNFpkVPxsoZNhKYE6kDgFlSfO\r\nBcUvLXdq29bBAfxd68E+Fw/4KUqGzmkH9J+ZpHB97kJnE/bQQqiZMcWyet86\r\nVjsVoYFB49X4NtHW5WmBLAa5tYnfsy5IvbGXxe6zpyP2IC95XL25R+88FUxL\r\nFQkaoYYgF9za2wtHCQVYMo+oV/z0GocmcF4=\r\n=D4SG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacopomaroli","email":"info@jacopomaroli.com"},"directories":{},"maintainers":[{"name":"jacopomaroli","email":"info@jacopomaroli.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3commas-client-node_1.0.0_1653935402655_0.49359252331669157"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-30T18:30:02.655Z","1.0.0":"2022-05-30T18:30:03.088Z","modified":"2022-05-30T18:30:03.220Z"},"maintainers":[{"name":"jacopomaroli","email":"info@jacopomaroli.com"}],"description":"A typescript client for 3commas for node.js. It supports also websockets","author":{"name":"Jacopo Maroli"},"license":"ISC","readme":"# 3commas Client Node:\r\nThis is a typescript client for 3commas for node.js. It supports also websockets.  \r\nThe client definition is automatically generated from OpenAPI specs using [OpenAPI Typescript Codegen](https://github.com/ferdikoomen/openapi-typescript-codegen)\r\n\r\n# Quickstart\r\n```\r\nimport dotenv from 'dotenv'\r\nimport { ThreeCommasClient, ThreeCommasClientConfig, WSEventType, AccountEntity } from '3commas-client-node'\r\n\r\ndotenv.config({ path: '.env' })\r\n\r\nconst THREECOMMAS_API_KEY: string = process.env.THREECOMMAS_API_KEY!\r\nconst THREECOMMAS_API_SECRET: string = process.env.THREECOMMAS_API_SECRET!\r\n\r\nasync function main () {\r\n  const config: ThreeCommasClientConfig = { apiKey: THREECOMMAS_API_KEY, apiSecret: THREECOMMAS_API_SECRET }\r\n  const threeCommasClient = new ThreeCommasClient(config)\r\n\r\n  const accounts = await threeCommasClient.RESTClient.accounts.getVer1Accounts()\r\n  const account: AccountEntity = accounts[0]\r\n  console.log(account.id)\r\n\r\n  // Websocket support\r\n  await threeCommasClient.waitForWsReady()\r\n  const waitForSub = () => new Promise<void>((resolve) => {\r\n    threeCommasClient.subscribe(WSEventType.ConfirmSubscription, function () {\r\n      resolve()\r\n    })\r\n    threeCommasClient.subscribe(WSEventType.SmartTrades, function () { })\r\n  })\r\n\r\n  await waitForSub()\r\n  threeCommasClient.wsClient.close()\r\n}\r\n\r\nmain()\r\n```","readmeFilename":"README.md"}