applesauce-accounts
Advanced tools
Comparing version 0.0.0-next-20250128190416 to 0.0.0-next-20250128204825
@@ -41,3 +41,3 @@ import { Nip07Interface } from "applesauce-signers"; | ||
/** Returns an array of serialized accounts */ | ||
toJSON(): SerializedAccount<any, Metadata>[]; | ||
toJSON(quite?: boolean): SerializedAccount<any, Metadata>[]; | ||
/** | ||
@@ -44,0 +44,0 @@ * Restores all accounts from an array of serialized accounts |
@@ -111,4 +111,14 @@ import { BehaviorSubject } from "rxjs"; | ||
/** Returns an array of serialized accounts */ | ||
toJSON() { | ||
return Array.from(this.accounts$.value).map((account) => account.toJSON()); | ||
toJSON(quite = false) { | ||
const accounts = []; | ||
for (const account of this.accounts) { | ||
try { | ||
accounts.push(account.toJSON()); | ||
} | ||
catch (error) { | ||
if (!quite) | ||
throw error; | ||
} | ||
} | ||
return accounts; | ||
} | ||
@@ -115,0 +125,0 @@ /** |
{ | ||
"name": "applesauce-accounts", | ||
"version": "0.0.0-next-20250128190416", | ||
"version": "0.0.0-next-20250128204825", | ||
"description": "A simple nostr account management system", | ||
@@ -36,3 +36,3 @@ "type": "module", | ||
"@noble/hashes": "^1.5.0", | ||
"applesauce-signers": "0.0.0-next-20250128190416", | ||
"applesauce-signers": "0.0.0-next-20250128204825", | ||
"nanoid": "^5.0.9", | ||
@@ -39,0 +39,0 @@ "nostr-tools": "^2.10.3", |
38241
852
+ Addedapplesauce-core@0.0.0-next-20250128204825(transitive)
+ Addedapplesauce-signers@0.0.0-next-20250128204825(transitive)
- Removedapplesauce-core@0.0.0-next-20250128190416(transitive)
- Removedapplesauce-signers@0.0.0-next-20250128190416(transitive)