@gethashd/bytecave-browser 1.0.44 → 1.0.46

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.
@@ -6229,7 +6229,6 @@ var StorageWebSocketClient = class {
6229
6229
  // src/contracts/ContentRegistry.ts
6230
6230
  var CONTENT_REGISTRY_ABI = [
6231
6231
  "function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
6232
- "function registerContent(string cid, string appId, uint256 hashIdToken) external",
6233
6232
  "function isContentRegistered(bytes32 cid) external view returns (bool)",
6234
6233
  "function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
6235
6234
  ];
@@ -6682,7 +6681,10 @@ Nonce: ${nonce}`;
6682
6681
  CONTENT_REGISTRY_ABI,
6683
6682
  signer
6684
6683
  );
6685
- const tx = await contract.registerContent(cid, appId, hashIdToken);
6684
+ const cidBytes32 = "0x" + cid;
6685
+ const appIdBytes32 = ethers2.keccak256(ethers2.toUtf8Bytes(appId));
6686
+ const owner = await signer.getAddress();
6687
+ const tx = await contract.registerContent(cidBytes32, owner, appIdBytes32, hashIdToken);
6686
6688
  console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
6687
6689
  const receipt = await tx.wait();
6688
6690
  console.log("[ByteCave] ContentRegistry registration confirmed:", receipt.hash);
@@ -1 +1 @@
1
- export declare const CONTENT_REGISTRY_ABI: readonly ["function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external", "function registerContent(string cid, string appId, uint256 hashIdToken) external", "function isContentRegistered(bytes32 cid) external view returns (bool)", "function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"];
1
+ export declare const CONTENT_REGISTRY_ABI: readonly ["function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external", "function isContentRegistered(bytes32 cid) external view returns (bool)", "function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"];
package/dist/index.cjs CHANGED
@@ -6282,7 +6282,6 @@ var StorageWebSocketClient = class {
6282
6282
  // src/contracts/ContentRegistry.ts
6283
6283
  var CONTENT_REGISTRY_ABI = [
6284
6284
  "function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
6285
- "function registerContent(string cid, string appId, uint256 hashIdToken) external",
6286
6285
  "function isContentRegistered(bytes32 cid) external view returns (bool)",
6287
6286
  "function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
6288
6287
  ];
@@ -6735,7 +6734,10 @@ Nonce: ${nonce}`;
6735
6734
  CONTENT_REGISTRY_ABI,
6736
6735
  signer
6737
6736
  );
6738
- const tx = await contract.registerContent(cid, appId, hashIdToken);
6737
+ const cidBytes32 = "0x" + cid;
6738
+ const appIdBytes32 = import_ethers2.ethers.keccak256(import_ethers2.ethers.toUtf8Bytes(appId));
6739
+ const owner = await signer.getAddress();
6740
+ const tx = await contract.registerContent(cidBytes32, owner, appIdBytes32, hashIdToken);
6739
6741
  console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
6740
6742
  const receipt = await tx.wait();
6741
6743
  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-FOQ3CE3H.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-FOQ3CE3H.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.46",
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();
@@ -1,6 +1,5 @@
1
1
  export const CONTENT_REGISTRY_ABI = [
2
2
  "function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
3
- "function registerContent(string cid, string appId, uint256 hashIdToken) external",
4
3
  "function isContentRegistered(bytes32 cid) external view returns (bool)",
5
4
  "function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
6
5
  ] as const;