@0xsequence/guard 1.8.4 → 1.8.5
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.
|
@@ -464,3 +464,5 @@ exports.AuthMethod = AuthMethod;
|
|
|
464
464
|
exports.GuardSigner = GuardSigner;
|
|
465
465
|
exports.getAuthUpdateProofTypedData = getAuthUpdateProofTypedData;
|
|
466
466
|
exports.getOwnershipProofTypedData = getOwnershipProofTypedData;
|
|
467
|
+
exports.isSignedOwnershipProof = isSignedOwnershipProof;
|
|
468
|
+
exports.signOwnershipProof = signOwnershipProof;
|
|
@@ -464,3 +464,5 @@ exports.AuthMethod = AuthMethod;
|
|
|
464
464
|
exports.GuardSigner = GuardSigner;
|
|
465
465
|
exports.getAuthUpdateProofTypedData = getAuthUpdateProofTypedData;
|
|
466
466
|
exports.getOwnershipProofTypedData = getOwnershipProofTypedData;
|
|
467
|
+
exports.isSignedOwnershipProof = isSignedOwnershipProof;
|
|
468
|
+
exports.signOwnershipProof = signOwnershipProof;
|
|
@@ -456,4 +456,4 @@ function toUTCString(date) {
|
|
|
456
456
|
return date.toUTCString().replace('GMT', 'UTC');
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
export { AuthMethod, GuardSigner, getAuthUpdateProofTypedData, getOwnershipProofTypedData };
|
|
459
|
+
export { AuthMethod, GuardSigner, getAuthUpdateProofTypedData, getOwnershipProofTypedData, isSignedOwnershipProof, signOwnershipProof };
|
|
@@ -47,6 +47,20 @@ export type OwnershipProof = {
|
|
|
47
47
|
walletAddress: string;
|
|
48
48
|
signer: ethers.Signer | signers.SapientSigner;
|
|
49
49
|
};
|
|
50
|
+
export declare function isSignedOwnershipProof(proof: OwnershipProof): proof is {
|
|
51
|
+
walletAddress: string;
|
|
52
|
+
timestamp: Date;
|
|
53
|
+
signerAddress: string;
|
|
54
|
+
signature: string;
|
|
55
|
+
};
|
|
56
|
+
export declare function signOwnershipProof(proof: Exclude<OwnershipProof, {
|
|
57
|
+
jwt: string;
|
|
58
|
+
}>): Promise<{
|
|
59
|
+
walletAddress: string;
|
|
60
|
+
timestamp: Date;
|
|
61
|
+
signerAddress: string;
|
|
62
|
+
signature: string;
|
|
63
|
+
}>;
|
|
50
64
|
export type AuthUpdateProof = {
|
|
51
65
|
jwt: string;
|
|
52
66
|
} & ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "guard sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/guard",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ethers": "^5.7.2",
|
|
13
|
-
"@0xsequence/account": "1.8.
|
|
14
|
-
"@0xsequence/core": "1.8.
|
|
15
|
-
"@0xsequence/signhub": "1.8.
|
|
16
|
-
"@0xsequence/utils": "1.8.
|
|
13
|
+
"@0xsequence/account": "1.8.5",
|
|
14
|
+
"@0xsequence/core": "1.8.5",
|
|
15
|
+
"@0xsequence/signhub": "1.8.5",
|
|
16
|
+
"@0xsequence/utils": "1.8.5"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"src",
|
package/src/signer.ts
CHANGED
|
@@ -209,13 +209,13 @@ export type OwnershipProof =
|
|
|
209
209
|
signer: ethers.Signer | signers.SapientSigner
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
function isSignedOwnershipProof(
|
|
212
|
+
export function isSignedOwnershipProof(
|
|
213
213
|
proof: OwnershipProof
|
|
214
214
|
): proof is { walletAddress: string; timestamp: Date; signerAddress: string; signature: string } {
|
|
215
215
|
return 'signerAddress' in proof && typeof proof.signerAddress === 'string'
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
async function signOwnershipProof(
|
|
218
|
+
export async function signOwnershipProof(
|
|
219
219
|
proof: Exclude<OwnershipProof, { jwt: string }>
|
|
220
220
|
): Promise<{ walletAddress: string; timestamp: Date; signerAddress: string; signature: string }> {
|
|
221
221
|
if (isSignedOwnershipProof(proof)) {
|