@storagehub/api-augment 0.2.11 → 0.2.14

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 (84) hide show
  1. package/dist/parachain/interfaces/augment-api-consts.js +1 -1
  2. package/dist/parachain/interfaces/augment-api-errors.js +1 -1
  3. package/dist/parachain/interfaces/augment-api-events.js +1 -1
  4. package/dist/parachain/interfaces/augment-api-query.js +1 -1
  5. package/dist/parachain/interfaces/augment-api-rpc.js +1 -1
  6. package/dist/parachain/interfaces/augment-api-runtime.js +1 -1
  7. package/dist/parachain/interfaces/augment-api-tx.js +1 -1
  8. package/dist/parachain/interfaces/augment-api.js +7 -7
  9. package/dist/parachain/interfaces/augment-types.js +1 -1
  10. package/dist/parachain/interfaces/index.js +1 -1
  11. package/dist/parachain/interfaces/lookup.js +2406 -2871
  12. package/dist/parachain/interfaces/lookup.js.map +1 -1
  13. package/dist/parachain/interfaces/registry.js +1 -1
  14. package/dist/parachain/interfaces/storagehubclient/index.js +1 -1
  15. package/dist/parachain/interfaces/types-lookup.js +1 -1
  16. package/dist/parachain/interfaces/types.js +1 -1
  17. package/dist/solochain-evm/interfaces/augment-api-consts.js +1 -1
  18. package/dist/solochain-evm/interfaces/augment-api-errors.js +1 -1
  19. package/dist/solochain-evm/interfaces/augment-api-events.js +1 -1
  20. package/dist/solochain-evm/interfaces/augment-api-query.js +1 -1
  21. package/dist/solochain-evm/interfaces/augment-api-rpc.js +1 -1
  22. package/dist/solochain-evm/interfaces/augment-api-runtime.js +1 -1
  23. package/dist/solochain-evm/interfaces/augment-api-tx.js +1 -1
  24. package/dist/solochain-evm/interfaces/augment-api.js +7 -7
  25. package/dist/solochain-evm/interfaces/augment-types.js +1 -1
  26. package/dist/solochain-evm/interfaces/index.js +1 -1
  27. package/dist/solochain-evm/interfaces/lookup.js +1686 -2109
  28. package/dist/solochain-evm/interfaces/lookup.js.map +1 -1
  29. package/dist/solochain-evm/interfaces/registry.js +1 -1
  30. package/dist/solochain-evm/interfaces/storagehubclient/index.js +1 -1
  31. package/dist/solochain-evm/interfaces/types-lookup.js +1 -1
  32. package/dist/solochain-evm/interfaces/types.js +1 -1
  33. package/dist/types/parachain/interfaces/augment-api-consts.d.ts +7 -7
  34. package/dist/types/parachain/interfaces/augment-api-errors.d.ts +3 -111
  35. package/dist/types/parachain/interfaces/augment-api-events.d.ts +185 -917
  36. package/dist/types/parachain/interfaces/augment-api-query.d.ts +112 -319
  37. package/dist/types/parachain/interfaces/augment-api-rpc.d.ts +32 -32
  38. package/dist/types/parachain/interfaces/augment-api-runtime.d.ts +25 -25
  39. package/dist/types/parachain/interfaces/augment-api-tx.d.ts +212 -637
  40. package/dist/types/parachain/interfaces/augment-api.d.ts +7 -7
  41. package/dist/types/parachain/interfaces/augment-types.d.ts +76 -75
  42. package/dist/types/parachain/interfaces/index.d.ts +1 -1
  43. package/dist/types/parachain/interfaces/lookup.d.ts +289 -326
  44. package/dist/types/parachain/interfaces/registry.d.ts +4 -4
  45. package/dist/types/parachain/interfaces/storagehubclient/index.d.ts +1 -1
  46. package/dist/types/parachain/interfaces/storagehubclient/types.d.ts +46 -36
  47. package/dist/types/parachain/interfaces/types-lookup.d.ts +525 -714
  48. package/dist/types/parachain/interfaces/types.d.ts +1 -1
  49. package/dist/types/solochain-evm/interfaces/augment-api-consts.d.ts +7 -7
  50. package/dist/types/solochain-evm/interfaces/augment-api-errors.d.ts +3 -111
  51. package/dist/types/solochain-evm/interfaces/augment-api-events.d.ts +150 -763
  52. package/dist/types/solochain-evm/interfaces/augment-api-query.d.ts +100 -291
  53. package/dist/types/solochain-evm/interfaces/augment-api-rpc.d.ts +32 -32
  54. package/dist/types/solochain-evm/interfaces/augment-api-runtime.d.ts +25 -25
  55. package/dist/types/solochain-evm/interfaces/augment-api-tx.d.ts +195 -582
  56. package/dist/types/solochain-evm/interfaces/augment-api.d.ts +7 -7
  57. package/dist/types/solochain-evm/interfaces/augment-types.d.ts +76 -75
  58. package/dist/types/solochain-evm/interfaces/index.d.ts +1 -1
  59. package/dist/types/solochain-evm/interfaces/lookup.d.ts +239 -276
  60. package/dist/types/solochain-evm/interfaces/registry.d.ts +4 -4
  61. package/dist/types/solochain-evm/interfaces/storagehubclient/index.d.ts +1 -1
  62. package/dist/types/solochain-evm/interfaces/storagehubclient/types.d.ts +47 -37
  63. package/dist/types/solochain-evm/interfaces/types-lookup.d.ts +425 -584
  64. package/dist/types/solochain-evm/interfaces/types.d.ts +1 -1
  65. package/metadata-sh-parachain.json +1 -1
  66. package/metadata-sh-solochain-evm.json +1 -1
  67. package/package.json +2 -2
  68. package/src/parachain/interfaces/augment-api-errors.ts +0 -108
  69. package/src/parachain/interfaces/augment-api-events.ts +14 -113
  70. package/src/parachain/interfaces/augment-api-tx.ts +63 -10
  71. package/src/parachain/interfaces/augment-types.ts +2 -0
  72. package/src/parachain/interfaces/lookup.ts +326 -390
  73. package/src/parachain/interfaces/registry.ts +2 -2
  74. package/src/parachain/interfaces/storagehubclient/types.ts +14 -4
  75. package/src/parachain/interfaces/types-lookup.ts +388 -490
  76. package/src/solochain-evm/interfaces/augment-api-errors.ts +0 -108
  77. package/src/solochain-evm/interfaces/augment-api-events.ts +14 -113
  78. package/src/solochain-evm/interfaces/augment-api-tx.ts +63 -10
  79. package/src/solochain-evm/interfaces/augment-types.ts +2 -0
  80. package/src/solochain-evm/interfaces/lookup.ts +276 -340
  81. package/src/solochain-evm/interfaces/registry.ts +2 -2
  82. package/src/solochain-evm/interfaces/storagehubclient/types.ts +14 -4
  83. package/src/solochain-evm/interfaces/types-lookup.ts +338 -440
  84. package/storagehub-api-augment-0.2.14.tgz +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storagehub/api-augment",
