Skip to content

Commit

Permalink
chore(docs): add new sample credential
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmoro committed Nov 14, 2024
1 parent 9f043c4 commit 188a048
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions apps/docs/src/components/sample-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ export const sampleCredential = {
},
};

export const sampleCredential1 = {
version: "v0",
witness: { type: "unsigned" },
credential: {
owner: {
_type: "PublicKey",
value: "B62qiVGZQdBJJrxnzhvqp7LKe6jDiFcpU3cF5xHoZof5Pz9qiL85KLx",
},
data: {
age: { _type: "Field", value: "42" },
name: {
_type: "Bytes",
value:
"416c696365000000000000000000000000000000000000000000000000000000",
},
},
},
};

export const samplePresentationRequest = {
type: "zk-app",
spec: {
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/components/test-zkapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createStore } from "@mina-js/connect";
import { useLocalStorage, useObjectState } from "@uidotdev/usehooks";
import { clsx } from "clsx";
import { useState, useSyncExternalStore } from "react";
import { sampleCredential, samplePresentationRequest } from "./sample-data";
import { sampleCredential1, samplePresentationRequest } from "./sample-data";

const store = createStore();

Expand All @@ -14,7 +14,7 @@ export const TestZkApp = () => {
const [message, setMessage] = useState("A message to sign");
const [fields, setFields] = useState('["1", "2", "3"]');
const [credentialInput, setCredentialInput] = useState(
JSON.stringify(sampleCredential, null, 2),
JSON.stringify(sampleCredential1, null, 2),
);
const [presentationRequest, setPresentationRequest] = useState(
JSON.stringify(samplePresentationRequest, null, 2),
Expand Down

0 comments on commit 188a048

Please sign in to comment.