@1sat/wallet-toolbox 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wallet/factory.js +8 -4
- package/package.json +1 -1
package/dist/wallet/factory.js
CHANGED
|
@@ -11,8 +11,8 @@ import { OneSatServices } from "../services/OneSatServices";
|
|
|
11
11
|
const DEFAULT_DATABASE_NAME = "wallet";
|
|
12
12
|
// Default timeout for remote storage connection
|
|
13
13
|
const DEFAULT_REMOTE_STORAGE_TIMEOUT = 5000;
|
|
14
|
-
// Default fee model
|
|
15
|
-
const DEFAULT_FEE_MODEL = { model: "sat/kb", value:
|
|
14
|
+
// Default fee model (100 sat/kb matches yours-wallet and 1sat-indexer minimum)
|
|
15
|
+
const DEFAULT_FEE_MODEL = { model: "sat/kb", value: 100 };
|
|
16
16
|
/**
|
|
17
17
|
* Parse a private key from various input formats.
|
|
18
18
|
* Supports PrivateKey instance, WIF string, or hex string.
|
|
@@ -101,15 +101,19 @@ export async function createWebWallet(config) {
|
|
|
101
101
|
conflictingActives: storageAny._conflictingActives?.map(c => c.settings?.storageIdentityKey),
|
|
102
102
|
});
|
|
103
103
|
// If there are conflicting actives, resolve by setting local as active (merges remote data)
|
|
104
|
+
// Non-blocking to avoid IDB transaction timeout
|
|
104
105
|
if (storageAny._conflictingActives && storageAny._conflictingActives.length > 0) {
|
|
105
106
|
const localKey = storageAny._active?.settings?.storageIdentityKey;
|
|
106
107
|
if (localKey && storageAny.setActive) {
|
|
107
108
|
console.log("[createWebWallet] Resolving conflicts by merging into local storage...");
|
|
108
|
-
|
|
109
|
+
storageAny.setActive(localKey, (msg) => {
|
|
109
110
|
console.log("[createWebWallet] Sync:", msg);
|
|
110
111
|
return msg;
|
|
112
|
+
}).then(() => {
|
|
113
|
+
console.log("[createWebWallet] Conflict resolution complete");
|
|
114
|
+
}).catch((err) => {
|
|
115
|
+
console.log("[createWebWallet] Conflict resolution failed:", err instanceof Error ? err.message : err);
|
|
111
116
|
});
|
|
112
|
-
console.log("[createWebWallet] Conflict resolution complete");
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
else if (storageAny._backups && storageAny._backups.length > 0 && storageAny.updateBackups) {
|