@storagehub/api-augment 0.2.6 → 0.2.7

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.
Files changed (35) hide show
  1. package/dist/parachain/interfaces/lookup.js +245 -239
  2. package/dist/parachain/interfaces/lookup.js.map +1 -1
  3. package/dist/solochain-evm/interfaces/lookup.js +195 -189
  4. package/dist/solochain-evm/interfaces/lookup.js.map +1 -1
  5. package/dist/types/parachain/interfaces/augment-api-consts.d.ts +4 -0
  6. package/dist/types/parachain/interfaces/augment-api-errors.d.ts +24 -0
  7. package/dist/types/parachain/interfaces/augment-api-events.d.ts +10 -24
  8. package/dist/types/parachain/interfaces/augment-api-tx.d.ts +27 -29
  9. package/dist/types/parachain/interfaces/lookup.d.ts +239 -239
  10. package/dist/types/parachain/interfaces/registry.d.ts +2 -1
  11. package/dist/types/parachain/interfaces/types-lookup.d.ts +247 -244
  12. package/dist/types/solochain-evm/interfaces/augment-api-consts.d.ts +4 -0
  13. package/dist/types/solochain-evm/interfaces/augment-api-errors.d.ts +24 -0
  14. package/dist/types/solochain-evm/interfaces/augment-api-events.d.ts +10 -24
  15. package/dist/types/solochain-evm/interfaces/augment-api-tx.d.ts +27 -23
  16. package/dist/types/solochain-evm/interfaces/lookup.d.ts +189 -189
  17. package/dist/types/solochain-evm/interfaces/registry.d.ts +2 -1
  18. package/dist/types/solochain-evm/interfaces/types-lookup.d.ts +197 -194
  19. package/metadata-sh-parachain.json +1 -1
  20. package/metadata-sh-solochain-evm.json +1 -1
  21. package/package.json +1 -1
  22. package/src/parachain/interfaces/augment-api-consts.ts +4 -0
  23. package/src/parachain/interfaces/augment-api-errors.ts +24 -0
  24. package/src/parachain/interfaces/augment-api-events.ts +8 -32
  25. package/src/parachain/interfaces/augment-api-tx.ts +36 -41
  26. package/src/parachain/interfaces/lookup.ts +245 -239
  27. package/src/parachain/interfaces/registry.ts +2 -0
  28. package/src/parachain/interfaces/types-lookup.ts +255 -246
  29. package/src/solochain-evm/interfaces/augment-api-consts.ts +4 -0
  30. package/src/solochain-evm/interfaces/augment-api-errors.ts +24 -0
  31. package/src/solochain-evm/interfaces/augment-api-events.ts +8 -32
  32. package/src/solochain-evm/interfaces/augment-api-tx.ts +36 -35
  33. package/src/solochain-evm/interfaces/lookup.ts +195 -189
  34. package/src/solochain-evm/interfaces/registry.ts +2 -0
  35. package/src/solochain-evm/interfaces/types-lookup.ts +205 -196
