@gethashd/bytecave-browser 1.0.35 → 1.0.36
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-PMRP2UEN.js → chunk-6WXUCYSA.js} +6 -6
- package/dist/client.d.ts +1 -1
- package/dist/contracts/ContentRegistry.d.ts +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +2 -1
- package/src/contracts/ContentRegistry.ts +2 -2
- package/src/provider.tsx +3 -3
|
@@ -6168,8 +6168,8 @@ var StorageWebSocketClient = class {
|
|
|
6168
6168
|
|
|
6169
6169
|
// src/contracts/ContentRegistry.ts
|
|
6170
6170
|
var CONTENT_REGISTRY_ABI = [
|
|
6171
|
-
"function registerContent(bytes32 cid, address owner, bytes32 appId) external",
|
|
6172
|
-
"function registerContent(string cid, string appId) external",
|
|
6171
|
+
"function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
|
|
6172
|
+
"function registerContent(string cid, string appId, uint256 hashIdToken) external",
|
|
6173
6173
|
"function isContentRegistered(bytes32 cid) external view returns (bool)",
|
|
6174
6174
|
"function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
|
|
6175
6175
|
];
|
|
@@ -6659,7 +6659,7 @@ Nonce: ${nonce}`;
|
|
|
6659
6659
|
* Register content in ContentRegistry contract (on-chain)
|
|
6660
6660
|
* This must be called before storing content that requires on-chain verification
|
|
6661
6661
|
*/
|
|
6662
|
-
async registerContent(cid, appId, signer) {
|
|
6662
|
+
async registerContent(cid, appId, hashIdToken, signer) {
|
|
6663
6663
|
if (!this.config.contentRegistryAddress) {
|
|
6664
6664
|
return {
|
|
6665
6665
|
success: false,
|
|
@@ -6679,7 +6679,7 @@ Nonce: ${nonce}`;
|
|
|
6679
6679
|
CONTENT_REGISTRY_ABI,
|
|
6680
6680
|
signer
|
|
6681
6681
|
);
|
|
6682
|
-
const tx = await contract.registerContent(cid, appId);
|
|
6682
|
+
const tx = await contract.registerContent(cid, appId, hashIdToken);
|
|
6683
6683
|
console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
|
|
6684
6684
|
const receipt = await tx.wait();
|
|
6685
6685
|
console.log("[ByteCave] ContentRegistry registration confirmed:", receipt.hash);
|
|
@@ -7105,11 +7105,11 @@ function ByteCaveProvider({
|
|
|
7105
7105
|
}
|
|
7106
7106
|
return globalClient.getNodeHealth(peerId);
|
|
7107
7107
|
};
|
|
7108
|
-
const registerContent = async (cid, appId2, signer) => {
|
|
7108
|
+
const registerContent = async (cid, appId2, hashIdToken, signer) => {
|
|
7109
7109
|
if (!globalClient) {
|
|
7110
7110
|
return { success: false, error: "Client not initialized" };
|
|
7111
7111
|
}
|
|
7112
|
-
return globalClient.registerContent(cid, appId2, signer);
|
|
7112
|
+
return globalClient.registerContent(cid, appId2, hashIdToken, signer);
|
|
7113
7113
|
};
|
|
7114
7114
|
const value = {
|
|
7115
7115
|
connectionState,
|
package/dist/client.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare class ByteCaveClient {
|
|
|
45
45
|
* Register content in ContentRegistry contract (on-chain)
|
|
46
46
|
* This must be called before storing content that requires on-chain verification
|
|
47
47
|
*/
|
|
48
|
-
registerContent(cid: string, appId: string, signer: ethers.Signer): Promise<{
|
|
48
|
+
registerContent(cid: string, appId: string, hashIdToken: string, signer: ethers.Signer): Promise<{
|
|
49
49
|
success: boolean;
|
|
50
50
|
txHash?: string;
|
|
51
51
|
error?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONTENT_REGISTRY_ABI: readonly ["function registerContent(bytes32 cid, address owner, bytes32 appId) external", "function registerContent(string cid, string appId) 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 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))"];
|
package/dist/index.cjs
CHANGED
|
@@ -6221,8 +6221,8 @@ var StorageWebSocketClient = class {
|
|
|
6221
6221
|
|
|
6222
6222
|
// src/contracts/ContentRegistry.ts
|
|
6223
6223
|
var CONTENT_REGISTRY_ABI = [
|
|
6224
|
-
"function registerContent(bytes32 cid, address owner, bytes32 appId) external",
|
|
6225
|
-
"function registerContent(string cid, string appId) external",
|
|
6224
|
+
"function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
|
|
6225
|
+
"function registerContent(string cid, string appId, uint256 hashIdToken) external",
|
|
6226
6226
|
"function isContentRegistered(bytes32 cid) external view returns (bool)",
|
|
6227
6227
|
"function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
|
|
6228
6228
|
];
|
|
@@ -6712,7 +6712,7 @@ Nonce: ${nonce}`;
|
|
|
6712
6712
|
* Register content in ContentRegistry contract (on-chain)
|
|
6713
6713
|
* This must be called before storing content that requires on-chain verification
|
|
6714
6714
|
*/
|
|
6715
|
-
async registerContent(cid, appId, signer) {
|
|
6715
|
+
async registerContent(cid, appId, hashIdToken, signer) {
|
|
6716
6716
|
if (!this.config.contentRegistryAddress) {
|
|
6717
6717
|
return {
|
|
6718
6718
|
success: false,
|
|
@@ -6732,7 +6732,7 @@ Nonce: ${nonce}`;
|
|
|
6732
6732
|
CONTENT_REGISTRY_ABI,
|
|
6733
6733
|
signer
|
|
6734
6734
|
);
|
|
6735
|
-
const tx = await contract.registerContent(cid, appId);
|
|
6735
|
+
const tx = await contract.registerContent(cid, appId, hashIdToken);
|
|
6736
6736
|
console.log("[ByteCave] ContentRegistry transaction sent:", tx.hash);
|
|
6737
6737
|
const receipt = await tx.wait();
|
|
6738
6738
|
console.log("[ByteCave] ContentRegistry registration confirmed:", receipt.hash);
|
|
@@ -7158,11 +7158,11 @@ function ByteCaveProvider({
|
|
|
7158
7158
|
}
|
|
7159
7159
|
return globalClient.getNodeHealth(peerId);
|
|
7160
7160
|
};
|
|
7161
|
-
const registerContent = async (cid, appId2, signer) => {
|
|
7161
|
+
const registerContent = async (cid, appId2, hashIdToken, signer) => {
|
|
7162
7162
|
if (!globalClient) {
|
|
7163
7163
|
return { success: false, error: "Client not initialized" };
|
|
7164
7164
|
}
|
|
7165
|
-
return globalClient.registerContent(cid, appId2, signer);
|
|
7165
|
+
return globalClient.registerContent(cid, appId2, hashIdToken, signer);
|
|
7166
7166
|
};
|
|
7167
7167
|
const value = {
|
|
7168
7168
|
connectionState,
|
package/dist/index.js
CHANGED
package/dist/provider.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface ByteCaveContextValue {
|
|
|
37
37
|
disconnect: () => Promise<void>;
|
|
38
38
|
store: (data: Uint8Array, mimeType?: string, signer?: any) => Promise<StoreResult>;
|
|
39
39
|
retrieve: (cid: string) => Promise<RetrieveResult>;
|
|
40
|
-
registerContent: (cid: string, appId: string, signer: any) => Promise<{
|
|
40
|
+
registerContent: (cid: string, appId: string, hashIdToken: string, signer: any) => Promise<{
|
|
41
41
|
success: boolean;
|
|
42
42
|
txHash?: string;
|
|
43
43
|
error?: string;
|
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -647,6 +647,7 @@ Nonce: ${nonce}`;
|
|
|
647
647
|
async registerContent(
|
|
648
648
|
cid: string,
|
|
649
649
|
appId: string,
|
|
650
|
+
hashIdToken: string,
|
|
650
651
|
signer: ethers.Signer
|
|
651
652
|
): Promise<{ success: boolean; txHash?: string; error?: string }> {
|
|
652
653
|
if (!this.config.contentRegistryAddress) {
|
|
@@ -672,7 +673,7 @@ Nonce: ${nonce}`;
|
|
|
672
673
|
signer
|
|
673
674
|
);
|
|
674
675
|
|
|
675
|
-
const tx = await contract.registerContent(cid, appId);
|
|
676
|
+
const tx = await contract.registerContent(cid, appId, hashIdToken);
|
|
676
677
|
console.log('[ByteCave] ContentRegistry transaction sent:', tx.hash);
|
|
677
678
|
|
|
678
679
|
const receipt = await tx.wait();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const CONTENT_REGISTRY_ABI = [
|
|
2
|
-
"function registerContent(bytes32 cid, address owner, bytes32 appId) external",
|
|
3
|
-
"function registerContent(string cid, string appId) external",
|
|
2
|
+
"function registerContent(bytes32 cid, address owner, bytes32 appId, uint256 hashIdToken) external",
|
|
3
|
+
"function registerContent(string cid, string appId, uint256 hashIdToken) external",
|
|
4
4
|
"function isContentRegistered(bytes32 cid) external view returns (bool)",
|
|
5
5
|
"function getContentRecord(bytes32 cid) external view returns (tuple(address owner, bytes32 appId, uint256 timestamp))"
|
|
6
6
|
] as const;
|
package/src/provider.tsx
CHANGED
|
@@ -41,7 +41,7 @@ interface ByteCaveContextValue {
|
|
|
41
41
|
disconnect: () => Promise<void>;
|
|
42
42
|
store: (data: Uint8Array, mimeType?: string, signer?: any) => Promise<StoreResult>;
|
|
43
43
|
retrieve: (cid: string) => Promise<RetrieveResult>;
|
|
44
|
-
registerContent: (cid: string, appId: string, signer: any) => Promise<{ success: boolean; txHash?: string; error?: string }>;
|
|
44
|
+
registerContent: (cid: string, appId: string, hashIdToken: string, signer: any) => Promise<{ success: boolean; txHash?: string; error?: string }>;
|
|
45
45
|
getNodeHealth: (peerId: string) => Promise<NodeHealth | null>;
|
|
46
46
|
error: string | null;
|
|
47
47
|
}
|
|
@@ -245,11 +245,11 @@ export function ByteCaveProvider({
|
|
|
245
245
|
return (globalClient as any).getNodeHealth(peerId);
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
const registerContent = async (cid: string, appId: string, signer: any): Promise<{ success: boolean; txHash?: string; error?: string }> => {
|
|
248
|
+
const registerContent = async (cid: string, appId: string, hashIdToken: string, signer: any): Promise<{ success: boolean; txHash?: string; error?: string }> => {
|
|
249
249
|
if (!globalClient) {
|
|
250
250
|
return { success: false, error: 'Client not initialized' };
|
|
251
251
|
}
|
|
252
|
-
return globalClient.registerContent(cid, appId, signer);
|
|
252
|
+
return globalClient.registerContent(cid, appId, hashIdToken, signer);
|
|
253
253
|
};
|
|
254
254
|
|
|
255
255
|
const value: ByteCaveContextValue = {
|