@notabene/verify-proof 1.4.1 → 1.4.2
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 +1 -1
- package/src/tests/index.test.ts +27 -0
package/package.json
CHANGED
package/src/tests/index.test.ts
CHANGED
@@ -298,4 +298,31 @@ describe("verifyProof", () => {
|
|
298
298
|
expect(result.status).toBe(ProofStatus.FAILED);
|
299
299
|
});
|
300
300
|
});
|
301
|
+
|
302
|
+
describe("SIWE", () => {
|
303
|
+
const proof: SignatureProof = {
|
304
|
+
address: "eip155:1:0xb5f28405d09746a20c7aa0399e5109f0c295b098",
|
305
|
+
attestation:
|
306
|
+
"localhost wants you to sign in with your **blockchain** account:\n0xb5f28405d09746a20c7aa0399e5109f0c295b098\n\nPlease sign this message to confirm your identity\n\nURI: http://localhost:8000\nVersion: 1\nChain ID: eip155:1\nNonce: 5389\nIssued At: 2025-05-22T09:28:38.992Z",
|
307
|
+
proof:
|
308
|
+
"0xf88efca56019b58d4523fa5b480fe549afd41d2d92a90e7b54126ca1d8a933fe4e5b3a507d1a2e9f28e6b9fab92d3fb288e946712903bbdafff4556694fc50f51b",
|
309
|
+
did: "did:pkh:eip155:1:0xb5f28405d09746a20c7aa0399e5109f0c295b098",
|
310
|
+
status: ProofStatus.PENDING,
|
311
|
+
type: ProofTypes.EIP191,
|
312
|
+
wallet_provider: "reown",
|
313
|
+
};
|
314
|
+
|
315
|
+
it("should verify proof", async () => {
|
316
|
+
const result = await verifyProof(proof);
|
317
|
+
expect(result.status).toBe(ProofStatus.VERIFIED);
|
318
|
+
});
|
319
|
+
|
320
|
+
it("should fail if not valid proof", async () => {
|
321
|
+
const result = await verifyProof({
|
322
|
+
...proof,
|
323
|
+
proof: "0x",
|
324
|
+
} as SignatureProof);
|
325
|
+
expect(result.status).toBe(ProofStatus.FAILED);
|
326
|
+
});
|
327
|
+
});
|
301
328
|
});
|