@gethashd/bytecave-browser 1.0.44 → 1.0.45

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.
@@ -6682,7 +6682,10 @@ Nonce: ${nonce}`;
6682
6682
  CONTENT_REGISTRY_ABI,
6683
6683
  signer
6684
6684
  );
6685
- const tx = await contract.registerContent(cid, appId, hashIdToken);
6685
+ const cidBytes32 = "0x" + cid;
6686
+ const appIdBytes32 = ethers2.keccak256(ethers2.toUtf8Bytes(appId));
6687
+ const owner = await signer.getAddress();
6688
+ const tx = await contract.registerContent(cidBytes32, owner, appIdBytes32, hashIdToken);
6686
6689
  console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
6687
6690
  const receipt = await tx.wait();
6688
6691
  console.log("[ByteCave] ContentRegistry registration confirmed:", receipt.hash);
package/dist/index.cjs CHANGED
@@ -6735,7 +6735,10 @@ Nonce: ${nonce}`;
6735
6735
  CONTENT_REGISTRY_ABI,
6736
6736
  signer
6737
6737
  );
6738
- const tx = await contract.registerContent(cid, appId, hashIdToken);
6738
+ const cidBytes32 = "0x" + cid;
6739
+ const appIdBytes32 = import_ethers2.ethers.keccak256(import_ethers2.ethers.toUtf8Bytes(appId));
6740
+ const owner = await signer.getAddress();
6741
+ const tx = await contract.registerContent(cidBytes32, owner, appIdBytes32, hashIdToken);
6739
6742
  console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
6740
6743
  const receipt = await tx.wait();
6741
6744
  console.log("[ByteCave] ContentRegistry registration confirmed:", receipt.hash);
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  useHashdImage,
14
14
  useHashdMedia,
15
15
  useHashdUrl
16
- } from "./chunk-M5BKEAWD.js";
16
+ } from "./chunk-LTSO3FCE.js";
17
17
  import {
18
18
  clearHashdCache,
19
19
  createHashdUrl,
@@ -8,7 +8,7 @@ import {
8
8
  useHashdImage,
9
9
  useHashdMedia,
10
10
  useHashdUrl
11
- } from "../chunk-M5BKEAWD.js";
11
+ } from "../chunk-LTSO3FCE.js";
12
12
  import "../chunk-EEZWRIUI.js";
13
13
  export {
14
14
  HashdAudio,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethashd/bytecave-browser",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "ByteCave browser client for WebRTC P2P connections to storage nodes",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
package/src/client.ts CHANGED
@@ -589,7 +589,17 @@ Nonce: ${nonce}`;
589
589
  signer
590
590
  );
591
591
 
592
- const tx = await contract.registerContent(cid, appId, hashIdToken);
592
+ // Convert CID to bytes32 (CID is already a SHA-256 hash, don't double-hash it)
593
+ const cidBytes32 = '0x' + cid;
594
+
595
+ // Hash appId to bytes32
596
+ const appIdBytes32 = ethers.keccak256(ethers.toUtf8Bytes(appId));
597
+
598
+ // Get signer address for owner parameter
599
+ const owner = await signer.getAddress();
600
+
601
+ // Use bytes32 overload to avoid double-hashing the CID
602
+ const tx = await contract.registerContent(cidBytes32, owner, appIdBytes32, hashIdToken);
593
603
  console.log('[ByteCave] ContentRegistry transaction sent:', tx.hash);
594
604
 
595
605
  const receipt = await tx.wait();