@learncard/vpqr-plugin 1.1.24 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,25 +9,26 @@
9
9
  The LearnCard Core is a pluggable, open-source, universal digital wallet to enable any individual or organization to seamlessly **issue, earn, store, share, and spend currency and credentials** built for the future of education and work.
10
10
 
11
11
  ## Documentation
12
+
12
13
  All LearnCard documentation can be found at:
13
14
  https://docs.learncard.com
14
15
 
15
16
  ## Install
16
17
 
17
18
  ```bash
18
- pnpm i @learncard/core
19
+ bun add @learncard/core
19
20
  ```
20
21
 
21
22
  ## Usage
22
23
 
23
24
  ### Instantiation
24
25
 
25
- Instantiate a wallet using `initLearnCard`. This method accepts a unique identifier string that is
26
+ Instantiate a wallet using `initLearnCard`. This method accepts a unique identifier string that is
26
27
  up to 64 characters long. If it is less than 64 characters, `initLearnCard` will pad the start of
27
28
  the string with 0's until it is 64 characters long.
28
29
 
29
30
  ```js
30
- import { initLearnCard } from "@learncard/core";
31
+ import { initLearnCard } from '@learncard/core';
31
32
 
32
33
  const wallet = await initLearnCard({ seed: 'a'.repeat(64) });
33
34
  ```
@@ -35,6 +36,7 @@ const wallet = await initLearnCard({ seed: 'a'.repeat(64) });
35
36
  ### Issuing/Verifying Credentials and Presentations
36
37
 
37
38
  #### Issue a credential
39
+
38
40
  ```js
39
41
  // Grab a test VC, or create your own!
40
42
  const unsignedVc = await wallet.invoke.getTestVc();
@@ -43,6 +45,7 @@ const vc = await wallet.invoke.issueCredential(unsignedVc);
43
45
  ```
44
46
 
45
47
  #### Verify a credential
48
+
46
49
  ```js
47
50
  const result = await wallet.invoke.verifyCredential(vc, {}, true);
48
51
 
@@ -53,11 +56,13 @@ else console.log('This credential is valid!');
53
56
  ```
54
57
 
55
58
  #### Issue a presentation
59
+
56
60
  ```js
57
61
  const vp = await wallet.invoke.issuePresentation(vc);
58
62
  ```
59
63
 
60
64
  #### Verify a presentation
65
+
61
66
  ```js
62
67
  const result = await wallet.invoke.verifyPresentation(vp);
63
68
 
@@ -74,14 +79,14 @@ else console.log('This presentation is valid!');
74
79
  To maintain co-ownership of credentials, it is best to store credentials in a public place, and then
75
80
  store references to that public place. While this is not the only way to store credentials (and is
76
81
  also definitely not a silver bullet! E.g. credentials containing private data), it is the opinion of
77
- this library that it should be used by default. As a result, instantiating a wallet, will
78
- automatically connect you to WeLibrary's ceramic node, and allow you to publish and retrieve
82
+ this library that it should be used by default. As a result, instantiating a wallet, will
83
+ automatically connect you to WeLibrary's ceramic node, and allow you to publish and retrieve
79
84
  credentials there using IDX.
80
85
 
81
86
  #### Publish Credential
82
87
 
83
88
  After signing a VC, you may choose to publish that credential to Ceramic. Doing so will return a
84
- stream ID, which you may share to the recipient. That stream ID can then be used to resolve the
89
+ stream ID, which you may share to the recipient. That stream ID can then be used to resolve the
85
90
  issued credential. This means both the issuer and recipient may store the _stream ID_ instead of the
86
91
  credential itself.
87
92
 
@@ -126,6 +131,7 @@ const vcs = await Promise.all(uris.map(async uri => wallet.read.get(uri)));
126
131
  ```
127
132
 
128
133
  ## Contributing
134
+
129
135
  Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
130
136
 
131
137
  Please make sure to update tests as appropriate.
@@ -134,7 +140,6 @@ Please make sure to update tests as appropriate.
134
140
 
135
141
  **[Learning Economy Foundation (LEF)](https://www.learningeconomy.io)** is a 501(c)(3) non-profit organization leveraging global standards and web3 protocols to bring quality skills and equal opportunity to every human on earth, and address the persistent inequities that exist around the globe in education and employment. We help you build the future of education and work with:
136
142
 
137
-
138
143
  ## License
139
144
 
140
145
  MIT © [Learning Economy Foundation](https://github.com/Learning-Economy-Foundation)