{"id":28042276,"url":"https://github.com/zoobc/zoobc-sdk","last_synced_at":"2025-10-11T22:33:18.323Z","repository":{"id":53499628,"uuid":"194639058","full_name":"zoobc/zoobc-sdk","owner":"zoobc","description":"Small set of libraries written with TypeScript and compiled to be JavaScript, making it easy to implement / integrate applications so that they connect with the P2P API of the nodes in the blockchain for the Web API of the explorer servers and wallet.","archived":false,"fork":false,"pushed_at":"2021-03-28T01:28:34.000Z","size":26886,"stargazers_count":0,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-05-07T23:34:58.762Z","etag":null,"topics":["blockchain","grpc","grpc-web","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/zbc-sdk","language":"JavaScript","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/zoobc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-01T09:09:55.000Z","updated_at":"2021-03-22T07:35:41.000Z","dependencies_parsed_at":"2022-08-18T18:00:36.373Z","dependency_job_id":null,"html_url":"https://github.com/zoobc/zoobc-sdk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobc%2Fzoobc-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobc%2Fzoobc-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobc%2Fzoobc-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobc%2Fzoobc-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoobc","download_url":"https://codeload.github.com/zoobc/zoobc-sdk/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973606,"owners_count":21834104,"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":["blockchain","grpc","grpc-web","javascript","typescript"],"created_at":"2025-05-11T14:25:14.149Z","updated_at":"2025-10-11T22:33:13.278Z","avatar_url":"https://github.com/zoobc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Screenshot](assets/images/ZooBC-SDK.gif)\n\n# ZooBC-SDK\n\n![npm](https://img.shields.io/npm/v/zoobc)\n![download](https://img.shields.io/npm/dw/zoobc)\n![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)\n![build](https://img.shields.io/circleci/build/github/zoobc/zoobc-sdk?token=8a1610a487c652b7165e501f7d4c814fe0e34e12)\n\nZooBC-SDK is a small set of libraries written with TypeScript and compiled to be JavaScript, making it easy to implement / integrate applications so that they connect with the P2P API of the nodes in the blockchain for the Web API of the explorer servers and wallet.\n\n## Start using ZooBC-SDK\n\nFor instructions on how to use web and mobile for a project, please refer to these documents:\n\n- [AngularJs](examples/angular)\n- [Ionic](examples/ionic)\n- [ReactJs](examples/react)\n- [React Native](https://github.com/zoobc/zoobc-thumbwar.git)\n- [VueJs](examples/vue)\n\n## General Usage\n\nAdd 'zbc-sdk' packages to your project by executing:\n\n```bash\n$ npm install zbc-sdk\nor\n$ yarn add zbc-sdk\n```\n\nHere's an example of basic usage for connection:\n\n```bash\nimport React, { useState, useEffect } from 'react';\nimport zoobc from 'zbc-sdk';\n\nconst App = () =\u003e {\n  const [blocks, setBlocks] = useState([])\n  const [error, setError] = useState(null)\n  const [detail, setDetail] = useState(null)\n\n  useEffect(() =\u003e {\n    const hosts = [\n      { host: 'http://your-ip-address:your-port', name: 'Testnet' },\n    ];\n    zoobc.Network.list(hosts)\n    listBlocks();\n  }, [])\n\n  const listBlocks = () =\u003e {\n    zoobc.Block\n      .getBlocks({height: 0})\n      .then(res =\u003e setBlocks(res.blocksList))\n      .catch(err =\u003e setError(err))\n  };\n\n  const onClickBlockId = (id) =\u003e {\n    zoobc.Block\n      .getBlockById(id)\n      .then(res =\u003e {\n        setDetail(res)\n        setError(null)\n      })\n      .catch(err =\u003e {\n        setError(err)\n        setDetail(null)\n      })\n  }\n\n  const onClickBlockHeight = (height) =\u003e {\n    zoobc.Block\n      .getBlockByHeight(height)\n      .then(res =\u003e {\n        setDetail(res)\n        setError(null)\n      })\n      .catch(err =\u003e {\n        setError(err)\n        setDetail(null)\n      })\n  }\n\n  return (\n    \u003c\u003e\n      {!!error \u0026\u0026 (\n        \u003c\u003e\n          \u003cdiv\u003e\u003cstrong\u003eError\u003c/strong\u003e\u003c/div\u003e\n          \u003ccode\u003e{JSON.stringify(error)}\u003c/code\u003e\n        \u003c/\u003e\n      )}{!!detail \u0026\u0026 (\n        \u003c\u003e\n          \u003cdiv\u003e\u003cstrong\u003eDetail\u003c/strong\u003e\u003c/div\u003e\n          \u003ccode\u003e{JSON.stringify(detail)}\u003c/code\u003e\n        \u003c/\u003e\n      )}\n        \u003ctable\u003e\n          \u003cthead\u003e\n            \u003ctr\u003e\n              \u003cth\u003eId\u003c/th\u003e\n              \u003cth\u003ePrevious Hash\u003c/th\u003e\n              \u003cth\u003eHeight\u003c/th\u003e\n              \u003cth\u003eTimestamp\u003c/th\u003e\n              \u003cth\u003eVersion\u003c/th\u003e\n            \u003c/tr\u003e\n          \u003c/thead\u003e\n          \u003ctbody\u003e\n            {blocks.length \u003e 0 \u0026\u0026\n              blocks.map((data, key) =\u003e {\n                return (\n                  \u003ctr key={key}\u003e\n                    \u003ctd onClick={() =\u003e onClickBlockId(data.block.id)}\u003e\n                      {data.block.id}\n                    \u003c/td\u003e\n                    \u003ctd\u003e{data.block.previousblockhash}\u003c/td\u003e\n                    \u003ctd onClick={() =\u003e onClickBlockHeight(data.block.height)}\u003e\n                      {data.block.height}\n                    \u003c/td\u003e\n                    \u003ctd\u003e{data.block.timestamp}\u003c/td\u003e\n                    \u003ctd\u003e{data.block.version}\u003c/td\u003e\n                  \u003c/tr\u003e\n                );\n              })}\n          \u003c/tbody\u003e\n        \u003c/table\u003e\n      \u003c/\u003e\n  )\n}\n\nexport default App;\n```\n\n## Contributors\n\nThanks to all who have [contributed](https://github.com/zoobc/zoobc-sdk/graphs/contributors) to ZooBC-SDK!\n\n\u003ctable\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/gungdesurya\"\u003e\n      \u003cimg src=\"https://avatars0.githubusercontent.com/u/16068576?s=400\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eGungde\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/eksant\"\u003e\n      \u003cimg src=\"https://avatars1.githubusercontent.com/u/32409305?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eEko\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/iamnafri\"\u003e\n      \u003cimg src=\"https://avatars2.githubusercontent.com/u/17779930?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eIrfan\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/gedeyandi456\"\u003e\n      \u003cimg src=\"https://avatars2.githubusercontent.com/u/43771081?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eYandi\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/gedenata\"\u003e\n      \u003cimg src=\"https://avatars2.githubusercontent.com/u/1158185?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eNata\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/bagasAgastya\"\u003e\n      \u003cimg src=\"https://avatars0.githubusercontent.com/u/43229728?s=400\u0026u=37969638269840f8b3a492776ca85c11a025cdb0\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eBagas\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/KevinH2810\"\u003e\n      \u003cimg src=\"https://avatars2.githubusercontent.com/u/47102992?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eKevin\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/zaenury\"\u003e\n      \u003cimg src=\"https://avatars1.githubusercontent.com/u/42806183?s=460\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdhiim\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n  \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://github.com/witarsana\"\u003e\n      \u003cimg src=\"https://avatars3.githubusercontent.com/u/16716094?s=400\u0026u=1884ab616ca41aee1b4218107fe8d4cf409043f0\u0026v=4\" width=\"25px;\" alt=\"\" /\u003e\n      \u003cbr /\u003e\u003csub\u003e\u003cb\u003eWitarsana\u003c/b\u003e\u003c/sub\u003e\n    \u003c/a\u003e\n  \u003c/td\u003e\n\u003c/table\u003e\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoobc%2Fzoobc-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoobc%2Fzoobc-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoobc%2Fzoobc-sdk/lists"}