{"id":18445133,"url":"https://github.com/yeikiu/ts-kraken","last_synced_at":"2025-10-18T00:38:55.178Z","repository":{"id":39912625,"uuid":"347292476","full_name":"yeikiu/ts-kraken","owner":"yeikiu","description":"👾📈 A strongly typed library to operate with the Kraken Crypto Exchange | https://www.npmjs.com/package/ts-kraken","archived":false,"fork":false,"pushed_at":"2025-07-23T01:04:18.000Z","size":121260,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-23T01:08:14.388Z","etag":null,"topics":["api","cli","crypto","cryptocurrencies","js","kraken","library","repl","rxjs","trading-api","tradingbot","ts","typescript","websocket"],"latest_commit_sha":null,"homepage":"https://yeikiu.github.io/ts-kraken/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeikiu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-13T06:29:34.000Z","updated_at":"2025-07-23T01:03:54.000Z","dependencies_parsed_at":"2024-01-18T12:40:37.710Z","dependency_job_id":"ea979907-1680-4e2d-8b1a-f48b3eebd7b4","html_url":"https://github.com/yeikiu/ts-kraken","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/yeikiu/ts-kraken","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeikiu%2Fts-kraken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeikiu%2Fts-kraken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeikiu%2Fts-kraken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeikiu%2Fts-kraken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeikiu","download_url":"https://codeload.github.com/yeikiu/ts-kraken/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeikiu%2Fts-kraken/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267442458,"owners_count":24087803,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","cli","crypto","cryptocurrencies","js","kraken","library","repl","rxjs","trading-api","tradingbot","ts","typescript","websocket"],"created_at":"2024-11-06T07:04:54.286Z","updated_at":"2025-10-18T00:38:50.135Z","avatar_url":"https://github.com/yeikiu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"display: flex; justify-content: space-between;\"\u003e\n  \u003cimg src=\".ci_badges/npm-version-badge.svg\" /\u003e\n  \u003cimg src=\".ci_badges/npm-dependencies-badge.svg\" /\u003e\n  \u003cimg src=\".ci_badges/npm-devdependencies-badge.svg\" /\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\".github/ts_kraken_logo.png\" width=\"640px\" alt=\"ts-ts_kraken_logo\" /\u003e\n\u003c/h1\u003e\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch4 align=\"center\"\u003eA \u003ci\u003estrongly typed library\u003c/i\u003e to operate with the \u003ca href=\"https://kraken.com\"\u003eKraken Crypto Exchange\u003c/a\u003e\u003c/h4\u003e\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-quick-start\"\u003eQuick-Start\u003c/a\u003e •\n  \u003ca href=\"#ℹ%EF%B8%8F-about-this-project\"\u003eAbout\u003c/a\u003e •\n  \u003ca href=\"#%EF%B8%8F-usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#-documentation\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"#-acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n## 🚀 Quick-Start\n\u003cdetails\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n- Add the dependency to your js/ts project: `npm i ts-kraken`\n\n- _Optionally_ add `KRAKEN_API_KEY` and `KRAKEN_API_SECRET` to your .env (only if you intend to use private methods, i.e. add orders or fetch balances)\n\n- Test the repl-cli with `npx ts-kraken` or find code-snippets examples for the methods you want to import in [the documentation](https://yeikiu.github.io/ts-kraken).\n\n```ts\nimport {\n  getClosedOrders,\n  getWsAuthToken,\n  privateWsSubscription,\n  publicWsSubscription\n} from 'ts-kraken'\n\ngetWsAuthToken()\n  .then(async token =\u003e {\n    console.log({ token })\n\n    /* Fetch latest 50 closed orders and logs them */\n    getClosedOrders().then(lastClosedOrdersArr =\u003e {\n      const closedOrders = lastClosedOrdersArr.map(\n        ({ orderid, descr: { order } }) =\u003e ({ orderid, order })\n      )\n\n      console.table(closedOrders)\n    })\n\n    /* Print any updates in the private `balances` channel */\n    const balances$ = await privateWsSubscription(\n      {\n        channel: 'balances',\n        params: { snapshot: true }\n      },\n      token\n    ) // Pass token here to save time as the library won't need to fetch one internally!\n\n    balances$.subscribe(({ data }) =\u003e {\n      console.table(data)\n    })\n\n    /* Track 5m candles updates */\n    const fiveMinsBtcUsdCandles$ = publicWsSubscription({\n      channel: 'ohlc',\n      params: { symbol: ['BTC/USD'], interval: 5, snapshot: false }\n    })\n\n    fiveMinsBtcUsdCandles$.subscribe(\n      ({ data: [{ open, high, low, close }] }) =\u003e {\n        console.log({ open, high, low, close })\n      }\n    )\n  })\n  .catch(error =\u003e {\n    console.log({ error })\n  })\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n## ℹ️ About this project \n\u003cdetails\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n\u003e **ts-kraken** is a **strongly-typed** _Typescript Library_ that will help you\n\u003e operating via code or shell with\n\u003e [the Kraken Crypto Exchange](https://kraken.com)\n\n- Easily operate with Kraken\n  [REST](https://docs.kraken.com/api/docs/category/rest-api/market-data) and\n  [WebSocketV2](https://docs.kraken.com/websockets/) APIs\n\n- Use\n  [`ts-kraken` helper methods](https://yeikiu.github.io/ts-kraken/functions/getClosedOrders.html)\n  to build your own trading bots\n\n- Subscribe to custom streams of data combining the RxJS Observables returned by\n  the WebsocketV2 methods\n\n- Get advantage of modern IDEs Typescript integrations (code autocompletion,\n  suggested imports, etc.)\n\n\u003cbr /\u003e\n\n\u003e It also features an **interactive _node REPL-cli_** to operate via\n\u003e command-shell or leave a socket open printing all updates to the terminal with\n\u003e a nice [jq](https://jqlang.github.io/jq/) format 🤓\n\n- Kraken UI down durig high traffic or maintenance? You can still use the APIs!\n\n- Use any of the available REST methods directly from your terminal\n\n- Print nicely formatted data updates coming directly from WebsocketV2\n  subscriptions\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n## 🛠️ Usage \n\u003cdetails\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n  \u003cbr /\u003e\n\n  #### Use the library in your TypeScript/JS project:\n  \u003cdetails open\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n  - `cd dependant/project/path \u0026\u0026 npm i ts-kraken`\n\n  \u003cimg src=\".github/ts_kraken_IDE_2.png\" width=\"640px\" alt=\"ts_kraken_ide\" /\u003e\n\n  \u003cbr /\u003e\n\n  \u003e Get _IDE code-suggestions_ for any REST or WS request you need\n\n  \u003cimg src=\".github/ts_kraken_IDE.png\" width=\"640px\" alt=\"ts_kraken_ide\" /\u003e\n\n  \u003c/details\u003e\n\n  \u003cbr /\u003e\n  \n  #### Use the REPL-cli\n  \u003cdetails\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n  \u003e You can create a `.env` file that the repl-cli will try to read from `cwd`\n  \u003e (current working directory):\n\n  - `touch .env`\n\n  Use the following format:\n\n  ```\n  # .env's file content holding your API key/secret\n\n  KRAKEN_API_KEY=yourApiKey\n  KRAKEN_API_SECRET=yourApiSecret\n  ```\n\n  \u003cbr /\u003e\n\n  ##### Launch the REPL directly on your terminal with `npx`:\n\n  \u003e Quickest way to test it! 🚀 (will automatically download the library as a\n  \u003e global npm package if you don't run `npm i ts-kraken` first)\n\n  - `npx ts-kraken`\n\n  \u003cbr /\u003e\n\n  ##### Set it up in a standalone directory:\n\n  \u003e Recommended if planning to use regularly and/or modify core functionality\n\n  - `git clone https://github.com/yeikiu/ts-kraken`\n\n  - `cd ts-kraken`\n\n  - `npm i`\n\n  - `npm run repl` or `npx kraken-repl`\n\n  \u003e Open a PR with any addition/change proposal you have!\n\n  ![ts_kraken_demo](.github/ts_kraken_demo.gif)\n\n  \u003cbr /\u003e\n\n  ##### REPL commands\n  \u003cdetails\u003e\u003csummary\u003e(click to extend 👇)\u003c/summary\u003e\n\n  \u003e The following list includes only a subset sample of all possible commands you\n  \u003e could generate for the .get and .post methods:\n\n  \u003cbr /\u003e\n\n  ```\n  .exit       👉 Exit the REPL\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .help       👉 Print this help message\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .get        👉 Fetch PUBLIC REST data.\n\n              Usage   \u003e\u003e .get \u003cPublicEndpoint\u003e! \u003cparamA=valueA\u0026param_list[]=value1\u0026param_list[]=value2\u003e? \u003cjqFilter\u003e? \u003c-table\u003e?\n\n              i.e.    \u003e\u003e .get Time .rfc1123\n                      \u003e\u003e .get AssetPairs . as $base|keys|map($base[.])|map({wsname,tick_size,pair_decimals,ordermin}) -table\n                      \u003e\u003e .get AssetPairs pair=BTC/EUR . as $base|keys[0]|$base[.]|{wsname,tick_size,pair_decimals,ordermin}\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .post       👉 Fetch PRIVATE REST data.\n\n              Usage   \u003e\u003e .post \u003cPrivateEndpoint\u003e! \u003cparamA=valueA\u0026param_list[]=value1\u0026param_list[]=value2\u003e? \u003cjqFilter\u003e? \u003c-table\u003e?\n\n              i.e.    \u003e\u003e .post OpenOrders .open as $open|.open|keys|map($open[.].descr.order)\n                      \u003e\u003e .post OpenOrders .open as $open|.open|keys|map($open[.].descr) -table\n                      \u003e\u003e .post AddOrder ordertype=market\u0026type=sell\u0026volume=0.002\u0026pair=ETHEUR\n                      \u003e\u003e .post CancelAll\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .privsub    👉 Subscribe to PRIVATE WS stream.\n\n              Usage   \u003e\u003e .privsub \u003csubscriptionName\u003e! \u003cparamA=valueA\u0026param_list[]=value1\u0026param_list[]=value2\u003e? \u003cjqFilter\u003e? \u003c-table\u003e?\n\n              i.e.    \u003e\u003e .privsub balances snap_orders=true .data|map({ asset, balance }) -table\n                      \u003e\u003e .privsub executions snap_orders=true .data|map({order_id,side,order_qty,symbol,order_type,limit_price}) -table\n\n  .pubsub     👉 Subscribe to PUBLIC WS stream.\n\n              Usage   \u003e\u003e .pubsub \u003csubscriptionName\u003e! \u003cparamA=valueA\u0026param_list[]=value1\u0026param_list[]=value2\u003e? \u003cjqFilter\u003e? \u003c-table\u003e?\n\n              i.e.    \u003e\u003e .pubsub ticker symbol[]=BTC/EUR .data[0].last\n                      \u003e\u003e .pubsub ticker symbol[]=BTC/EUR\u0026symbol[]=ADA/BTC\u0026symbol[]=USDT/USD .data[0]|{symbol,last} -table\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .setkeys    👉 Load API key/secret (non-persistent, use a .env file to reuse persistent keys)\n\n  .showkeys   👉 Display current API key/secret in use\n\n  -----------------------------------------------------------------------------------------------------------------------------------------------------\n\n  .unsub      👉 Closes WebSocket stream for GIVEN subscriptionName.\n\n              i.e.    \u003e\u003e .unsub ticker\n                      \u003e\u003e .unsub executions\n\n  .unsuball   👉 Closes WebSocket stream for ALL subscriptions.\n\n              i.e.    \u003e\u003e .unsuball\n  ```\n\n  \u003c/details\u003e\n\u003c/details\u003e\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n## 🔖 Documentation\n\n- [ts-kraken Documentation](https://yeikiu.github.io/ts-kraken)\n\n- [Kraken REST API docs](https://docs.kraken.com/api/docs/rest-api/add-order)\n- [Kraken WebSocketsV2 API docs](https://docs.kraken.com/api/docs/websocket-v2/add_order)\n\n- [jq Manual](https://stedolan.github.io/jq/manual)\n- [jq Playground](https://jqkungfu.com/)\n\n\u003cbr /\u003e\n\n## 🙏 Acknowledgments\n\n- [@trasherdk](https://github.com/trasherdk) | Contributor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeikiu%2Fts-kraken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeikiu%2Fts-kraken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeikiu%2Fts-kraken/lists"}