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

idin-js-sdk

v0.2.13

Published

```js let key = crypto.p256.genKeyPair(); console.log('[x] private : ', key.private); console.log('[x] public : ', key.public); ```

Readme

Generate Key pair (ECDSA secp256r1,p256)

let key = crypto.p256.genKeyPair();
console.log('[x] private : ', key.private);
console.log('[x] public : ', key.public);

create DID

const { crypto, tx, helpers, Api } = sdk;
const { types } = helpers;
/*
    nonce be 1 for OP_DID_REGISTER
*/
const header = tx.tx.setHeader(1, types.OP_DID_REGISTER);
const txHex = tx.Builder(PRIVATE_KEY, header);
const c = new Api('http://localhost:9597');
const res = await c.submitTx(txHex);
console.log(res);

Add Key to DID

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  PRI_OF_KEY
   - Private key of new public key
*/
// can get nonce from api.getDIDInfo
const nonce = 2;
const newKey = tx.fnDIDAddKey(nonce, PRI_OF_KEY, MAIN_ADDR);
let x = tx.Builder(
  MAIN_PRI,
  tx.setHeader(nonce, types.OP_DID_ADD_KEY, MAIN_ADDR),
  newKey
);

Revoke Key in DID

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  PUBLIC_KEY
   - Public key u need to revoke
*/
// can get nonce from api.getDIDInfo
const nonce = 3;
const obj = tx.fnDIDRevokeKey(PUBLIC_KEY);
let x = tx.Builder(
  MAIN_PRI,
  tx.setHeader(nonce, types.OP_DID_REVOKE_KEY, MAIN_ADDR),
  obj
);

DID Recovery Register

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  MEMBER_PRI
   - Private of MEMBER_ADDR to sign
  MEMBER_ADDR 
   - DID of member you will add to recovery list
*/

// can get nonce from api.getDIDInfo
const nonce = 4;
const member = [
  tx.fnDIDAddRecovery(nonce, MEMBER_PRI, MAIN_ADDR, MEMBER_ADDR)
  //
];
let x = tx.Builder(
  MAIN_PRI,
  tx.setHeader(nonce, types.OP_DID_ADD_RECOVERY, MAIN_ADDR),
  member
);

DID recovery

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  MEMBER_PRI
   - Private of MEMBER_ADDR to sign
  MEMBER_ADDR 
   - DID of member you will add to recovery list
  NEW_PUBLIC_KEY
   - public key will register after recovery ledger
  NEW_PRI
   - Private of [NEW_PUBLIC_KEY]
*/

/*
   can get nonce from api.getDIDInfo
*/
const nonce = 5;
const obj = [
  tx.fnDIDRecovery(
    nonce,
    MEMBER_PRI,
    MAIN_ADDR,
    NEW_PUBLIC_KEY,
    MEMBER_ADDR
    //
  )
  //
];

let x = tx.Builder(
  NEW_PRI,
  tx.setHeader(nonce, types.OP_DID_RECOVERY, MAIN_ADDR),
  obj
);

Credentails Register

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  HASH_OF_DOCUMNET
   - hex format
*/

// can get nonce from api.getDIDInfo
const nonce = 6;
let x = tx.Builder(
  MAIN_PRI,
  tx.setHeader(nonce, lib.types.OP_CDT_REGISTER, MAIN_ADDR),
  fnCDTRegister(HASH_OF_DOCUMNET)
);

Credentials revoke

/*
  MAIN_ADDR
   - DID ledger u will add new key
  MAIN_PRI
   - Private key have register public key on DID ledger
  HASH_OF_DOCUMNET
   - hex format
*/

// can get nonce from api.getDIDInfo
const nonce = 6;
let x = tx.Builder(
  MAIN_PRI,
  tx.setHeader(nonce, lib.types.OP_CDT_REVOKE, MAIN_ADDR),
  fnCDTRevoke(HASH_OF_DOCUMNET)
);

Contecnt API

const { api } = sdk;
// set url to call api
const api = new Api('http://localhost:9597');
let addr = 'ic8Bd1uC2oF6giKgeNVkZ2rX5uEFCEX88C';
let pubKey =
  '04754fb050330295abdf7dfefca3be97be61faa1693b685f1fd885874143082604e5b223efe628069ec908adacdba84ec4f74a37736feb5987eb86b414fb0c7c7d';

// get did info
let res = await api.getDIDInfo(addr);
console.log('[x] Bakatest : ', res);

// get key in did
res = await api.getDIDKey(addr, pubKey);
console.log('[x] Bakatest : ', res);

// get cdt info
res = await api.getCDTInfo(addr, 'bakatest');
console.log('[x] Bakatest : ', res);

// get did active list [addr,page,limit]
res = await api.getDIDKeys(addr, 1, 5);
console.log('[x] Bakatest : ', res);

// get did active list [addr,page,limit]
res = await api.getDIDHistory(addr, 1, 5);
console.log('[x] Bakatest : ', res);

// get recovery info [addr]
res = await api.getRecoveryInfo(addr);
console.log('[x] Bakatest : ', res);

Schema of Transaction

[HEADER]

{
    ver:  String,
    nonce: Number,//int
    op: String,//types.OP...
    addr: String,//Address
}

[DATA]

{
    header: [HEADER],
    body: String,//[BODY...] -> hex
}

[KEY]

{
    publicKey: String,//Hex
    signature: String,//hex
    type: String,//types.P256_2019
}

[RECOVERY_KEY]

{
    publicKey: String,//hex
    signature: String,//hex
    type: String,//types.P256_2019,
    byAddr: String,//address
}

[TRANSACTION]

{
    data: String,//hex
    signature: String,//hex
    publicKey: String,//hex
    encoding: String,//types.ENCODING
    keyType: String//types.P256_2019
}

Body Operator

[BODY_ADD_KEY]

[KEY];

[BODY_REVOKE_KEY]

String; //Public Key Hex

[BODY_REGISTER_CREDENTIALS]

String; //Hash Hex

[BODY_REVOKE_CREDENTIALS]

String; //Hash Hex

[BODY_ADD_KEY]

[KEY];

[BODY_RECOVERY_DID]

{
    by: Array[RECOVERY_KEY],
    NewKey: [KEY]
}