{"_id":"@binance/futures-connector","_rev":"5-309a3f178f50440675b4b04023380d71","name":"@binance/futures-connector","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@binance/futures-connector","version":"0.1.0","keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","_id":"@binance/futures-connector@0.1.0","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"homepage":"https://github.com/binance/binance-futures-connector-node#readme","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"dist":{"shasum":"3a731f4240a6abb0797a1c6039bc12f716357b12","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.0.tgz","fileCount":28,"integrity":"sha512-UZCLiraEf7ZcwrR8upp0VWgBf7i/HqBOmowd1ohnyTcCVYVk1YRSpBVNQFJ/vZH7jgw0pzH0y8qqLDdqlcz7XQ==","signatures":[{"sig":"MEUCIQDBjVLx0FjQAqxVoowHWioeKKfHwFlVgEabU0m1ovhpuQIgZ2fp9hBKvOmic7LyOKhsbJMEISluO5srW4w/1CQbwGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78859},"jest":{"testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"]},"main":"src/index.js","gitHead":"ba20aebf8a4f2fcdb1416f7204175ec95d49661b","scripts":{"test":"jest --detectOpenHandles","coverage":"jest --silent --ci --coverage --testLocationInResults","standard":"standard","test:watch":"jest --watchAll"},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"standard":{"ignore":["__tests__/**/*.js"]},"repository":{"url":"git+https://github.com/binance/binance-futures-connector-node.git","type":"git"},"_npmVersion":"8.19.4","description":"NodeJS Binance Futures Connector","directories":{},"_nodeVersion":"16.20.0","dependencies":{"ws":"^8.14.2","axios":"^1.5.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"_npmOperationalInternal":{"tmp":"tmp/futures-connector_0.1.0_1697199907265_0.97485143428256","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@binance/futures-connector","version":"0.1.3","keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","_id":"@binance/futures-connector@0.1.3","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"homepage":"https://github.com/binance/binance-futures-connector-node#readme","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"dist":{"shasum":"0835b7017b01db987ce708bc5f7c11d06c040f0d","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.3.tgz","fileCount":28,"integrity":"sha512-8Wc0cvOMAnPluZOwFYg70cG9LjCzyvs+KEQ/WPItvS6Hl/Fq/WhsbaGMS1PtGmgm5/syWf8MPc1I3Z5mF04tzQ==","signatures":[{"sig":"MEUCIDrvsDqDxagfxOn3h3p6UmVLGBBQrFMVsgLkW7LH62pSAiEA7n++hy+EMw2BCVEg4EU45lve98JKXBwWuS7pF8eYET4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80887},"jest":{"testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"]},"main":"src/index.js","gitHead":"82a129efec5fab2dd4f605a2d12a28ea98a5e257","scripts":{"test":"jest --detectOpenHandles","coverage":"jest --silent --ci --coverage --testLocationInResults","standard":"standard","test:watch":"jest --watchAll"},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"standard":{"ignore":["__tests__/**/*.js"]},"repository":{"url":"git+https://github.com/binance/binance-futures-connector-node.git","type":"git"},"_npmVersion":"8.19.4","description":"NodeJS Binance Futures Connector","directories":{},"_nodeVersion":"16.20.2","dependencies":{"ws":"^8.17.1","axios":"^1.6.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"_npmOperationalInternal":{"tmp":"tmp/futures-connector_0.1.3_1719976897409_0.4437859436506657","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@binance/futures-connector","version":"0.1.4","keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","_id":"@binance/futures-connector@0.1.4","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"homepage":"https://github.com/binance/binance-futures-connector-node#readme","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"dist":{"shasum":"255ceb69566f4c3f4ae2c71cda8cd62670d78e51","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.4.tgz","fileCount":28,"integrity":"sha512-UviPK9QGSRfawzNqLjof59IfS81GdO0xbiSNkQTQEjZ1lOQFbYBO4ibe0FkFvmsoWCMOBNwfcbeg94NuhIyAbg==","signatures":[{"sig":"MEYCIQCehvlXwoC+eiB0XsiYrRK2JjS+DAOVWjw6pCw437tf5QIhAPSODTpmD650nanfOa2Ntvam8SaA3dNE0+gBQRK9KAOP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80887},"jest":{"testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"]},"main":"src/index.js","gitHead":"cd23cd139313e33116afaeaef3ed0a112896ffd9","scripts":{"test":"jest --detectOpenHandles","coverage":"jest --silent --ci --coverage --testLocationInResults","standard":"standard","test:watch":"jest --watchAll"},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"standard":{"ignore":["__tests__/**/*.js"]},"repository":{"url":"git+https://github.com/binance/binance-futures-connector-node.git","type":"git"},"_npmVersion":"8.19.4","description":"NodeJS Binance Futures Connector","directories":{},"_nodeVersion":"16.20.2","dependencies":{"ws":"^8.17.1","axios":"^1.7.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"_npmOperationalInternal":{"tmp":"tmp/futures-connector_0.1.4_1724046113529_0.7076753231477919","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@binance/futures-connector","version":"0.1.5","keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","_id":"@binance/futures-connector@0.1.5","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"homepage":"https://github.com/binance/binance-futures-connector-node#readme","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"dist":{"shasum":"919b43a1bfbe7acc690d121b1f96514f18fd1c55","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.5.tgz","fileCount":28,"integrity":"sha512-8L++u0+WNh8zDIS0s3SQVZGpaNVee51Ok8oNh5yQZ3YADuVQAcQnLwZXWrjjTAqR69xYlBP/JB3npz9xJ90Pqw==","signatures":[{"sig":"MEUCIDpI27W5umVRPxsRlmLNcu38EpgfUUmUgxFlF/eYZM9QAiEA9+3csRtGZxBr7m2xeIHDsG4bgznf4HVRCxr0/Umf0hc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83856},"jest":{"testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"]},"main":"src/index.js","gitHead":"64330a91bdaf4237bba1ccc3589b01099a224dc5","scripts":{"test":"jest --detectOpenHandles","coverage":"jest --silent --ci --coverage --testLocationInResults","standard":"standard","test:watch":"jest --watchAll"},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"standard":{"ignore":["__tests__/**/*.js"]},"repository":{"url":"git+https://github.com/binance/binance-futures-connector-node.git","type":"git"},"_npmVersion":"8.19.4","description":"NodeJS Binance Futures Connector","directories":{},"_nodeVersion":"16.20.2","dependencies":{"ws":"^8.17.1","axios":"^1.7.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"_npmOperationalInternal":{"tmp":"tmp/futures-connector_0.1.5_1727940712733_0.8921698667955946","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"@binance/futures-connector","version":"0.1.6","keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","_id":"@binance/futures-connector@0.1.6","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"homepage":"https://github.com/binance/binance-futures-connector-node#readme","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"dist":{"shasum":"135c884230152964a5df9a47f9b7f866496d6f42","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.6.tgz","fileCount":29,"integrity":"sha512-si15Pm/fTiqSG8WAkxNWXpe4CsSr3phWDq55MaBN+yQ9BXF6wdV4SWk+VSR3FuNZAFn8MtkKNY5CrwMH80ox4A==","signatures":[{"sig":"MEQCIHy95d/VRmlXp3i6BDcN3aKmEJmRKNIMKDAtQtvLxohnAiBAqvLXQYzyVuf24ThowyQapHNPkoTzTe22S1/sfaEiWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108970},"jest":{"testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"]},"main":"src/index.js","engines":{"npm":">=8.19.4","node":">=16.20.2"},"gitHead":"1c7373f16f53d8ee802ba654a21f77029288397c","scripts":{"test":"jest --detectOpenHandles","coverage":"jest --silent --ci --coverage --testLocationInResults","standard":"standard","test:watch":"jest --watchAll"},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"standard":{"ignore":["__tests__/**/*.js"]},"repository":{"url":"git+https://github.com/binance/binance-futures-connector-node.git","type":"git"},"_npmVersion":"8.19.4","description":"NodeJS Binance Futures Connector","directories":{},"_nodeVersion":"16.20.2","dependencies":{"ws":"^8.17.1","axios":"^1.7.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"_npmOperationalInternal":{"tmp":"tmp/futures-connector_0.1.6_1733303496984_0.5082700134283482","host":"s3://npm-registry-packages"}},"0.1.7":{"name":"@binance/futures-connector","version":"0.1.7","description":"NodeJS Binance Futures Connector","main":"src/index.js","scripts":{"test":"jest --detectOpenHandles","test:watch":"jest --watchAll","standard":"standard","coverage":"jest --silent --ci --coverage --testLocationInResults"},"repository":{"type":"git","url":"git+https://github.com/binance/binance-futures-connector-node.git"},"engines":{"node":">=16.20.2","npm":">=8.19.4"},"keywords":["Binance","API"],"author":{"name":"Binance"},"license":"MIT","bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"homepage":"https://github.com/binance/binance-futures-connector-node#readme","dependencies":{"axios":"^1.7.4","ws":"^8.17.1"},"devDependencies":{"jest":"^29.7.0","nock":"^13.3.3","standard":"^17.1.0"},"jest":{"testPathIgnorePatterns":["__tests__/websocket/subscription.test.js"],"transformIgnorePatterns":["node_modules/(?!axios)/"],"testMatch":["**/__tests__/**/*.test.js"]},"standard":{"ignore":["__tests__/**/*.js"]},"gitHead":"0eff9d347285008b15c237a91c5af596a7234bfd","_id":"@binance/futures-connector@0.1.7","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-c8YPN2F25Rlyv03nhoFHYoMrNptzJytoiYgfSwqjkYuWu6bBAbq3RQ7ClglPfRXjlWzSePLgxK63CllZ0F56bQ==","shasum":"61591858d59422d266b922dd5df64892fda6ea3f","tarball":"https://registry.npmjs.org/@binance/futures-connector/-/futures-connector-0.1.7.tgz","fileCount":29,"unpackedSize":109531,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC6XuqvYjBsSIn+1PkuewqU1YHZYKTHkoqW6dPTCVjH+QIgeZluDfTrPGhfa2rHubIY9NqyopaTkL+iVUkb4I6gg5c="}]},"_npmUser":{"name":"binance-bot","email":"binance-bot@binance.com"},"directories":{},"maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/futures-connector_0.1.7_1738054901149_0.2514942901355286"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-13T12:25:07.189Z","modified":"2025-01-28T09:01:41.511Z","0.1.0":"2023-10-13T12:25:07.483Z","0.1.3":"2024-07-03T03:21:37.550Z","0.1.4":"2024-08-19T05:41:53.701Z","0.1.5":"2024-10-03T07:31:52.931Z","0.1.6":"2024-12-04T09:11:37.167Z","0.1.7":"2025-01-28T09:01:41.305Z"},"bugs":{"url":"https://github.com/binance/binance-futures-connector-node/issues"},"author":{"name":"Binance"},"license":"MIT","homepage":"https://github.com/binance/binance-futures-connector-node#readme","keywords":["Binance","API"],"repository":{"type":"git","url":"git+https://github.com/binance/binance-futures-connector-node.git"},"description":"NodeJS Binance Futures Connector","maintainers":[{"name":"binance-bot","email":"binance-bot@binance.com"}],"readme":"# NodeJS Binance Futures Connector\n\n[![npm version](https://badge.fury.io/js/%40binance%2Ffutures-connector.svg)](https://badge.fury.io/js/%40binance%2Ffutures-connector)\n[![Node version](https://img.shields.io/node/v/%40binance%2Ffutures-connector.svg?style=flat)](http://nodejs.org/download/)\n[![Standard-Js](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis is a lightweight library that works as a connector to the UM and CM Binance Futures Endpoints. It’s designed to be simple, clean, and easy to use with minimal dependencies.\n\n- Supported APIs:\n  - /fapi/\\*\n  - /dapi/\\*\n  - UM Futures Websocket Market Stream\n  - CM Futures Websocket Market Stream\n  - UM Futures User Data Stream\n  - CM Futures User Data Stream\n- Inclusion of examples\n- Customisable base URL\n- Support request timeout and HTTP proxy\n- Response metadata can be displayed\n- Customisable Logger\n\n## Installation\n\n```bash\nnpm install @binance/futures-connector\n```\n\n## Documentation\n\n[https://binance.github.io/binance-futures-connector-node/](https://binance.github.io/binance-futures-connector-node/)\n\n## RESTful APIs\n\n```javascript\nconst { CMFutures } = require(\"@binance/futures-connector\");\n\nconst apiKey = \"\";\nconst apiSecret = \"\";\nconst cmFuturesClient = new CMFutures(apiKey, apiSecret, {\n  baseURL: \"https://dapi.binance.com\",\n});\n\ncmFuturesClient\n  .newOrder(\"BNBUSD_PERP\", \"BUY\", \"LIMIT\", {\n    timeInForce: \"GTC\",\n    quantity: 1,\n    price: 0.001,\n  })\n  .then((response) => console.log(response))\n  .catch(console.error);\n```\n\nPlease find `examples` folder to see the examples for more endpoints.\n\n## RSA Key based Authentication\n\n```javascript\nconst { UMFutures } = require(\"@binance/futures-connector\");\n\nconst apiKey = \"\";\nconst apiSecret = \"\"; // has no effect when RSA private key is provided\n\n// load private key\nconst privateKey = fs.readFileSync(\"/Users/john/ssl/private_key_encrypted.pem\");\nconst privateKeyPassphrase = \"password\";\n\nconst umFuturesClient = new UMFutures(apiKey, apiSecret, {\n  privateKey,\n  privateKeyPassphrase, // only used for encrypted key\n});\n\n// Get account information\numFuturesClient\n  .getAccountInformation()\n  .then((response) => client.logger.log(response.data));\n```\n\n### Testnet\n\nYou can use the testnet by adjusting the base URL:\n\n```javascript\n// provide the testnet base url\nconst umFuturesClient = new UMFutures(apiKey, apiSecret, {\n  baseURL: \"https://testnet.binancefuture.com\",\n});\n```\n\n### Base URL\n\nIf `baseURL` is not provided, it defaults to `fapi.binance.com`.\n\nIt's recommended to pass in the `baseURL` parameter to the constructor, so that it can easily be replaced with the testnet baseURL for testing/debugging.\n\n````javascript\n\n```javascript\n\n### Optional Parameters\n\nOptional parameters are encapsulated to a single object as the last function parameter.\n\n```javascript\nconst { UMFutures } = require('@binance/futures-connector')\n\nconst apiKey = ''\nconst apiSecret = ''\nconst client = new Spot(apiKey, apiSecret)\n\numFuturesClient.getAccountInformation({ recvWindow: 2000 }).then(response => umFuturesClient.logger.log(response.data))\n\n````\n\n### Timeout\n\nIt's easy to set timeout in milliseconds in request. If the request take longer than timeout, the request will be aborted. If it's not set, there will be no timeout.\n\n```javascript\nconst { UMFutures } = require(\"@binance/futures-connector\");\n\nconst apiKey = \"\";\nconst apiSecret = \"\";\nconst umFuturesClient = new UMFutures(apiKey, apiSecret, { timeout: 1000 });\n\nclient\n  .getAccountInformation()\n  .then((response) => umFuturesClient.logger.log(response.data))\n  .catch((error) => umFuturesClient.logger.error(error.message));\n```\n\n### Proxy\n\nThe `axios` package is used as the http client in this library. A proxy settings is passed into `axios` directly, the details can be found at [here](https://github.com/axios/axios#request-config):\n\n```javascript\nconst { UMFutures } = require(\"@binance/futures-connector\");\n\nconst apiKey = \"\";\nconst apiSecret = \"\";\nconst umFuturesClient = new UMFutures(apiKey, apiSecret, {\n  proxy: {\n    protocol: \"https\",\n    host: \"127.0.0.1\",\n    port: 9000,\n    auth: {\n      username: \"proxy_user\",\n      password: \"password\",\n    },\n  },\n});\n```\n\nYou may have a HTTP proxy, that can bring the problem that you need to make a HTTPS connection through the HTTP proxy. You can do that by build a HTTPS-over-HTTP tunnel by npm package [tunnel](https://www.npmjs.com/package/tunnel), and then pass the turnnel agent to `httpsAgent` in `axios`.\n\n```javascript\nconst tunnel = require(\"tunnel\");\n\nconst agent = tunnel.httpsOverHttp({\n  proxy: {\n    host: \"127.0.0.1\",\n    port: 3128,\n  },\n});\n\nconst umFuturesClient = new UMFutures(null, null, {\n  baseURL: \"https://fapi.binance.com\",\n  httpsAgent: agent,\n});\n\numFuturesClient\n  .getAccountInformation()\n  .then((response) => umFuturesClient.logger.log(response.data))\n  .catch((error) => umFuturesClient.logger.error(error));\n```\n\n[This comment](https://github.com/axios/axios/issues/925#issuecomment-359982190) provides more details.\n\n### Custom Logger Integration\n\n```javascript\nconst { UMFutures } = require(\"@binance/futures-connector\");\nconst fs = require(\"fs\");\nconst { Console } = require(\"console\");\n\n// make sure the logs/ folder is created beforehand\nconst output = fs.createWriteStream(\"./logs/stdout.log\");\nconst errorOutput = fs.createWriteStream(\"./logs/stderr.log\");\n\nconst logger = new Console({ stdout: output, stderr: errorOutput });\nconst umFuturesClient = new UMFutures(\"\", \"\", { logger: logger });\n\numFuturesClient\n  .getExchangeInfo()\n  .then((response) => umFuturesClient.logger.log(response.data));\n// check the output file\n```\n\nThe default logger defined in the package is [Node.js Console class](https://nodejs.org/api/console.html). Its output is sent to `process.stdout` and `process.stderr`, same as the global console.\n\n### Error\n\nThere are 2 types of error that may be returned from the API server and the user has to handle it properly:\n\n- `Client error`\n\n  - This is thrown when server returns `4XX`, it's an issue from client side.\n  - The following properties may be helpful to resolve the issue:\n    - Response header - Please refer to `Response Metadata` section for more details.\n    - HTTP status code\n    - Error code - Server's error code, e.g. `-1102`\n    - Error message - Server's error message, e.g. `Unknown order sent.`\n    - Request config - Configuration send to the server, which can include URL, request method and headers.\n\n  ```\n  // client initialization is skipped\n  client.exchangeInfo({ symbol: 'invalidSymbol' })\n    .then(response => client.logger.log(response.data))\n    .catch(err => {\n      client.logger.error(err.response.headers) // full response header\n      client.logger.error(err.response.status) // HTTP status code 400\n      client.logger.error(err.response.data) // includes both error code and message\n      client.logger.error(err.response.config) // includes request's config\n    })\n\n  ```\n\n- `Server error`\n  - This is thrown when server returns `5XX`, it's an issue from server side.\n\n## Websocket\n\nThe WebSocket URLs for the available futures environments are as follows:\n\n- Testnet CM: wss://dstream.binancefuture.com\n- Testnet UM: wss://stream.binancefuture.com\n- Main CM: wss://dstream.binance.com\n- Main UM: wss://fstream.binance.com\n\n### Websocket Streams\n\nYou can connect to the WebSocket stream using the UMStream Module (for USD-M Futures). Here is an example:\n\n```javascript\nconst { UMStream } = require(\"@binance/futures-connector\");\nconst logger = new Console({ stdout: process.stdout, stderr: process.stderr });\n\n// Define callbacks for different events\nconst callbacks = {\n  open: () => logger.debug(\"Connected with Websocket server\"),\n  close: () => logger.debug(\"Disconnected with Websocket server\"),\n  message: (data) => logger.info(data),\n};\n\n// Create a new WebSocket client with the wsURL (Websocket URL) defined\nconst umWebsocketStreamClient = new UMStream({\n  logger,\n  callbacks,\n  wsURL: \"wss://fstream.binance.com\",\n});\n\n// Subscribe to the allMarketMiniTickersStream stream\numWebsocketStreamClient.allMarketMiniTickersStream(\"bnbusdt_perp\");\n\n// Close the WebSocket stream after 6 seconds\nsetTimeout(() => umWebsocketStreamClient.disconnect(), 6000);\n```\n\n### Unsubscribe Websocket Stream\n\nYou can unsubscribe from a WebSocket stream as follows:\n\n```javascript\numWebsocketStreamClient.unsubscribe(\"bnbusdt_perp@kline_1m\");\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}