@rockerone/xprnkit 0.3.6 → 0.3.8
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/build/providers/XPRNProvider.d.ts +2 -1
- package/build/providers/XPRNProvider.js +0 -2
- package/build/services/identity-proof/create-identity-proof.js +1 -1
- package/build/services/identity-proof/types.d.ts +2 -1
- package/build/services/identity-proof/verify-identity-proof.js +2 -1
- package/package.json +1 -1
|
@@ -9,7 +9,8 @@ import { type IdentityProofStatus } from "../services/identity-proof";
|
|
|
9
9
|
*/
|
|
10
10
|
export type XPRNIdentityProof = {
|
|
11
11
|
actor: string;
|
|
12
|
-
|
|
12
|
+
/** Public key (optional - not available for browser/WebAuth wallets) */
|
|
13
|
+
publicKey?: string;
|
|
13
14
|
/** JWT token from the identity proof verification */
|
|
14
15
|
token?: string;
|
|
15
16
|
/** Additional data from the verification response */
|
|
@@ -106,7 +106,6 @@ export const XPRNProvider = ({ children, config, }) => {
|
|
|
106
106
|
const newToken = result.token || storedEntry.identityProofToken;
|
|
107
107
|
setIdentityProof({
|
|
108
108
|
actor: actor,
|
|
109
|
-
publicKey: "",
|
|
110
109
|
token: newToken,
|
|
111
110
|
});
|
|
112
111
|
setIdentityProofStatus("success");
|
|
@@ -326,7 +325,6 @@ export const XPRNProvider = ({ children, config, }) => {
|
|
|
326
325
|
const newToken = result.token || storedToken;
|
|
327
326
|
setIdentityProof({
|
|
328
327
|
actor,
|
|
329
|
-
publicKey: "", // We don't have public key from stored token
|
|
330
328
|
token: newToken,
|
|
331
329
|
});
|
|
332
330
|
setIdentityProofStatus("success");
|
|
@@ -34,11 +34,11 @@ export async function createIdentityProof(session, options) {
|
|
|
34
34
|
throw new DOMException("Aborted", "AbortError");
|
|
35
35
|
}
|
|
36
36
|
// Build the identity proof
|
|
37
|
+
// Note: publicKey may not be available for browser/WebAuth wallets
|
|
37
38
|
const proof = {
|
|
38
39
|
signer: {
|
|
39
40
|
actor,
|
|
40
41
|
permission,
|
|
41
|
-
publicKey: session.publicKey.toString(),
|
|
42
42
|
},
|
|
43
43
|
transaction: txResult.resolvedTransaction,
|
|
44
44
|
signatures: txResult.signatures.map(sig => sig.toString()),
|
|
@@ -5,7 +5,8 @@ import type { LinkSession } from "@proton/web-sdk";
|
|
|
5
5
|
export type IdentityProofSigner = {
|
|
6
6
|
actor: string;
|
|
7
7
|
permission: string;
|
|
8
|
-
|
|
8
|
+
/** Public key (optional - not available for browser/WebAuth wallets) */
|
|
9
|
+
publicKey?: string;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Identity proof generated from wallet signing
|
|
@@ -34,11 +34,12 @@ export async function verifyIdentityProof(proof, config, options) {
|
|
|
34
34
|
}
|
|
35
35
|
const url = getCreateUrl(config);
|
|
36
36
|
// Build request body
|
|
37
|
+
// Note: public_key is optional (not available for browser/WebAuth wallets)
|
|
37
38
|
const requestBody = {
|
|
38
39
|
signer: {
|
|
39
40
|
actor: proof.signer.actor,
|
|
40
41
|
permission: proof.signer.permission,
|
|
41
|
-
public_key: proof.signer.publicKey,
|
|
42
|
+
...(proof.signer.publicKey ? { public_key: proof.signer.publicKey } : {}),
|
|
42
43
|
},
|
|
43
44
|
transaction: proof.transaction,
|
|
44
45
|
signatures: proof.signatures,
|