@storagehub/api-augment 0.2.1 → 0.2.2

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.2",
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.2"
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
  /**
@@ -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
  **/
@@ -1404,6 +1404,7 @@ import type {
1404
1404
  ProviderId,
1405
1405
  QueryAvailableStorageCapacityError,
1406
1406
  QueryBspConfirmChunksToProveForFileError,
1407
+ QueryBspsVolunteeredForFileError,
1407
1408
  QueryBucketsForMspError,
1408
1409
  QueryBucketsOfUserStoredByMspError,
1409
1410
  QueryConfirmChunksToProveForFileError,
@@ -2325,6 +2326,7 @@ declare module "@polkadot/types/types/registry" {
2325
2326
  PvfPrepTimeoutKind: PvfPrepTimeoutKind;
2326
2327
  QueryAvailableStorageCapacityError: QueryAvailableStorageCapacityError;
2327
2328
  QueryBspConfirmChunksToProveForFileError: QueryBspConfirmChunksToProveForFileError;
2329
+ QueryBspsVolunteeredForFileError: QueryBspsVolunteeredForFileError;
2328
2330
  QueryBucketsForMspError: QueryBucketsForMspError;
2329
2331
  QueryBucketsOfUserStoredByMspError: QueryBucketsOfUserStoredByMspError;
2330
2332
  QueryConfirmChunksToProveForFileError: QueryConfirmChunksToProveForFileError;
@@ -218,6 +218,13 @@ export interface QueryBspConfirmChunksToProveForFileError extends Enum {
218
218
  readonly type: "StorageRequestNotFound" | "ConfirmChunks" | "InternalError";
219
219
  }
220
220
 
221
+ /** @name QueryBspsVolunteeredForFileError */
222
+ export interface QueryBspsVolunteeredForFileError extends Enum {
223
+ readonly isStorageRequestNotFound: boolean;
224
+ readonly isInternalError: boolean;
225
+ readonly type: "StorageRequestNotFound" | "InternalError";
226
+ }
227
+
221
228
  /** @name QueryBucketsForMspError */
222
229
  export interface QueryBucketsForMspError extends Enum {
223
230
  readonly isProviderNotRegistered: 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
  /**
@@ -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
  **/
@@ -1404,6 +1404,7 @@ import type {
1404
1404
  ProviderId,
1405
1405
  QueryAvailableStorageCapacityError,
1406
1406
  QueryBspConfirmChunksToProveForFileError,
1407
+ QueryBspsVolunteeredForFileError,
1407
1408
  QueryBucketsForMspError,
1408
1409
  QueryBucketsOfUserStoredByMspError,
1409
1410
  QueryConfirmChunksToProveForFileError,
@@ -2325,6 +2326,7 @@ declare module "@polkadot/types/types/registry" {
2325
2326
  PvfPrepTimeoutKind: PvfPrepTimeoutKind;
2326
2327
  QueryAvailableStorageCapacityError: QueryAvailableStorageCapacityError;
2327
2328
  QueryBspConfirmChunksToProveForFileError: QueryBspConfirmChunksToProveForFileError;
2329
+ QueryBspsVolunteeredForFileError: QueryBspsVolunteeredForFileError;
2328
2330
  QueryBucketsForMspError: QueryBucketsForMspError;
2329
2331
  QueryBucketsOfUserStoredByMspError: QueryBucketsOfUserStoredByMspError;
2330
2332
  QueryConfirmChunksToProveForFileError: QueryConfirmChunksToProveForFileError;
@@ -228,6 +228,13 @@ export interface QueryBspConfirmChunksToProveForFileError extends Enum {
228
228
  readonly type: "StorageRequestNotFound" | "ConfirmChunks" | "InternalError";
229
229
  }
230
230
 
231
+ /** @name QueryBspsVolunteeredForFileError */
232
+ export interface QueryBspsVolunteeredForFileError extends Enum {
233
+ readonly isStorageRequestNotFound: boolean;
234
+ readonly isInternalError: boolean;
235
+ readonly type: "StorageRequestNotFound" | "InternalError";
236
+ }
237
+
231
238
  /** @name QueryBucketsForMspError */
232
239
  export interface QueryBucketsForMspError extends Enum {
233
240
  readonly isProviderNotRegistered: boolean;