edc-health-care_web3

1.0.2 • Public • Published

EDC Health Care_Web3

Install

  • yarn add <package-local-path>

Usage

Connection

import { Connection } from "edc-health-care_web3";

const connection = new Connection("http://localhost:8545");

DID

import { Authenticator, Connection, DID } from "edc-health-care_web3";
import { AuthType } from "edc-health-care_web3/types/did";

const connection = new Connection(
  "http://localhost:8545",
  "ws://localhost:8546"
);

const did = new DID(connection);

const { address, privateKey } = did.generateDID();
console.log(address, privateKey);
const authenticator = new Authenticator(
  connection,
  [],
  "0x0000000000000000000000000000000000000000"
);

did.setAuthDID(privateKey, address, AuthType.IV, authenticator);

LockData Quesiton

import { Connection, DID } from "edc-health-care_web3";
import { Question } from "edc-health-care_web3/lock-data";
import { hashFuntion } from "edc-health-care_web3/utils/helper";

const connection = new Connection("http://localhost:8545");

const did = new DID(connection);

const { address, privateKey } = did.generateDID();

const question = new Question(
  connection,
  [],
  "0x0000000000000000000000000000000000000000"
);

const hashValue = hashFuntion(connection, "data-hash");
question.lockData(privateKey, hashValue, "uri-to-data", "data-for-hash");

Readme

Keywords

none

Package Sidebar

Install

npm i edc-health-care_web3

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

173 kB

Total Files

67

Last publish

Collaborators

  • cungdev