{"_id":"@cex-io/cexio-prime-liquidity","_rev":"7-2dff16145f8833e4655d69fc5c524430","name":"@cex-io/cexio-prime-liquidity","dist-tags":{"latest":"0.2.4"},"versions":{"0.2.2":{"name":"@cex-io/cexio-prime-liquidity","version":"0.2.2","keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","_id":"@cex-io/cexio-prime-liquidity@0.2.2","maintainers":[{"name":"oucexio","email":"ou@cex.io"},{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"}],"homepage":"https://github.com/cex-io-exchange/cexio-prime-liquidity","bugs":{"url":"https://github.com/cex-io-exchange/cexio-prime-liquidity/issues"},"dist":{"shasum":"01111a7d8e5b074ebd48b573af16bf382779a6bb","tarball":"https://registry.npmjs.org/@cex-io/cexio-prime-liquidity/-/cexio-prime-liquidity-0.2.2.tgz","fileCount":6,"integrity":"sha512-ZkSrxvvcF+vLh7MmUMfb+bXs8i6qVaJhoAIsENtwRrCmw++o5HbUY9FGhqROPDkA/R51c3UIwjgPKwNJhx/M5A==","signatures":[{"sig":"MEUCIClW+MeOuWCZG9MUSJTV7cCptajlG4qMyYZl7P4cKZ8WAiEAlvDop83nhLBHsukXMrPSjvGEHvcqOfAeW8cxS3OzjMg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5DwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo52A//f2ozSZd4NQij2nFgO0jh65QNpxTl7rCW5bhYeQR61hChQWc/\r\nNwJctuckw7sdafHhF0Y9PZOIUF8feCGTPsxRHKmJNLOlPF7TyBg2p18A2VWD\r\nozghNkaeHxYiO9euMv6g9C+GivFN/0ze06rDZKYPxz5BY0FK5Qh+p4f4U0v0\r\nSkO+QcBHElUvf0l7eAbo5hZ56HSNbIQPIavFIUzU+fc//bPM2oFSnYc/ZlRv\r\nbOijYW9BWDkUPiHRJ1sof1UmIFMD9MHped3iQ1sa6/YWhkiT4FgG2U0ChrrT\r\nlwrIw5zwA1MS0hU4BY9Tbe0ntKq5J12lCUqn853BL4FwujBFll+DZza9pzVF\r\nl2z+CoSlrvMyh1LDY/tjC0dR4SsWxHCuPxD6DoEOOHQtTFheArZZgUwt2LdV\r\nlqCeSoTREnibzjx6T39ot7TqF292eDAMlDcp1X3Cz9RmuMeH6jA1vQCUN95d\r\n1qw1j+dujc9/m6G9BIWkn9IkBGZ/YYSIXHK6UiwWEEhbI6EbJdx15J65j84g\r\niCWeC6iAT4vFZIwsdES9JoIkA705WQi3o4lcN9IY6NFMoC7VLBN47mmSz7yS\r\n4wYZ0upEK/Y7ke3aT9zsoo2+42fImBXoxoS+3iFPra82N46ioq9KEQ0lVt8m\r\nipK/65nYRcLj3DV/+7959njAUdpBpp7Pm1Q=\r\n=yBHf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","engines":{"node":">=8"},"gitHead":"529dda3bc622cc9bbdbed46ddd246461fea85271","_npmUser":{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},"repository":{"url":"git+https://github.com/cex-io-exchange/cexio-prime-liquidity.git","type":"git"},"_npmVersion":"6.4.1","description":"The official Node.js client for CEX.IO Prime Liquidity API","directories":{"lib":"lib"},"_nodeVersion":"8.16.2","dependencies":{"ws":"^7.3.0","node-fetch":"^2.6.9"},"_hasShrinkwrap":false,"devDependencies":{"log4js":"^6.3.0","standard":"^14.3.4"},"_npmOperationalInternal":{"tmp":"tmp/cexio-prime-liquidity_0.2.2_1682673904755_0.41108321103081624","host":"s3://npm-registry-packages"}},"0.2.3":{"name":"@cex-io/cexio-prime-liquidity","version":"0.2.3","keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","_id":"@cex-io/cexio-prime-liquidity@0.2.3","maintainers":[{"name":"dverescexio","email":"d.veres@cex.io"},{"name":"oucexio","email":"ou@cex.io"},{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"}],"homepage":"https://github.com/cex-io-exchange/cexio-prime-liquidity","bugs":{"url":"https://github.com/cex-io-exchange/cexio-prime-liquidity/issues"},"dist":{"shasum":"e849368b4db71de2b37afc9809e3552090712965","tarball":"https://registry.npmjs.org/@cex-io/cexio-prime-liquidity/-/cexio-prime-liquidity-0.2.3.tgz","fileCount":6,"integrity":"sha512-GtkbkY/B8U55y0PMNgcopqiYbdrFeW1m0IWFbHuB9B17PL3AQTZckDdNigsofRraiXhiWtpKLAz6xUNCCCdvfQ==","signatures":[{"sig":"MEYCIQC2YbhaXqdsJyYfxlN4x1M1afhz0L15jl2zdTF+c2lldwIhAMVu16IJb5qyJGUFp+V+Zj7/Aq3cUyrzEesGtUpdadu5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUOyMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHzg//cBiyG5GkxfjaTEA2He/w4diVGsI8nYpZv6MDd6JzFU4j+ict\r\nXqJmrt8bGZzNfNeqqf1lw//kb8QJnIb+7I2dAyh4PjEtkkyzSOuS6mn0AujO\r\nqDXKdqCxPHDGXgHU8dvJzlTyYDM4bvka3XrYDOVVSquorzGJWTpORvqKakpZ\r\nD+X5c8YmK3NE+KgJmOiXOJdOT+NqrGdRICWs1z5BoEroXVzBCnT0UcQKER6e\r\nZ5EwBYRedQZhviJJc2ywBAmArUXvoE2iN5oBYRBaNaADd30JD5LMppEcXq89\r\nWSIxR/HJhvqVe6Hpu6AoiwBB/pErA4mi5eoEvZMpDmT9YftvGmXk99B/4AYJ\r\nqMBirNIUdPE6YohYrOL+BiXszA1Xg9cjLuW4marI83WtqKMaM8HcGwaN4R/C\r\nmeLuAO09mJb9SXVfrW0FGIAmveVKsD/XSCVyT4X3WXD6hyyDMW96wrLCAHf4\r\nk67NmMTkpEczaxSNHJxGJ1AmqoDBo2PNk/pw1RipmbGgTBVfQmCHh6hcZ2PM\r\nfjjhSsk4jhm7v0AlWk4pEKrT3n++TrbTSU/aKxWq2OSUc0cS7I1zOFrVaxQo\r\n01Nr3VVMii0S4OoyGl1z+O+4taD6GJx5W0Sjezie4DHDcnLg2Po0QlvnXpqG\r\ngW0f9s0h1cgjZQtN841syFD6TBwg3vWxwM0=\r\n=0VHJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","engines":{"node":">=8"},"gitHead":"b11d05715b091a378db0543a0e8251eb4dabd7eb","_npmUser":{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},"repository":{"url":"git+https://github.com/cex-io-exchange/cexio-prime-liquidity.git","type":"git"},"_npmVersion":"6.4.1","description":"The official Node.js client for CEX.IO Prime Liquidity API","directories":{"lib":"lib"},"_nodeVersion":"8.16.2","dependencies":{"ws":"^7.3.0","node-fetch":"^2.6.9"},"_hasShrinkwrap":false,"devDependencies":{"log4js":"^6.3.0","standard":"^14.3.4"},"_npmOperationalInternal":{"tmp":"tmp/cexio-prime-liquidity_0.2.3_1683025036432_0.46127251346719067","host":"s3://npm-registry-packages"}},"0.2.4":{"name":"@cex-io/cexio-prime-liquidity","version":"0.2.4","description":"The official Node.js client for CEX.IO Prime Liquidity API","main":"index.js","directories":{"lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-prime-liquidity.git"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-prime-liquidity/issues"},"homepage":"https://github.com/cex-io-exchange/cexio-prime-liquidity","engines":{"node":">=8"},"keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"author":{"name":"cex.io"},"license":"MIT","dependencies":{"node-fetch":"^2.6.9","ws":"^7.3.0"},"devDependencies":{"log4js":"^6.3.0","standard":"^14.3.4"},"gitHead":"4fb362df8bea9e65fbb730ba294e9d37289cf419","_id":"@cex-io/cexio-prime-liquidity@0.2.4","_nodeVersion":"15.11.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-hwMvMhj/fhD2YDH/YhvhvdRNR3CPoco1ZLuYlUsDSLlM4ejKqo1FqGvNFugVSizPq4+RfmuQXKX7+MmeyMK5Pg==","shasum":"0b423e56e2767019633f70dcbe772bfa283e5770","tarball":"https://registry.npmjs.org/@cex-io/cexio-prime-liquidity/-/cexio-prime-liquidity-0.2.4.tgz","fileCount":6,"unpackedSize":18379,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA5jbrIvPjIRz7SQalYWiQ8muf7EYzGoOpOVz0j/A4kpAiEAk9PifLolvuS36URi1wUiReuIdnymWLQwmTabGrd+Ips="}]},"_npmUser":{"name":"oucexio","email":"ou@cex.io","actor":{"name":"oucexio","email":"ou@cex.io","type":"user"}},"maintainers":[{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},{"name":"oucexio","email":"ou@cex.io"},{"name":"dverescexio","email":"d.veres@cex.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cexio-prime-liquidity_0.2.4_1751481372978_0.443452352623968"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-28T09:25:04.690Z","modified":"2025-07-02T18:36:13.393Z","0.2.1":"2023-04-27T15:21:19.385Z","0.2.2":"2023-04-28T09:25:04.925Z","0.2.3":"2023-05-02T10:57:16.587Z","0.2.4":"2025-07-02T18:36:13.173Z"},"bugs":{"url":"https://github.com/cex-io-exchange/cexio-prime-liquidity/issues"},"author":{"name":"cex.io"},"license":"MIT","homepage":"https://github.com/cex-io-exchange/cexio-prime-liquidity","keywords":["API","exchange","real-time","trading","cryptoexchange","crypto","bitcoin","ethereum","trade"],"repository":{"type":"git","url":"git+https://github.com/cex-io-exchange/cexio-prime-liquidity.git"},"description":"The official Node.js client for CEX.IO Prime Liquidity API","maintainers":[{"name":"dmytro.svynarenko","email":"d.svynarenko@cex.io"},{"name":"oucexio","email":"ou@cex.io"},{"name":"dverescexio","email":"d.veres@cex.io"}],"readme":"# CEX.IO Prime Liquidity\n\nThe official Node.js client for CEX.IO Prime Liquidity API (https://docs.prime.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-prime-liquidity\n```\n\n## Rest client\n\n```js\nconst { RestClient } = require('@cex-io/cexio-prime-liquidity')\nconst defaultClient = new RestClient()\nconst authenticatedClient = new RestClient(apiKey, apiSecret, options)\n```\n\nArguments for RestClient are optional. For private actions you need to obtain 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: true.\n- `apiUrl` _string_ - Can be changed to test your bot on demo environment.\n  default is 'https://liquidity.prime.cex.io/api/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 occured then method rejects with status code and error description.\n\nFor more details check [api refference](https://docs.prime.cex.io).\n\n```js\nconst { RestClient } = require('@cex-io/cexio-prime-liquidity')\n\nconst client = new RestClient()\n\nclient.callPublic('get_demo_order_book')\n  .then(res => console.log(res))\n  .catch(err => console.error(err))\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-prime-liquidity')\n\nconst key = '_account_api_key_'\nconst secret = '_account_api_secret_'\nconst action = 'get_my_trading_conditions'\nconst params = {\n  pairs: ['BTC-USD']\n}\n\nconst client = new RestClient(key, secret)\n\nclient.callPrivate(action, params)\n  .then(res => console.log(res))\n  .catch(err => console.error(err))\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-prime-liquidity')\nconst ws = new WebsocketClient(apiKey, apiSecret, options)\n```\n\nTo init the WebsocketClient you must pass `apiKey` and `apiSecret` arguments. You can obtain them 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- `wsReplyTimeout` _integer_ - Request timeout in milliseconds, default is 30000.\n- `rejectUnauthorized` _boolean_ - This option useful when you test demo env, default: true.\n- `apiUrl` _string_ - Can be changed to test your bot on demo environment.\n  default is 'https://liquidity.prime.cex.io/api/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 occured then method rejects with status code and error description.\n\n```js\n  const { WebsocketClient } = require('@cex-io/cexio-prime-liquidity')\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. At the now available two types of updates `account_update` and `executionReport`. You can get more details about them in [documentation](https://docs.prime.cex.io/#websocket-account-events).\n\n```js\nconst { WebsocketClient } = require('@cex-io/cexio-prime-liquidity')\nconst ws = new WebsocketClient(apiKey, apiSecret)\n\nws.connect()\n  .then(() => {\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  })\n  .catch(err => console.error(err))\n```","readmeFilename":"README.md"}