{"id":20932921,"url":"https://github.com/jferrl/go-kraken","last_synced_at":"2025-06-14T12:04:58.251Z","repository":{"id":192025943,"uuid":"685555499","full_name":"jferrl/go-kraken","owner":"jferrl","description":"Go library for accessing the Kraken API :octopus:","archived":false,"fork":false,"pushed_at":"2023-10-05T09:51:48.000Z","size":146,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T12:02:30.281Z","etag":null,"topics":["crypto","go","golang","kraken"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jferrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-08-31T13:48:12.000Z","updated_at":"2024-02-29T08:54:14.000Z","dependencies_parsed_at":"2023-09-02T06:15:20.557Z","dependency_job_id":"6eca5d12-5b49-4f3e-a046-1d57471d2040","html_url":"https://github.com/jferrl/go-kraken","commit_stats":null,"previous_names":["jferrl/go-kraken"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jferrl/go-kraken","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fgo-kraken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fgo-kraken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fgo-kraken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fgo-kraken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferrl","download_url":"https://codeload.github.com/jferrl/go-kraken/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fgo-kraken/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259812959,"owners_count":22915194,"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":["crypto","go","golang","kraken"],"created_at":"2024-11-18T21:53:46.140Z","updated_at":"2025-06-14T12:04:58.226Z","avatar_url":"https://github.com/jferrl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-kraken\n\n[![GoDoc](https://img.shields.io/static/v1?label=godoc\u0026message=reference\u0026color=blue)](https://pkg.go.dev/github.com/jferrl/go-kraken)\n[![Test Status](https://github.com/jferrl/go-kraken/workflows/tests/badge.svg)](https://github.com/jferrl/go-kraken/actions?query=workflow%3Atests)\n[![CodeQL](https://github.com/jferrl/go-kraken/workflows/CodeQL/badge.svg)](https://github.com/jferrl/go-kraken/actions?query=workflow%3ACodeQL)\n[![codecov](https://codecov.io/gh/jferrl/go-kraken/branch/main/graph/badge.svg?token=68I4BZF235)](https://codecov.io/gh/jferrl/go-kraken)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jferrl/go-kraken)](https://goreportcard.com/report/github.com/jferrl/go-kraken)\n\nGo library for accessing the Kraken API. :octopus:\n\nDocs url \u003chttps://docs.kraken.com/rest/\u003e.\n\n## Usage\n\ngo-kraken is compatible with modern Go releases.\n\nBuild a new client, then you can use the services to reach different parts of the Kraken API. For example:\n\n```go\npackage main\n\nimport (\n \"context\"\n \"fmt\"\n\n \"github.com/jferrl/go-kraken\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n c := kraken.New(nil)\n\n // Get server time\n st, err := c.MarketData.Time(ctx)\n if err != nil {\n  fmt.Println(err)\n  return\n }\n\n fmt.Println(st)\n}\n```\n\nUsing the `context` package, you can easily pass cancelation signals and\ndeadlines to various services of the client for handling a request.\n\n## Token Creation\n\n\u003chttps://pro.kraken.com/app/settings/api\u003e\n\n## Authentication\n\n\u003chttps://docs.kraken.com/rest/#section/Authentication\u003e\n\nAuthenticated requests must include both API-Key and API-Sign HTTP headers, and nonce in the request payload. otp is also required in the payload if two-factor authentication (2FA) is enabled.\n\n### Nonce\n\nNonce must be an always increasing, unsigned 64-bit integer, for each request that is made with a particular API key. While a simple counter would provide a valid nonce, a more usual method of generating a valid nonce is to use e.g. a UNIX timestamp in milliseconds.\n\n### 2FA\n\nIf two-factor authentication (2FA) is enabled for the API key and action in question, the one time password must be specified in the payload's otp value.\n\nIn order to set OTP in the request, you can use the `ContextWithOtp` function. Internally, OTP value is stored in the context and then used in the request.\n\n For example:\n\n```go\npackage main\n\nimport (\n \"context\"\n\n \"github.com/jferrl/go-kraken\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n ctxWithOpt := kraken.ContextWithOtp(ctx, \"123456\")\n}\n```\n\n###  API-Key\n\nThe \"API-Key\" header should contain your API key.\n\nSecurity Scheme Type: API Key\nHeader parameter name: API-Key\n\n###  API-Sign\n\nAuthenticated requests should be signed with the \"API-Sign\" header, using a signature generated with your private key, nonce, encoded payload, and URI path according to:\n\n`HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key`\n\n## License\n\nThis library is distributed under the BSD-style license found in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fgo-kraken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferrl%2Fgo-kraken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fgo-kraken/lists"}