@vlayer/react 0.1.0-nightly-20250122-968cfb7 → 0.1.0-nightly-20250123-7126532
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/package.json
CHANGED
@@ -48,9 +48,13 @@ export class MockExtensionWebProofProvider implements WebProofProvider {
|
|
48
48
|
const mockProofDoneMessage: ExtensionMessage = {
|
49
49
|
type: ExtensionMessageType.ProofDone,
|
50
50
|
payload: {
|
51
|
-
|
51
|
+
presentationJSON:
|
52
52
|
this.mockBehavior.mockProof ||
|
53
53
|
({ mock: "proof" } as unknown as PresentationJSON),
|
54
|
+
decodedTranscript: {
|
55
|
+
sent: "mock sent",
|
56
|
+
recv: "mock recv",
|
57
|
+
},
|
54
58
|
},
|
55
59
|
};
|
56
60
|
this.listeners[ExtensionMessageType.ProofDone]?.forEach((listener) => {
|
@@ -71,16 +75,27 @@ export class MockExtensionWebProofProvider implements WebProofProvider {
|
|
71
75
|
}, this.mockBehavior.delayMs);
|
72
76
|
}
|
73
77
|
|
74
|
-
public async getWebProof(): Promise<
|
78
|
+
public async getWebProof(): Promise<{
|
79
|
+
presentationJSON: PresentationJSON;
|
80
|
+
decodedTranscript: {
|
81
|
+
sent: string;
|
82
|
+
recv: string;
|
83
|
+
};
|
84
|
+
}> {
|
75
85
|
await new Promise((resolve) =>
|
76
86
|
setTimeout(resolve, this.mockBehavior.delayMs),
|
77
87
|
);
|
78
88
|
|
79
89
|
if (this.mockBehavior.shouldSucceed) {
|
80
|
-
return
|
81
|
-
|
82
|
-
|
83
|
-
|
90
|
+
return {
|
91
|
+
presentationJSON:
|
92
|
+
this.mockBehavior.mockProof ||
|
93
|
+
({ mock: "proof" } as unknown as PresentationJSON),
|
94
|
+
decodedTranscript: {
|
95
|
+
sent: "mock sent",
|
96
|
+
recv: "mock recv",
|
97
|
+
},
|
98
|
+
};
|
84
99
|
} else {
|
85
100
|
throw new Error(this.mockBehavior.mockError || "Mock error occurred");
|
86
101
|
}
|
@@ -19,10 +19,9 @@ export const useWebProof = (
|
|
19
19
|
useEffect(() => {
|
20
20
|
webProofProvider.addEventListeners(
|
21
21
|
ExtensionMessageType.ProofDone,
|
22
|
-
({ payload: {
|
23
|
-
console.log("useWebproof: ProofDone message", proof);
|
22
|
+
({ payload: { presentationJSON } }) => {
|
24
23
|
setWebProof({
|
25
|
-
webProofJson: JSON.stringify(
|
24
|
+
webProofJson: JSON.stringify(presentationJSON),
|
26
25
|
});
|
27
26
|
setStatus(WebProofRequestStatus.success);
|
28
27
|
},
|