npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dotbit/plugin-register

v0.0.3

Published

@dotbit/plugin-register ================== ## QuickStart

Readme

@dotbit/plugin-register

QuickStart

import { createInstance } from 'dotbit'
import { BitPluginRegister } from '@dotbit/plugin-register'

const dotbit = createInstance()

dotbit.installPlugin(new BitPluginRegister())

const account = dotbit.account('example.bit')
await account.register({
  keyInfo: {
    key: '0x7df93d9F500fD5A9537FEE086322a988D4fDCC38',
    coin_type: CoinType.ETH
  },
  registerYears: 1,
  paymentMethodID: PaymentMethodIDs.eth
})

Only ETH, BNB, and MATIC address are supported as registration address for .bit accounts.

Only ETH, BNB, MATIC and .bit Balance CKB are supported as payment methods for registration of .bit accounts, see PaymentMethodIDs for the corresponding parameters.

The registration period is up to 20 years.

Register as an Ethereum NFT

Registered to Ethereum, so the registered address must be an Ethereum address and the payment method must be PaymentMethodIDs.eth, crossTo must be set to CoinType.ETH.

import { createInstance } from 'dotbit'
import { BitPluginRegister } from '@dotbit/plugin-register'

const dotbit = createInstance()

dotbit.installPlugin(new BitPluginRegister())

const account = dotbit.account('example.bit')
await account.register({
  registerYears: 1,
  paymentMethodID: PaymentMethodIDs.eth,
  crossTo: CoinType.ETH
})

the info method is called to see if the registration is successful, when the status field is IndexerAccountStatus.onCrossChain it means the registration is successful.

const info = await account.info()
console.log(info)
// {
//   account: 'example.bit',
//   account_alias: 'example.bit',
//   account_id_hex: '0x...',
//   next_account_id_hex: '0x...',
//   create_at_unix: 1672123931,
//   expired_at_unix: 1703659931,
//   status: 3,
//   das_lock_arg_hex: '0x...',
//   owner_algorithm_id: 5,
//   owner_key: '0x...',
//   manager_algorithm_id: 5,
//   manager_key: '0x...'
// }

⚠️note: Registration takes about 5 minutes and requires a recurring call to the info method to ensure successful registration.

you need to wait for a successful account registration and call mintEthNft

await account.mintEthNft()

the crossChainAccountStatus method is called to determine if the casting was successful. Success is indicated when the status field is CrossChainAccountStatus.mintConfirm.

⚠️note: the casting may take up to 5 minutes to complete and may require repeated calls to the crossChainAccountStatus method to confirm the account status.

const status = await account.crossChainAccountStatus()
console.log(status)
// {
//   account: 'example.bit',
//   lock_hash: '0x...',
//   mint_hash: '0x...',
//   status: 5
// }

.bit account are converted to ethereum NFT

a registered .bit account needs to be converted to ethereum NFT in two steps, the first of which is to lock the account.

import { createInstance } from 'dotbit'
import { BitPluginRegister } from '@dotbit/plugin-register'

const dotbit = createInstance()

dotbit.installPlugin(new BitPluginRegister())

const account = dotbit.account('example.bit')
await account.lockAccount()

the crossChainAccountStatus method needs to be called to confirm that the first step is complete. When the status field is CrossChainAccountStatus.mintSign the first step has completed successfully.

⚠️note: the first step may take up to 5 minutes to complete and may require a recurring call to the crossChainAccountStatus method to confirm the account status.

const status = await account.crossChainAccountStatus()
console.log(status)
// {
//   account: 'example.bit',
//   lock_hash: '0x...',
//   mint_hash: '',
//   status: 3
// }

after waiting for the first step to succeed, the second step is to call mintEthNft

await account.mintEthNft()

the second step takes about 5 minutes to complete, and the crossChainAccountStatus method can be called, when the status field is CrossChainAccountStatus.mintConfirm indicating that the second step has completed.

convert a .bit ethereum NFT to a .bit account.

import { createInstance } from 'dotbit'
import { BitPluginRegister } from '@dotbit/plugin-register'

const dotbit = createInstance()

dotbit.installPlugin(new BitPluginRegister())

const account = dotbit.account('example.bit')
await account.mintBitAccount()

call the info method to see if the casting was successful. When the status field is IndexerAccountStatus.normal, it means that the casting was successful.

const info = await account.info()
console.log(info)
// {
//   account: 'example.bit',
//   account_alias: 'example.bit',
//   account_id_hex: '0x...',
//   next_account_id_hex: '0x...',
//   create_at_unix: 1672123931,
//   expired_at_unix: 1703659931,
//   status: 0,
//   das_lock_arg_hex: '0x...',
//   owner_algorithm_id: 5,
//   owner_key: '0x...',
//   manager_algorithm_id: 5,
//   manager_key: '0x...'
// }

⚠️note: the casting takes about 5 minutes and the info method needs to be called repeatedly to ensure that the casting is successful.

renew .bit account

import { createInstance } from 'dotbit'
import { BitPluginRegister } from '@dotbit/plugin-register'

const dotbit = createInstance()

dotbit.installPlugin(new BitPluginRegister())

const account = dotbit.account('example.bit')
await account.renew({
  renewYears: 1,
  paymentMethodID: PaymentMethodIDs.eth
})

⚠️note: SubDID renewal is not supported for now.

License

MIT License (including all dependencies).