3
- "version": "0.2.11",
3
+ "version": "0.2.14",
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.8"
37
+ "@storagehub/types-bundle": "0.2.9"
38
38
  },
39
39
  "scripts": {
40
40
  "scrape": "pnpm tsx scripts/scrapeMetadata.ts",
@@ -162,10 +162,6 @@ declare module "@polkadot/api-base/types/errors" {
162
162
  [key: string]: AugmentedError<ApiType>;
163
163
  };
164
164
  fileSystem: {
165
- /**
166
- * BSP did not succeed threshold check.
167
- **/
168
- AboveThreshold: AugmentedError<ApiType>;
169
165
  /**
170
166
  * Batch file deletion must contain files from a single bucket only.
171
167
  **/
@@ -174,18 +170,10 @@ declare module "@polkadot/api-base/types/errors" {
174
170
  * BSP has already confirmed storing the given file.
175
171
  **/
176
172
  BspAlreadyConfirmed: AugmentedError<ApiType>;
177
- /**
178
- * BSP is already a data server for the move bucket request.
179
- **/
180
- BspAlreadyDataServer: AugmentedError<ApiType>;
181
173
  /**
182
174
  * BSP already volunteered to store the given file.
183
175
  **/
184
176
  BspAlreadyVolunteered: AugmentedError<ApiType>;
185
- /**
186
- * Too many registered data servers for the move bucket request.
187
- **/
188
- BspDataServersExceeded: AugmentedError<ApiType>;
189
177
  /**
190
178
  * BSP has not confirmed storing the given file.
191
179
  **/
@@ -202,10 +190,6 @@ declare module "@polkadot/api-base/types/errors" {
202
190
  * Action not allowed while the bucket is being moved.
203
191
  **/
204
192
  BucketIsBeingMoved: AugmentedError<ApiType>;
205
- /**
206
- * Bucket is not private. Call `update_bucket_privacy` to make it private.
207
- **/
208
- BucketIsNotPrivate: AugmentedError<ApiType>;
209
193
  /**
210
194
  * Bucket is not empty.
211
195
  **/
@@ -222,10 +206,6 @@ declare module "@polkadot/api-base/types/errors" {
222
206
  * Collection ID was not found.
223
207
  **/
224
208
  CollectionNotFound: AugmentedError<ApiType>;
225
- /**
226
- * Divided by 0
227
- **/
228
- DividedByZero: AugmentedError<ApiType>;
229
209
  /**
230
210
  * Duplicate file key detected within the same batch deletion request.
231
211
  **/
@@ -250,18 +230,6 @@ declare module "@polkadot/api-base/types/errors" {
250
230
  * Failed to create file metadata
251
231
  **/
252
232
  FailedToCreateFileMetadata: AugmentedError<ApiType>;
253
- /**
254
- * Failed to decode threshold.
255
- **/
256
- FailedToDecodeThreshold: AugmentedError<ApiType>;
257
- /**
258
- * Failed to encode BSP id as slice.
259
- **/
260
- FailedToEncodeBsp: AugmentedError<ApiType>;
261
- /**
262
- * Failed to encode fingerprint as slice.
263
- **/
264
- FailedToEncodeFingerprint: AugmentedError<ApiType>;
265
233
  /**
266
234
  * Failed to get owner account of ID of provider
267
235
  **/
@@ -286,10 +254,6 @@ declare module "@polkadot/api-base/types/errors" {
286
254
  * Failed to query earliest volunteer tick
287
255
  **/
288
256
  FailedToQueryEarliestFileVolunteerTick: AugmentedError<ApiType>;
289
- /**
290
- * Failed to convert to primitive type.
291
- **/
292
- FailedTypeConversion: AugmentedError<ApiType>;
293
257
  /**
294
258
  * File has an active storage request and as such is not eligible for deletion.
295
259
  * The user should use the `revoke_storage_request` extrinsic to revoke it first.
@@ -299,18 +263,6 @@ declare module "@polkadot/api-base/types/errors" {
299
263
  * File has an `IncompleteStorageRequest` associated with it and as such is not eligible for a new storage request
300
264
  **/
301
265
  FileHasIncompleteStorageRequest: AugmentedError<ApiType>;
302
- /**
303
- * File key already pending deletion.
304
- **/
305
- FileKeyAlreadyPendingDeletion: AugmentedError<ApiType>;
306
- /**
307
- * File key computed from metadata doesn't match the provided file key.
308
- **/
309
- FileKeyMismatch: AugmentedError<ApiType>;
310
- /**
311
- * File key not found in pending deletion requests.
312
- **/
313
- FileKeyNotPendingDeletion: AugmentedError<ApiType>;
314
266
  /**
315
267
  * The bounded vector that holds file metadata to process it is full but there's still more to process.
316
268
  **/
@@ -323,10 +275,6 @@ declare module "@polkadot/api-base/types/errors" {
323
275
  * Failed to fetch the rate for the payment stream.
324
276
  **/
325
277
  FixedRatePaymentStreamNotFound: AugmentedError<ApiType>;
326
- /**
327
- * Forest proof verification failed.
328
- **/
329
- ForestProofVerificationFailed: AugmentedError<ApiType>;
330
278
  /**
331
279
  * Failed to get value when just checked it existed.
332
280
  **/
@@ -335,10 +283,6 @@ declare module "@polkadot/api-base/types/errors" {
335
283
  * Incomplete storage request not found.
336
284
  **/
337
285
  IncompleteStorageRequestNotFound: AugmentedError<ApiType>;
338
- /**
339
- * Key already exists in mapping when it should not.
340
- **/
341
- InconsistentStateKeyAlreadyExists: AugmentedError<ApiType>;
342
286
  /**
343
287
  * SP does not have enough storage capacity to store the file.
344
288
  **/
@@ -363,23 +307,11 @@ declare module "@polkadot/api-base/types/errors" {
363
307
  * Invalid signed operation provided.
364
308
  **/
365
309
  InvalidSignedOperation: AugmentedError<ApiType>;
366
- /**
367
- * Maximum threshold cannot be zero.
368
- **/
369
- MaximumThresholdCannotBeZero: AugmentedError<ApiType>;
370
- /**
371
- * Max replication target cannot be smaller than default replication target.
372
- **/
373
- MaxReplicationTargetSmallerThanDefault: AugmentedError<ApiType>;
374
310
  /**
375
311
  * Error created in 2024. If you see this, you are well beyond the singularity and should
376
312
  * probably stop using this pallet.
377
313
  **/
378
314
  MaxTickNumberReached: AugmentedError<ApiType>;
379
- /**
380
- * Max number of user pending deletion requests reached.
381
- **/
382
- MaxUserPendingDeletionRequestsReached: AugmentedError<ApiType>;
383
315
  /**
384
316
  * Minimum amount of blocks between the request opening and being able to confirm it not reached.
385
317
  **/
@@ -416,10 +348,6 @@ declare module "@polkadot/api-base/types/errors" {
416
348
  * No global reputation weight set.
417
349
  **/
418
350
  NoGlobalReputationWeightSet: AugmentedError<ApiType>;
419
- /**
420
- * Privacy update results in no change
421
- **/
422
- NoPrivacyChange: AugmentedError<ApiType>;
423
351
  /**
424
352
  * Account is not a BSP.
425
353
  **/
@@ -436,10 +364,6 @@ declare module "@polkadot/api-base/types/errors" {
436
364
  * Operation failed because the account is not the owner of the bucket.
437
365
  **/
438
366
  NotBucketOwner: AugmentedError<ApiType>;
439
- /**
440
- * Unauthorized operation, signer does not own the file.
441
- **/
442
- NotFileOwner: AugmentedError<ApiType>;
443
367
  /**
444
368
  * The MSP is trying to confirm to store a file from a storage request is not the one selected to store it.
445
369
  **/
@@ -448,10 +372,6 @@ declare module "@polkadot/api-base/types/errors" {
448
372
  * Operations not allowed for insolvent provider
449
373
  **/
450
374
  OperationNotAllowedForInsolventProvider: AugmentedError<ApiType>;
451
- /**
452
- * Operations not allowed while bucket is not being stored by an MSP
453
- **/
454
- OperationNotAllowedWhileBucketIsNotStoredByMsp: AugmentedError<ApiType>;
455
375
  /**
456
376
  * Certain operations (such as issuing new storage requests) are not allowed when interacting with insolvent users.
457
377
  **/
@@ -468,10 +388,6 @@ declare module "@polkadot/api-base/types/errors" {
468
388
  * Provider is not storing the file.
469
389
  **/
470
390
  ProviderNotStoringFile: AugmentedError<ApiType>;
471
- /**
472
- * Root of the provider not found.
473
- **/
474
- ProviderRootNotFound: AugmentedError<ApiType>;
475
391
  /**
476
392
  * Replication target cannot be zero.
477
393
  **/
@@ -500,10 +416,6 @@ declare module "@polkadot/api-base/types/errors" {
500
416
  * Operation not allowed while the storage request exists.
501
417
  **/
502
418
  StorageRequestExists: AugmentedError<ApiType>;
503
- /**
504
- * No slot available found in ticks to insert storage request expiration time.
505
- **/
506
- StorageRequestExpiredNoSlotAvailable: AugmentedError<ApiType>;
507
419
  /**
508
420
  * Not authorized to delete the storage request.
509
421
  **/
@@ -512,34 +424,14 @@ declare module "@polkadot/api-base/types/errors" {
512
424
  * Storage request not registered for the given file.
513
425
  **/
514
426
  StorageRequestNotFound: AugmentedError<ApiType>;
515
- /**
516
- * Operation not allowed while the storage request is not being revoked.
517
- **/
518
- StorageRequestNotRevoked: AugmentedError<ApiType>;
519
427
  /**
520
428
  * Arithmetic error in threshold calculation.
521
429
  **/
522
430
  ThresholdArithmeticError: AugmentedError<ApiType>;
523
- /**
524
- * BSPs assignment threshold cannot be below asymptote.
525
- **/
526
- ThresholdBelowAsymptote: AugmentedError<ApiType>;
527
- /**
528
- * Tick range to maximum threshold cannot be zero.
529
- **/
530
- TickRangeToMaximumThresholdCannotBeZero: AugmentedError<ApiType>;
531
- /**
532
- * Too many batch responses to process.
533
- **/
534
- TooManyBatchResponses: AugmentedError<ApiType>;
535
431
  /**
536
432
  * Too many storage request responses.
537
433
  **/
538
434
  TooManyStorageRequestResponses: AugmentedError<ApiType>;
539
- /**
540
- * Number of removed BSPs volunteered from storage request prefix did not match the expected number.
541
- **/
542
- UnexpectedNumberOfRemovedVolunteeredBsps: AugmentedError<ApiType>;
543
435
  /**
544
436
  * A SP tried to stop storing files from a user that was supposedly insolvent, but the user is not insolvent.
545
437
  **/
@@ -26,7 +26,6 @@ import type {
26
26
  FrameSupportMessagesProcessMessageError,
27
27
  FrameSupportTokensMiscBalanceStatus,
28
28
  FrameSystemDispatchEventInfo,
29
- PalletFileSystemEitherAccountIdOrMspId,
30
29
  PalletFileSystemFileOperationIntention,
31
30
  PalletFileSystemRejectedStorageRequestReason,
32
31
  PalletNftsAttributeNamespace,
@@ -488,45 +487,6 @@ declare module "@polkadot/api-base/types/events" {
488
487
  [who: AccountId32, bucketId: H256, collectionId: Option<u32>, private: bool],
489
488
  { who: AccountId32; bucketId: H256; collectionId: Option<u32>; private: bool }
490
489
  >;
491
- /**
492
- * Failed to decrease MSP's used capacity for expired file deletion request
493
- **/
494
- FailedToDecreaseMspUsedCapacity: AugmentedEvent<
495
- ApiType,
496
- [
497
- user: AccountId32,
498
- mspId: H256,
499
- fileKey: H256,
500
- fileSize: u64,
501
- error: SpRuntimeDispatchError
502
- ],
503
- {
504
- user: AccountId32;
505
- mspId: H256;
506
- fileKey: H256;
507
- fileSize: u64;
508
- error: SpRuntimeDispatchError;
509
- }
510
- >;
511
- /**
512
- * Failed to get the MSP owner of the bucket for an expired file deletion request
513
- * This is different from the bucket not having a MSP, which is allowed and won't error
514
- **/
515
- FailedToGetMspOfBucket: AugmentedEvent<
516
- ApiType,
517
- [bucketId: H256, error: SpRuntimeDispatchError],
518
- { bucketId: H256; error: SpRuntimeDispatchError }
519
- >;
520
- /**
521
- * Notifies that a priority challenge with a trie remove mutation failed to be queued in the `on_idle` hook.
522
- * This can happen if the priority challenge queue is full, and the failed challenge should be manually
523
- * queued at a later time.
524
- **/
525
- FailedToQueuePriorityChallenge: AugmentedEvent<
526
- ApiType,
527
- [fileKey: H256, error: SpRuntimeDispatchError],
528
- { fileKey: H256; error: SpRuntimeDispatchError }
529
- >;
530
490
  /**
531
491
  * Event to notify if, in the `on_idle` hook when cleaning up an expired storage request,
532
492
  * the return of that storage request's deposit to the user failed.
@@ -536,49 +496,6 @@ declare module "@polkadot/api-base/types/events" {
536
496
  [fileKey: H256, owner: AccountId32, amountToReturn: u128, error: SpRuntimeDispatchError],
537
497
  { fileKey: H256; owner: AccountId32; amountToReturn: u128; error: SpRuntimeDispatchError }
538
498
  >;
539
- /**
540
- * Event to notify if, in the `on_idle` hook when cleaning up an expired storage request,
541
- * the transfer of a part of that storage request's deposit to one of the volunteered BSPs failed.
542
- **/
543
- FailedToTransferDepositFundsToBsp: AugmentedEvent<
544
- ApiType,
545
- [
546
- fileKey: H256,
547
- owner: AccountId32,
548
- bspId: H256,
549
- amountToTransfer: u128,
550
- error: SpRuntimeDispatchError
551
- ],
552
- {
553
- fileKey: H256;
554
- owner: AccountId32;
555
- bspId: H256;
556
- amountToTransfer: u128;
557
- error: SpRuntimeDispatchError;
558
- }
559
- >;
560
- /**
561
- * Notifies that a file will be deleted.
562
- **/
563
- FileDeletionRequest: AugmentedEvent<
564
- ApiType,
565
- [
566
- user: AccountId32,
567
- fileKey: H256,
568
- fileSize: u64,
569
- bucketId: H256,
570
- mspId: H256,
571
- proofOfInclusion: bool
572
- ],
573
- {
574
- user: AccountId32;
575
- fileKey: H256;
576
- fileSize: u64;
577
- bucketId: H256;
578
- mspId: H256;
579
- proofOfInclusion: bool;
580
- }
581
- >;
582
499
  /**
583
500
  * Notifies that a file deletion has been requested.
584
501
  * Contains a signed intention that allows any actor to execute the actual deletion.
@@ -601,6 +518,20 @@ declare module "@polkadot/api-base/types/events" {
601
518
  * the file key from the BSPs and/or Bucket storing that file from their forest.
602
519
  **/
603
520
  IncompleteStorageRequest: AugmentedEvent<ApiType, [fileKey: H256], { fileKey: H256 }>;
521
+ /**
522
+ * Notifies that an incomplete storage request has been fully cleaned up.
523
+ *
524
+ * This event is emitted in two scenarios:
525
+ * 1. When an incomplete storage request is created but there are no providers to clean
526
+ * (e.g., MSP confirmed with inclusion proof and no BSPs confirmed).
527
+ * 2. When the file has been removed from all providers and the incomplete storage
528
+ * request entry is removed from storage.
529
+ **/
530
+ IncompleteStorageRequestCleanedUp: AugmentedEvent<
531
+ ApiType,
532
+ [fileKey: H256],
533
+ { fileKey: H256 }
534
+ >;
604
535
  /**
605
536
  * Notifies that a bucket has been moved to a new MSP under a new value proposition.
606
537
  **/
@@ -721,36 +652,6 @@ declare module "@polkadot/api-base/types/events" {
721
652
  expiresAt: u32;
722
653
  }
723
654
  >;
724
- /**
725
- * Notifies that a file key has been queued for a priority challenge for file deletion.
726
- **/
727
- PriorityChallengeForFileDeletionQueued: AugmentedEvent<
728
- ApiType,
729
- [issuer: PalletFileSystemEitherAccountIdOrMspId, fileKey: H256],
730
- { issuer: PalletFileSystemEitherAccountIdOrMspId; fileKey: H256 }
731
- >;
732
- /**
733
- * Notifies that a proof has been submitted for a pending file deletion request.
734
- **/
735
- ProofSubmittedForPendingFileDeletionRequest: AugmentedEvent<
736
- ApiType,
737
- [
738
- user: AccountId32,
739
- fileKey: H256,
740
- fileSize: u64,
741
- bucketId: H256,
742
- mspId: H256,
743
- proofOfInclusion: bool
744
- ],
745
- {
746
- user: AccountId32;
747
- fileKey: H256;
748
- fileSize: u64;
749
- bucketId: H256;
750
- mspId: H256;
751
- proofOfInclusion: bool;
752
- }
753
- >;
754
655
  /**
755
656
  * Notifies that a SP has stopped storing a file because its owner has become insolvent.
756
657
  **/
@@ -423,11 +423,31 @@ declare module "@polkadot/api-base/types/submittable" {
423
423
  };
424
424
  fileSystem: {
425
425
  /**
426
- * Executed by a BSP to confirm to stop storing a file.
426
+ * Executed by a BSP to confirm stopping storage of a file and remove it from their forest.
427
427
  *
428
- * It has to have previously opened a pending stop storing request using the `bsp_request_stop_storing` extrinsic.
429
- * The minimum amount of blocks between the request and the confirmation is defined by the runtime, such that the
430
- * BSP can't immediately stop storing a file it has previously lost when receiving a challenge for it.
428
+ * This is the second step of the two-phase stop storing process. The BSP must have previously
429
+ * called [`bsp_request_stop_storing`] to open a pending stop storing request.
430
+ *
431
+ * A minimum waiting period ([`MinWaitForStopStoring`]) must pass between the request and this
432
+ * confirmation. This prevents a BSP from immediately dropping a file when challenged for it,
433
+ * ensuring they can't avoid slashing by quickly calling stop storing upon receiving a challenge.
434
+ *
435
+ * ## What this extrinsic does
436
+ *
437
+ * 1. Verifies the pending stop storing request exists and the minimum wait time has passed
438
+ * 2. Verifies the file is still in the BSP's forest via the inclusion proof
439
+ * 3. **Removes the file from the BSP's forest and updates their root**
440
+ * 4. Decreases the BSP's used capacity
441
+ * 5. Stops challenge/randomness cycles if the BSP has no more files
442
+ *
443
+ * Note: The payment stream was already updated in [`bsp_request_stop_storing`].
444
+ *
445
+ * ## Errors
446
+ *
447
+ * - [`PendingStopStoringRequestNotFound`]: No pending request exists for this BSP and file
448
+ * - [`MinWaitForStopStoringNotReached`]: The minimum waiting period hasn't passed yet
449
+ * - [`OperationNotAllowedWithInsolventUser`]: The file owner is insolvent (the BSP should use
450
+ * [`stop_storing_for_insolvent_user`] instead)
431
451
  **/
432
452
  bspConfirmStopStoring: AugmentedSubmittable<
433
453
  (
@@ -464,12 +484,45 @@ declare module "@polkadot/api-base/types/submittable" {
464
484
  /**
465
485
  * Executed by a BSP to request to stop storing a file.
466
486
  *
467
- * In the event when a storage request no longer exists for the data the BSP no longer stores,
468
- * it is required that the BSP still has access to the metadata of the initial storage request.
469
- * If they do not, they will at least need that metadata to reconstruct the File ID and from wherever
470
- * the BSP gets that data is up to it. One example could be from the assigned MSP.
471
- * This metadata is necessary since it is needed to reconstruct the leaf node key in the storage
472
- * provider's Merkle Forest.
487
+ * This is the first step of a two-phase process for a BSP to voluntarily stop storing a file.
488
+ * The BSP must later call [`bsp_confirm_stop_storing`] after a minimum waiting period to
489
+ * complete the process and actually remove the file from their forest.
490
+ *
491
+ * **Important**: This extrinsic does NOT modify the BSP's forest root. The file remains in the
492
+ * BSP's forest until [`bsp_confirm_stop_storing`] is called.
493
+ *
494
+ * The BSP is required to provide the file metadata (bucket_id, location, owner, fingerprint, size)
495
+ * to reconstruct and verify the file key. The BSP can get this metadata from its file storage, but
496
+ * it providing it is not a proof that the BSP actually has the file, since this metadata can be obtained
497
+ * from the original storage request or from the assigned MSP if the storage request no longer exists.
498
+ *
499
+ * ## Behavior based on storage request state
500
+ *
501
+ * 1. **Storage request exists and BSP has confirmed storing it**: The BSP is removed from the
502
+ * storage request's confirmed and volunteered lists and the confirmed/volunteered counts are decremented.
503
+ * The BSP is also removed from the storage request as a data server.
504
+ *
505
+ * 2. **Storage request exists but BSP is not a volunteer**: The `bsps_required` count is
506
+ * incremented to compensate for the BSP leaving.
507
+ *
508
+ * 3. **No storage request exists**: A new storage request is created with `bsps_required = 1`
509
+ * so another BSP can pick up the file and maintain its replication target. If `can_serve` is true,
510
+ * the requesting BSP is added as a data server to help the new volunteer download the file.
511
+ *
512
+ * ## Fees
513
+ *
514
+ * The BSP is charged a penalty fee ([`BspStopStoringFilePenalty`]) which is transferred to the treasury.
515
+ *
516
+ * ## Payment Stream
517
+ *
518
+ * The payment stream with the file owner is **updated immediately** in this extrinsic (not in
519
+ * [`bsp_confirm_stop_storing`]). This removes any financial incentive for the BSP to delay or
520
+ * skip the confirmation, as they stop getting paid as soon as they announce their intent to stop storing.
521
+ *
522
+ * ## Restrictions
523
+ *
524
+ * This extrinsic will fail with [`FileHasIncompleteStorageRequest`] if an `IncompleteStorageRequest`
525
+ * exists for the file key. The BSP must wait until fisherman nodes clean up the incomplete request.
473
526
  **/
474
527
  bspRequestStopStoring: AugmentedSubmittable<
475
528
  (
@@ -1401,6 +1401,7 @@ import type {
1401
1401
  LoadFileInStorageResult,
1402
1402
  MainStorageProviderId,
1403
1403
  MerklePatriciaRoot,
1404
+ MspStorageRequestStatus,
1404
1405
  Multiaddresses,
1405
1406
  ProviderId,
1406
1407
  QueryAvailableStorageCapacityError,
@@ -2137,6 +2138,7 @@ declare module "@polkadot/types/types/registry" {
2137
2138
  MomentOf: MomentOf;
2138
2139
  MoreAttestations: MoreAttestations;
2139
2140
  MortalEra: MortalEra;
2141
+ MspStorageRequestStatus: MspStorageRequestStatus;
2140
2142
  MultiAddress: MultiAddress;
2141
2143
  Multiaddresses: Multiaddresses;
2142
2144
  MultiAsset: MultiAsset;