@storagehub/api-augment 0.2.1 → 0.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storagehub/api-augment",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -34,7 +34,7 @@
34
34
  "@polkadot/types-codec": "^16.4.7",
35
35
  "tsx": "4.20.5",
36
36
  "typescript": "^5.9.2",
37
- "@storagehub/types-bundle": "0.2.1"
37
+ "@storagehub/types-bundle": "0.2.3"
38
38
  },
39
39
  "scripts": {
40
40
  "scrape": "pnpm tsx scripts/scrapeMetadata.ts",
@@ -799,8 +799,8 @@ declare module "@polkadot/api-base/types/events" {
799
799
  /**
800
800
  * Notifies that a storage request has either been directly rejected by the MSP or
801
801
  * the MSP did not respond to the storage request in time.
802
- * Note: There might be BSPs that have volunteered and confirmed the file already, for
803
- * which a priority challenge to delete the file will be issued.
802
+ * Note: the storage request will be marked as "incomplete", and it is expected that fisherman
803
+ * nodes will pick it up and delete the file from the confirmed BSPs as well as the Bucket.
804
804
  **/
805
805
  StorageRequestRejected: AugmentedEvent<
806
806
  ApiType,
@@ -809,8 +809,8 @@ declare module "@polkadot/api-base/types/events" {
809
809
  >;
810
810
  /**
811
811
  * Notifies that a storage request has been revoked by the user who initiated it.
812
- * Note: the BSPs who confirmed the file are also issued a priority challenge to delete the
813
- * file.
812
+ * Note: the storage request will be marked as "incomplete", and it is expected that fisherman
813
+ * nodes will pick it up and delete the file from the confirmed BSPs as well as the Bucket.
814
814
  **/
815
815
  StorageRequestRevoked: AugmentedEvent<ApiType, [fileKey: H256], { fileKey: H256 }>;
816
816
  /**
@@ -101,8 +101,10 @@ import type {
101
101
  CheckpointChallenge,
102
102
  FileMetadata,
103
103
  GetFileFromFileStorageResult,
104
+ GetValuePropositionsResult,
104
105
  LoadFileInStorageResult,
105
106
  RemoveFilesFromForestStorageResult,
107
+ RpcProviderId,
106
108
  SaveFileToDisk
107
109
  } from "@storagehub/api-augment/parachain/interfaces/storagehubclient";
108
110
 
@@ -1128,6 +1130,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" {
1128
1130
  getForestRoot: AugmentedRpc<
1129
1131
  (forest_key: Option<H256> | null | Uint8Array | H256 | string) => Observable<Option<H256>>
1130
1132
  >;
1133
+ /**
1134
+ * Get the provider ID of the current node, if any.
1135
+ **/
1136
+ getProviderId: AugmentedRpc<() => Observable<RpcProviderId>>;
1137
+ /**
1138
+ * Get the value propositions of the node if it's an MSP; otherwise a NotAnMsp/Error enum.
1139
+ **/
1140
+ getValuePropositions: AugmentedRpc<() => Observable<GetValuePropositionsResult>>;
1131
1141
  /**
1132
1142
  * Generate and insert new keys of type BCSV into the keystore.
1133
1143
  **/
@@ -82,6 +82,7 @@ import type {
82
82
  ProviderId,
83
83
  QueryAvailableStorageCapacityError,
84
84
  QueryBspConfirmChunksToProveForFileError,
85
+ QueryBspsVolunteeredForFileError,
85
86
  QueryBucketsForMspError,
86
87
  QueryBucketsOfUserStoredByMspError,
87
88
  QueryEarliestChangeCapacityBlockError,
@@ -339,6 +340,15 @@ declare module "@polkadot/api-base/types/calls" {
339
340
  fileKey: H256 | string | Uint8Array
340
341
  ) => Observable<Result<Vec<ChunkId>, QueryBspConfirmChunksToProveForFileError>>
341
342
  >;
343
+ /**
344
+ * Query the BSPs that volunteered for a file.
345
+ **/
346
+ queryBspsVolunteeredForFile: AugmentedCall<
347
+ ApiType,
348
+ (
349
+ fileKey: H256 | string | Uint8Array
350
+ ) => Observable<Result<Vec<BackupStorageProviderId>, QueryBspsVolunteeredForFileError>>
351
+ >;
342
352
  /**
343
353
  * Query the earliest tick number that a BSP can volunteer for a file.
344
354
  **/
@@ -373,6 +383,15 @@ declare module "@polkadot/api-base/types/calls" {
373
383
  fileKey: H256 | string | Uint8Array
374
384
  ) => Observable<Result<Vec<ChunkId>, QueryMspConfirmChunksToProveForFileError>>
375
385
  >;
386
+ /**
387
+ * Get the storage requests for a given MSP.
388
+ **/
389
+ storageRequestsByMsp: AugmentedCall<
390
+ ApiType,
391
+ (
392
+ mspId: MainStorageProviderId | string | Uint8Array
393
+ ) => Observable<BTreeMap<H256, StorageRequestMetadata>>
394
+ >;
376
395
  /**
377
396
  * Generic call
378
397
  **/
@@ -1394,6 +1394,7 @@ import type {
1394
1394
  GetProofSubmissionRecordError,
1395
1395
  GetStakeError,
1396
1396
  GetUsersWithDebtOverThresholdError,
1397
+ GetValuePropositionsResult,
1397
1398
  IncompleteFileStatus,
1398
1399
  IncompleteStorageRequestMetadataResponse,
1399
1400
  IsStorageRequestOpenToVolunteersError,
@@ -1404,6 +1405,7 @@ import type {
1404
1405
  ProviderId,
1405
1406
  QueryAvailableStorageCapacityError,
1406
1407
  QueryBspConfirmChunksToProveForFileError,
1408
+ QueryBspsVolunteeredForFileError,
1407
1409
  QueryBucketsForMspError,
1408
1410
  QueryBucketsOfUserStoredByMspError,
1409
1411
  QueryConfirmChunksToProveForFileError,
@@ -1417,6 +1419,7 @@ import type {
1417
1419
  RandomnessOutput,
1418
1420
  RemoveFilesFromForestStorageResult,
1419
1421
  ReputationWeightType,
1422
+ RpcProviderId,
1420
1423
  SaveFileToDisk,
1421
1424
  ShouldRemoveFile,
1422
1425
  StorageDataUnit,
@@ -1937,6 +1940,7 @@ declare module "@polkadot/types/types/registry" {
1937
1940
  GetProofSubmissionRecordError: GetProofSubmissionRecordError;
1938
1941
  GetStakeError: GetStakeError;
1939
1942
  GetUsersWithDebtOverThresholdError: GetUsersWithDebtOverThresholdError;
1943
+ GetValuePropositionsResult: GetValuePropositionsResult;
1940
1944
  GiltBid: GiltBid;
1941
1945
  GlobalValidationData: GlobalValidationData;
1942
1946
  GlobalValidationSchedule: GlobalValidationSchedule;
@@ -2325,6 +2329,7 @@ declare module "@polkadot/types/types/registry" {
2325
2329
  PvfPrepTimeoutKind: PvfPrepTimeoutKind;
2326
2330
  QueryAvailableStorageCapacityError: QueryAvailableStorageCapacityError;
2327
2331
  QueryBspConfirmChunksToProveForFileError: QueryBspConfirmChunksToProveForFileError;
2332
+ QueryBspsVolunteeredForFileError: QueryBspsVolunteeredForFileError;
2328
2333
  QueryBucketsForMspError: QueryBucketsForMspError;
2329
2334
  QueryBucketsOfUserStoredByMspError: QueryBucketsOfUserStoredByMspError;
2330
2335
  QueryConfirmChunksToProveForFileError: QueryConfirmChunksToProveForFileError;
@@ -2410,6 +2415,7 @@ declare module "@polkadot/types/types/registry" {
2410
2415
  RoundSnapshot: RoundSnapshot;
2411
2416
  RoundState: RoundState;
2412
2417
  RpcMethods: RpcMethods;
2418
+ RpcProviderId: RpcProviderId;
2413
2419
  RuntimeApiMetadataLatest: RuntimeApiMetadataLatest;
2414
2420
  RuntimeApiMetadataV15: RuntimeApiMetadataV15;
2415
2421
  RuntimeApiMetadataV16: RuntimeApiMetadataV16;
@@ -156,6 +156,14 @@ export interface GetUsersWithDebtOverThresholdError extends Enum {
156
156
  | "InternalApiError";
157
157
  }
158
158
 
159
+ /** @name GetValuePropositionsResult */
160
+ export interface GetValuePropositionsResult extends Enum {
161
+ readonly isSuccess: boolean;
162
+ readonly asSuccess: Vec<Bytes>;
163
+ readonly isNotAnMsp: boolean;
164
+ readonly type: "Success" | "NotAnMsp";
165
+ }
166
+
159
167
  /** @name IncompleteFileStatus */
160
168
  export interface IncompleteFileStatus extends Struct {
161
169
  readonly file_metadata: FileMetadata;
@@ -218,6 +226,13 @@ export interface QueryBspConfirmChunksToProveForFileError extends Enum {
218
226
  readonly type: "StorageRequestNotFound" | "ConfirmChunks" | "InternalError";
219
227
  }
220
228
 
229
+ /** @name QueryBspsVolunteeredForFileError */
230
+ export interface QueryBspsVolunteeredForFileError extends Enum {
231
+ readonly isStorageRequestNotFound: boolean;
232
+ readonly isInternalError: boolean;
233
+ readonly type: "StorageRequestNotFound" | "InternalError";
234
+ }
235
+
221
236
  /** @name QueryBucketsForMspError */
222
237
  export interface QueryBucketsForMspError extends Enum {
223
238
  readonly isProviderNotRegistered: boolean;
@@ -315,6 +330,16 @@ export interface RemoveFilesFromForestStorageResult extends Enum {
315
330
  /** @name ReputationWeightType */
316
331
  export interface ReputationWeightType extends u32 {}
317
332
 
333
+ /** @name RpcProviderId */
334
+ export interface RpcProviderId extends Enum {
335
+ readonly isNotAProvider: boolean;
336
+ readonly isBsp: boolean;
337
+ readonly asBsp: H256;
338
+ readonly isMsp: boolean;
339
+ readonly asMsp: H256;
340
+ readonly type: "NotAProvider" | "Bsp" | "Msp";
341
+ }
342
+
318
343
  /** @name SaveFileToDisk */
319
344
  export interface SaveFileToDisk extends Enum {
320
345
  readonly isFileNotFound: boolean;
@@ -738,8 +738,8 @@ declare module "@polkadot/api-base/types/events" {
738
738
  /**
739
739
  * Notifies that a storage request has either been directly rejected by the MSP or
740
740
  * the MSP did not respond to the storage request in time.
741
- * Note: There might be BSPs that have volunteered and confirmed the file already, for
742
- * which a priority challenge to delete the file will be issued.
741
+ * Note: the storage request will be marked as "incomplete", and it is expected that fisherman
742
+ * nodes will pick it up and delete the file from the confirmed BSPs as well as the Bucket.
743
743
  **/
744
744
  StorageRequestRejected: AugmentedEvent<
745
745
  ApiType,
@@ -748,8 +748,8 @@ declare module "@polkadot/api-base/types/events" {
748
748
  >;
749
749
  /**
750
750
  * Notifies that a storage request has been revoked by the user who initiated it.
751
- * Note: the BSPs who confirmed the file are also issued a priority challenge to delete the
752
- * file.
751
+ * Note: the storage request will be marked as "incomplete", and it is expected that fisherman
752
+ * nodes will pick it up and delete the file from the confirmed BSPs as well as the Bucket.
753
753
  **/
754
754
  StorageRequestRevoked: AugmentedEvent<ApiType, [fileKey: H256], { fileKey: H256 }>;
755
755
  /**
@@ -101,8 +101,10 @@ import type {
101
101
  CheckpointChallenge,
102
102
  FileMetadata,
103
103
  GetFileFromFileStorageResult,
104
+ GetValuePropositionsResult,
104
105
  LoadFileInStorageResult,
105
106
  RemoveFilesFromForestStorageResult,
107
+ RpcProviderId,
106
108
  SaveFileToDisk
107
109
  } from "@storagehub/api-augment/solochain-evm/interfaces/storagehubclient";
108
110
 
@@ -1128,6 +1130,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" {
1128
1130
  getForestRoot: AugmentedRpc<
1129
1131
  (forest_key: Option<H256> | null | Uint8Array | H256 | string) => Observable<Option<H256>>
1130
1132
  >;
1133
+ /**
1134
+ * Get the provider ID of the current node, if any.
1135
+ **/
1136
+ getProviderId: AugmentedRpc<() => Observable<RpcProviderId>>;
1137
+ /**
1138
+ * Get the value propositions of the node if it's an MSP; otherwise a NotAnMsp/Error enum.
1139
+ **/
1140
+ getValuePropositions: AugmentedRpc<() => Observable<GetValuePropositionsResult>>;
1131
1141
  /**
1132
1142
  * Generate and insert new keys of type BCSV into the keystore.
1133
1143
  **/
@@ -86,6 +86,7 @@ import type {
86
86
  ProviderId,
87
87
  QueryAvailableStorageCapacityError,
88
88
  QueryBspConfirmChunksToProveForFileError,
89
+ QueryBspsVolunteeredForFileError,
89
90
  QueryBucketsForMspError,
90
91
  QueryBucketsOfUserStoredByMspError,
91
92
  QueryEarliestChangeCapacityBlockError,
@@ -433,6 +434,15 @@ declare module "@polkadot/api-base/types/calls" {
433
434
  fileKey: H256 | string | Uint8Array
434
435
  ) => Observable<Result<Vec<ChunkId>, QueryBspConfirmChunksToProveForFileError>>
435
436
  >;
437
+ /**
438
+ * Query the BSPs that volunteered for a file.
439
+ **/
440
+ queryBspsVolunteeredForFile: AugmentedCall<
441
+ ApiType,
442
+ (
443
+ fileKey: H256 | string | Uint8Array
444
+ ) => Observable<Result<Vec<BackupStorageProviderId>, QueryBspsVolunteeredForFileError>>
445
+ >;
436
446
  /**
437
447
  * Query the earliest tick number that a BSP can volunteer for a file.
438
448
  **/
@@ -467,6 +477,15 @@ declare module "@polkadot/api-base/types/calls" {
467
477
  fileKey: H256 | string | Uint8Array
468
478
  ) => Observable<Result<Vec<ChunkId>, QueryMspConfirmChunksToProveForFileError>>
469
479
  >;
480
+ /**
481
+ * Get the storage requests for a given MSP.
482
+ **/
483
+ storageRequestsByMsp: AugmentedCall<
484
+ ApiType,
485
+ (
486
+ mspId: MainStorageProviderId | string | Uint8Array
487
+ ) => Observable<BTreeMap<H256, StorageRequestMetadata>>
488
+ >;
470
489
  /**
471
490
  * Generic call
472
491
  **/
@@ -1394,6 +1394,7 @@ import type {
1394
1394
  GetProofSubmissionRecordError,
1395
1395
  GetStakeError,
1396
1396
  GetUsersWithDebtOverThresholdError,
1397
+ GetValuePropositionsResult,
1397
1398
  IncompleteFileStatus,
1398
1399
  IncompleteStorageRequestMetadataResponse,
1399
1400
  IsStorageRequestOpenToVolunteersError,
@@ -1404,6 +1405,7 @@ import type {
1404
1405
  ProviderId,
1405
1406
  QueryAvailableStorageCapacityError,
1406
1407
  QueryBspConfirmChunksToProveForFileError,
1408
+ QueryBspsVolunteeredForFileError,
1407
1409
  QueryBucketsForMspError,
1408
1410
  QueryBucketsOfUserStoredByMspError,
1409
1411
  QueryConfirmChunksToProveForFileError,
@@ -1417,6 +1419,7 @@ import type {
1417
1419
  RandomnessOutput,
1418
1420
  RemoveFilesFromForestStorageResult,
1419
1421
  ReputationWeightType,
1422
+ RpcProviderId,
1420
1423
  SaveFileToDisk,
1421
1424
  ShouldRemoveFile,
1422
1425
  StorageDataUnit,
@@ -1937,6 +1940,7 @@ declare module "@polkadot/types/types/registry" {
1937
1940
  GetProofSubmissionRecordError: GetProofSubmissionRecordError;
1938
1941
  GetStakeError: GetStakeError;
1939
1942
  GetUsersWithDebtOverThresholdError: GetUsersWithDebtOverThresholdError;
1943
+ GetValuePropositionsResult: GetValuePropositionsResult;
1940
1944
  GiltBid: GiltBid;
1941
1945
  GlobalValidationData: GlobalValidationData;
1942
1946
  GlobalValidationSchedule: GlobalValidationSchedule;
@@ -2325,6 +2329,7 @@ declare module "@polkadot/types/types/registry" {
2325
2329
  PvfPrepTimeoutKind: PvfPrepTimeoutKind;
2326
2330
  QueryAvailableStorageCapacityError: QueryAvailableStorageCapacityError;
2327
2331
  QueryBspConfirmChunksToProveForFileError: QueryBspConfirmChunksToProveForFileError;
2332
+ QueryBspsVolunteeredForFileError: QueryBspsVolunteeredForFileError;
2328
2333
  QueryBucketsForMspError: QueryBucketsForMspError;
2329
2334
  QueryBucketsOfUserStoredByMspError: QueryBucketsOfUserStoredByMspError;
2330
2335
  QueryConfirmChunksToProveForFileError: QueryConfirmChunksToProveForFileError;
@@ -2410,6 +2415,7 @@ declare module "@polkadot/types/types/registry" {
2410
2415
  RoundSnapshot: RoundSnapshot;
2411
2416
  RoundState: RoundState;
2412
2417
  RpcMethods: RpcMethods;
2418
+ RpcProviderId: RpcProviderId;
2413
2419
  RuntimeApiMetadataLatest: RuntimeApiMetadataLatest;
2414
2420
  RuntimeApiMetadataV15: RuntimeApiMetadataV15;
2415
2421
  RuntimeApiMetadataV16: RuntimeApiMetadataV16;
@@ -163,6 +163,14 @@ export interface GetUsersWithDebtOverThresholdError extends Enum {
163
163
  | "InternalApiError";
164
164
  }
165
165
 
166
+ /** @name GetValuePropositionsResult */
167
+ export interface GetValuePropositionsResult extends Enum {
168
+ readonly isSuccess: boolean;
169
+ readonly asSuccess: Vec<Bytes>;
170
+ readonly isNotAnMsp: boolean;
171
+ readonly type: "Success" | "NotAnMsp";
172
+ }
173
+
166
174
  /** @name IncompleteFileStatus */
167
175
  export interface IncompleteFileStatus extends Struct {
168
176
  readonly file_metadata: FileMetadata;
@@ -228,6 +236,13 @@ export interface QueryBspConfirmChunksToProveForFileError extends Enum {
228
236
  readonly type: "StorageRequestNotFound" | "ConfirmChunks" | "InternalError";
229
237
  }
230
238
 
239
+ /** @name QueryBspsVolunteeredForFileError */
240
+ export interface QueryBspsVolunteeredForFileError extends Enum {
241
+ readonly isStorageRequestNotFound: boolean;
242
+ readonly isInternalError: boolean;
243
+ readonly type: "StorageRequestNotFound" | "InternalError";
244
+ }
245
+
231
246
  /** @name QueryBucketsForMspError */
232
247
  export interface QueryBucketsForMspError extends Enum {
233
248
  readonly isProviderNotRegistered: boolean;
@@ -325,6 +340,16 @@ export interface RemoveFilesFromForestStorageResult extends Enum {
325
340
  /** @name ReputationWeightType */
326
341
  export interface ReputationWeightType extends u32 {}
327
342
 
343
+ /** @name RpcProviderId */
344
+ export interface RpcProviderId extends Enum {
345
+ readonly isNotAProvider: boolean;
346
+ readonly isBsp: boolean;
347
+ readonly asBsp: H256;
348
+ readonly isMsp: boolean;
349
+ readonly asMsp: H256;
350
+ readonly type: "NotAProvider" | "Bsp" | "Msp";
351
+ }
352
+
328
353
  /** @name SaveFileToDisk */
329
354
  export interface SaveFileToDisk extends Enum {
330
355
  readonly isFileNotFound: boolean;