edc-health-care_web3
1.0.2 • Public • Published
yarn add <package-local-path>
import { Connection } from "edc-health-care_web3";
const connection = new Connection("http://localhost:8545");
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);
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
nonePackage Sidebar
Install
npm i edc-health-care_web3
Weekly Downloads