Commit graph

151 commits

Author SHA1 Message Date
25023df8bd Add keypair rotation detection and migration feature
When a user rotates their Nostr keypair in account settings, the
merchant still holds the old key. This adds:

- key_mismatch flag on MerchantConfig (runtime, not persisted) -
  detected on each GET /api/v1/merchant by comparing account vs
  merchant pubkey
- POST /api/v1/merchant/{id}/migrate-keys endpoint that updates
  the merchant keys, republishes all stalls/products under the new
  identity, and resubscribes
- Warning banner in the UI with a "Migrate Keys" button and
  confirmation dialog
- update_merchant_keys() crud function

Orders and DM history are preserved since they reference customer
pubkeys. Old stall/product events on relays become orphaned.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 16:59:03 +02:00
5c38947fc6 Auto-provision merchant from account keypair on first access
The LNbits user account IS the merchant identity. GET /api/v1/merchant
now auto-creates the merchant record using the account's existing Nostr
keypair if one doesn't exist yet, so the extension is immediately
usable without any setup screen.

- Extract _auto_create_merchant() helper used by both GET and POST
- Remove welcome/key-generation screen (replaced with loading spinner)
- Remove dead frontend code (generateKeys, importKeys dialogs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 16:59:03 +02:00
a8eeace36d Improve merchant creation with automatic keypair generation
Enhance the merchant creation process by automatically generating Nostr keypairs
for users who don't have them, and streamline the API interface.

Changes:
- Add CreateMerchantRequest model to simplify merchant creation API
- Auto-generate Nostr keypairs for users without existing keys
- Update merchant creation endpoint to use user account keypairs
- Improve error handling and validation in merchant creation flow
- Clean up frontend JavaScript for merchant creation

This ensures all merchants have proper Nostr keypairs for marketplace
functionality without requiring manual key management from users.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-24 01:59:27 -04:00
arcbtc
7771201c32 moved to orders tab 2025-12-30 11:46:45 +00:00
arcbtc
1777b5df6d Merge branch 'main' into feature/merchant-keys-panel-146 2025-12-30 11:40:14 +00:00
Ben Weeks
7aec14854c feat: multi-profile support and UI improvements
- Remove backend restriction on one merchant per user
- Add "Generate New Key" dialog with npub/nsec display
- Add "Import Existing Key" option with duplicate check
- Change "Save" to "Save & Publish" in edit profile dialog
- Remove standalone Publish button (now part of Save)
- Add trash icon to saved profile for removal
- Show display_name in saved profiles dropdown
- Hide nsec by default with eye toggle in generate dialog

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:05:18 +00:00
Arc
a2931d675a fixup: ui 2025-12-24 05:32:27 +00:00
Arc
05a23fae0b Merge remote-tracking branch 'origin/main' into feature/nostrclient-status-indicator 2025-12-24 03:57:27 +00:00
Ben Weeks
bd010ece6b style: fix prettier formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:21:59 +00:00
Ben Weeks
b8c2c99175 chore: remove unused status endpoint and debug logging
- Remove api_get_nostr_status() - frontend calls nostrclient directly
- Remove unused httpx and settings imports
- Remove console.log debug statement

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 14:46:30 +00:00
Ben Weeks
d2755d7232 fix: improve nostrclient status detection and display
- Call nostrclient /relays API directly from frontend for accurate status
- Show correct error messages from API response (body.detail)
- Add orange warning state for no relays configured
- Show relay count when connected (X of Y connected)
- Simplify status logic: 200 = green, no relays = orange, error = red

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:49:33 +00:00
Ben Weeks
9911a03575 feat: add nostrclient status indicator and connection button
- Add /api/v1/status endpoint to check nostrclient availability
- Add color-coded "Connect" button (red/orange/green) based on status
- Show dropdown with connection details (relays count, websocket status)
- Add warning banner when nostrclient extension is not available
- Update info card with description of extension functionality

Closes #132

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:15:11 +00:00
Ben Weeks
71f458b9b9 feat: restructure UI with tab-based navigation (#119)
Reorganizes the merchant dashboard into a tab-based layout:
- Tabs: Merchant | Shipping | Stalls | Products | Messages | Orders
- Publish dropdown with NIP-15 options (NIP-99 disabled/coming soon)
- Consistent UI patterns across all tabs:
  - Search/filter/buttons aligned right
  - Actions column on right side of tables
  - Equal-width tabs
- Stalls tab: popup edit dialog, navigation to Products/Orders
- Products tab: filter icon dropdown for stall filtering
- Modular component structure for each tab section
- Fixed product API calls to use correct endpoints

Closes #119

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 19:06:28 +00:00
Vlad Stan
de7fe059b8
V1 (#106)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
2024-11-06 11:50:21 +02:00
PatMulligan
7a3b144a94
pass showKeys as prop to merchant-details child and use emit to toggle (#105)
previously, index and its child compoment merchant-details had their own
booleans and their values were not synched. Using a prop avoids this
problem
2024-10-25 15:19:13 +03:00
Vlad Stan
f2773e0b44
Fix subscription errors (#81)
* pref: merge filters in one

* chore: load nit

* feat: restore individual order
2023-09-12 15:03:37 +03:00
Vlad Stan
c06f9a20a7
Extract market place (#78)
* chore: remove marketplace components

* feat: add static marketplace

* feat: add entry point for static marketplace

* doc: add comment

* chore: include nostr-bundle.js
2023-07-31 11:35:50 +03:00
Vlad Stan
fca8fa2bc6 chore: code clean-up 2023-07-24 11:11:31 +02:00
Vlad Stan
4c12a93f9f refactor: stuff 2023-07-24 11:11:31 +02:00
Vlad Stan
b9c163f353 fix: update product list when product deleted 2023-07-24 11:11:31 +02:00
Vlad Stan
780e6e8b1a feat: add readNotes and clearAllData option 2023-07-24 11:11:31 +02:00
Vlad Stan
096d14735b fix: why even optimize 2023-07-24 11:11:31 +02:00
Vlad Stan
b6e149a1b0 chore: code clean-up 2023-07-18 16:40:43 +02:00
Vlad Stan
93d183aacd feat: user logout and data clear 2023-07-18 16:40:43 +02:00
Vlad Stan
a965a02303 feat: ui loading update 2023-07-18 16:40:43 +02:00
Vlad Stan
21185fce34 chore: code clean-up 2023-07-18 16:40:43 +02:00
Vlad Stan
316d4313f6 fix: persist UI config 2023-07-18 16:40:43 +02:00
Vlad Stan
ec50c3e2a0 feat: load naddr 2023-07-18 16:40:43 +02:00
Vlad Stan
672f4d6def feat: ask for login 2023-07-18 16:40:43 +02:00
Vlad Stan
481592ab68 fet: ui bla 2023-07-18 16:40:43 +02:00
Vlad Stan
b448eacb40 fix: config update 2023-07-18 16:40:43 +02:00
Vlad Stan
1721ec8741 refactor: code clean-up 2023-07-18 16:40:43 +02:00
Vlad Stan
97d7d66925 feat: UI improvements 2023-07-18 16:40:43 +02:00
Vlad Stan
cb2a1f6016 fix: navigation link 2023-07-18 16:40:43 +02:00
Vlad Stan
da5b8e86f9 fix: active page 2023-07-18 16:40:43 +02:00
Vlad Stan
5d433ce37e fix: query param names 2023-07-18 16:40:43 +02:00
Vlad Stan
835a9d4c0f refactor: param parsnig 2023-07-18 16:40:43 +02:00
Vlad Stan
c12945cac1 refactor: naddrs stuff 2023-07-18 16:40:43 +02:00
Vlad Stan
c91936a2cc fix: dark mode 2023-07-18 16:40:43 +02:00
Vlad Stan
8b2833e065 refactor: extract applyUiConfigs 2023-07-18 16:40:43 +02:00
Vlad Stan
fc9b9f36f1 refactor: extract restoreFromStorage 2023-07-18 16:40:43 +02:00
Vlad Stan
ee0ae38855 feat: refresh market-config 2023-07-18 16:40:43 +02:00
Vlad Stan
ece97355ee fix: logo image 2023-07-18 16:40:43 +02:00
Vlad Stan
9af06f9a99 fix: banner & logo update 2023-07-18 16:40:43 +02:00
Vlad Stan
307f7db802 chore: code clean-up 2023-07-18 16:40:43 +02:00
Vlad Stan
edd5036163 feat: prepare for naddr fix 2023-07-18 16:40:43 +02:00
Vlad Stan
d4267ab8e3 feat: add remove relays 2023-07-18 16:40:43 +02:00
Vlad Stan
47439087fb feat: nicer stall cards 2023-07-18 16:40:43 +02:00
Vlad Stan
c4f41a6cc5 feat: add basic stall list 2023-07-18 16:40:43 +02:00
Vlad Stan
038a984293 fix: navigation 2023-07-18 16:40:43 +02:00