@net-protocol/storage 0.1.8 → 0.1.10
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/index.d.mts +97 -155
- package/dist/index.d.ts +97 -155
- package/dist/index.js +275 -716
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +272 -710
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +70 -0
- package/dist/react.d.ts +70 -0
- package/dist/react.js +1380 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +1367 -0
- package/dist/react.mjs.map +1 -0
- package/dist/types-BnOI6cJS.d.mts +87 -0
- package/dist/types-BnOI6cJS.d.ts +87 -0
- package/package.json +15 -2
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
import { U as UseStorageOptions, a as StorageData, B as BulkStorageKey, c as UseXmlStorageOptions, d as UseStorageFromRouterOptions } from './types-BnOI6cJS.mjs';
|
|
3
|
+
|
|
4
|
+
declare function useStorage({ chainId, key, operatorAddress, enabled, index, keyFormat, useRouter, outputFormat, }: UseStorageOptions): {
|
|
5
|
+
data: StorageData | undefined;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: Error | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare function useStorageForOperator({ chainId, operatorAddress, }: UseStorageOptions): {
|
|
10
|
+
data: any[][];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
error: undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function useStorageForOperatorAndKey({ chainId, key, operatorAddress, keyFormat, outputFormat, }: UseStorageOptions): {
|
|
15
|
+
data: {
|
|
16
|
+
text: string;
|
|
17
|
+
value: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
error: Error | undefined;
|
|
21
|
+
};
|
|
22
|
+
declare function useBulkStorage({ chainId, keys, safe, keyFormat, }: {
|
|
23
|
+
chainId: number;
|
|
24
|
+
keys: BulkStorageKey[];
|
|
25
|
+
safe?: boolean;
|
|
26
|
+
keyFormat?: "raw" | "bytes32";
|
|
27
|
+
}): {
|
|
28
|
+
data: {
|
|
29
|
+
text: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
error: Error | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Get total number of versions (writes) for a storage key
|
|
37
|
+
* Tries both chunked storage and regular storage
|
|
38
|
+
*/
|
|
39
|
+
declare function useStorageTotalWrites({ chainId, key, operatorAddress, enabled, keyFormat, }: {
|
|
40
|
+
chainId: number;
|
|
41
|
+
key?: string;
|
|
42
|
+
operatorAddress?: string;
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
keyFormat?: "raw" | "bytes32";
|
|
45
|
+
}): {
|
|
46
|
+
data: number | undefined;
|
|
47
|
+
isLoading: boolean;
|
|
48
|
+
error: viem.ReadContractErrorType | null | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare function useXmlStorage({ chainId, key, operatorAddress, skipXmlParsing, enabled, content, index, keyFormat, useRouter, outputFormat, }: UseXmlStorageOptions): {
|
|
52
|
+
text: string;
|
|
53
|
+
value: string;
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
error: Error | undefined;
|
|
56
|
+
isXml: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generic hook to fetch storage content from StorageRouter
|
|
61
|
+
* Handles both regular storage and chunked storage seamlessly
|
|
62
|
+
* Works for any storage key (not just canvases)
|
|
63
|
+
*/
|
|
64
|
+
declare function useStorageFromRouter({ chainId, storageKey, operatorAddress, enabled, }: UseStorageFromRouterOptions): {
|
|
65
|
+
data: StorageData | undefined;
|
|
66
|
+
isLoading: boolean;
|
|
67
|
+
error: Error | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { UseStorageOptions, UseXmlStorageOptions, useBulkStorage, useStorage, useStorageForOperator, useStorageForOperatorAndKey, useStorageFromRouter, useStorageTotalWrites, useXmlStorage };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
import { U as UseStorageOptions, a as StorageData, B as BulkStorageKey, c as UseXmlStorageOptions, d as UseStorageFromRouterOptions } from './types-BnOI6cJS.js';
|
|
3
|
+
|
|
4
|
+
declare function useStorage({ chainId, key, operatorAddress, enabled, index, keyFormat, useRouter, outputFormat, }: UseStorageOptions): {
|
|
5
|
+
data: StorageData | undefined;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: Error | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare function useStorageForOperator({ chainId, operatorAddress, }: UseStorageOptions): {
|
|
10
|
+
data: any[][];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
error: undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function useStorageForOperatorAndKey({ chainId, key, operatorAddress, keyFormat, outputFormat, }: UseStorageOptions): {
|
|
15
|
+
data: {
|
|
16
|
+
text: string;
|
|
17
|
+
value: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
error: Error | undefined;
|
|
21
|
+
};
|
|
22
|
+
declare function useBulkStorage({ chainId, keys, safe, keyFormat, }: {
|
|
23
|
+
chainId: number;
|
|
24
|
+
keys: BulkStorageKey[];
|
|
25
|
+
safe?: boolean;
|
|
26
|
+
keyFormat?: "raw" | "bytes32";
|
|
27
|
+
}): {
|
|
28
|
+
data: {
|
|
29
|
+
text: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
error: Error | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Get total number of versions (writes) for a storage key
|
|
37
|
+
* Tries both chunked storage and regular storage
|
|
38
|
+
*/
|
|
39
|
+
declare function useStorageTotalWrites({ chainId, key, operatorAddress, enabled, keyFormat, }: {
|
|
40
|
+
chainId: number;
|
|
41
|
+
key?: string;
|
|
42
|
+
operatorAddress?: string;
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
keyFormat?: "raw" | "bytes32";
|
|
45
|
+
}): {
|
|
46
|
+
data: number | undefined;
|
|
47
|
+
isLoading: boolean;
|
|
48
|
+
error: viem.ReadContractErrorType | null | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare function useXmlStorage({ chainId, key, operatorAddress, skipXmlParsing, enabled, content, index, keyFormat, useRouter, outputFormat, }: UseXmlStorageOptions): {
|
|
52
|
+
text: string;
|
|
53
|
+
value: string;
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
error: Error | undefined;
|
|
56
|
+
isXml: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generic hook to fetch storage content from StorageRouter
|
|
61
|
+
* Handles both regular storage and chunked storage seamlessly
|
|
62
|
+
* Works for any storage key (not just canvases)
|
|
63
|
+
*/
|
|
64
|
+
declare function useStorageFromRouter({ chainId, storageKey, operatorAddress, enabled, }: UseStorageFromRouterOptions): {
|
|
65
|
+
data: StorageData | undefined;
|
|
66
|
+
isLoading: boolean;
|
|
67
|
+
error: Error | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { UseStorageOptions, UseXmlStorageOptions, useBulkStorage, useStorage, useStorageForOperator, useStorageForOperatorAndKey, useStorageFromRouter, useStorageTotalWrites, useXmlStorage };
|