@storagehub-sdk/core 0.1.0 → 0.2.0
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/_wasm_embed.d.ts +1 -1
- package/dist/evm/clients.d.ts +1 -1
- package/dist/evm/storageHubClient.d.ts +14 -14
- package/dist/evm/types.d.ts +1 -1
- package/dist/file-manager.d.ts +1 -1
- package/dist/http/HttpClient.d.ts +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +2 -2
- package/dist/wallet/base.d.ts +1 -1
- package/dist/wallet/eip1193.d.ts +2 -2
- package/dist/wallet/errors.d.ts +1 -1
- package/dist/wallet/local.d.ts +2 -2
- package/dist/wasm.d.ts +1 -1
- package/package.json +6 -13
- package/wasm/pkg/storagehub_wasm_bg.wasm +0 -0
package/dist/evm/clients.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Normalize how Core talks to an EVM endpoint in both environments (browser EIP‑1193 and Node HTTP)
|
|
5
5
|
* and return viem clients for reads (public) and writes (wallet) with a minimal API.
|
|
6
6
|
*/
|
|
7
|
-
import { type Account, type Chain, createPublicClient, createWalletClient, type EIP1193Provider } from
|
|
7
|
+
import { type Account, type Chain, createPublicClient, createWalletClient, type EIP1193Provider } from "viem";
|
|
8
8
|
/**
|
|
9
9
|
* HTTP transport configuration.
|
|
10
10
|
* - Requires a JSON‑RPC URL and an explicit viem Chain.
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* All arguments are strongly typed. String data (names, paths) are passed as strings and encoded internally.
|
|
8
8
|
* Binary data (signatures) are passed as Uint8Array. Hex values are 0x-prefixed strings (32-byte IDs).
|
|
9
9
|
*/
|
|
10
|
-
import { filesystemAbi } from
|
|
11
|
-
import type { EvmWriteOptions, StorageHubClientOptions } from
|
|
12
|
-
import { ReplicationLevel } from
|
|
13
|
-
import { type Address } from
|
|
10
|
+
import { filesystemAbi } from "../abi/filesystem";
|
|
11
|
+
import type { EvmWriteOptions, StorageHubClientOptions } from "./types";
|
|
12
|
+
import type { ReplicationLevel } from "./types";
|
|
13
|
+
import { type Address } from "viem";
|
|
14
14
|
export { filesystemAbi };
|
|
15
15
|
export declare class StorageHubClient {
|
|
16
16
|
private readonly publicClient;
|
|
@@ -73,13 +73,13 @@ export declare class StorageHubClient {
|
|
|
73
73
|
* @param name - bucket name as string (max 100 UTF-8 bytes)
|
|
74
74
|
* @returns bucketId as 0x-prefixed 32-byte hex
|
|
75
75
|
*/
|
|
76
|
-
deriveBucketId(owner: Address, name: string): Promise<unknown
|
|
76
|
+
deriveBucketId(owner: Address, name: string): Promise<unknown> | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* Get how many file deletion requests a user currently has pending.
|
|
79
79
|
* @param user - user EVM address
|
|
80
80
|
* @returns count as number
|
|
81
81
|
*/
|
|
82
|
-
getPendingFileDeletionRequestsCount(user: Address): Promise<unknown
|
|
82
|
+
getPendingFileDeletionRequestsCount(user: Address): Promise<unknown> | undefined;
|
|
83
83
|
/**
|
|
84
84
|
* Create a new bucket.
|
|
85
85
|
* @param mspId - 32-byte MSP ID (0x-prefixed hex)
|
|
@@ -88,7 +88,7 @@ export declare class StorageHubClient {
|
|
|
88
88
|
* @param valuePropId - 32-byte value proposition ID (0x-prefixed hex)
|
|
89
89
|
* @param options - optional gas and fee overrides
|
|
90
90
|
*/
|
|
91
|
-
createBucket(mspId: `0x${string}`, name: string, isPrivate: boolean, valuePropId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
91
|
+
createBucket(mspId: `0x${string}`, name: string, isPrivate: boolean, valuePropId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
92
92
|
/**
|
|
93
93
|
* Request moving a bucket to a new MSP/value proposition.
|
|
94
94
|
* @param bucketId - 32-byte bucket ID
|
|
@@ -96,26 +96,26 @@ export declare class StorageHubClient {
|
|
|
96
96
|
* @param newValuePropId - 32-byte new value proposition ID
|
|
97
97
|
* @param options - optional gas and fee overrides
|
|
98
98
|
*/
|
|
99
|
-
requestMoveBucket(bucketId: `0x${string}`, newMspId: `0x${string}`, newValuePropId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
99
|
+
requestMoveBucket(bucketId: `0x${string}`, newMspId: `0x${string}`, newValuePropId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
100
100
|
/**
|
|
101
101
|
* Update bucket privacy flag.
|
|
102
102
|
* @param bucketId - 32-byte bucket ID
|
|
103
103
|
* @param isPrivate - true for private
|
|
104
104
|
* @param options - optional gas and fee overrides
|
|
105
105
|
*/
|
|
106
|
-
updateBucketPrivacy(bucketId: `0x${string}`, isPrivate: boolean, options?: EvmWriteOptions): Promise<`0x${string}
|
|
106
|
+
updateBucketPrivacy(bucketId: `0x${string}`, isPrivate: boolean, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
107
107
|
/**
|
|
108
108
|
* Create and associate a collection with a bucket.
|
|
109
109
|
* @param bucketId - 32-byte bucket ID
|
|
110
110
|
* @param options - optional gas and fee overrides
|
|
111
111
|
*/
|
|
112
|
-
createAndAssociateCollectionWithBucket(bucketId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
112
|
+
createAndAssociateCollectionWithBucket(bucketId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
113
113
|
/**
|
|
114
114
|
* Delete an empty bucket.
|
|
115
115
|
* @param bucketId - 32-byte bucket ID
|
|
116
116
|
* @param options - optional gas and fee overrides
|
|
117
117
|
*/
|
|
118
|
-
deleteBucket(bucketId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
118
|
+
deleteBucket(bucketId: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
119
119
|
/**
|
|
120
120
|
* Issue a storage request for a file.
|
|
121
121
|
* @param bucketId - 32-byte bucket ID
|
|
@@ -128,13 +128,13 @@ export declare class StorageHubClient {
|
|
|
128
128
|
* @param replicas - number of replicas (only required for ReplicationLevel.Custom)
|
|
129
129
|
* @param options - optional gas and fee overrides
|
|
130
130
|
*/
|
|
131
|
-
issueStorageRequest(bucketId: `0x${string}`, location: string, fingerprint: `0x${string}`, size: bigint, mspId: `0x${string}`, peerIds: string[], replicationLevel: ReplicationLevel, replicas: number, options?: EvmWriteOptions): Promise<`0x${string}
|
|
131
|
+
issueStorageRequest(bucketId: `0x${string}`, location: string, fingerprint: `0x${string}`, size: bigint, mspId: `0x${string}`, peerIds: string[], replicationLevel: ReplicationLevel, replicas: number, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
132
132
|
/**
|
|
133
133
|
* Revoke a pending storage request by file key.
|
|
134
134
|
* @param fileKey - 32-byte file key
|
|
135
135
|
* @param options - optional gas and fee overrides
|
|
136
136
|
*/
|
|
137
|
-
revokeStorageRequest(fileKey: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
137
|
+
revokeStorageRequest(fileKey: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
138
138
|
/**
|
|
139
139
|
* Request deletion of a file using a signed intention.
|
|
140
140
|
* @param signedIntention - tuple [fileKey: 0x32, operation: number] where operation must be 0 (Delete)
|
|
@@ -145,5 +145,5 @@ export declare class StorageHubClient {
|
|
|
145
145
|
* @param fingerprint - 32-byte file fingerprint
|
|
146
146
|
* @param options - optional gas and fee overrides
|
|
147
147
|
*/
|
|
148
|
-
requestDeleteFile(signedIntention: readonly [`0x${string}`, number], signature: Uint8Array, bucketId: `0x${string}`, location: string, size: bigint, fingerprint: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}
|
|
148
|
+
requestDeleteFile(signedIntention: readonly [`0x${string}`, number], signature: Uint8Array, bucketId: `0x${string}`, location: string, size: bigint, fingerprint: `0x${string}`, options?: EvmWriteOptions): Promise<`0x${string}` | undefined>;
|
|
149
149
|
}
|
package/dist/evm/types.d.ts
CHANGED
package/dist/file-manager.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class HttpClient {
|
|
|
26
26
|
private readonly defaultHeaders;
|
|
27
27
|
private readonly fetchImpl;
|
|
28
28
|
constructor(options: HttpClientConfig);
|
|
29
|
-
request<T>(method:
|
|
29
|
+
request<T>(method: "GET" | "POST" | "PUT" | "DELETE", path: string, options?: RequestOptions): Promise<T | Response>;
|
|
30
30
|
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
31
31
|
post<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
32
32
|
put<T>(path: string, options?: RequestOptions): Promise<T>;
|