@1sat/wallet-toolbox 0.0.42 → 0.0.44

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.
@@ -44,8 +44,33 @@ export async function fullSync(options) {
44
44
  args.since = undefined;
45
45
  // Get chunk from local storage
46
46
  const chunk = await storage.runAsSync(async (sync) => sync.getSyncChunk(args));
47
+ // DEBUG CHECKPOINT 2: Log PUSH chunk contents
48
+ const pushBaskets = chunk.outputBaskets || [];
49
+ const pushOutputs = chunk.outputs || [];
50
+ const pushTransactions = chunk.transactions || [];
51
+ const push1SatOutputs = pushOutputs.filter((o) => o.satoshis === 1);
52
+ console.log("=== CHECKPOINT 2: PUSH CHUNK ===");
53
+ console.log("[PUSH] Chunk #:", chunkCount + 1);
54
+ console.log("[PUSH] Transactions:", pushTransactions.length);
55
+ for (const t of pushTransactions) {
56
+ console.log(` Tx: transactionId=${t.transactionId}, txid=${t.txid?.slice(0, 16) ?? "null"}..., status=${t.status}`);
57
+ }
58
+ console.log("[PUSH] Output Baskets:", pushBaskets.length);
59
+ for (const b of pushBaskets) {
60
+ console.log(` Basket: id=${b.basketId}, name="${b.name}"`);
61
+ }
62
+ console.log("[PUSH] Total Outputs:", pushOutputs.length);
63
+ console.log("[PUSH] Outputs with basketId:", pushOutputs.filter((o) => o.basketId != null).length);
64
+ console.log("[PUSH] 1-sat Outputs:", push1SatOutputs.length);
65
+ console.log("[PUSH] 1-sat with basketId:", push1SatOutputs.filter((o) => o.basketId != null).length);
66
+ for (const o of push1SatOutputs) {
67
+ console.log(` 1sat Output: outputId=${o.outputId}, basketId=${o.basketId}, txid=${o.txid?.slice(0, 16)}...${o.vout}`);
68
+ }
69
+ console.log("=== END CHECKPOINT 2 ===");
47
70
  // Send chunk to remote
71
+ console.log("[PUSH] Sending chunk to remote...");
48
72
  const result = await remoteStorage.processSyncChunk(args, chunk);
73
+ console.log(`[PUSH] Server response: inserts=${result.inserts}, updates=${result.updates}, done=${result.done}`);
49
74
  pushInserts += result.inserts;
50
75
  pushUpdates += result.updates;
51
76
  chunkCount++;
@@ -79,6 +104,30 @@ export async function fullSync(options) {
79
104
  });
80
105
  // Step 3: Pull from remote (full pull due to reset state)
81
106
  onProgress?.("pulling", "Pulling all data from remote...");
107
+ // DEBUG CHECKPOINT 3: Intercept PULL chunks from remote
108
+ const originalGetSyncChunk = remoteStorage.getSyncChunk?.bind(remoteStorage);
109
+ if (originalGetSyncChunk) {
110
+ remoteStorage.getSyncChunk = async function (args) {
111
+ const chunk = (await originalGetSyncChunk(args));
112
+ const pullBaskets = chunk.outputBaskets || [];
113
+ const pullOutputs = chunk.outputs || [];
114
+ const pull1SatOutputs = pullOutputs.filter((o) => o.satoshis === 1);
115
+ console.log("=== CHECKPOINT 3: PULL CHUNK ===");
116
+ console.log("[PULL] Output Baskets:", pullBaskets.length);
117
+ for (const b of pullBaskets) {
118
+ console.log(` Basket: id=${b.basketId}, name="${b.name}"`);
119
+ }
120
+ console.log("[PULL] Total Outputs:", pullOutputs.length);
121
+ console.log("[PULL] Outputs with basketId:", pullOutputs.filter((o) => o.basketId != null).length);
122
+ console.log("[PULL] 1-sat Outputs:", pull1SatOutputs.length);
123
+ console.log("[PULL] 1-sat with basketId:", pull1SatOutputs.filter((o) => o.basketId != null).length);
124
+ for (const o of pull1SatOutputs) {
125
+ console.log(` 1sat Output: outputId=${o.outputId}, basketId=${o.basketId}, txid=${o.txid?.slice(0, 16)}...${o.vout}`);
126
+ }
127
+ console.log("=== END CHECKPOINT 3 ===");
128
+ return chunk;
129
+ };
130
+ }
82
131
  const pullResult = await storage.syncFromReader(identityKey, remoteStorage);
83
132
  onProgress?.("pulling", `Pulled ${pullResult.inserts} inserts, ${pullResult.updates} updates`);
84
133
  // Step 4: Complete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/wallet-toolbox",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "BSV wallet library extending @bsv/wallet-toolbox with 1Sat Ordinals protocol support",
5
5
  "author": "1Sat Team",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "fflate": "^0.8.2"
45
45
  },
46
46
  "peerDependencies": {
47
- "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@^1.7.20-idb-fix.19"
47
+ "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@^1.7.20-idb-fix.20"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@bsv/wallet-toolbox-mobile": {
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@biomejs/biome": "^1.9.4",
56
- "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@^1.7.20-idb-fix.17",
57
- "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@^1.7.20-idb-fix.19",
56
+ "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@^1.7.20-idb-fix.20",
57
+ "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@^1.7.20-idb-fix.20",
58
58
  "@types/bun": "^1.3.4",
59
59
  "@types/chrome": "^0.1.32",
60
60
  "typescript": "^5.9.3"