From b354d96163e2ba2103f7d8b101dae547eb4747fa Mon Sep 17 00:00:00 2001 From: Pawel Zelawski 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. --- vite.config.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vite.config.ts') diff --git a/vite.config.ts b/vite.config.ts index a69cc50..6ec42ad 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,11 @@ +import path, { resolve } from 'path'; // Import path module +import { fileURLToPath } from 'url'; // Import for ESM __dirname alternative import { defineConfig } from 'vite'; import dts from 'vite-plugin-dts'; // Plugin to generate consolidated .d.ts file -import { resolve } from 'path'; + +// Get current directory path in ESM +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); // https://vitejs.dev/guide/build.html#library-mode export default defineConfig({ @@ -20,14 +25,14 @@ export default defineConfig({ rollupOptions: { // Make sure to externalize deps that shouldn't be bundled // into your library (e.g., peer dependencies) - external: ['crypto', 'module', 'digibyte-message'], // Externalize Node built-ins and the core dependency + external: ['crypto', 'module', 'bitcoinjs-message'], // Externalize Node built-ins and the core dependency output: { // Provide global variables to use in the UMD build // for externalized deps globals: { crypto: 'crypto', // Map 'crypto' import to global 'crypto' (Node) module: 'module', // Map 'module' import to global 'module' (Node) - 'digibyte-message': 'DigibyteMessage' // Example global name if needed, might not be necessary for UMD if only used internally + 'bitcoinjs-message': 'bitcoinjsMessage' // Map 'bitcoinjs-message' to global 'bitcoinjsMessage' }, }, }, -- cgit v1.2.3