From b354d96163e2ba2103f7d8b101dae547eb4747fa Mon Sep 17 00:00:00 2001
From: Pawel Zelawski <pawel.zelawski@outlook.com>
Date: Mon, 14 Apr 2025 10:30:43 +0200
Subject: fix: Correct Bech32 address verification via dependency change

- Replaced faulty 'digibyte-message' dependency with 'bitcoinjs-message'.
- This resolves a critical bug where signatures from DigiByte Bech32 addresses (dgb1...) could not be verified due to issues in the old dependency chain.
- digiid-ts now correctly handles Legacy (D...), SegWit (S...), and Bech32 (dgb1...) address signature verification.
- Updated build configurations and addressed related linting issues revealed during testing.
---
 examples/verify-callback.ts | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'examples/verify-callback.ts')

diff --git a/examples/verify-callback.ts b/examples/verify-callback.ts
index a1df685..79edc65 100644
--- a/examples/verify-callback.ts
+++ b/examples/verify-callback.ts
@@ -5,8 +5,14 @@
  * The callback contains a signature that needs to be verified against the original challenge.
  */
 
-// Import directly from src for running locally before publishing
-// In a real project, you'd import from 'digiid-ts' after installing
-import { verifyDigiIDCallback, DigiIDError } from '../src/index';
+// This example assumes you have a basic Express.js server setup.
+// Run with: ts-node examples/verify-callback.ts
+
+// Import only what's needed
+
+// In-memory store for demo purposes. Replace with a database in production.
+// Store nonce => { expectedUrl: string, timestamp: number }
+const nonceStore = new Map<string, { expectedUrl: string; timestamp: number }>();
+const NONCE_EXPIRY_MS = 5 * 60 * 1000; // 5 minutes
 
 // ... existing code ... 
\ No newline at end of file
-- 
cgit v1.2.3