The Hypersign Schema comply specification and is stored on as it is schema documents and made available as immutable objects.
Read section for more details.
HypersignSchema SDK
Is a javascript library for Schema related operation (generate, sign, register etc). It also provides APIs to store/update/retrive Schema to/from the on the Hypersign Blockchain network easily.
NOTES
A DID registred on Hypersign blockchain in order to register a schema on Hypersign blockchain network.
Schema can not be registred using private DIDs.
Table of Contents
Install The Package
npm i https://github.com/hypersign-protocol/hid-ssi-js-sdk --save
Import The Package
import { HypersignSchema } from 'hs-ssi-sdk';
Offchain APIs
Initialize Instance of HypersignSchema
const hypersignSchema = new HypersignSchema();
// OR initialize by passing a namepace. Default ''
// More complex way to initialize this class can be found in this documentation later
const namespace = 'testnet';
const hypersignSchema = new HypersignSchema({ namespace });
const hypersignSchema = new HypersignSchema({
offlineSigner, // OPTIONAL signer of type OfflineSigner
nodeRestEndpoint: 'https://api.jagrat.hypersign.id', // OPTIONAL RPC endpoint of the Hypersign blockchain, Default 'TEST'
nodeRpcEndpoint: 'https://rpc.jagrat.hypersign.id', // OPTIONAL REST endpoint of the Hypersign blockchain
namespace: 'testnet', // OPTIONAL namespace of did, Default ''
});
// OR Just initalize with offlineSigner
const hypersignSchema = new HypersignSchema({
offlineSigner
})
OfflineSigner
offlineSigner = await createWallet(mnemonic);
Call init() to initialize the offlineSigner
await hypersignSchema.init();
register()
Register a schema Document in Hypersign blockchain