- Add wallet tab with NWC (Nostr Wallet Connect) Lightning support - Add Cashu ecash wallet with mint management, send/receive tokens - Add Cashu deposit feature (mint via Lightning invoice) - Add token viewer showing proof amounts and timestamps - Add refresh button with auto-refresh for spent proof detection - Add browser sync warning for Cashu users on welcome screen - Add Cashu onboarding info panel with storage considerations - Add settings page sync info note explaining how to change sync - Add backups page for vault snapshot management - Add About section to identity (You) page - Fix lint accessibility issues in wallet component Files modified: - projects/common/src/lib/services/nwc/* (new) - projects/common/src/lib/services/cashu/* (new) - projects/common/src/lib/services/storage/* (extended) - projects/chrome/src/app/components/home/wallet/* - projects/firefox/src/app/components/home/wallet/* - projects/chrome/src/app/components/welcome/* - projects/firefox/src/app/components/welcome/* - projects/chrome/src/app/components/home/settings/* - projects/firefox/src/app/components/home/settings/* - projects/chrome/src/app/components/home/identity/* - projects/firefox/src/app/components/home/identity/* - projects/chrome/src/app/components/home/backups/* (new) - projects/firefox/src/app/components/home/backups/* (new) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
80 lines
2.3 KiB
TypeScript
80 lines
2.3 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
import {
|
|
BrowserSyncData,
|
|
CashuMint_ENCRYPTED,
|
|
Identity_ENCRYPTED,
|
|
NwcConnection_ENCRYPTED,
|
|
Permission_ENCRYPTED,
|
|
BrowserSyncHandler,
|
|
Relay_ENCRYPTED,
|
|
} from '@common';
|
|
import browser from 'webextension-polyfill';
|
|
|
|
/**
|
|
* Handles the browser sync operations when the browser sync is enabled.
|
|
* If it's not enabled, it behaves like the local extension storage (which is fine).
|
|
*/
|
|
export class FirefoxSyncNoHandler extends BrowserSyncHandler {
|
|
async loadUnmigratedData(): Promise<Partial<Record<string, any>>> {
|
|
const data = await browser.storage.local.get(null);
|
|
|
|
// Remove any available "ignore properties".
|
|
this.ignoreProperties.forEach((property) => {
|
|
delete data[property];
|
|
});
|
|
return data;
|
|
}
|
|
|
|
async saveAndSetFullData(data: BrowserSyncData): Promise<void> {
|
|
await browser.storage.local.set(data as Record<string, any>);
|
|
this.setFullData(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_Permissions(data: {
|
|
permissions: Permission_ENCRYPTED[];
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_Permissions(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_Identities(data: {
|
|
identities: Identity_ENCRYPTED[];
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_Identities(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_SelectedIdentityId(data: {
|
|
selectedIdentityId: string | null;
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_SelectedIdentityId(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_Relays(data: {
|
|
relays: Relay_ENCRYPTED[];
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_Relays(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_NwcConnections(data: {
|
|
nwcConnections: NwcConnection_ENCRYPTED[];
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_NwcConnections(data);
|
|
}
|
|
|
|
async saveAndSetPartialData_CashuMints(data: {
|
|
cashuMints: CashuMint_ENCRYPTED[];
|
|
}): Promise<void> {
|
|
await browser.storage.local.set(data);
|
|
this.setPartialData_CashuMints(data);
|
|
}
|
|
|
|
async clearData(): Promise<void> {
|
|
const props = Object.keys(await this.loadUnmigratedData());
|
|
await browser.storage.local.remove(props);
|
|
}
|
|
}
|