@@ -132,6 +132,10 @@ declare module "@polkadot/api-base/types/consts" {
132
132
  * Maximum number of expired items (per type) to clean up in a single tick.
133
133
  **/
134
134
  maxExpiredItemsInTick: u32 & AugmentedConst<ApiType>;
135
+ /**
136
+ * Maximum number of file deletions that can be processed in a single extrinsic call for `delete_files` and `delete_files_for_incomplete_storage_request`.
137
+ **/
138
+ maxFileDeletionsPerExtrinsic: u32 & AugmentedConst<ApiType>;
135
139
  /**
136
140
  * Maximum byte size of a file path.
137
141
  **/
@@ -186,6 +186,10 @@ declare module "@polkadot/api-base/types/errors" {
186
186
  * BSP did not succeed threshold check.
187
187
  **/
188
188
  AboveThreshold: AugmentedError<ApiType>;
189
+ /**
190
+ * Batch file deletion must contain files from a single bucket only.
191
+ **/
192
+ BatchFileDeletionMustContainSingleBucket: AugmentedError<ApiType>;
189
193
  /**
190
194
  * BSP has already confirmed storing the given file.
191
195
  **/
@@ -242,6 +246,10 @@ declare module "@polkadot/api-base/types/errors" {
242
246
  * Divided by 0
243
247
  **/
244
248
  DividedByZero: AugmentedError<ApiType>;
249
+ /**
250
+ * Duplicate file key detected within the same batch deletion request.
251
+ **/
252
+ DuplicateFileKeyInBatchFileDeletion: AugmentedError<ApiType>;
245
253
  /**
246
254
  * Failed to fetch the dynamic-rate payment stream.
247
255
  **/
@@ -282,6 +290,18 @@ declare module "@polkadot/api-base/types/errors" {
282
290
  * Failed to get the payment account of the provider.
283
291
  **/
284
292
  FailedToGetPaymentAccount: AugmentedError<ApiType>;
293
+ /**
294
+ * Failed to push file key to bounded vector during BSP file deletion
295
+ **/
296
+ FailedToPushFileKeyToBspDeletionVector: AugmentedError<ApiType>;
297
+ /**
298
+ * Failed to push file key to bounded vector during bucket file deletion
299
+ **/
300
+ FailedToPushFileKeyToBucketDeletionVector: AugmentedError<ApiType>;
301
+ /**
302
+ * Failed to push user to bounded vector during BSP file deletion
303
+ **/
304
+ FailedToPushUserToBspDeletionVector: AugmentedError<ApiType>;
285
305
  /**
286
306
  * Failed to query earliest volunteer tick
287
307
  **/
@@ -399,6 +419,10 @@ declare module "@polkadot/api-base/types/errors" {
399
419
  * No file keys to confirm storing
400
420
  **/
401
421
  NoFileKeysToConfirm: AugmentedError<ApiType>;
422
+ /**
423
+ * Requires at least 1 file key to be deleted.
424
+ **/
425
+ NoFileKeysToDelete: AugmentedError<ApiType>;
402
426
  /**
403
427
  * No global reputation weight set.
404
428
  **/
@@ -377,26 +377,12 @@ declare module "@polkadot/api-base/types/events" {
377
377
  { bspId: H256; fileKey: H256; newRoot: H256 }
378
378
  >;
379
379
  /**
380
- * Notifies that a file deletion has been completed successfully for a BSP.
380
+ * Notifies that file deletions have been completed successfully for a BSP.
381
381
  **/
382
- BspFileDeletionCompleted: AugmentedEvent<
382
+ BspFileDeletionsCompleted: AugmentedEvent<
383
383
  ApiType,
384
- [
385
- user: AccountId20,
386
- fileKey: H256,
387
- fileSize: u64,
388
- bspId: H256,
389
- oldRoot: H256,
390
- newRoot: H256
391
- ],
392
- {
393
- user: AccountId20;
394
- fileKey: H256;
395
- fileSize: u64;
396
- bspId: H256;
397
- oldRoot: H256;
398
- newRoot: H256;
399
- }
384
+ [users: Vec<AccountId20>, fileKeys: Vec<H256>, bspId: H256, oldRoot: H256, newRoot: H256],
385
+ { users: Vec<AccountId20>; fileKeys: Vec<H256>; bspId: H256; oldRoot: H256; newRoot: H256 }
400
386
  >;
401
387
  BspRequestedToStopStoring: AugmentedEvent<
402
388
  ApiType,
@@ -412,14 +398,13 @@ declare module "@polkadot/api-base/types/events" {
412
398
  { who: AccountId20; bucketId: H256; maybeCollectionId: Option<u32> }
413
399
  >;
414
400
  /**
415
- * Notifies that a file deletion has been completed successfully for a Bucket.
401
+ * Notifies that file deletions have been completed successfully for a Bucket.
416
402
  **/
417
- BucketFileDeletionCompleted: AugmentedEvent<
403
+ BucketFileDeletionsCompleted: AugmentedEvent<
418
404
  ApiType,
419
405
  [
420
406
  user: AccountId20,
421
- fileKey: H256,
422
- fileSize: u64,
407
+ fileKeys: Vec<H256>,
423
408
  bucketId: H256,
424
409
  mspId: Option<H256>,
425
410
  oldRoot: H256,
@@ -427,8 +412,7 @@ declare module "@polkadot/api-base/types/events" {
427
412
  ],
428
413
  {
429
414
  user: AccountId20;
430
- fileKey: H256;
431
- fileSize: u64;
415
+ fileKeys: Vec<H256>;
432
416
  bucketId: H256;
433
417
  mspId: Option<H256>;
434
418
  oldRoot: H256;
@@ -512,14 +496,6 @@ declare module "@polkadot/api-base/types/events" {
512
496
  error: SpRuntimeDispatchError;
513
497
  }
514
498
  >;
515
- /**
516
- * Notifies that a file has been deleted from a rejected storage request.
517
- **/
518
- FileDeletedFromIncompleteStorageRequest: AugmentedEvent<
519
- ApiType,
520
- [fileKey: H256, bspId: Option<H256>],
521
- { fileKey: H256; bspId: Option<H256> }
522
- >;
523
499
  /**
524
500
  * Notifies that a file will be deleted.
525
501
  **/
@@ -29,6 +29,7 @@ import type {
29
29
  FpAccountEthereumSignature,
30
30
  PalletBalancesAdjustmentDirection,
31
31
  PalletFileSystemBucketMoveRequestResponse,
32
+ PalletFileSystemFileDeletionRequest,
32
33
  PalletFileSystemFileKeyWithProof,
33
34
  PalletFileSystemFileOperationIntention,
34
35
  PalletFileSystemReplicationTarget,
@@ -528,57 +529,57 @@ declare module "@polkadot/api-base/types/submittable" {
528
529
  [H256]
529
530
  >;
530
531
  /**
531
- * Deletes a file from a provider's forest, changing its root
532
+ * Deletes files from a provider's forest, changing its root
532
533
  *
533
534
  * This extrinsic allows any actor to execute file deletion based on signed intentions
534
- * from the `FileDeletionRequested` event. It requires a valid forest proof showing that the
535
- * file exists in the specified provider's forest before allowing deletion.
535
+ * from the `FileDeletionRequested` event. It requires a valid forest proof showing that
536
+ * all files exist in the specified provider's forest before allowing deletion.
536
537
  *
537
- * If `bsp_id` is `None`, the file will be deleted from the bucket forest.
538
- * If `bsp_id` is `Some(id)`, the file will be deleted from the specified BSP's forest.
538
+ * Multiple files can be deleted in a single call using one forest proof bounded by [`MaxFileDeletionsPerExtrinsic`](Config::MaxFileDeletionsPerExtrinsic).
539
+ *
540
+ * If `bsp_id` is `None`, files will be deleted from the bucket forest.
541
+ * If `bsp_id` is `Some(id)`, files will be deleted from the specified BSP's forest.
539
542
  **/
540
- deleteFile: AugmentedSubmittable<
543
+ deleteFiles: AugmentedSubmittable<
541
544
  (
542
- fileOwner: AccountId20 | string | Uint8Array,
543
- signedIntention:
544
- | PalletFileSystemFileOperationIntention
545
- | { fileKey?: any; operation?: any }
546
- | string
547
- | Uint8Array,
548
- signature: FpAccountEthereumSignature | string | Uint8Array,
549
- bucketId: H256 | string | Uint8Array,
550
- location: Bytes | string | Uint8Array,
551
- size: u64 | AnyNumber | Uint8Array,
552
- fingerprint: H256 | string | Uint8Array,
545
+ fileDeletions:
546
+ | Vec<PalletFileSystemFileDeletionRequest>
547
+ | (
548
+ | PalletFileSystemFileDeletionRequest
549
+ | {
550
+ fileOwner?: any;
551
+ signedIntention?: any;
552
+ signature?: any;
553
+ bucketId?: any;
554
+ location?: any;
555
+ size_?: any;
556
+ fingerprint?: any;
557
+ }
558
+ | string
559
+ | Uint8Array
560
+ )[],
553
561
  bspId: Option<H256> | null | Uint8Array | H256 | string,
554
562
  forestProof: SpTrieStorageProofCompactProof | { encodedNodes?: any } | string | Uint8Array
555
563
  ) => SubmittableExtrinsic<ApiType>,
556
- [
557
- AccountId20,
558
- PalletFileSystemFileOperationIntention,
559
- FpAccountEthereumSignature,
560
- H256,
561
- Bytes,
562
- u64,
563
- H256,
564
- Option<H256>,
565
- SpTrieStorageProofCompactProof
566
- ]
564
+ [Vec<PalletFileSystemFileDeletionRequest>, Option<H256>, SpTrieStorageProofCompactProof]
567
565
  >;
568
566
  /**
569
- * Delete a file from an incomplete (rejected, expired or revoked) storage request.
567
+ * Delete files from an incomplete (rejected, expired or revoked) storage request.
570
568
  *
571
- * This extrinsic allows fisherman nodes to delete files from providers when an IncompleteStorageRequestMetadata for the given file_key
572
- * exist in the IncompleteStorageRequests mapping. It validates that the IncompleteStorageRequestMetadata exists,
573
- * that the provider has the file in its Merkle Patricia Forest, and verifies the file key matches the metadata.
569
+ * This extrinsic allows fisherman nodes to delete files from providers when IncompleteStorageRequestMetadata
570
+ * for the given file keys exist in the IncompleteStorageRequests mapping. It validates that the metadata exists
571
+ * for each file, that the provider has the files in its Merkle Patricia Forest, and verifies the file keys match
572
+ * the metadata.
573
+ *
574
+ * Multiple files can be deleted in a single call using one forest proof bounded by [`MaxFileDeletionsPerExtrinsic`](Config::MaxFileDeletionsPerExtrinsic).
574
575
  **/
575
- deleteFileForIncompleteStorageRequest: AugmentedSubmittable<
576
+ deleteFilesForIncompleteStorageRequest: AugmentedSubmittable<
576
577
  (
577
- fileKey: H256 | string | Uint8Array,
578
+ fileKeys: Vec<H256> | (H256 | string | Uint8Array)[],
578
579
  bspId: Option<H256> | null | Uint8Array | H256 | string,
579
580
  forestProof: SpTrieStorageProofCompactProof | { encodedNodes?: any } | string | Uint8Array
580
581
  ) => SubmittableExtrinsic<ApiType>,
581
- [H256, Option<H256>, SpTrieStorageProofCompactProof]
582
+ [Vec<H256>, Option<H256>, SpTrieStorageProofCompactProof]
582
583
  >;
583
584
  /**
584
585
  * Issue a new storage request for a file