@storagehub/types-bundle 0.2.4 → 0.2.6

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.
@@ -2,30 +2,30 @@ import { rpcDefinitions } from "./rpc.js";
2
2
  import { runtime } from "./runtime.js";
3
3
  import { PARACHAIN_TYPES, SOLOCHAIN_EVM_TYPES } from "./types.js";
4
4
  export const shParachainDefinitions = {
5
- rpc: rpcDefinitions,
6
- runtime,
7
- types: [
8
- {
9
- minmax: [0, undefined],
10
- types: PARACHAIN_TYPES
11
- }
12
- ]
5
+ rpc: rpcDefinitions,
6
+ runtime,
7
+ types: [
8
+ {
9
+ minmax: [0, undefined],
10
+ types: PARACHAIN_TYPES
11
+ }
12
+ ]
13
13
  };
14
14
  export const shSolochainEvmDefinitions = {
15
- rpc: rpcDefinitions,
16
- runtime,
17
- types: [
18
- {
19
- minmax: [0, undefined],
20
- types: SOLOCHAIN_EVM_TYPES
21
- }
22
- ]
15
+ rpc: rpcDefinitions,
16
+ runtime,
17
+ types: [
18
+ {
19
+ minmax: [0, undefined],
20
+ types: SOLOCHAIN_EVM_TYPES
21
+ }
22
+ ]
23
23
  };
24
24
  export const types = {
25
- spec: {
26
- "sh-parachain-runtime": shParachainDefinitions,
27
- shParachainDefinitions,
28
- "sh-solochain-evm": shSolochainEvmDefinitions
29
- }
25
+ spec: {
26
+ "sh-parachain-runtime": shParachainDefinitions,
27
+ shParachainDefinitions,
28
+ "sh-solochain-evm": shSolochainEvmDefinitions
29
+ }
30
30
  };
