{"id":31635126,"url":"https://github.com/dotbithq/dotbit.js","last_synced_at":"2025-10-07T00:48:40.444Z","repository":{"id":42082117,"uuid":"385859923","full_name":"dotbitHQ/dotbit.js","owner":"dotbitHQ","description":"The ultimate JavaScript SDK for .bit","archived":false,"fork":false,"pushed_at":"2024-07-10T04:38:05.000Z","size":1343,"stargazers_count":27,"open_issues_count":0,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-06T02:21:27.116Z","etag":null,"topics":["blockchain","did","ethereum","javascript","sdk","web3"],"latest_commit_sha":null,"homepage":"https://d.id","language":"TypeScript","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/dotbitHQ.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-14T07:58:07.000Z","updated_at":"2024-07-10T04:38:09.000Z","dependencies_parsed_at":"2022-07-16T11:00:38.196Z","dependency_job_id":"9beb879d-6d51-44fb-b220-f8fb49ad74e9","html_url":"https://github.com/dotbitHQ/dotbit.js","commit_stats":{"total_commits":131,"total_committers":7,"mean_commits":"18.714285714285715","dds":0.2137404580152672,"last_synced_commit":"996b866c6468b533ef24e474be2072015646c3b8"},"previous_names":["deaccountsystems/das-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dotbitHQ/dotbit.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdotbit.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdotbit.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdotbit.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdotbit.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotbitHQ","download_url":"https://codeload.github.com/dotbitHQ/dotbit.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fdotbit.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278703580,"owners_count":26031205,"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-10-06T02:00:05.630Z","response_time":65,"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":["blockchain","did","ethereum","javascript","sdk","web3"],"created_at":"2025-10-07T00:48:37.439Z","updated_at":"2025-10-07T00:48:40.437Z","avatar_url":"https://github.com/dotbitHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://d.id/\"\u003e\n    \u003cimg width=\"1000\" src=\"/docs/dotbit-banner.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eDotbit.js\u003c/h2\u003e\n\u003cp align=\"center\"\u003eThe Official \u003ca href=\"https://d.id/\"\u003e.bit\u003c/a\u003e JavaScript SDK provided by .bit team.\u003c/p\u003e\n\u003cdiv align=\"center\"\u003e\n\n![NPM](https://img.shields.io/npm/l/dotbit) ![npm](https://img.shields.io/npm/v/dotbit)\n\u003c/div\u003e\n\n\u003e This is the new version of .bit (previously known as DAS) JavaScript SDK. If you are looking for the source code of the deprecated npm package [das-sdk](https://www.npmjs.com/package/das-sdk), please visit the [das-sdk](https://github.com/dotbitHQ/dotbit.js/tree/das-sdk) branch on GitHub.\n\n## Table of Contents\n- [Features](#features)\n- [Getting Started](#getting-started)\n- [CHANGELOG](#changelog)\n- [API Documentation](#api-documentation)\n- [Plugins](#plugins)\n- [FAQ](#faq)\n- [Get Help](#get-help)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Features\n- Query .bit account info (e.g. **owner, manager, status**, etc.)\n- Query .bit account records (e.g. **addresses, profiles, dwebs and custom data**.)\n- Enable .bit [Second-level DID](https://d.id/did-as-a-service) for a specific account.\n- **Mint a Second-level DID** of a .bit main account.\n- Query all the Second-level DIDs of a .bit main account.\n- Manage the **ownership** of a .bit account(Second-level DID included).\n- Manage the **records** of a .bit account(Second-level DID included).\n- **Register a .bit account** with CKB.\n\n## Getting Started\n\nFirst, you need to install Dotbit.js using [`npm`](https://www.npmjs.com/package/dotbit)\n```bash\nnpm install dotbit --save\n```\nor [`yarn`](https://yarnpkg.com/package/dotbit).\n```bash\nyarn add dotbit\n```\n\nThen, you need to import Dotbit.js SDK in your code and create an instance before interacting with it:\n```javascript\n// For CommonJS\nconst { createInstance } = require('dotbit')\nconst dotbit = createInstance()\n```\n\n```javascript\n// For ES Module\nimport { createInstance } from 'dotbit'\nconst dotbit = createInstance()\n```\n\nNow you could perform various operations using Dotbit.js SDK. Here is a simple example:\n```javascript\n// Get the account info of a .bit account\ndotbit.accountInfo(\"imac.bit\").then(console.log)\n```\nA sample result would be like:\n```javascript\n{\n  account: 'imac.bit',\n  account_id_hex: '0x5728088435fb8788472a9ca601fbc0b9cbea8be3',\n  next_account_id_hex: '0x57280ab92f213d74c7a185e9b9d26d0a795108de',\n  create_at_unix: 1671164348,\n  expired_at_unix: 1702700348,\n  status: 0,\n  das_lock_arg_hex: '0x05b2be2887a26f44555835eeacc47d65b88b6b42c205b2be2887a26f44555835eeacc47d65b88b6b42c2',\n  owner_algorithm_id: 17000,\n  owner_key: '0xb2be2887a26f44555835eeacc47d65b88b6b42c2',\n  manager_algorithm_id: 17000,\n  manager_key: '0xb2be2887a26f44555835eeacc47d65b88b6b42c2',\n  enable_sub_account: 0\n}\n```\n\nFor more details about each API, you could refer to our [API Documentation](#api-documentation).\nWe also provide code examples here: [For browser](./example/browser/index.js), [For Node.js](./example/node/mint-sub-account.js).\n\n## CHANGELOG\n[CHANGELOG](./CHANGELOG.md)\n\n## API Documentation\n- [createInstance](/docs/api/create-instance.md)\n- [DotBit](/docs/api/dotbit.md)\n- [BitAccount](/docs/api/bit-account.md)\n- [BitSubAccount](/docs/api/bit-subaccount.md)\n\n## Plugins\n.bit has partnerships with the greatest teams \u0026 projects in the ecosystems.\n`Dotbit.js` offers a simple and powerful plugin system that allows us to add advanced features to this library.\n\n#### Usage\nBasically, you can install and use a plugin like the codes below.\n\n```javascript\nimport { PluginXXX } from 'dotbit-plugin-xxx'\nimport { createInstance } from 'dotbit'\n\nconst dotbit = createInstance()\ndotbit.installPlugin(new PluginXXX())\ndotbit.methodAddedByXXX()\n```\n\nFor detailed usage, please follow the instructions in the specific plugin's README.\n\n#### List of plugins\n- [@dotbit/plugin-template](./packages/plugin-template/README.md): A demo plugin demonstrating the basic structure of a .bit plugin.\n- [@dotbit/plugin-web3mq](./packages/plugin-web3mq/README.md): A plugin for integrating [Web3MQ](https://www.web3messaging.online/).\n- [@dotbit/plugin-avatar](./packages/plugin-avatar/README.md): A plugin for resolving users' avatar.\n- [@dotbit/plugin-register](./packages/plugin-register/README.md): A plugin to register .bit account.\n\n#### Write your own plugin\nWrite a plugin for .bit is easy! \n\nIf you want to write a plugin for your or other projects, please follow the same structure of [plugin template](./packages/plugin-template/README.md).\n\n## FAQ\n#### What is coin_type?\n`coin_type` is a way to distinguish between different coins or blockchain networks using the Coin Types defined in [SLIP 44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md).\nFor example, the `coin_type` for ETH is `60`, the `coin_type` for BTC is `0`, and the `coin_type` for BNB is `9006`, etc.\n\n#### Which coin_type does .bit support?\n.bit uses `coin_type` in a few different ways:\n- .bit uses `coin_type` to identify each chain or coin in .bit records. In this case, .bit supports all `coin_type` values defined in [SLIP 44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md).\n- .bit uses `coin_type` to identify different types of `owner/manager` key information. For example, you can use an ETH address (coin_type: 60) as your .bit owner and a TRON address (coin_type: 195) as your manager. \n\nFor a complete list of `coin_type` values that .bit supports in `key_info`, please see [const.ts](./src/const.ts).\n\n## Get Help\nIf you have questions or need help with Dotbit.js, there are several ways to get assistance:\n- Join the .bit community on [Discord channel](https://discord.gg/fVppR7z4ht).\n- File [issues](https://github.com/dotbitHQ/dotbit.js/issues) on the GitHub repository for Dotbit.js.\n\n## Contribute\nWe welcome contributions to Dotbit.js! If you are interested in helping to improve the project, there are several ways you can contribute:\n- Report bugs or suggest improvements by opening an [issue](https://github.com/dotbitHQ/dotbit.js/issues) on the GitHub repository.\n- Submit a pull request with your changes to the code.\n\nPlease note that Dotbit.js SDK is still under development, so any contribution (including pull requests) is welcome.\n\n## License\nDotbit.js (including **all** dependencies) is protected under the [MIT License](LICENSE). This means that you are free to use, modify, and distribute the software as long as you include the original copyright and license notice. Please refer to the license for the full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fdotbit.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotbithq%2Fdotbit.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fdotbit.js/lists"}