{"id":36796269,"url":"https://github.com/mitsutoshi/bitflyergo","last_synced_at":"2026-01-12T13:30:12.688Z","repository":{"id":47623550,"uuid":"219751075","full_name":"mitsutoshi/bitflyergo","owner":"mitsutoshi","description":"Library trading cryptocurrency using Golang on bitFlyer.","archived":false,"fork":false,"pushed_at":"2023-05-29T02:50:54.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T21:38:04.069Z","etag":null,"topics":["bitflyer","bitflyer-lightning","cryptocurrency","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitsutoshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-05T13:25:50.000Z","updated_at":"2021-08-21T05:13:46.000Z","dependencies_parsed_at":"2022-08-29T23:20:19.953Z","dependency_job_id":null,"html_url":"https://github.com/mitsutoshi/bitflyergo","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/mitsutoshi/bitflyergo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsutoshi%2Fbitflyergo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsutoshi%2Fbitflyergo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsutoshi%2Fbitflyergo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsutoshi%2Fbitflyergo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitsutoshi","download_url":"https://codeload.github.com/mitsutoshi/bitflyergo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsutoshi%2Fbitflyergo/sbom","scorecard":{"id":650590,"data":{"date":"2025-08-11","repo":{"name":"github.com/mitsutoshi/bitflyergo","commit":"69c401ae524beaa7f28124e1aad98c443a7fe111"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mitsutoshi/bitflyergo/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mitsutoshi/bitflyergo/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/mitsutoshi/bitflyergo/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/mitsutoshi/bitflyergo/test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T13:25:14.447Z","repository_id":47623550,"created_at":"2025-08-21T13:25:14.447Z","updated_at":"2025-08-21T13:25:14.447Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bitflyer","bitflyer-lightning","cryptocurrency","go","golang"],"created_at":"2026-01-12T13:30:12.513Z","updated_at":"2026-01-12T13:30:12.646Z","avatar_url":"https://github.com/mitsutoshi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"bitflyergo\n===========\n\n![.github/workflows/test.yml](https://github.com/mitsutoshi/bitflyergo/workflows/.github/workflows/test.yml/badge.svg) [![CircleCI](https://circleci.com/gh/mitsutoshi/bitflyergo.svg?style=svg)](https://circleci.com/gh/mitsutoshi/bitflyergo) [![Go Report Card](https://goreportcard.com/badge/github.com/mitsutoshi/bitflyergo)](https://goreportcard.com/report/github.com/mitsutoshi/bitflyergo)\n\nbitflyergo is golang library to trade cryptocurrency on bitFlyer.\n\nSupport following functions.\n\n* REST-API Client\n* Realtime API (WebSocket JSON-RPC)\n* Utility functions\n\n## How to use\n\nHere are some ways to use the library. If you want to know API specification, See tha public [documents](https://lightning.bitflyer.com/docs).\n\n### Initialize\n\nYou need to call `bitflyergo.NewBitflyer` with arguments. First argument is your api key, second that is your api secret. If you don't use private api, you may specify blank.\n\n```go\napiKey := \"\u003cYour API Key\u003e\"\napiSecret := \"\u003cYour API Secret\u003e\"\nbf := bitflyergo.NewBitflyer(apiKey, apiSecret)\n```\n\n### Call Public API\n\n#### /v1/getexecutions\n\nGet the last five execution histories of `FX_BTC_JPY`.\n\n* product_code: FX_BTC_JPY\n* count: 5\n\n```go\nparams := map[string]string{\n    \"product_code\": \"FX_BTC_JPY\",\n    \"count\":        \"5\",\n}\nexecutions, err := bf.GetExecutions(params)\n```\n\nReturn value is `[]bitflyergo.Execution`. \n\n```go\nfor _, e := range *executions {\n    fmt.Println(e)\n}\n```\n\n```\n{800001572 2019-02-09T10:49:55.58 398759 0.01 BUY JRF20190209-XXXXX-XXXXX1 JRF20190209-YYYYYY-YYYYY1}\n{800001572 2019-02-09T10:49:55.57 398758 0.01 BUY JRF20190209-XXXXX-XXXXX2 JRF20190209-YYYYYY-YYYYY2}\n...\n```\n\n#### /v1/getboard\n\n```go\nboard, err := bf.GetBoard()\n```\n\n### Call Private API\n\n#### /v1/me/getexecutions\n\n#### /v1/me/getchildorders\n\n```go\nparams := map[string]string{\n    \"\": \"\",\n}\nchildOrders, err := api.GetChildOrders(params)\n```\n\n#### /v1/me/getpositions\n\n```go\nproductCode := \"FX_BTC_JPY\"\npositions, err := api.GetPositions(productCode)\n```\n\n#### /v1/me/getcollateral\n\n```go\ncollateral, err := api.GetCollateral()\n```\n\n#### /v1/me/getbalance\n\n```go\nbalance, err := api.GetBalance()\n```\n\n#### /v1/me/sendchildorder\n\nPlace the limit order. `SendChildOrder` returns `childOrderAcceptanceId string`. `childOrderAcceptanceId` is when order is accepted ID.\n\n```go\nparams := map[string]string{\n    \"price\": \"400000\",\n}\nchildOrderAcceptanceId, err := api.SendChildOrder(\"FX_BTC_JPY\", \"LIMIT\", \"BUY\", 0.01, params)\n```\n\nPlace the market order. market order does't need to specify price of argument.\n\n```go\nchildOrderAcceptanceId, err := api.SendChildOrder(\"FX_BTC_JPY\", \"MARKET\", \"BUY\", 0.01, nil)\n```\n\n### Receive streaming data from websocket\n\nbitflyergo provides the APIs to use bitFlyer Lightning Realtime API.\n\nFirst, you need to implement `Callback` interface's methods.\n\n```go\n// OnReceiveBoard is the callbck when board is received from websocket.\nOnReceiveBoard(channelName string, board *Board)\n\n// OnReceiveBoardSnapshot is the callbck when board snapshot is received from websocket.\nOnReceiveBoardSnapshot(channelName string, board *Board)\n\n// OnReceiveExecutions is the callbck when executions is received from websocket.\nOnReceiveExecutions(channelName string, executions []Execution)\n\n// OnReceiveTicker is the callbck when ticker is received from websocket.\nOnReceiveTicker(channelName string, ticker *Ticker)\n\n// OnReceiveChildOrderEvents is the callbck when child order event is received from websocket.\nOnReceiveChildOrderEvents(channelName string, event []ChildOrderEvent)\n\n// OnReceiveParentOrderEvents is the callbck when board is received from websocket.\nOnReceiveParentOrderEvents(channelName string, event []ParentOrderEvent)\n\n// OnErrorOccur is the callbck when error is occurred during receiving stream data.\nOnErrorOccur(channelName string, err error)\n```\n\nThen, Write code for receiving Realtime API data from websocket.\n\n```go\n// Create WebSocketClient with Callback interface implement.\nws := WebSocketClient{\n    Debug: false,\n\tCb:    \u0026YourCallbackImplement{},\n}\n\n// connect Realtime API.\nerr := ws.Connect()\nif err != nil {\n\tlog.Fatal(err)\n}\n\n// start receiving data. must to use goroutine.\ngo ws.Receive()\n\n// subscribe channel\nws.SubscribeExecutions(\"FX_BTC_JPY\")\n\ninterrupt := make(chan os.Signal, 1)\nsignal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)\nLOOP:\n\tfor {\n\t\tselect {\n\t\tcase _ = \u003c-interrupt:\n\t\t\tbreak LOOP\n\t\t}\n\t}\n```\n\n## How to test\n\nTests using private api require following environment variables.\n\n```sh\nexport APIKEY=\u003cvalue\u003e\nexport APISECRET=\u003cvalue\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsutoshi%2Fbitflyergo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitsutoshi%2Fbitflyergo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsutoshi%2Fbitflyergo/lists"}