31
- //# sourceMappingURL=definitions.js.map
31
+ //# sourceMappingURL=definitions.js.map
package/dist/rpc.js CHANGED
@@ -1,294 +1,284 @@
1
1
  export const rpcDefinitions = {
2
- storagehubclient: {
3
- loadFileInStorage: {
4
- description:
5
- "Load a file in the local storage. This is the first step when uploading a file.",
6
- params: [
7
- {
8
- name: "file_path",
9
- type: "String"
2
+ storagehubclient: {
3
+ loadFileInStorage: {
4
+ description: "Load a file in the local storage. This is the first step when uploading a file.",
5
+ params: [
6
+ {
7
+ name: "file_path",
8
+ type: "String"
9
+ },
10
+ {
11
+ name: "location",
12
+ type: "String"
13
+ },
14
+ {
15
+ name: "owner_account_id_hex",
16
+ type: "String"
17
+ },
18
+ {
19
+ name: "bucket_id",
20
+ type: "H256"
21
+ }
22
+ ],
23
+ type: "LoadFileInStorageResult"
10
24
  },
11
- {
12
- name: "location",
13
- type: "String"
25
+ removeFilesFromFileStorage: {
26
+ description: "Remove a list of files from the file storage. Useful when doing manual maintenance.",
27
+ params: [
28
+ {
29
+ name: "file_keys",
30
+ type: "Vec<H256>"
31
+ }
32
+ ],
33
+ type: "()"
14
34
  },
15
- {
16
- name: "owner_account_id_hex",
17
- type: "String"
35
+ removeFilesWithPrefixFromFileStorage: {
36
+ description: "Remove all files under a prefix from the file storage. Useful when doing manual maintenance.",
37
+ params: [
38
+ {
39
+ name: "prefix",
40
+ type: "H256"
41
+ }
42
+ ],
43
+ type: "()"
18
44
  },
19
- {
20
- name: "bucket_id",
21
- type: "H256"
22
- }
23
- ],
24
- type: "LoadFileInStorageResult"
25
- },
26
- removeFilesFromFileStorage: {
27
- description:
28
- "Remove a list of files from the file storage. Useful when doing manual maintenance.",
29
- params: [
30
- {
31
- name: "file_keys",
32
- type: "Vec<H256>"
33
- }
34
- ],
35
- type: "()"
36
- },
37
- removeFilesWithPrefixFromFileStorage: {
38
- description:
39
- "Remove all files under a prefix from the file storage. Useful when doing manual maintenance.",
40
- params: [
41
- {
42
- name: "prefix",
43
- type: "H256"
44
- }
45
- ],
46
- type: "()"
47
- },
48
- saveFileToDisk: {
49
- description: "Save a file from the local storage to the disk.",
50
- params: [
51
- {
52
- name: "file_key",
53
- type: "H256"
45
+ saveFileToDisk: {
46
+ description: "Save a file from the local storage to the disk.",
47
+ params: [
48
+ {
49
+ name: "file_key",
50
+ type: "H256"
51
+ },
52
+ {
53
+ name: "file_path",
54
+ type: "String"
55
+ }
56
+ ],
57
+ type: "SaveFileToDisk"
54
58
  },
55
- {
56
- name: "file_path",
57
- type: "String"
58
- }
59
- ],
60
- type: "SaveFileToDisk"
61
- },
62
- addFilesToForestStorage: {
63
- description: "Add files to the forest storage. Useful when doing manual maintenance.",
64
- params: [
65
- {
66
- name: "forest_key",
67
- type: "Option<H256>"
59
+ addFilesToForestStorage: {
60
+ description: "Add files to the forest storage. Useful when doing manual maintenance.",
61
+ params: [
62
+ {
63
+ name: "forest_key",
64
+ type: "Option<H256>"
65
+ },
66
+ {
67
+ name: "metadata_of_files_to_add",
68
+ type: "Vec<FileMetadata>"
69
+ }
70
+ ],
71
+ type: "AddFilesToForestStorageResult"
68
72
  },
69
- {
70
- name: "metadata_of_files_to_add",
71
- type: "Vec<FileMetadata>"
72
- }
73
- ],
74
- type: "AddFilesToForestStorageResult"
75
- },
76
- removeFilesFromForestStorage: {
77
- description: "Remove files from the forest storage. Useful when doing manual maintenance.",
78
- params: [
79
- {
80
- name: "forest_key",
81
- type: "Option<H256>"
73
+ removeFilesFromForestStorage: {
74
+ description: "Remove files from the forest storage. Useful when doing manual maintenance.",
75
+ params: [
76
+ {
77
+ name: "forest_key",
78
+ type: "Option<H256>"
79
+ },
80
+ {
81
+ name: "file_keys",
82
+ type: "Vec<H256>"
83
+ }
84
+ ],
85
+ type: "RemoveFilesFromForestStorageResult"
82
86
  },
83
- {
84
- name: "file_keys",
85
- type: "Vec<H256>"
86
- }
87
- ],
88
- type: "RemoveFilesFromForestStorageResult"
89
- },
90
- getForestRoot: {
91
- description: "Get the root of the forest trie.",
92
- params: [
93
- {
94
- name: "forest_key",
95
- type: "Option<H256>"
96
- }
97
- ],
98
- type: "Option<H256>"
99
- },
100
- isFileInForest: {
101
- description: "Check if a file is in the forest.",
102
- params: [
103
- {
104
- name: "forest_key",
105
- type: "Option<H256>"
87
+ getForestRoot: {
88
+ description: "Get the root of the forest trie.",
89
+ params: [
90
+ {
91
+ name: "forest_key",
92
+ type: "Option<H256>"
93
+ }
94
+ ],
95
+ type: "Option<H256>"
106
96
  },
107
- {
108
- name: "file_key",
109
- type: "H256"
110
- }
111
- ],
112
- type: "bool"
113
- },
114
- isFileInFileStorage: {
115
- description: "Check if a file is in the file storage.",
116
- params: [
117
- {
118
- name: "file_key",
119
- type: "H256"
120
- }
121
- ],
122
- type: "GetFileFromFileStorageResult"
123
- },
124
- getFileMetadata: {
125
- description: "Get the metadata of a file from the Forest storage.",
126
- params: [
127
- {
128
- name: "forest_key",
129
- type: "Option<H256>"
97
+ isFileInForest: {
98
+ description: "Check if a file is in the forest.",
99
+ params: [
100
+ {
101
+ name: "forest_key",
102
+ type: "Option<H256>"
103
+ },
104
+ {
105
+ name: "file_key",
106
+ type: "H256"
107
+ }
108
+ ],
109
+ type: "bool"
130
110
  },
131
- {
132
- name: "file_key",
133
- type: "H256"
134
- }
135
- ],
136
- type: "Option<FileMetadata>"
137
- },
138
- generateForestProof: {
139
- description:
140
- "Generate a SCALE-encoded proof for a group of file keys that might or might not be in the forest.",
141
- params: [
142
- {
143
- name: "forest_key",
144
- type: "Option<H256>"
111
+ isFileInFileStorage: {
112
+ description: "Check if a file is in the file storage.",
113
+ params: [
114
+ {
115
+ name: "file_key",
116
+ type: "H256"
117
+ }
118
+ ],
119
+ type: "GetFileFromFileStorageResult"
145
120
  },
146
- {
147
- name: "challenged_file_keys",
148
- type: "Vec<H256>"
149
- }
150
- ],
151
- type: "Vec<u8>"
152
- },
153
- generateProof: {
154
- description:
155
- "Generate a SCALE-encoded proof for a group of file keys that might or might not be in the forest, alongside their key proofs.",
156
- params: [
157
- {
158
- name: "provider_id",
159
- type: "H256"
121
+ getFileMetadata: {
122
+ description: "Get the metadata of a file from the Forest storage.",
123
+ params: [
124
+ {
125
+ name: "forest_key",
126
+ type: "Option<H256>"
127
+ },
128
+ {
129
+ name: "file_key",
130
+ type: "H256"
131
+ }
132
+ ],
133
+ type: "Option<FileMetadata>"
160
134
  },
161
- {
162
- name: "seed",
163
- type: "H256"
135
+ generateForestProof: {
136
+ description: "Generate a SCALE-encoded proof for a group of file keys that might or might not be in the forest.",
137
+ params: [
138
+ {
139
+ name: "forest_key",
140
+ type: "Option<H256>"
141
+ },
142
+ {
143
+ name: "challenged_file_keys",
144
+ type: "Vec<H256>"
145
+ }
146
+ ],
147
+ type: "Vec<u8>"
164
148
  },
165
- {
166
- name: "checkpoint_challenges",
167
- type: "Option<Vec<CheckpointChallenge>>"
168
- }
169
- ],
170
- type: "Vec<u8>"
171
- },
172
- generateFileKeyProofBspConfirm: {
173
- description:
174
- "Generate a SCALE-encoded proof for a file key to allow a BSP to confirm storing it.",
175
- params: [
176
- {
177
- name: "bsp_id",
178
- type: "H256"
149
+ generateProof: {
150
+ description: "Generate a SCALE-encoded proof for a group of file keys that might or might not be in the forest, alongside their key proofs.",
151
+ params: [
152
+ {
153
+ name: "provider_id",
154
+ type: "H256"
155
+ },
156
+ {
157
+ name: "seed",
158
+ type: "H256"
159
+ },
160
+ {
161
+ name: "checkpoint_challenges",
162
+ type: "Option<Vec<CheckpointChallenge>>"
163
+ }
164
+ ],
165
+ type: "Vec<u8>"
179
166
  },
180
- {
181
- name: "file_key",
182
- type: "H256"
183
- }
184
- ],
185
- type: "Vec<u8>"
186
- },
187
- generateFileKeyProofMspAccept: {
188
- description:
189
- "Generate a SCALE-encoded proof for a file key to allow a MSP to accept storing it.",
190
- params: [
191
- {
192
- name: "msp_id",
193
- type: "H256"
167
+ generateFileKeyProofBspConfirm: {
168
+ description: "Generate a SCALE-encoded proof for a file key to allow a BSP to confirm storing it.",
169
+ params: [
170
+ {
171
+ name: "bsp_id",
172
+ type: "H256"
173
+ },
174
+ {
175
+ name: "file_key",
176
+ type: "H256"
177
+ }
178
+ ],
179
+ type: "Vec<u8>"
194
180
  },
195
- {
196
- name: "file_key",
197
- type: "H256"
198
- }
199
- ],
200
- type: "Vec<u8>"
201
- },
202
- insertBcsvKeys: {
203
- description: "Generate and insert new keys of type BCSV into the keystore.",
204
- params: [
205
- {
206
- name: "seed",
207
- type: "Option<String>"
208
- }
209
- ],
210
- type: "String"
211
- },
212
- removeBcsvKeys: {
213
- description: "Remove keys of BCSV type for the Blockchain Service.",
214
- params: [
215
- {
216
- name: "keystore_path",
217
- type: "String"
218
- }
219
- ],
220
- type: "()"
221
- },
222
- addToExcludeList: {
223
- description:
224
- "Add key to exclude list. Exclude type can be `file`, `user`, `bucket` and `fingerprint`.",
225
- params: [
226
- {
227
- name: "key",
228
- type: "H256"
181
+ generateFileKeyProofMspAccept: {
182
+ description: "Generate a SCALE-encoded proof for a file key to allow a MSP to accept storing it.",
183
+ params: [
184
+ {
185
+ name: "msp_id",
186
+ type: "H256"
187
+ },
188
+ {
189
+ name: "file_key",
190
+ type: "H256"
191
+ }
192
+ ],
193
+ type: "Vec<u8>"
229
194
  },
230
- {
231
- name: "exclude_type",
232
- type: "String"
233
- }
234
- ],
235
- type: "()"
236
- },
237
- removeFromExcludeList: {
238
- description: "Remove key from exclude list",
239
- params: [
240
- {
241
- name: "key",
242
- type: "H256"
195
+ insertBcsvKeys: {
196
+ description: "Generate and insert new keys of type BCSV into the keystore.",
197
+ params: [
198
+ {
199
+ name: "seed",
200
+ type: "Option<String>"
201
+ }
202
+ ],
203
+ type: "String"
243
204
  },
244
- {
245
- name: "exclude_type",
246
- type: "String"
247
- }
248
- ],
249
- type: "()"
250
- },
251
- isFileKeyExpected: {
252
- description: "Check whether this node is currently expecting to receive the given file key",
253
- params: [
254
- {
255
- name: "file_key",
256
- type: "H256"
257
- }
258
- ],
259
- type: "bool"
260
- },
261
- receiveBackendFileChunks: {
262
- description:
263
- "Send a FileKeyProof with one or more chunks to be processed locally by the node",
264
- params: [
265
- {
266
- name: "file_key",
267
- type: "H256"
205
+ removeBcsvKeys: {
206
+ description: "Remove keys of BCSV type for the Blockchain Service.",
207
+ params: [
208
+ {
209
+ name: "keystore_path",
210
+ type: "String"
211
+ }
212
+ ],
213
+ type: "()"
214
+ },
215
+ addToExcludeList: {
216
+ description: "Add key to exclude list. Exclude type can be `file`, `user`, `bucket` and `fingerprint`.",
217
+ params: [
218
+ {
219
+ name: "key",
220
+ type: "H256"
221
+ },
222
+ {
223
+ name: "exclude_type",
224
+ type: "String"
225
+ }
226
+ ],
227
+ type: "()"
228
+ },
229
+ removeFromExcludeList: {
230
+ description: "Remove key from exclude list",
231
+ params: [
232
+ {
233
+ name: "key",
234
+ type: "H256"
235
+ },
236
+ {
237
+ name: "exclude_type",
238
+ type: "String"
239
+ }
240
+ ],
241
+ type: "()"
242
+ },
243
+ isFileKeyExpected: {
244
+ description: "Check whether this node is currently expecting to receive the given file key",
245
+ params: [
246
+ {
247
+ name: "file_key",
248
+ type: "H256"
249
+ }
250
+ ],
251
+ type: "bool"
252
+ },
253
+ receiveBackendFileChunks: {
254
+ description: "Send a FileKeyProof with one or more chunks to be processed locally by the node",
255
+ params: [
256
+ {
257
+ name: "file_key",
258
+ type: "H256"
259
+ },
260
+ {
261
+ name: "file_key_proof",
262
+ type: "Vec<u8>"
263
+ }
264
+ ],
265
+ type: "Vec<u8>"
266
+ },
267
+ getProviderId: {
268
+ description: "Get the provider ID of the current node, if any.",
269
+ params: [],
270
+ type: "RpcProviderId"
271
+ },
272
+ getValuePropositions: {
273
+ description: "Get the value propositions of the node if it's an MSP; otherwise a NotAnMsp/Error enum.",
274
+ params: [],
275
+ type: "GetValuePropositionsResult"
268
276
  },
269
- {
270
- name: "file_key_proof",
271
- type: "Vec<u8>"
277
+ getCurrentPricePerGigaUnitPerTick: {
278
+ description: "Get the current price per giga unit per tick from the payment streams pallet",
279
+ params: [],
280
+ type: "u128"
272
281
  }
273
- ],
274
- type: "Vec<u8>"
275
- },
276
- getProviderId: {
277
- description: "Get the provider ID of the current node, if any.",
278
- params: [],
279
- type: "RpcProviderId"
280
- },
281
- getValuePropositions: {
282
- description:
283
- "Get the value propositions of the node if it's an MSP; otherwise a NotAnMsp/Error enum.",
284
- params: [],
285
- type: "GetValuePropositionsResult"
286
- },
287
- getCurrentPricePerGigaUnitPerTick: {
288
- description: "Get the current price per giga unit per tick from the payment streams pallet",
289
- params: [],
290
- type: "u128"
291
282
  }
292
- }
293
283
  };
294
- //# sourceMappingURL=rpc.js.map
284
+ //# sourceMappingURL=rpc.js.map