Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix documentation main package and fix castor verifySignature … #378

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions src/castor/Castor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,23 @@ export default class Castor implements CastorInterface {
* ```ts
* const message = "data to sign";
* const messageBytes = new TextEncoder().encode(message);
* const signatureSecp256K1 = apollo.signStringMessage(keyPairSecp256K1.privateKey, message);
*
* const did = castor.parseDID("did:prism:123456");
* const challenge = messageBytes
* const signature = signatureSecp256K1.value;
*
* const isValid = castor.verifySignature(
* castor.parseDID("did:prism:123456"),
* challenge, // Uint8Array
* signature // Uint8Array
* );
* const {mnemonics, seed} = apollo.createRandomSeed();
* const privateKey = apollo.createPublicKey({
* type: KeyTypes.EC,
* curve: Curve.SECP256K1,
* seed: Buffer.from(seed.value).toString("hex"),
* derivationPath: "m/0'/0'/0'"
* });
* if (privateKey.isSignable()) {
* const signature = privateKey.sign(message);
* const did = castor.parseDID("did:prism:123456");
* const challenge = messageBytes
* const isValid = castor.verifySignature(
* castor.parseDID("did:prism:123456"),
* challenge, // Uint8Array
* signature // Uint8Array
* );
* }
* ```
*
* @async
Expand Down
4 changes: 3 additions & 1 deletion typedoc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const packageJson = require("./package.json");

module.exports = {
"$schema": "https://typedoc.org/schema.json",
"entryPoints": [
"./src/index.ts"
],
"out": "./docs/sdk",
"tsconfig": "./tsconfig.json",
"name": "@atala/prism-wallet-sdk",
"name": packageJson.name,
"useTsLinkResolution": true,
"hideGenerator": true,
"entryPointStrategy": "resolve",
Expand Down
Loading