@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.
- package/dist/{chunk-M5BKEAWD.js → chunk-FOQ3CE3H.js} +4 -2
- package/dist/contracts/ContentRegistry.d.ts +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.js +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +11 -1
- package/src/contracts/ContentRegistry.ts +0 -1
|
@@ -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
|
|
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
|
|
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
|
|
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
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -589,7 +589,17 @@ Nonce: ${nonce}`;
|
|
|
589
589
|
signer
|
|
590
590
|
);
|
|
591
591
|
|
|
592
|
-
|
|
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;
|