1.0.9 • Published 2 years ago

@gooddollar/ceramic-seed-sdk v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

CeramicSeedSDK

Manage a privatekey or seed by multiple Ids

Getting Started

Install Ceramic-seed-sdk into your project

yarn add @gooddollar/ceramic-seed-sdk

Usage

import { CeramicSDK } from '@gooddollar/ceramic-seed-sdk'
  • Create a new instance of the sdk:
const sdk = new CeramicSDK("https://ceramic-clay.3boxlabs.com");
  • Initialize a DID based on private key and create a new one if none exists:
    const sdkClient = new CeramicSDK(NODE_URL_3BOXLABS);
    const myPrvkey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // Length need to be 32
    const res = await sdkClient.initialize(myPrvkey, "pubkeyToUseAsAuthId");
  • Add the given private key as another authSecret that can access the DID seed:
    const res = await sdkClient.addAuthenticator(myNewPrvkey, derivedPubkey2);
  • Remove the provided authenticator:
    const removed = await sdkClient.removeAuthenticator(pubkey);
  • Retrieves the unencrypted master seed:
    const ms = await sdkClient.getMasterSeed();