
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
The Official .bit JavaScript SDK provided by .bit team.
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, please visit the das-sdk branch on GitHub.
First, you need to install Dotbit.js using npm
npm install dotbit --save
or yarn
.
yarn add dotbit
Then, you need to import Dotbit.js SDK in your code and create an instance before interacting with it:
// For CommonJS
const { createInstance } = require('dotbit')
const dotbit = createInstance()
// For ES Module
import { createInstance } from 'dotbit'
const dotbit = createInstance()
Now you could perform various operations using Dotbit.js SDK. Here is a simple example:
// Get the account info of a .bit account
dotbit.accountInfo("imac.bit").then(console.log)
A sample result would be like:
{
account: 'imac.bit',
account_id_hex: '0x5728088435fb8788472a9ca601fbc0b9cbea8be3',
next_account_id_hex: '0x57280ab92f213d74c7a185e9b9d26d0a795108de',
create_at_unix: 1671164348,
expired_at_unix: 1702700348,
status: 0,
das_lock_arg_hex: '0x05b2be2887a26f44555835eeacc47d65b88b6b42c205b2be2887a26f44555835eeacc47d65b88b6b42c2',
owner_algorithm_id: 17000,
owner_key: '0xb2be2887a26f44555835eeacc47d65b88b6b42c2',
manager_algorithm_id: 17000,
manager_key: '0xb2be2887a26f44555835eeacc47d65b88b6b42c2',
enable_sub_account: 0
}
For more details about each API, you could refer to our API Documentation. We also provide code examples here: For browser, For Node.js.
.bit has partnerships with the greatest teams & projects in the ecosystems.
Dotbit.js
offers a simple and powerful plugin system that allows us to add advanced features to this library.
Basically, you can install and use a plugin like the codes below.
import { PluginXXX } from 'dotbit-plugin-xxx'
import { createInstance } from 'dotbit'
const dotbit = createInstance()
dotbit.installPlugin(new PluginXXX())
dotbit.methodAddedByXXX()
For detailed usage, please follow the instructions in the specific plugin's README.
Write a plugin for .bit is easy!
If you want to write a plugin for your or other projects, please follow the same structure of plugin template.
coin_type
is a way to distinguish between different coins or blockchain networks using the Coin Types defined in SLIP 44.
For example, the coin_type
for ETH is 60
, the coin_type
for BTC is 0
, and the coin_type
for BNB is 9006
, etc.
.bit uses coin_type
in a few different ways:
coin_type
to identify each chain or coin in .bit records. In this case, .bit supports all coin_type
values defined in SLIP 44.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.For a complete list of coin_type
values that .bit supports in key_info
, please see const.ts.
If you have questions or need help with Dotbit.js, there are several ways to get assistance:
We welcome contributions to Dotbit.js! If you are interested in helping to improve the project, there are several ways you can contribute:
Please note that Dotbit.js SDK is still under development, so any contribution (including pull requests) is welcome.
Dotbit.js (including all dependencies) is protected under the MIT 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.
FAQs
A complete .bit SDK and utilities in TypeScript
We found that dotbit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.