From a551f46c90c9325c611844e1488287e0e4ba767e Mon Sep 17 00:00:00 2001 From: padreug Date: Thu, 4 Sep 2025 22:39:02 +0200 Subject: [PATCH] Remove deprecated scripts and components related to Nostr functionality, including admin post debugging, VAPID key generation, and admin note sending. Clean up package dependencies by removing unused libraries and updating package-lock.json and package.json accordingly. --- debug_admin_posts.js | 94 ------ generate-vapid-keys.js | 28 -- package-lock.json | 178 +---------- package.json | 7 +- send_admin_note.js | 126 -------- send_posts_from_configured_admins.js | 100 ------ send_test_note.js | 75 ----- src/components/NostrmarketPublisher.vue | 300 ------------------ src/components/market/CartSummary.vue | 1 - src/components/market/MarketSettings.vue | 1 - src/components/ui/LogoutConfirmDialog.vue | 80 ----- .../ui/fuzzy-search/FuzzySearchDemo.vue | 115 ------- src/lib/notifications/manager.ts | 1 - src/lib/utils/formatting.test.ts | 201 ------------ src/pages/Login.vue | 187 ----------- src/pages/MarketDashboard.vue | 1 - 16 files changed, 7 insertions(+), 1488 deletions(-) delete mode 100644 debug_admin_posts.js delete mode 100644 generate-vapid-keys.js delete mode 100644 send_admin_note.js delete mode 100644 send_posts_from_configured_admins.js delete mode 100644 send_test_note.js delete mode 100644 src/components/NostrmarketPublisher.vue delete mode 100644 src/components/ui/LogoutConfirmDialog.vue delete mode 100644 src/components/ui/fuzzy-search/FuzzySearchDemo.vue delete mode 100644 src/lib/utils/formatting.test.ts delete mode 100644 src/pages/Login.vue diff --git a/debug_admin_posts.js b/debug_admin_posts.js deleted file mode 100644 index f2f3be4..0000000 --- a/debug_admin_posts.js +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env node - -// Debug what admin posts exist in the relay -import { SimplePool } from 'nostr-tools' - -const RELAY_URL = "ws://127.0.0.1:5001/nostrrelay/mainhub" -const ADMIN_PUBKEYS = [ - "4b9d7688eba64565dcb77cc8ab157eca1964d5de9f7afabe03eb5b54a43d9882", - "30b1ab3683fa6cc0e3695849ee1ec29e9fbae4c9e7ddb7452a4ddb37a0660040", - "c116dbc73a8ccd0046a2ecf96c0b0531d3eda650d449798ac5b86ff6e301debe" -] - -async function debugAdminPosts() { - const pool = new SimplePool() - - console.log('šŸ” Checking relay for admin posts...') - console.log('Relay:', RELAY_URL) - console.log('Admin pubkeys:', ADMIN_PUBKEYS.length) - console.log('') - - try { - // Check each admin individually - for (let i = 0; i < ADMIN_PUBKEYS.length; i++) { - const pubkey = ADMIN_PUBKEYS[i] - console.log(`šŸ‘¤ Admin ${i + 1}: ${pubkey.slice(0, 16)}...`) - - const individualFilter = { - kinds: [1], - authors: [pubkey], - limit: 10 - } - - const events = [] - const sub = pool.subscribeMany([RELAY_URL], [individualFilter], { - onevent(event) { - events.push(event) - }, - oneose() { - console.log(` Found ${events.length} posts`) - events.forEach((event, idx) => { - console.log(` ${idx + 1}. "${event.content.slice(0, 60)}${event.content.length > 60 ? '...' : ''}"`) - console.log(` Created: ${new Date(event.created_at * 1000).toLocaleString()}`) - }) - console.log('') - } - }) - - // Wait for events - await new Promise(resolve => setTimeout(resolve, 1000)) - sub.close() - } - - // Now test the combined filter (what the app uses) - console.log('šŸ”„ Testing combined filter (what the app uses)...') - const combinedFilter = { - kinds: [1], - authors: ADMIN_PUBKEYS, - limit: 50 - } - - const allEvents = [] - const combinedSub = pool.subscribeMany([RELAY_URL], [combinedFilter], { - onevent(event) { - allEvents.push(event) - }, - oneose() { - console.log(`šŸ“Š Combined filter result: ${allEvents.length} total posts`) - - // Group by author - const byAuthor = {} - allEvents.forEach(event => { - const shortPubkey = event.pubkey.slice(0, 16) + '...' - if (!byAuthor[shortPubkey]) byAuthor[shortPubkey] = 0 - byAuthor[shortPubkey]++ - }) - - console.log('Posts by author:') - Object.entries(byAuthor).forEach(([author, count]) => { - console.log(` ${author}: ${count} posts`) - }) - } - }) - - await new Promise(resolve => setTimeout(resolve, 1000)) - combinedSub.close() - - } catch (error) { - console.error('āŒ Error:', error) - } finally { - pool.close([RELAY_URL]) - } -} - -debugAdminPosts() \ No newline at end of file diff --git a/generate-vapid-keys.js b/generate-vapid-keys.js deleted file mode 100644 index 40fad25..0000000 --- a/generate-vapid-keys.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node - -// Proper VAPID key generator using web-push library -import webpush from 'web-push' - -console.log('šŸ”‘ VAPID Key Generator for Push Notifications') -console.log('') - -try { - // Generate proper VAPID keys using web-push - const vapidKeys = webpush.generateVAPIDKeys() - - console.log('šŸ“‹ Add these to your .env file:') - console.log('') - console.log(`VITE_VAPID_PUBLIC_KEY=${vapidKeys.publicKey}`) - console.log(`VITE_PUSH_NOTIFICATIONS_ENABLED=true`) - console.log('') - console.log('šŸ” Private key (keep secure, for backend only):') - console.log(`VAPID_PRIVATE_KEY=${vapidKeys.privateKey}`) - console.log('') - console.log('āœ… Once added, restart your dev server to apply the changes.') - console.log('') - console.log('ā„¹ļø These are cryptographically secure VAPID keys suitable for production.') - -} catch (error) { - console.error('āŒ Error generating VAPID keys:', error) - process.exit(1) -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 480a3ac..7157825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,9 @@ "version": "0.0.0", "dependencies": { "@tanstack/vue-table": "^8.21.2", - "@types/qrcode": "^1.5.5", "@vueuse/components": "^12.5.0", "@vueuse/core": "^12.8.2", - "@vueuse/head": "^2.0.0", "@vueuse/integrations": "^13.6.0", - "async-validator": "^4.2.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^4.1.0", @@ -28,14 +25,12 @@ "radix-vue": "^1.9.13", "reka-ui": "^2.4.1", "tailwind-merge": "^2.6.0", - "tailwind-variants": "^0.3.1", "tailwindcss-animate": "^1.0.7", "unique-names-generator": "^4.7.1", "vue": "^3.5.13", "vue-i18n": "^9.14.2", "vue-router": "^4.5.0", - "vue-sonner": "^2.0.2", - "web-vitals": "^3.5.2" + "vue-sonner": "^2.0.2" }, "devDependencies": { "@electron-forge/cli": "^7.7.0", @@ -5086,20 +5081,12 @@ "version": "22.13.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.20.0" } }, - "node_modules/@types/qrcode": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.5.tgz", - "integrity": "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", @@ -5167,76 +5154,6 @@ "@types/node": "*" } }, - "node_modules/@unhead/dom": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/@unhead/dom/-/dom-1.11.20.tgz", - "integrity": "sha512-jgfGYdOH+xHJF/j8gudjsYu3oIjFyXhCWcgKaw3vQnT616gSqyqnGQGOItL+BQtQZACKNISwIfx5PuOtztMKLA==", - "license": "MIT", - "dependencies": { - "@unhead/schema": "1.11.20", - "@unhead/shared": "1.11.20" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, - "node_modules/@unhead/schema": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/@unhead/schema/-/schema-1.11.20.tgz", - "integrity": "sha512-0zWykKAaJdm+/Y7yi/Yds20PrUK7XabLe9c3IRcjnwYmSWY6z0Cr19VIs3ozCj8P+GhR+/TI2mwtGlueCEYouA==", - "license": "MIT", - "dependencies": { - "hookable": "^5.5.3", - "zhead": "^2.2.4" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, - "node_modules/@unhead/shared": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/@unhead/shared/-/shared-1.11.20.tgz", - "integrity": "sha512-1MOrBkGgkUXS+sOKz/DBh4U20DNoITlJwpmvSInxEUNhghSNb56S0RnaHRq0iHkhrO/cDgz2zvfdlRpoPLGI3w==", - "license": "MIT", - "dependencies": { - "@unhead/schema": "1.11.20", - "packrup": "^0.1.2" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, - "node_modules/@unhead/ssr": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/@unhead/ssr/-/ssr-1.11.20.tgz", - "integrity": "sha512-j6ehzmdWGAvv0TEZyLE3WBnG1ULnsbKQcLqBDh3fvKS6b3xutcVZB7mjvrVE7ckSZt6WwOtG0ED3NJDS7IjzBA==", - "license": "MIT", - "dependencies": { - "@unhead/schema": "1.11.20", - "@unhead/shared": "1.11.20" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, - "node_modules/@unhead/vue": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/@unhead/vue/-/vue-1.11.20.tgz", - "integrity": "sha512-sqQaLbwqY9TvLEGeq8Fd7+F2TIuV3nZ5ihVISHjWpAM3y7DwNWRU7NmT9+yYT+2/jw1Vjwdkv5/HvDnvCLrgmg==", - "license": "MIT", - "dependencies": { - "@unhead/schema": "1.11.20", - "@unhead/shared": "1.11.20", - "hookable": "^5.5.3", - "unhead": "1.11.20" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - }, - "peerDependencies": { - "vue": ">=2.7 || >=3" - } - }, "node_modules/@vitejs/plugin-vue": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz", @@ -5497,21 +5414,6 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/@vueuse/head": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@vueuse/head/-/head-2.0.0.tgz", - "integrity": "sha512-ykdOxTGs95xjD4WXE4na/umxZea2Itl0GWBILas+O4oqS7eXIods38INvk3XkJKjqMdWPcpCyLX/DioLQxU1KA==", - "license": "MIT", - "dependencies": { - "@unhead/dom": "^1.7.0", - "@unhead/schema": "^1.7.0", - "@unhead/ssr": "^1.7.0", - "@unhead/vue": "^1.7.0" - }, - "peerDependencies": { - "vue": ">=2.7 || >=3" - } - }, "node_modules/@vueuse/integrations": { "version": "13.6.0", "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-13.6.0.tgz", @@ -5882,7 +5784,9 @@ "version": "4.2.5", "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz", "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/at-least-node": { "version": "1.0.0", @@ -8845,12 +8749,6 @@ "he": "bin/he" } }, - "node_modules/hookable": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz", - "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", - "license": "MIT" - }, "node_modules/http_ece": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http_ece/-/http_ece-1.2.0.tgz", @@ -11358,15 +11256,6 @@ "node": ">=6" } }, - "node_modules/packrup": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/packrup/-/packrup-0.1.2.tgz", - "integrity": "sha512-ZcKU7zrr5GlonoS9cxxrb5HVswGnyj6jQvwFBa6p5VFw7G71VAHcUKL5wyZSU/ECtPM/9gacWxy2KFQKt1gMNA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, "node_modules/parse-author": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-author/-/parse-author-2.0.0.tgz", @@ -13331,32 +13220,6 @@ "url": "https://github.com/sponsors/dcastil" } }, - "node_modules/tailwind-variants": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/tailwind-variants/-/tailwind-variants-0.3.1.tgz", - "integrity": "sha512-krn67M3FpPwElg4FsZrOQd0U26o7UDH/QOkK8RNaiCCrr052f6YJPBUfNKnPo/s/xRzNPtv1Mldlxsg8Tb46BQ==", - "license": "MIT", - "dependencies": { - "tailwind-merge": "2.5.4" - }, - "engines": { - "node": ">=16.x", - "pnpm": ">=7.x" - }, - "peerDependencies": { - "tailwindcss": "*" - } - }, - "node_modules/tailwind-variants/node_modules/tailwind-merge": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.4.tgz", - "integrity": "sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/dcastil" - } - }, "node_modules/tailwindcss": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.12.tgz", @@ -13756,23 +13619,9 @@ "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, "license": "MIT" }, - "node_modules/unhead": { - "version": "1.11.20", - "resolved": "https://registry.npmjs.org/unhead/-/unhead-1.11.20.tgz", - "integrity": "sha512-3AsNQC0pjwlLqEYHLjtichGWankK8yqmocReITecmpB1H0aOabeESueyy+8X1gyJx4ftZVwo9hqQ4O3fPWffCA==", - "license": "MIT", - "dependencies": { - "@unhead/dom": "1.11.20", - "@unhead/schema": "1.11.20", - "@unhead/shared": "1.11.20", - "hookable": "^5.5.3" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", @@ -14309,12 +14158,6 @@ "node": ">= 16" } }, - "node_modules/web-vitals": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz", - "integrity": "sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==", - "license": "Apache-2.0" - }, "node_modules/webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -14888,15 +14731,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zhead": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/zhead/-/zhead-2.2.4.tgz", - "integrity": "sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } } } } diff --git a/package.json b/package.json index e256d0a..7b20497 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,9 @@ }, "dependencies": { "@tanstack/vue-table": "^8.21.2", - "@types/qrcode": "^1.5.5", "@vueuse/components": "^12.5.0", "@vueuse/core": "^12.8.2", - "@vueuse/head": "^2.0.0", "@vueuse/integrations": "^13.6.0", - "async-validator": "^4.2.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^4.1.0", @@ -37,14 +34,12 @@ "radix-vue": "^1.9.13", "reka-ui": "^2.4.1", "tailwind-merge": "^2.6.0", - "tailwind-variants": "^0.3.1", "tailwindcss-animate": "^1.0.7", "unique-names-generator": "^4.7.1", "vue": "^3.5.13", "vue-i18n": "^9.14.2", "vue-router": "^4.5.0", - "vue-sonner": "^2.0.2", - "web-vitals": "^3.5.2" + "vue-sonner": "^2.0.2" }, "devDependencies": { "@electron-forge/cli": "^7.7.0", diff --git a/send_admin_note.js b/send_admin_note.js deleted file mode 100644 index 6b7a6aa..0000000 --- a/send_admin_note.js +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env node - -// Send admin announcement to your Nostr relays -// Usage: node send_admin_note.js - -import { generateSecretKey, getPublicKey, nip19, SimplePool, finalizeEvent } from 'nostr-tools' - -// Configuration - using public relays for testing -const RELAY_URLS = [ - "ws://127.0.0.1:5001/nostrrelay/mainhub" - //"wss://relay.damus.io", - //"wss://nos.lol" - // Local relay (requires auth): "ws://127.0.0.1:5001/nostrrelay/mainhub" -] - -async function sendAdminAnnouncement() { - try { - console.log('šŸš€ Sending admin announcement...') - - // Configured admin pubkeys from your .env - const configuredAdminPubkeys = [ - "4b9d7688eba64565dcb77cc8ab157eca1964d5de9f7afabe03eb5b54a43d9882", - "30b1ab3683fa6cc0e3695849ee1ec29e9fbae4c9e7ddb7452a4ddb37a0660040", - "c116dbc73a8ccd0046a2ecf96c0b0531d3eda650d449798ac5b86ff6e301debe" - ] - - // For demo: generate a keypair, but let's use a specific admin pubkey for testing - // In real use, you'd use the actual admin private key - const privateKey = generateSecretKey() - const publicKey = getPublicKey(privateKey) - const nsec = nip19.nsecEncode(privateKey) - const npub = nip19.npubEncode(publicKey) - - console.log(`šŸ“ Generated Test Identity:`) - console.log(`Public Key (npub): ${npub}`) - console.log(`Hex pubkey: ${publicKey}`) - console.log('') - console.log(`šŸ“‹ Your configured admin pubkeys: ${configuredAdminPubkeys.length}`) - configuredAdminPubkeys.forEach((pubkey, i) => { - console.log(` ${i + 1}. ${pubkey.slice(0, 16)}...`) - }) - console.log('') - console.log('šŸ’” To see this as an admin post:') - console.log(` Add this pubkey to your .env: "${publicKey}"`) - console.log('') - - // Create announcement content - const announcements = [ - '🚨 COMMUNITY ANNOUNCEMENT: Server maintenance scheduled for tonight at 10 PM GMT. Expected downtime: 30 minutes.', - 'šŸ“¢ NEW FEATURE: Lightning zaps are now available! Send sats to support your favorite community members.', - 'šŸŽ‰ WELCOME: We have reached 100 active community members! Thank you for making this space amazing.', - 'āš ļø IMPORTANT: Please update your profile information to include your Lightning address for zaps.', - 'šŸ› ļø MAINTENANCE COMPLETE: All systems are now running smoothly. Thank you for your patience!' - ] - - const randomAnnouncement = announcements[Math.floor(Math.random() * announcements.length)] - - // Create the note event - const event = { - kind: 1, - created_at: Math.floor(Date.now() / 1000), - tags: [], - content: randomAnnouncement, - pubkey: publicKey, - } - - // Sign the event - const signedEvent = finalizeEvent(event, privateKey) - - console.log(`šŸ“” Publishing to ${RELAY_URLS.length} relays...`) - console.log(`Content: ${randomAnnouncement}`) - console.log('') - - // Connect to relays and publish - const pool = new SimplePool() - - try { - // Ultra simple approach - just publish and assume it works - console.log('Publishing to relays...') - - for (const relay of RELAY_URLS) { - try { - console.log(` → Publishing to ${relay}...`) - pool.publish([relay], signedEvent) - console.log(` āœ… Attempted publish to ${relay}`) - } catch (error) { - console.log(` āŒ Error with ${relay}:`, error.message) - } - } - - // Wait a bit for the publishes to complete - await new Promise(resolve => setTimeout(resolve, 3000)) - - const successful = RELAY_URLS.length - const failed = 0 - - console.log('') - console.log(`āœ… Success: ${successful}/${RELAY_URLS.length} relays`) - if (failed > 0) { - console.log(`āŒ Failed: ${failed} relays`) - } - console.log(`šŸ“ Event ID: ${signedEvent.id}`) - - } catch (error) { - console.error('āŒ Failed to publish:', error.message) - } finally { - // Clean up - pool.close(RELAY_URLS) - } - - } catch (error) { - console.error('āŒ Error:', error.message) - process.exit(1) - } -} - -// Run it -sendAdminAnnouncement() - .then(() => { - console.log('\nšŸŽ‰ Done! Check your app to see the admin announcement.') - process.exit(0) - }) - .catch(error => { - console.error('āŒ Script failed:', error) - process.exit(1) - }) diff --git a/send_posts_from_configured_admins.js b/send_posts_from_configured_admins.js deleted file mode 100644 index 503c93a..0000000 --- a/send_posts_from_configured_admins.js +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env node - -// Send posts from the exact admin pubkeys configured in .env -// This will populate the relay with posts from multiple admins to test filtering - -import { nip19, SimplePool, finalizeEvent } from 'nostr-tools' - -const RELAY_URL = "ws://127.0.0.1:5001/nostrrelay/mainhub" - -// These are the exact admin pubkeys from your .env -const CONFIGURED_ADMIN_PUBKEYS = [ - "4b9d7688eba64565dcb77cc8ab157eca1964d5de9f7afabe03eb5b54a43d9882", - "30b1ab3683fa6cc0e3695849ee1ec29e9fbae4c9e7ddb7452a4ddb37a0660040", - "c116dbc73a8ccd0046a2ecf96c0b0531d3eda650d449798ac5b86ff6e301debe", - "35f2f262a9cbd6001931d6e0563937cd7f6ef3286ffd5f9e08edf5816916f0fd" -] - -// For testing, we'll use fake private keys that generate these exact pubkeys -// In real usage, these would be the actual admin private keys -const DEMO_PRIVATE_KEYS = [ - "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", // Will generate a different pubkey, for demo - "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", // Will generate a different pubkey, for demo - "fedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", // Will generate a different pubkey, for demo -] - -const ADMIN_ANNOUNCEMENTS = [ - "🚨 SECURITY UPDATE: Please update your client to the latest version for enhanced security features.", - "šŸ“¢ NEW POLICY: Community guidelines have been updated. Please review the latest terms.", - "šŸŽ‰ MILESTONE: We've reached 500 active community members! Thank you for your participation.", - "āš ļø MAINTENANCE: Scheduled relay maintenance this Sunday at 2 AM UTC. Expect brief downtime.", - "šŸ› ļø FEATURE UPDATE: Lightning zaps now support custom amounts. Try it out!", - "🌟 COMMUNITY HIGHLIGHT: Thanks to all contributors who helped improve our platform this month.", - "šŸ“Š STATS: Daily active users have increased 40% this quarter. Amazing growth!", - "šŸ”§ BUG FIX: Resolved connection issues some users experienced earlier today.", -] - -async function sendPostsFromConfiguredAdmins() { - console.log('šŸš€ Sending posts from configured admin pubkeys...') - console.log(`Configured admins: ${CONFIGURED_ADMIN_PUBKEYS.length}`) - console.log('') - - const pool = new SimplePool() - - try { - // Send 2 posts from each admin (8 total posts) - for (let i = 0; i < CONFIGURED_ADMIN_PUBKEYS.length; i++) { - const adminPubkey = CONFIGURED_ADMIN_PUBKEYS[i] - console.log(`šŸ‘¤ Admin ${i + 1}: ${adminPubkey.slice(0, 16)}...`) - - // Use demo private key for this admin - // NOTE: In real usage, you'd use the actual admin's private key - const demoPrivateKey = DEMO_PRIVATE_KEYS[i % DEMO_PRIVATE_KEYS.length] - - // Send 2 different announcements from this admin - for (let j = 0; j < 2; j++) { - const announcement = ADMIN_ANNOUNCEMENTS[(i * 2 + j) % ADMIN_ANNOUNCEMENTS.length] - - const event = { - kind: 1, - created_at: Math.floor(Date.now() / 1000) + (i * 2 + j), // Slight time offset - tags: [], - content: announcement, - pubkey: adminPubkey, // Use the configured pubkey directly - } - - // For demo purposes, we can't actually sign with the real admin's private key - // So we'll create a fake signature that demonstrates the concept - const fakeSignedEvent = { - ...event, - id: `fake_${Date.now()}_${i}_${j}`, - sig: "fake_signature_for_demo" - } - - console.log(` šŸ“ Post ${j + 1}: "${announcement.slice(0, 50)}${announcement.length > 50 ? '...' : ''}"`) - - try { - // In a real scenario, you'd use the actual signed event - // pool.publish([RELAY_URL], signedEvent) - console.log(` āœ… Would publish to ${RELAY_URL}`) - } catch (error) { - console.log(` āŒ Error: ${error.message}`) - } - } - console.log('') - } - - console.log('šŸ’” NOTE: This is a demonstration script.') - console.log(' To actually send posts, you would need the real admin private keys.') - console.log(' The posts would be properly signed and published to the relay.') - console.log('') - console.log('šŸ” Run debug_admin_posts.js again to see the updated results.') - - } catch (error) { - console.error('āŒ Error:', error) - } finally { - pool.close([RELAY_URL]) - } -} - -sendPostsFromConfiguredAdmins() \ No newline at end of file diff --git a/send_test_note.js b/send_test_note.js deleted file mode 100644 index 805fd80..0000000 --- a/send_test_note.js +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env node - -// Test script to send a Nostr note using nostr-tools -// Usage: node send_test_note.js - -import { SimplePool, getPublicKey, finalizeEvent, nip19 } from 'nostr-tools' - -async function sendTestNote(nsecInput, relayUrl, message) { - try { - // Parse the private key - let privateKey; - if (nsecInput.startsWith('nsec')) { - const decoded = nip19.decode(nsecInput); - privateKey = decoded.data; - } else { - // Assume hex - privateKey = Buffer.from(nsecInput, 'hex'); - } - - const publicKey = getPublicKey(privateKey); - const npub = nip19.npubEncode(publicKey); - - console.log(`Sending note from: ${npub}`); - console.log(`Hex pubkey: ${publicKey}`); - console.log(`To relay: ${relayUrl}`); - console.log(`Message: ${message}`); - console.log(''); - console.log('šŸ’” To make this an admin post, add this hex pubkey to .env:'); - console.log(` "${publicKey}"`); - console.log(''); - - // Create the event - const event = { - kind: 1, - created_at: Math.floor(Date.now() / 1000), - tags: [], - content: message, - pubkey: publicKey, - }; - - // Sign the event - const signedEvent = finalizeEvent(event, privateKey) - - // Connect to relay and publish - const pool = new SimplePool(); - const relays = [relayUrl]; - - console.log('Connecting to relay...'); - await pool.publish(relays, signedEvent); - - console.log('āœ… Event published successfully!'); - console.log('Event ID:', signedEvent.id); - - // Wait a bit then close - setTimeout(() => { - pool.close(relays); - process.exit(0); - }, 2000); - - } catch (error) { - console.error('āŒ Failed to send note:', error.message); - process.exit(1); - } -} - -// Parse command line arguments -const args = process.argv.slice(2); -if (args.length < 3) { - console.log('Usage: node send_test_note.js '); - console.log('Example: node send_test_note.js nsec1abc123... wss://relay.example.com "Hello world!"'); - process.exit(1); -} - -const [nsec, relayUrl, message] = args; -sendTestNote(nsec, relayUrl, message); \ No newline at end of file diff --git a/src/components/NostrmarketPublisher.vue b/src/components/NostrmarketPublisher.vue deleted file mode 100644 index ed6b3b2..0000000 --- a/src/components/NostrmarketPublisher.vue +++ /dev/null @@ -1,300 +0,0 @@ - - - - - diff --git a/src/components/market/CartSummary.vue b/src/components/market/CartSummary.vue index 4b08095..abb9d7d 100644 --- a/src/components/market/CartSummary.vue +++ b/src/components/market/CartSummary.vue @@ -141,7 +141,6 @@ - - diff --git a/src/components/ui/fuzzy-search/FuzzySearchDemo.vue b/src/components/ui/fuzzy-search/FuzzySearchDemo.vue deleted file mode 100644 index 282e1f7..0000000 --- a/src/components/ui/fuzzy-search/FuzzySearchDemo.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - \ No newline at end of file diff --git a/src/lib/notifications/manager.ts b/src/lib/notifications/manager.ts index 35a0229..609bc83 100644 --- a/src/lib/notifications/manager.ts +++ b/src/lib/notifications/manager.ts @@ -1,5 +1,4 @@ // Notification manager for push notifications -// import type { NotificationPayload } from './push' export interface NotificationOptions { diff --git a/src/lib/utils/formatting.test.ts b/src/lib/utils/formatting.test.ts deleted file mode 100644 index 7f96d15..0000000 --- a/src/lib/utils/formatting.test.ts +++ /dev/null @@ -1,201 +0,0 @@ -/** - * Test file for formatting utility functions - * This file can be run with a test runner or used for manual verification - */ - -import { - formatNumber, - formatSats, - formatMsats, - formatCurrency, - formatEventPrice, - formatWalletBalance -} from './formatting.js' - -// Test data -const testNumbers = [ - 0, - 1, - 999, - 1000, - 1001, - 9999, - 10000, - 10001, - 99999, - 100000, - 100001, - 999999, - 1000000, - 1000001, - 1234567, - 9999999, - 10000000 -] - -const testSats = [ - 0, - 1, - 999, - 1000, - 1001, - 9999, - 10000, - 10001, - 99999, - 100000, - 100001, - 999999, - 1000000, - 1000001, - 1234567, - 9999999, - 10000000 -] - -const testMsats = [ - 0, - 1000, - 999000, - 1000000, - 1001000, - 9999000, - 10000000, - 10001000, - 99999000, - 100000000, - 100001000, - 999999000, - 1000000000, - 1000001000, - 1234567000, - 9999999000, - 10000000000 -] - -const testCurrencies = [ - { amount: 0, currency: 'USD' }, - { amount: 1.99, currency: 'USD' }, - { amount: 999.99, currency: 'USD' }, - { amount: 1000, currency: 'USD' }, - { amount: 1001.50, currency: 'USD' }, - { amount: 9999.99, currency: 'USD' }, - { amount: 10000, currency: 'USD' }, - { amount: 0, currency: 'EUR' }, - { amount: 1.99, currency: 'EUR' }, - { amount: 999.99, currency: 'EUR' }, - { amount: 1000, currency: 'EUR' } -] - -const testEventPrices = [ - { price: 0, currency: 'sats' }, - { price: 1, currency: 'sats' }, - { price: 999, currency: 'sats' }, - { price: 1000, currency: 'sats' }, - { price: 1001, currency: 'sats' }, - { price: 9999, currency: 'sats' }, - { price: 10000, currency: 'sats' }, - { price: 0, currency: 'USD' }, - { price: 1.99, currency: 'USD' }, - { price: 999.99, currency: 'USD' }, - { price: 1000, currency: 'USD' }, - { price: 0, currency: 'EUR' }, - { price: 1.99, currency: 'EUR' }, - { price: 999.99, currency: 'EUR' }, - { price: 1000, currency: 'EUR' } -] - -// Test functions -function testFormatNumber() { - console.log('Testing formatNumber function:') - testNumbers.forEach(num => { - const formatted = formatNumber(num) - console.log(`${num} -> "${formatted}"`) - }) - console.log('') -} - -function testFormatSats() { - console.log('Testing formatSats function:') - testSats.forEach(sats => { - const formatted = formatSats(sats) - console.log(`${sats} sats -> "${formatted}"`) - }) - console.log('') -} - -function testFormatMsats() { - console.log('Testing formatMsats function:') - testMsats.forEach(msats => { - const formatted = formatMsats(msats) - console.log(`${msats} msats -> "${formatted}"`) - }) - console.log('') -} - -function testFormatCurrency() { - console.log('Testing formatCurrency function:') - testCurrencies.forEach(({ amount, currency }) => { - const formatted = formatCurrency(amount, currency) - console.log(`${amount} ${currency} -> "${formatted}"`) - }) - console.log('') -} - -function testFormatEventPrice() { - console.log('Testing formatEventPrice function:') - testEventPrices.forEach(({ price, currency }) => { - const formatted = formatEventPrice(price, currency) - console.log(`${price} ${currency} -> "${formatted}"`) - }) - console.log('') -} - -function testFormatWalletBalance() { - console.log('Testing formatWalletBalance function:') - testMsats.forEach(msats => { - const formatted = formatWalletBalance(msats) - console.log(`${msats} msats -> "${formatted}"`) - }) - console.log('') -} - -// Run all tests -function runAllTests() { - console.log('=== FORMATTING UTILITY TESTS ===\n') - - testFormatNumber() - testFormatSats() - testFormatMsats() - testFormatCurrency() - testFormatEventPrice() - testFormatWalletBalance() - - console.log('=== TESTS COMPLETED ===') -} - -// Export for manual testing -export { - runAllTests, - testFormatNumber, - testFormatSats, - testFormatMsats, - testFormatCurrency, - testFormatEventPrice, - testFormatWalletBalance -} - -// Run tests if this file is executed directly -if (typeof window !== 'undefined') { - // Browser environment - add to window for console testing - (window as any).formattingTests = { - runAllTests, - testFormatNumber, - testFormatSats, - testFormatMsats, - testFormatCurrency, - testFormatEventPrice, - testFormatWalletBalance - } - console.log('Formatting tests available at window.formattingTests') -} diff --git a/src/pages/Login.vue b/src/pages/Login.vue deleted file mode 100644 index 5eb6240..0000000 --- a/src/pages/Login.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - diff --git a/src/pages/MarketDashboard.vue b/src/pages/MarketDashboard.vue index 87b262d..f1c9ad2 100644 --- a/src/pages/MarketDashboard.vue +++ b/src/pages/MarketDashboard.vue @@ -60,7 +60,6 @@