{"id":13633091,"url":"https://github.com/IOfate/bitpanda-ws","last_synced_at":"2025-04-18T10:34:05.240Z","repository":{"id":42631309,"uuid":"387269188","full_name":"IOfate/bitpanda-ws","owner":"IOfate","description":"Node.js websocket client for BitPanda","archived":false,"fork":false,"pushed_at":"2023-01-07T09:20:25.000Z","size":160,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-09T02:33:27.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IOfate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-18T21:06:31.000Z","updated_at":"2024-02-11T07:45:46.000Z","dependencies_parsed_at":"2023-02-06T18:45:40.039Z","dependency_job_id":null,"html_url":"https://github.com/IOfate/bitpanda-ws","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IOfate%2Fbitpanda-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IOfate%2Fbitpanda-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IOfate%2Fbitpanda-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IOfate%2Fbitpanda-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IOfate","download_url":"https://codeload.github.com/IOfate/bitpanda-ws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249479054,"owners_count":21279187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T23:00:27.299Z","updated_at":"2025-04-18T10:34:04.984Z","avatar_url":"https://github.com/IOfate.png","language":"TypeScript","readme":"# BitPanda WS\n\n[![Node.js CI](https://github.com/IOfate/bitpanda-ws/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/IOfate/bitpanda-ws/actions/workflows/node.js.yml)\n[![npm version](https://img.shields.io/npm/v/@iofate/bitpanda-ws)](https://www.npmjs.com/package/@iofate/bitpanda-ws)\n[![dependencies Status](https://status.david-dm.org/gh/iofate/bitpanda-ws.svg)](https://david-dm.org/iofate/bitpanda-ws)\n[![devDependencies Status](https://status.david-dm.org/gh/iofate/bitpanda-ws.svg?type=dev)](https://david-dm.org/iofate/bitpanda-ws?type=dev)\n\nNode.js websocket client for BitPanda.\nWebsocket API documentation: https://developers.bitpanda.com/exchange/?shell#websocket-api-overview\n\n## IOfate\n\nThis package is made by the IOfate company and is open source, feel free to use it, share it and contribute!\n\n## Features\n\n- [x] Price ticks\n  - [x] Subscription\n  - [x] Unsubscribe\n- [x] Candlesticks\n  - [x] Subscription\n  - [x] Unsubscribe\n- [x] Emit errors by sockets\n- [x] Auto-reconnect\n\n## Install\n\n```\n$ npm install @iofate/bitpanda-ws\n```\n\n## How to use it\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst main = async () =\u003e {\n  const client = new BitPandaWs();\n  const symbol = 'BTC/EUR';\n  const candleTimeFrame = '1m';\n\n  await client.open();\n\n  client.on(`ticker-${symbol}`, ticker =\u003e console.log(ticker));\n  client.on(`candle-${symbol}-${candleTimeFrame}`, candle =\u003e console.log(candle));\n  client.on('error-ticker', error =\u003e console.error(error));\n  client.on('error-candle', error =\u003e console.error(error));\n\n  client.subscribeTicker(symbol);\n  client.subscribeCandles(symbol, candleTimeFrame);\n};\n\nmain();\n```\n\n## API\n\nThis package export one class `BitPandaWs` which extend from [Emittery](https://www.npmjs.com/package/emittery), which allow us to dispatch and listen events.\nMore information about Emittery API here: https://github.com/sindresorhus/emittery#api\n\n\n### bitPandaWs = new BitPandaWs()\n\nCreate a new instance of BitPandaWs.\n\n### bitPandaWs.open()\n\nOpen BitPanda websockets. **Must be called before any subscription!**\n\nReturns a promise.\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nawait bitPandaWs.open();\n```\n\n### bitPandaWs.isOpen()\n\nTo know if sockets are open or not.\n\nReturns a boolean.\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nif (!bitPandaWs.isOpen()) {\n  await bitPandaWs.open();\n}\n```\n\n### bitPandaWs.subscribeTicker(symbol)\n\nSubscribe to the websocket ticker of the chosen symbol.\nOnce called you'll be able to listen to ticker events for this symbol.\n**`open` method must be called before calling this one.**\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nawait bitPandaWs.open();\nbitPandaWs.subscribeTicker('BTC/EUR');\nbitPandaWs.on('ticker-BTC/EUR', ticker =\u003e console.log(ticker));\n```\n\n### bitPandaWs.unsubscribeTicker(symbol)\n\nUnsubscribe from the ticker websocket of the associated symbol.\nOnce called no more events will be dispatched.\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nawait bitPandaWs.open();\nbitPandaWs.subscribeTicker('BTC/EUR');\nconst stopListenFn = bitPandaWs.on('ticker-BTC/EUR', ticker =\u003e console.log(ticker));\nbitPandaWs.unsubscribeTicker('BTC/EUR');\nstopListenFn();\n```\n\n### bitPandaWs.subscribeCandles(symbol, timeFrame)\n\nSubscribe to the websocket candle of the chosen symbol and time frame.\nOnce called you'll be able to listen to candle events for this symbol.\n**`open` method must be called before calling this one.**\n\nValid time frame: `'1m', '5m', '15m', '30m', '1h', '4h', '1d', '1w', '1M'`\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nawait bitPandaWs.open();\nbitPandaWs.subscribeCandles('BTC/EUR', '1d');\nbitPandaWs.on('candle-BTC/EUR-1d', candle =\u003e console.log(candle));\n```\n\n### bitPandaWs.unsubscribeCandles(symbol, timeFrame)\n\nUnsubscribe from the candle websocket of the associated symbol.\nOnce called no more events will be dispatched.\n\n```js\nimport { BitPandaWs } from '@iofate/bitpanda-ws';\n\nconst bitPandaWs = new BitPandaWs();\n\nawait bitPandaWs.open();\nbitPandaWs.subscribeCandles('BTC/EUR', '1d');\nconst stopListenFn = bitPandaWs.on('candle-BTC/EUR-1d', candle =\u003e console.log(candle));\nbitPandaWs.unsubscribeCandles('BTC/EUR', '1d');\nstopListenFn();\n```\n","funding_links":[],"categories":["Market data libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIOfate%2Fbitpanda-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIOfate%2Fbitpanda-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIOfate%2Fbitpanda-ws/lists"}