@zk-email/sdk 0.0.90 → 0.0.92
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 +47 -40
- package/dist/{ccip-tKhmfloM.mjs → ccip-Csu-wlvy.mjs} +2 -2
- package/dist/{ccip-tKhmfloM.mjs.map → ccip-Csu-wlvy.mjs.map} +1 -1
- package/dist/{ccip-Cn55ETmA.js → ccip-H1jWmBQc.js} +2 -2
- package/dist/{ccip-Cn55ETmA.js.map → ccip-H1jWmBQc.js.map} +1 -1
- package/dist/{index-uNa-m4WB.mjs → index-CKBpDKzL.mjs} +12 -4
- package/dist/{index-uNa-m4WB.mjs.map → index-CKBpDKzL.mjs.map} +1 -1
- package/dist/{index-C8FLbH7o.js → index-DM81s2-Y.js} +3 -3
- package/dist/{index-C8FLbH7o.js.map → index-DM81s2-Y.js.map} +1 -1
- package/dist/zk-email-sdk.cjs.js +1 -1
- package/dist/zk-email-sdk.es.js +1 -1
- package/package.json +1 -1
- package/NPM-README.md +0 -70
- package/dist/README.md +0 -70
package/dist/zk-email-sdk.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DM81s2-Y.js");exports.Blueprint=e.Blueprint;exports.Proof=e.Proof;Object.defineProperty(exports,"ProofStatus",{enumerable:!0,get:()=>e.ProofStatus});Object.defineProperty(exports,"Status",{enumerable:!0,get:()=>e.Status});Object.defineProperty(exports,"ZkFramework",{enumerable:!0,get:()=>e.ZkFramework});exports.ZodError=e.ZodError;exports.default=e.index;exports.generateProofInputs=e.generateProofInputs;exports.getDKIMSelector=e.getDKIMSelector;exports.getLoginWithGithubUrl=e.getLoginWithGithubUrl;exports.parseEmail=e.parseEmail;exports.startJsonFileDownload=e.startJsonFileDownload;exports.testBlueprint=e.testBlueprint;exports.testDecomposedRegex=e.testDecomposedRegex;
|
2
2
|
//# sourceMappingURL=zk-email-sdk.cjs.js.map
|
package/dist/zk-email-sdk.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { h as t, P as e, q as o, S as r, o as l, Z as n, f as i, l as p, k as u, n as f, p as g, j as m, m as d, t as P } from "./index-
|
1
|
+
import { h as t, P as e, q as o, S as r, o as l, Z as n, f as i, l as p, k as u, n as f, p as g, j as m, m as d, t as P } from "./index-CKBpDKzL.mjs";
|
2
2
|
export {
|
3
3
|
t as Blueprint,
|
4
4
|
e as Proof,
|
package/package.json
CHANGED
package/NPM-README.md
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
# ZKEmail SDK
|
2
|
-
|
3
|
-
With the ZKEmail SDK you can create proofs about emails using blueprints. You can create blueprints with this
|
4
|
-
SDK (documentation pending), or using our [registry](registry.zk.email).
|
5
|
-
|
6
|
-
## Install
|
7
|
-
|
8
|
-
The SDK works for all JavaScript environments. You can find
|
9
|
-
examples for server-side (Node, Deno, Bun) and client-side (Vite, Next.js) usage [here](https://github.com/zkemail/sdk-ts-demo).
|
10
|
-
|
11
|
-
To install run:
|
12
|
-
|
13
|
-
```bash
|
14
|
-
npm i @zk-email/sdk
|
15
|
-
```
|
16
|
-
|
17
|
-
## Create a blueprint
|
18
|
-
|
19
|
-
Go to our [registry](registry.zk.email) and create a blueprint there. You can also create one with the SDK,
|
20
|
-
we will provide the documentation for this shortly.
|
21
|
-
|
22
|
-
## Generate a proof
|
23
|
-
|
24
|
-
Initialize the SDK:
|
25
|
-
|
26
|
-
```ts
|
27
|
-
import zkeSdk from "@zk-email/sdk";
|
28
|
-
const sdk = zkSdk();
|
29
|
-
```
|
30
|
-
|
31
|
-
Next, obtain the slug of the blueprint you want to create a proof for from our [registry](registry.zk.email).
|
32
|
-
|
33
|
-

|
34
|
-
|
35
|
-
Use the slug to get the blueprint:
|
36
|
-
|
37
|
-
```ts
|
38
|
-
const blueprint = await sdk.getBlueprint("Bisht13/SuccinctZKResidencyInvite@v2");
|
39
|
-
```
|
40
|
-
|
41
|
-
Create a prover. Here you can define whether the proof should be generated remotely (faster)
|
42
|
-
or in the browser (slower but private).
|
43
|
-
Set `isLocal` to `true` for proving in the browser.
|
44
|
-
|
45
|
-
```ts
|
46
|
-
const prover = blueprint.createProver({ isLocal: true });
|
47
|
-
```
|
48
|
-
|
49
|
-
Now pass the email as a `string` to the prover to generate a proof.
|
50
|
-
|
51
|
-
If your blueprint requires external inputs, pass them as a second argument.
|
52
|
-
|
53
|
-
You can check out our [Next.js example](https://github.com/zkemail/sdk-ts-demo/tree/main/nextjs) to see how
|
54
|
-
a user can locally upload an email file.
|
55
|
-
|
56
|
-
```ts
|
57
|
-
// 2. argument, externalInputs is only required if defined in the blueprint
|
58
|
-
const proof = await prover.generateProof(emailStr, [
|
59
|
-
{ name: "email", value: "a@b.de", maxLength: 50 },
|
60
|
-
]);
|
61
|
-
|
62
|
-
console.log("Proof data: ", proof.props.proofData);
|
63
|
-
console.log("Public data: ", proof.props.publicData);
|
64
|
-
```
|
65
|
-
|
66
|
-
You can also verify the proof on chain. We currently use a contract deployed to Base Sepolia for this.
|
67
|
-
|
68
|
-
```ts
|
69
|
-
const isVerified = await blueprint.verifyProofOnChain(proof);
|
70
|
-
```
|
package/dist/README.md
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
# ZKEmail SDK
|
2
|
-
|
3
|
-
With the ZKEmail SDK you can create proofs about emails using blueprints. You can create blueprints with this
|
4
|
-
SDK (documentation pending), or using our [registry](registry.zk.email).
|
5
|
-
|
6
|
-
## Install
|
7
|
-
|
8
|
-
The SDK works for all JavaScript environments. You can find
|
9
|
-
examples for server-side (Node, Deno, Bun) and client-side (Vite, Next.js) usage [here](https://github.com/zkemail/sdk-ts-demo).
|
10
|
-
|
11
|
-
To install run:
|
12
|
-
|
13
|
-
```bash
|
14
|
-
npm i @zk-email/sdk
|
15
|
-
```
|
16
|
-
|
17
|
-
## Create a blueprint
|
18
|
-
|
19
|
-
Go to our [registry](registry.zk.email) and create a blueprint there. You can also create one with the SDK,
|
20
|
-
we will provide the documentation for this shortly.
|
21
|
-
|
22
|
-
## Generate a proof
|
23
|
-
|
24
|
-
Initialize the SDK:
|
25
|
-
|
26
|
-
```ts
|
27
|
-
import zkeSdk from "@zk-email/sdk";
|
28
|
-
const sdk = zkSdk();
|
29
|
-
```
|
30
|
-
|
31
|
-
Next, obtain the slug of the blueprint you want to create a proof for from our [registry](registry.zk.email).
|
32
|
-
|
33
|
-

|
34
|
-
|
35
|
-
Use the slug to get the blueprint:
|
36
|
-
|
37
|
-
```ts
|
38
|
-
const blueprint = await sdk.getBlueprint("Bisht13/SuccinctZKResidencyInvite@v2");
|
39
|
-
```
|
40
|
-
|
41
|
-
Create a prover. Here you can define whether the proof should be generated remotely (faster)
|
42
|
-
or in the browser (slower but private).
|
43
|
-
Set `isLocal` to `true` for proving in the browser.
|
44
|
-
|
45
|
-
```ts
|
46
|
-
const prover = blueprint.createProver({ isLocal: true });
|
47
|
-
```
|
48
|
-
|
49
|
-
Now pass the email as a `string` to the prover to generate a proof.
|
50
|
-
|
51
|
-
If your blueprint requires external inputs, pass them as a second argument.
|
52
|
-
|
53
|
-
You can check out our [Next.js example](https://github.com/zkemail/sdk-ts-demo/tree/main/nextjs) to see how
|
54
|
-
a user can locally upload an email file.
|
55
|
-
|
56
|
-
```ts
|
57
|
-
// 2. argument, externalInputs is only required if defined in the blueprint
|
58
|
-
const proof = await prover.generateProof(emailStr, [
|
59
|
-
{ name: "email", value: "a@b.de", maxLength: 50 },
|
60
|
-
]);
|
61
|
-
|
62
|
-
console.log("Proof data: ", proof.props.proofData);
|
63
|
-
console.log("Public data: ", proof.props.publicData);
|
64
|
-
```
|
65
|
-
|
66
|
-
You can also verify the proof on chain. We currently use a contract deployed to Base Sepolia for this.
|
67
|
-
|
68
|
-
```ts
|
69
|
-
const isVerified = await blueprint.verifyProofOnChain(proof);
|
70
|
-
```
|