{"_id":"@cex-io/cexio-exchange-plus","_rev":"9-9d39ec724ab30e64d7e0ecc4c7398e18","time":{"created":"2023-04-27T10:41:52.254Z","1.0.0":"2023-04-25T13:15:17.747Z","modified":"2024-02-07T11:24:02.728Z","1.0.1":"2023-04-27T10:41:52.543Z","1.0.2":"2023-04-28T09:27:29.416Z","1.0.3":"2024-02-07T11:23:43.132Z"},"name":"@cex-io/cexio-exchange-plus","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"@cex-io/cexio-exchange-plus","version":"1.0.1","description":"The official Node.js client for CEX.IO Exchange Plus API","main":"index.js","directories":{"lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-exchange-plus.git"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-exchange-plus/issues"},"homepage":"https://github.com/cex-io-exchange/cexio-exchange-plus","engines":{"node":">=14"},"keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","dependencies":{"node-fetch":"^2.6.9","ws":"^8.13.0"},"devDependencies":{"log4js":"^6.9.1","standard":"^14.3.4"},"gitHead":"14b7d386815535604626187a5db378838315ada4","_id":"@cex-io/cexio-exchange-plus@1.0.1","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-pGVnp1SuQV8SyHRZKNmFquDNBeE7lIasKfc19jt5vdnR8a9h03ugnC9870sa7VapsA+rQcRTqSvYtBf9FUM54A==","shasum":"702eede7fdec7ad474f0ac6a8d07a9a0da81e2fc","tarball":"https://registry.npmjs.org/@cex-io/cexio-exchange-plus/-/cexio-exchange-plus-1.0.1.tgz","fileCount":7,"unpackedSize":22399,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbjx7wsdSoz2TXpY1OmymeMJfblAbcsX6dSgisvVSnugIgIH0gmysmKLGgREYbB6zmQXEG7qxrzSo69iiw/kPOwlg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSlFwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJHA/9EiglyT46vNrU5n6ObyzcmUiL0nzwOJde32ZQtK29cNwFvxLH\r\nfSymVP1/qXuAsa+5nG3fzKKaxbX/S7BUO5SvYOcOGw+koHCCsrNznHikjVl8\r\nhDUDPzlaIxVglY+YP2iij9IpL7b2dRbBE/kG0o+R3bSfVQVMC7oVDtZSFygP\r\nO69M5cwtOq8xxPGupKds8nZOtCWP3DMVDVWEox3/CcoB/9rufpXXfmIQ1Ebz\r\nkeQHX073hi/1uFJQ5IgRduKbTuX1TypTPz4eZTXX+stFp2vN1EfVU1DN1jyZ\r\nYTVrC9/XAlZvHcQPL4YExdZkZaepWJcRZMvoQMq2CoBjmx1pbqX1E4NiPEBK\r\neQGYYMxdRGBQw5jgRI9D3u3NAernKzF/+t0Ao7+PyC418Fda5ssrcVk331r2\r\nvCrFcdCzrvIaN40Lb1F3QEEiP9AxB03s1BeKUTMOzOCUg8AoPa6cYs9K+sRm\r\n6Zsg/iJ5VXeyhooa++3X1v9eH6HiGZnqqwVvMCP2eSljYD+Mf+nViRIb6bLo\r\nfZUc3kZ8nga5x+KykwpUQjiusBDgMZYbvMcdQdn2daUP9wC78rdmbNeeNWa4\r\nYPm1VMyeHjEpGC4x9W+S3eyP7Lq1JmodVgrGJ4PkxfqIe4+GISA9Wl5LzoO6\r\nJNx6hTqBTD0TX52xxPLvTDiAo8DQvSKuKCY=\r\n=wRIu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},"maintainers":[{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cexio-exchange-plus_1.0.1_1682592112317_0.7692593332618411"},"_hasShrinkwrap":false,"deprecated":"Following the recent rebrand of CEX.IO Exchange Plus to CEX.IO Spot Trading this package is deprecated. Please use https://www.npmjs.com/package/@cex-io/cexio-spot-trading"},"1.0.2":{"name":"@cex-io/cexio-exchange-plus","version":"1.0.2","description":"The official Node.js client for CEX.IO Exchange Plus API","main":"index.js","directories":{"lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-exchange-plus.git"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-exchange-plus/issues"},"homepage":"https://github.com/cex-io-exchange/cexio-exchange-plus","engines":{"node":">=14"},"keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","dependencies":{"node-fetch":"^2.6.9","ws":"^8.13.0"},"devDependencies":{"log4js":"^6.9.1","standard":"^14.3.4"},"gitHead":"73c509ced9d5dc7fb09bc8dc72470b753e8113df","_id":"@cex-io/cexio-exchange-plus@1.0.2","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-v1NyCdC2pNomR2DFhQhSCxaQW+7mNerPHjxC4sl5OtMjLXRbnzld7V8G9lpTLWtDmWL1WE+w0cCW+lrYUdVS4Q==","shasum":"cabacf8a13d763ff1a317a985940359718f81c1a","tarball":"https://registry.npmjs.org/@cex-io/cexio-exchange-plus/-/cexio-exchange-plus-1.0.2.tgz","fileCount":7,"unpackedSize":22446,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICU+SC82bcBBwq5twsBbX7AmyfabqPxfuZWTC0QdfX8jAiEAmj160EXsF/qvQraw31JmRFO+Yp/l531c1JZs540Tl4I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5GBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYMA//UX0ETUZWeRRVYMwNJZtiTXsB/U5bqjivIJfECkApQBMQehVA\r\noS15hLgMxCnUjHtG1E2aWtlBvwfOFMZd2smvDfsB3jXHy0IAuc69Jxd235RY\r\nTX3CgJgLQSlzZgYXTFvr6wEWD/7a9g/6qVkQD8r0o20xpTiOGjLxyn642fR8\r\n5F4LRDt3HJitc8WxbYY85oezphKkr6WlRWmSasEy1Twv1EyFw1ySwei8dUSN\r\nRhUATXU6d4GzUFaIgSRYeOZueooOCY3WBhvmLfrD8WBgHTHkTKW6fdJN/6XK\r\npwUCLTAvfcYcT4m13EiWpW5z8CqImBdzmp44F4Z+g3j7uf87mKkNYh8Z4SK7\r\nr6ElDTDCLKVKkkV1yv5WXj7WgDa+hTkuVGGNm//0gPEw6gxaQ2/0ektOVCFP\r\naHVIUk1EKrxPHLSw4ydvUxHAwQlR6/bx/YyGFbpqAyZExjsGPhHFgGtt3S/h\r\nnQp1iZ9Svb7x79gXmWGnVAN4sIND4tZKwVYtTupRnfuxBAzmnx1yT4uZ60yR\r\nLCL73u0JjDS4uzx9ZpVm19Kyn+nIoXBGeE7GVmCJkp3P2O9GL9T8XQL5SvqC\r\n9oCr66N7K6K6xeXhpPXedw650qel1T9i5GU9cw9YkQlDK4UQsZz/4YMW+Nrx\r\nSnTmlKKRHbF2XouFCoQ/KcAI/GRzBDhr79A=\r\n=ddWS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},"maintainers":[{"name":"oucexio","email":"ou@cex.io"},{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cexio-exchange-plus_1.0.2_1682674049273_0.30141229857093177"},"_hasShrinkwrap":false,"deprecated":"Following the recent rebrand of CEX.IO Exchange Plus to CEX.IO Spot Trading this package is deprecated. Please use https://www.npmjs.com/package/@cex-io/cexio-spot-trading"},"1.0.3":{"name":"@cex-io/cexio-exchange-plus","version":"1.0.3","description":"The official Node.js client for CEX.IO Exchange Plus API","main":"index.js","directories":{"lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-exchange-plus.git"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-exchange-plus/issues"},"homepage":"https://github.com/cex-io-exchange/cexio-exchange-plus","engines":{"node":">=14"},"keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","dependencies":{"node-fetch":"^2.6.9","ws":"^8.13.0"},"devDependencies":{"log4js":"^6.9.1","standard":"^14.3.4"},"gitHead":"d653456ddac1045fd50f91d05e299da8ee9732cd","_id":"@cex-io/cexio-exchange-plus@1.0.3","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-BrCUdhkrBjW02b5HIs8guSFVYr8MtpETnUHSBpUla6z1SOWg1CG/vIZi5R1xWmclLjj7VDG37+nMTUhMIe4hiw==","shasum":"209c63afc2c2f43d10b612a5a5bcd8613a500e15","tarball":"https://registry.npmjs.org/@cex-io/cexio-exchange-plus/-/cexio-exchange-plus-1.0.3.tgz","fileCount":7,"unpackedSize":22726,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf00sRh7Mwaifa2VBYtNS2yqdqPPWO0avJgzf10aYGbAIhAOqT+/N8+Ye5WnaN11ABkRM4zHOo25cxdoFHQs/BXisA"}]},"_npmUser":{"name":"oucexio","email":"ou@cex.io"},"maintainers":[{"name":"dverescexio","email":"d.veres@cex.io"},{"name":"oucexio","email":"ou@cex.io"},{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cexio-exchange-plus_1.0.3_1707305022947_0.9499330613965331"},"_hasShrinkwrap":false,"deprecated":"Following the recent rebrand of CEX.IO Exchange Plus to CEX.IO Spot Trading this package is deprecated. Please use https://www.npmjs.com/package/@cex-io/cexio-spot-trading"}},"maintainers":[{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},{"name":"dverescexio","email":"d.veres@cex.io"},{"name":"oucexio","email":"ou@cex.io"}],"description":"The official Node.js client for CEX.IO Exchange Plus API","homepage":"https://github.com/cex-io-exchange/cexio-exchange-plus","keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-exchange-plus.git"},"author":{"name":"cex.io"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-exchange-plus/issues"},"license":"MIT","readme":"# 2024-02-07 Repository Deprecated And Archived\nFollowing the recent rebrand of CEX.IO Exchange Plus to CEX.IO Spot Trading, new repository for the official the official Node.js client for CEX.IO Spot Trading API was created https://github.com/cex-io-exchange/cexio-spot-trading\n\n# CEX.IO Exchange Plus\n\nThe official Node.js client for CEX.IO Exchange Plus API (https://docs.plus.cex.io)\n\n## Features\n\n- Easy to use, requires only key-secret pair to setup\n- Handle all transport work, just call required action\n- Popular protocols supported, REST and WebSocket onboard\n\n## Installation\n\n```bash\nnpm install @cex-io/cexio-exchange-plus\n```\n\n## Rest client\n\n```js\nconst { RestClient } = require('@cex-io/cexio-exchange-plus')\nconst defaultClient = new RestClient()\nconst authenticatedClient = new RestClient(apiKey, apiSecret, options)\n```\n\nArguments for RestClient are optional. For private actions you need to generate apiKey and apiSecret pair from UI terminal.\n\n- `apiKey` _string_ - Api key for specific account.\n- `apiSecret` _string_ - Api secret for specific account.\n- `options` _object_ - Additional settings for client.\n\nAvailable client options described below, they all are optional:\n\n- `apiLimit` _integer_ - Rate limit value for apiKey. Default is 300.\n  Client will check requests count and prevent from spam the server. You can ask to increase this limit.\n- `timeout` _integer_ - Request timeout in milliseconds. Default is 30000.\n- `rejectUnauthorized` _boolean_ - This option useful when you test demo env. Default is true.\n- `host` _string_ - Can be changed to test your bot on demo environment. Default is 'https://api.plus.cex.io/'\n- `apiUrlPublic` _string_ - Use a concrete url for public API calls. This option overrides `host` value. Default is 'https://api.plus.cex.io/rest-public/'\n- `apiUrl` _string_ - Use a concrete url for private API calls. This option overrides `host` value. Default is 'https://api.plus.cex.io/rest/'\n\n\n### Public actions\n\nTo make a public request use `async callPublic(action, params)` method.\nThis method return `Promise` which resolves with server response.\nIf some error was occurred then method rejects with status code and error description.\n\nFor more details check [api reference](https://docs.plus.cex.io).\n\n```js\nconst { RestClient } = require('@cex-io/cexio-exchange-plus')\n\nconst client = new RestClient()\n\ntry {\n  const res = await client.callPublic('get_ticker')\n  console.log(res)\n} catch (err) {\n  console.log(err)\n}\n```\n\n```js\n{ error: 'Bad Request', statusCode: 400 }\n{ error: 'Unexpected error', statusCode: 500 }\n```\n\n### Private actions\n\nTo make private api calls use `async callPrivate(action, params)`. It's similar to public method but requires `apiKey` and `apiSecret` arguments to client initialization. Each private request is signed with `HMAC sha256` so if key is incorrect or signature is wrong client will return rejected promise with error like this `{ error: 'Authorization Failed', statusCode: 401 }`\n\n```js\nconst { RestClient } = require('@cex-io/cexio-exchange-plus')\n\nconst key = '_account_api_key_'\nconst secret = '_account_api_secret_'\nconst action = 'get_my_orders'\nconst params = {\n  pair: 'BTC-USD'\n}\n\nconst client = new RestClient(key, secret)\n\ntry {\n  const res = await client.callPrivate(action, params)\n  console.log(res)\n} catch (err) {\n  console.error(err)\n}\n```\n\nSuccess response example:\n\n```js\n{ ok: 'ok', data: { ... } }\n```\n\n## WebSocket client\n\n```js\nconst { WebsocketClient } = require('@cex-io/cexio-exchange-plus')\nconst ws = new WebsocketClient(apiKey, apiSecret, options)\n```\n\nTo init the WebsocketClient you must pass `apiKey` and `apiSecret` arguments. You can generate them in UI terminal.\n\n- `apiKey` _string_ - Api key for specific account.\n- `apiSecret` _string_ - Api secret for specific account.\n- `options` _object_ - Additional settings for client.\n\nAvailable client options described below, they all are optional:\n\n- `wsReplyTimeout` _integer_ - Request timeout in milliseconds. Default is 30000.\n- `rejectUnauthorized` _boolean_ - This option useful when you test demo env. Default is true.\n- `host` _string_ - Can be changed to test your bot on demo environment. Default is 'wss://api.plus.cex.io/'\n- `apiUrlPublic` _string_ - Use a concrete url for public WS calls. This option overrides `host` value. Default is 'wss://api.plus.cex.io/ws-public/'\n- `apiUrl` _string_ - Use a concrete url for private WS calls. This option overrides `host` value. Default is 'wss://api.plus.cex.io/ws/'\n\n\n### Call Private actions\nTo send request to the server you need to connect and auth first. Everything is under the hood and all you need is call `async ws.connect()` method. After that you can invoke `async ws.callPrivate(action, params)` method which returns `Promise` with server response.\nIf some error was occurred then method rejects with status code and error description.\n\n```js\n  const { WebsocketClient } = require('@cex-io/cexio-exchange-plus')\n  const ws = new WebsocketClient(apiKey, apiSecret, options)\n\n  await ws.connect() // connect and auth on the server\n\n  const res = await ws.callPrivate(action, params)\n  console.log('result:', res)\n\n  ws.disconnect() // close connection\n```\n\n### Subscribe to updates\nThe WebsocketClient allows you to receive updates. The following types of updates are available: `account_update`, `executionReport`, `order_book_increment`, `tradeUpdate`, etc. You can get more details about them in [documentation](https://docs.plus.cex.io/#websocket-private-api-calls-account-events).\n\n```js\nconst { WebsocketClient } = require('@cex-io/cexio-exchange-plus')\nconst ws = new WebsocketClient(apiKey, apiSecret)\n\ntry {\n  await ws.connect()\n\n  ws.subscribe('executionReport', msg => {\n    console.log('executionReport:', msg)\n  })\n\n  ws.subscribe('account_update', msg => {\n    console.log('account_update:', msg)\n  })\n} catch (err) {\n  console.error(err)\n}\n```","readmeFilename":"README.md"}