{"id":21193327,"url":"https://github.com/vdegenne/kraken-api-js","last_synced_at":"2025-07-10T03:32:32.088Z","repository":{"id":39898171,"uuid":"217761958","full_name":"vdegenne/kraken-api-js","owner":"vdegenne","description":"JavaScript full support of kraken API","archived":false,"fork":false,"pushed_at":"2022-12-06T14:53:41.000Z","size":21,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-22T23:02:31.481Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vdegenne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-26T19:55:00.000Z","updated_at":"2021-03-04T15:01:04.000Z","dependencies_parsed_at":"2023-01-23T08:40:14.640Z","dependency_job_id":null,"html_url":"https://github.com/vdegenne/kraken-api-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdegenne","download_url":"https://codeload.github.com/vdegenne/kraken-api-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615182,"owners_count":17496946,"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-11-20T19:13:53.373Z","updated_at":"2024-11-20T19:13:54.076Z","avatar_url":"https://github.com/vdegenne.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kraken-api-js\n\nJavaScript full support of [`kraken-api`](https://github.com/nothingisdead/npm-kraken-api).  \nOriginally `kraken-api` is **CommonJS** friendly only. This package is a port for **CommonJS**, **ES2015 Module** and **TypeScript** support.\n\n## Imports\n\n### CommonJS\n\n```javascript\nconst { KrakenClient } = require('kraken-api-js')\n```\n\n### ES-Module\n\n```javascript\nimport { KrakenClient } from 'kraken-api-js'\n```\n\n### TypeScript (typings included)\n\n```javascript\nimport { KrakenClient } from 'kraken-api-js'\n```\n\n## Usage\n\n```javascript\nconst key = '' // your API key\nconst privateKey = '' // your API private key\nconst kraken = new KrakenClient(key, privateKey)\n\n/* examples */\nconst main = async () =\u003e {\n  // public endpoint\n  const {result} = await kraken.api('Ticker', { pair: 'XRPUSD' })\n  console.log(result.XXRPZUSD.c) // print current USD value of XRP\n\n  // private endpoint\n  const {result} = await kraken.api('Balance')\n  console.log(result.XXBT) // print how much bitcoins you have on your account right now\n}\n\nmain()\n```\n---\n\n*Below is a list of the different methods you can call. To see the parameters you have to provide to each method please refer to the official [Kraken API page](https://www.kraken.com/features/api)*\n\n### public methods\n\n`Time` `Assets` `AssetPairs` `Ticker` `Depth` `Trades` `Spread` `OHLC`\n\n### private methods\n\n`Balance` `TradeBalance` `OpenOrders` `ClosedOrders` `QueryOrders` `TradesHistory` `QueryTrades` `OpenPositions` `Ledgers` `QueryLedgers` `TradeVolume` `AddOrder` `CancelOrder` `DepositMethods` `DepositAddresses` `DepositStatus` `WithdrawInfo` `Withdraw` `WithdrawStatus` `WithdrawCancel` `GetWebSocketsToken`\n\n### import methods list\n\nThe array of both public and private methods can be imported into your project\n\n```javascript\n/* commonjs */\nconst { KrakenMethods } = require('kraken-api-js')\n\n/* es-module \u0026 typescript */\nimport { KrakenMethods } from 'kraken-api-js'\n```\n\n\n## Errors handling\n\nIn `kraken-api` if the response from the API contains an error the `api` method will throw an `Error`.\nIn this version, the response is always a json object, giving you more freedom to handle the errors :\n\n```javascript\ntry {\n  const {result, error} = await client.api('Ticker', { pair: 'fakePair' })\n  if (error.length \u003e 0) {\n    console.log(`Response contains errors [ ${error.join(', ')} ]`)\n    return\n  }\n  else if (result) {\n    console.log('Response is clean')\n    console.log(result)\n  }\n} catch (e) {\n  // this piece of code will only get executed if the API couldn't be reached\n  // (e.g. if the network has no connection to internet)\n  console.log('the API couldn\\'t be reached')\n}\n```\n\n## Author\n\nValentin Degenne\n\nvdegenne (at) gmail (dot) com\n\nbitcoin:3KfrLBhWgKxnNH9hoC8ipSPYi3LW3Qrj8i  \nethereum:0x2b168Ec72b8B6168E3A0BAFa3A2f356374C880C5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdegenne%2Fkraken-api-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdegenne%2Fkraken-api-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdegenne%2Fkraken-api-js/lists"}