{"id":13733899,"url":"https://github.com/denkhaus/go-bitshares","last_synced_at":"2025-12-24T05:00:01.158Z","repository":{"id":56040949,"uuid":"98793380","full_name":"denkhaus/go-bitshares","owner":"denkhaus","description":"API for Bitshares - supports websocket RPC \u0026 Wallet functions","archived":false,"fork":false,"pushed_at":"2020-11-29T13:36:02.000Z","size":1152,"stargazers_count":23,"open_issues_count":2,"forks_count":27,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-13T21:47:08.202Z","etag":null,"topics":["bitshares","bitshares-api","cryptocurrency","decentralised-exchange","rpc","websocket"],"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/denkhaus.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":"2017-07-30T11:36:30.000Z","updated_at":"2023-11-22T22:59:43.000Z","dependencies_parsed_at":"2022-08-15T12:00:52.326Z","dependency_job_id":null,"html_url":"https://github.com/denkhaus/go-bitshares","commit_stats":null,"previous_names":["denkhaus/bitshares"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/denkhaus/go-bitshares","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denkhaus%2Fgo-bitshares","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denkhaus%2Fgo-bitshares/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denkhaus%2Fgo-bitshares/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denkhaus%2Fgo-bitshares/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denkhaus","download_url":"https://codeload.github.com/denkhaus/go-bitshares/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denkhaus%2Fgo-bitshares/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27995798,"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-12-24T02:00:07.193Z","response_time":83,"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":["bitshares","bitshares-api","cryptocurrency","decentralised-exchange","rpc","websocket"],"created_at":"2024-08-03T03:00:50.723Z","updated_at":"2025-12-24T05:00:01.114Z","avatar_url":"https://github.com/denkhaus.png","language":"Go","funding_links":[],"categories":["Libraries"],"sub_categories":["Go Libraries"],"readme":"# go-bitshares\n\nA Bitshares API consuming a websocket connection to an active full node or a RPC connection to your `cli_wallet`. \nLook for several examples in [examples](/examples) and [tests](/tests) folder. This is work in progress. To mitigate breaking changes, please use tagged branches. New tagged branches will be created for breaking changes. No additional cgo dependencies for transaction signing required. Use it at your own risk. \n\n## install\n\n```bash\ngo get -u github.com/denkhaus/go-bitshares\n```\n\nInstall dev-dependencies with\n\n```bash\nmake init\n```\n\nThis API uses [ffjson](https://github.com/pquerna/ffjson). \nIf you change types or operations you have to regenerate the required static `MarshalJSON` and `UnmarshalJSON` functions for the new/changed code.\n\n```bash\nmake generate\n```\n\nIf you encounter any errors, try: \n\n```bash\nmake generate_new\n```\n\nto generate ffjson helpers from scratch.\n\n## generate operation samples\nTo generate op samples for testing, go to [gen](/gen) package.\nGenerated operation samples get injected automatically while running operation tests.\n\n## testing\nTo test this stuff I use a combined docker based MainNet/TestNet wallet, you can find [here](https://github.com/denkhaus/bitshares-docker).\nOperations testing uses generated real blockchain sample code by [gen](/gen) package. To test run:\n\n```bash\nmake test_operations\nmake test_api\n```\n\nor a long running block (deserialize/serialize/compare) range test.\n\n```bash\nmake test_blocks\n```\n\n## code\n\n```go\nwsFullApiUrl := \"wss://bitshares.openledger.info/ws\"\n\napi := bitshares.NewWebsocketAPI(wsFullApiUrl)\nif err := api.Connect(); err != nil {\n\tlog.Fatal(err)\n}\n\napi.OnError(func(err error) {\n\tlog.Fatal(err)\n})\n\nUserID   := types.NewAccountID(\"1.2.253\")\nAssetBTS := types.NewAssetID(\"1.3.0\")\n\nres, api.GetAccountBalances(UserID, AssetBTS)\nif err != nil {\n\tlog.Fatal(err)\n}\n\nlog.Printf(\"balances: %v\", res)\n```\n\nIf you need wallet functions, use:\n\n```go\nrpcApiUrl    := \"http://localhost:8095\" \napi := bitshares.NewWalletAPI(rpcApiUrl)\n\nif err := api.Connect(); err != nil{\n\tlog.Fatal(err)\n}\n\n...\n```\n\nFor a long application lifecycle, you can use an API instance with latency tester that connects to the most reliable node.\nNote: Because the tester takes time to unleash its magic, use the above-mentioned constructor for quick in and out.\n\n```go\nwsFullApiUrl := \"wss://bitshares.openledger.info/ws\"\n\n//wsFullApiUrl serves as \"quick startup\" fallback endpoint here, \n//until the latency tester provides the first results.\n\napi, err := bitshares.NewWithAutoEndpoint(wsFullApiUrl)\nif err != nil {\n\tlog.Fatal(err)\n}\n\nif err := api.Connect(); err != nil {\n\tlog.Fatal(err)\n}\n\napi.OnError(func(err error) {\n\tlog.Fatal(err)\n})\n\n...\n```\n\n## implemented and tested (serialize/unserialize) operations\n\n- [x] OperationTypeTransfer OperationType\n- [x] OperationTypeLimitOrderCreate\n- [x] OperationTypeLimitOrderCancel\n- [x] OperationTypeCallOrderUpdate\n- [x] OperationTypeFillOrder (virtual)\n- [x] OperationTypeAccountCreate\n- [x] OperationTypeAccountUpdate\n- [x] OperationTypeAccountWhitelist\n- [x] OperationTypeAccountUpgrade\n- [x] OperationTypeAccountTransfer\n- [x] OperationTypeAssetCreate\n- [x] OperationTypeAssetUpdate\n- [x] OperationTypeAssetUpdateBitasset\n- [x] OperationTypeAssetUpdateFeedProducers\n- [x] OperationTypeAssetIssue\n- [x] OperationTypeAssetReserve\n- [x] OperationTypeAssetFundFeePool\n- [x] OperationTypeAssetSettle\n- [x] OperationTypeAssetGlobalSettle\n- [x] OperationTypeAssetPublishFeed\n- [x] OperationTypeWitnessCreate\n- [x] OperationTypeWitnessUpdate\n- [x] OperationTypeProposalCreate\n- [x] OperationTypeProposalUpdate\n- [x] OperationTypeProposalDelete\n- [x] OperationTypeWithdrawPermissionCreate\n- [x] OperationTypeWithdrawPermissionUpdate\n- [x] OperationTypeWithdrawPermissionClaim\n- [x] OperationTypeWithdrawPermissionDelete\n- [x] OperationTypeCommitteeMemberCreate\n- [x] OperationTypeCommitteeMemberUpdate\n- [x] OperationTypeCommitteeMemberUpdateGlobalParameters\n- [x] OperationTypeVestingBalanceCreate\n- [x] OperationTypeVestingBalanceWithdraw\n- [x] OperationTypeWorkerCreate\n- [x] OperationTypeCustom\n- [ ] OperationTypeAssert\n- [x] OperationTypeBalanceClaim\n- [x] OperationTypeOverrideTransfer\n- [x] OperationTypeTransferToBlind\n- [ ] OperationTypeBlindTransfer\n- [x] OperationTypeTransferFromBlind\n- [ ] OperationTypeAssetSettleCancel\n- [x] OperationTypeAssetClaimFees\n- [ ] OperationTypeFBADistribute\n- [x] OperationTypeBidColatteral\n- [ ] OperationTypeExecuteBid\n\n## todo\n- add missing operations\n- add convenience functions \n\n\nHave fun and feel free to contribute needed operations and tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenkhaus%2Fgo-bitshares","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenkhaus%2Fgo-bitshares","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenkhaus%2Fgo-bitshares/lists"}