{"id":21193282,"url":"https://github.com/vdegenne/kraken-api-browser","last_synced_at":"2025-07-02T19:32:59.648Z","repository":{"id":35443006,"uuid":"217705681","full_name":"vdegenne/kraken-api-browser","owner":"vdegenne","description":"kraken-api port for modern browsers","archived":false,"fork":false,"pushed_at":"2022-12-06T23:35:55.000Z","size":132,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T22:19:41.139Z","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":null,"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-26T12:29:26.000Z","updated_at":"2020-11-22T20:52:41.000Z","dependencies_parsed_at":"2023-01-15T21:22:12.793Z","dependency_job_id":null,"html_url":"https://github.com/vdegenne/kraken-api-browser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vdegenne/kraken-api-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdegenne","download_url":"https://codeload.github.com/vdegenne/kraken-api-browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdegenne%2Fkraken-api-browser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262358134,"owners_count":23298538,"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:42.563Z","updated_at":"2025-07-02T19:32:59.626Z","avatar_url":"https://github.com/vdegenne.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/vdegenne"],"categories":[],"sub_categories":[],"readme":"# kraken-api-browser\n\n`kraken-api-browser` is a browser port of the server-side kraken API [`kraken-api`](https://github.com/nothingisdead/npm-kraken-api).\n\nUse `npm i kraken-api-browser` to install it.\n\nIt's a es6 module file, which means you can directly import it into your web page\n\n```html\n\u003cscript type=\"module\" src=\"/node_modules/kraken-api-browser/build.js\"\u003e\u003c/script\u003e\n```\n*(see Browser Usage for more details)*  \n\n\nYou can also import it in a es6 module project, and in a TypeScript project (typings included)\n\n```typescript\nimport { KrakenClient } from 'kraken-api-browser';\n```\n\n## Usage\n\n```javascript\nconst kraken = new KrakenClient();\n\nasync function main () {\n  const { result } = await kraken.api('Ticker', { pair: 'XBTEUR' });\n\n  console.log(result);\n}\n\nmain()\n```\n\n### Browser Usage\n\n```html\n\u003cscript src=\"/node_modules/kraken-api-browser/build.js\" type=\"module\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const kraken = new KrakenClient();\n  ...\n\u003c/script\u003e\n```\n\nor\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { KrakenClient } from '/node_modules/kraken-api-browser/build.js';\n\n  const kraken = new KrakenClient();\n  ...\n\u003c/script\u003e\n```\n\n*(note: if you are using a server that resolves es module paths on requests you know what's up)*\n\n### TypeScript Usage\n\nIf you are using TypeScript you can easily see the methods available with auto-suggestion feature in your IDE.\n\n\u003cimg src=\"screencapture.png\"/\u003e\n\n\n## Availabe public methods\n\n```\n'Time' | 'Assets' | 'AssetPairs' | 'Ticker' | 'Depth' | 'Trades' | 'Spread' | 'OHLC'\n```\n*(note: You can also use the `publicMethod` function to narrow down the list of available public methods because right now the private methods won't work, read the disclaimer below)*\n\n\n# Disclaimer\n\nI contacted the Kraken support to ask them to allow cors requests when using private methods such as `Balance` but they couldn't help me... When requesting a private method Kraken API requires a bunch of security codes such as the API keys and other things to be sent in the header of that https request. On a server side it works just fine but browsers such as Google Chrome send a pre-flight `OPTIONS` request before the `POST` one (https://stackoverflow.com/a/29954326/773595) when modifying the header of sensitive requests.  \n**For this reason the private methods in this framework are for the time being not working**  \nOne way for Kraken to fix this issue would be to accept `OPTIONS` requests from trusted origins (if not all origins) but they didn't.\n\n\n## Support\n\n[Buy Me a Coffee](https://www.buymeacoffee.com/vdegenne)  \nbitcoin address: 3KfrLBhWgKxnNH9hoC8ipSPYi3LW3Qrj8i","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdegenne%2Fkraken-api-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdegenne%2Fkraken-api-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdegenne%2Fkraken-api-browser/lists"}