Skip to content

Commit

Permalink
chore: fix documentation main package and fix castor verifySignature …
Browse files Browse the repository at this point in the history
…docs

Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
  • Loading branch information
elribonazo committed Feb 6, 2025
1 parent ebe1c80 commit 52cfc66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
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

0 comments on commit 52cfc66

Please sign in to comment.