@vlayer/sdk 0.1.0-nightly-20241004-7d30f05e → 0.1.0-nightly-20241007-c9fd44e
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -28,17 +28,17 @@ declare const chrome: {
|
|
28
28
|
};
|
29
29
|
};
|
30
30
|
|
31
|
+
// this id is fixed in the extension by the key in manifest.json
|
32
|
+
const EXTENSION_ID = "ghigbilfcgeibjkkajaekabeldkmijcd";
|
33
|
+
|
31
34
|
export const createExtensionWebProofProvider = ({
|
32
35
|
notaryUrl = "https://notary.pse.dev/v0.1.0-alpha.5/",
|
33
36
|
wsProxyUrl = "wss://notary.pse.dev/proxy",
|
34
37
|
}: WebProofProviderSetup): WebProofProvider => {
|
35
38
|
return {
|
36
39
|
getWebProof: async function (webProofSetup: WebProofSetupInput) {
|
37
|
-
// TODO: we can't assume that developer is using vite
|
38
|
-
// VITE_EXTENSION_ID value should be injected by the build system
|
39
|
-
|
40
40
|
return new Promise<WebProof>((resolve, reject) => {
|
41
|
-
chrome.runtime.sendMessage(
|
41
|
+
chrome.runtime.sendMessage(EXTENSION_ID, {
|
42
42
|
action: ExtensionAction.RequestWebProof,
|
43
43
|
payload: {
|
44
44
|
notaryUrl,
|
@@ -47,7 +47,6 @@ export const createExtensionWebProofProvider = ({
|
|
47
47
|
steps: webProofSetup.steps,
|
48
48
|
},
|
49
49
|
});
|
50
|
-
const EXTENSION_ID = import.meta.env.VITE_EXTENSION_ID as string;
|
51
50
|
const port = chrome.runtime.connect(EXTENSION_ID);
|
52
51
|
// TODO: validate message in runtime
|
53
52
|
port.onMessage.addListener(
|