@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
@@ -118,6 +118,10 @@ declare module "@polkadot/api-base/types/consts" {
118
118
  * Maximum number of expired items (per type) to clean up in a single tick.
119
119
  **/
120
120
  maxExpiredItemsInTick: u32 & AugmentedConst<ApiType>;
121
+ /**
122
+ * Maximum number of file deletions that can be processed in a single extrinsic call for `delete_files` and `delete_files_for_incomplete_storage_request`.
123
+ **/
124
+ maxFileDeletionsPerExtrinsic: u32 & AugmentedConst<ApiType>;
121
125
  /**
122
126
  * Maximum byte size of a file path.
123
127
  **/
@@ -178,6 +178,10 @@ declare module "@polkadot/api-base/types/errors" {
178
178
  * BSP did not succeed threshold check.
179
179
  **/
180
180
  AboveThreshold: AugmentedError<ApiType>;
181
+ /**
182
+ * Batch file deletion must contain files from a single bucket only.
183
+ **/
184
+ BatchFileDeletionMustContainSingleBucket: AugmentedError<ApiType>;
181
185
  /**
182
186
  * BSP has already confirmed storing the given file.
183
187
  **/
@@ -234,6 +238,10 @@ declare module "@polkadot/api-base/types/errors" {
234
238
  * Divided by 0
235
239
  **/
236
240
  DividedByZero: AugmentedError<ApiType>;
241
+ /**
242
+ * Duplicate file key detected within the same batch deletion request.
243
+ **/
244
+ DuplicateFileKeyInBatchFileDeletion: AugmentedError<ApiType>;
237
245
  /**
238
246
  * Failed to fetch the dynamic-rate payment stream.
239
247
  **/
@@ -274,6 +282,18 @@ declare module "@polkadot/api-base/types/errors" {
274
282
  * Failed to get the payment account of the provider.
275
283
  **/
276
284
  FailedToGetPaymentAccount: AugmentedError<ApiType>;
285
+ /**
286
+ * Failed to push file key to bounded vector during BSP file deletion
287
+ **/
288
+ FailedToPushFileKeyToBspDeletionVector: AugmentedError<ApiType>;
289
+ /**
290
+ * Failed to push file key to bounded vector during bucket file deletion
291
+ **/
292
+ FailedToPushFileKeyToBucketDeletionVector: AugmentedError<ApiType>;
293
+ /**
294
+ * Failed to push user to bounded vector during BSP file deletion
295
+ **/
296
+ FailedToPushUserToBspDeletionVector: AugmentedError<ApiType>;
277
297
  /**
278
298
  * Failed to query earliest volunteer tick
279
299
  **/
@@ -391,6 +411,10 @@ declare module "@polkadot/api-base/types/errors" {
391
411
  * No file keys to confirm storing
392
412
  **/
393
413
  NoFileKeysToConfirm: AugmentedError<ApiType>;
414
+ /**
415
+ * Requires at least 1 file key to be deleted.
416
+ **/
417
+ NoFileKeysToDelete: AugmentedError<ApiType>;
394
418
  /**
395
419
  * No global reputation weight set.
396
420
  **/
@@ -388,19 +388,17 @@ declare module "@polkadot/api-base/types/events" {
388
388
  newRoot: H256;
389
389
  }>;
390
390
  /**
391
- * Notifies that a file deletion has been completed successfully for a BSP.
391
+ * Notifies that file deletions have been completed successfully for a BSP.
392
392
  **/
393
- BspFileDeletionCompleted: AugmentedEvent<ApiType, [
394
- user: AccountId20,
395
- fileKey: H256,
396
- fileSize: u64,
393
+ BspFileDeletionsCompleted: AugmentedEvent<ApiType, [
394
+ users: Vec<AccountId20>,
395
+ fileKeys: Vec<H256>,
397
396
  bspId: H256,
398
397
  oldRoot: H256,
399
398
  newRoot: H256
400
399
  ], {
401
- user: AccountId20;
402
- fileKey: H256;
403
- fileSize: u64;
400
+ users: Vec<AccountId20>;
401
+ fileKeys: Vec<H256>;
404
402
  bspId: H256;
405
403
  oldRoot: H256;
406
404
  newRoot: H256;
@@ -429,20 +427,18 @@ declare module "@polkadot/api-base/types/events" {
429
427
  maybeCollectionId: Option<u32>;
430
428
  }>;
431
429
  /**
432
- * Notifies that a file deletion has been completed successfully for a Bucket.
430
+ * Notifies that file deletions have been completed successfully for a Bucket.
433
431
  **/
434
- BucketFileDeletionCompleted: AugmentedEvent<ApiType, [
432
+ BucketFileDeletionsCompleted: AugmentedEvent<ApiType, [
435
433
  user: AccountId20,
436
- fileKey: H256,
437
- fileSize: u64,
434
+ fileKeys: Vec<H256>,
438
435
  bucketId: H256,
439
436
  mspId: Option<H256>,
440
437
  oldRoot: H256,
441
438
  newRoot: H256
442
439
  ], {
443
440
  user: AccountId20;
444
- fileKey: H256;
445
- fileSize: u64;
441
+ fileKeys: Vec<H256>;
446
442
  bucketId: H256;
447
443
  mspId: Option<H256>;
448
444
  oldRoot: H256;
@@ -533,16 +529,6 @@ declare module "@polkadot/api-base/types/events" {
533
529
  amountToTransfer: u128;
534
530
  error: SpRuntimeDispatchError;
535
531
  }>;
536
- /**
537
- * Notifies that a file has been deleted from a rejected storage request.
538
- **/
539
- FileDeletedFromIncompleteStorageRequest: AugmentedEvent<ApiType, [
540
- fileKey: H256,
541
- bspId: Option<H256>
542
- ], {
543
- fileKey: H256;
544
- bspId: Option<H256>;
545
- }>;
546
532
  /**
547
533
  * Notifies that a file will be deleted.
548
534
  **/
@@ -3,7 +3,7 @@ import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableE
3
3
  import type { Bytes, Compact, Option, U256, Vec, bool, u128, u32, u64 } from "@polkadot/types-codec";
4
4
  import type { AnyNumber, IMethod, ITuple } from "@polkadot/types-codec/types";
5
5
  import type { AccountId20, Call, H160, H256 } from "@polkadot/types/interfaces/runtime";
6
- import type { EthereumTransactionTransactionV2, FpAccountEthereumSignature, PalletBalancesAdjustmentDirection, PalletFileSystemBucketMoveRequestResponse, PalletFileSystemFileKeyWithProof, PalletFileSystemFileOperationIntention, PalletFileSystemReplicationTarget, PalletFileSystemStorageRequestMspBucketResponse, PalletNftsAttributeNamespace, PalletNftsCancelAttributesApprovalWitness, PalletNftsCollectionConfig, PalletNftsDestroyWitness, PalletNftsItemConfig, PalletNftsItemTip, PalletNftsMintSettings, PalletNftsMintWitness, PalletNftsPreSignedAttributes, PalletNftsPreSignedMint, PalletNftsPriceWithDirection, PalletProofsDealerProof, ShSolochainEvmRuntimeConfigsRuntimeParamsRuntimeParameters, ShSolochainEvmRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpSessionMembershipProof, SpTrieStorageProofCompactProof, SpWeightsWeightV2Weight } from "@polkadot/types/lookup";
6
+ import type { EthereumTransactionTransactionV2, FpAccountEthereumSignature, PalletBalancesAdjustmentDirection, PalletFileSystemBucketMoveRequestResponse, PalletFileSystemFileDeletionRequest, PalletFileSystemFileKeyWithProof, PalletFileSystemFileOperationIntention, PalletFileSystemReplicationTarget, PalletFileSystemStorageRequestMspBucketResponse, PalletNftsAttributeNamespace, PalletNftsCancelAttributesApprovalWitness, PalletNftsCollectionConfig, PalletNftsDestroyWitness, PalletNftsItemConfig, PalletNftsItemTip, PalletNftsMintSettings, PalletNftsMintWitness, PalletNftsPreSignedAttributes, PalletNftsPreSignedMint, PalletNftsPriceWithDirection, PalletProofsDealerProof, ShSolochainEvmRuntimeConfigsRuntimeParamsRuntimeParameters, ShSolochainEvmRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpSessionMembershipProof, SpTrieStorageProofCompactProof, SpWeightsWeightV2Weight } from "@polkadot/types/lookup";
7
7
  export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
8
8
  export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
9
9
  export type __SubmittableExtrinsicFunction<ApiType extends ApiTypes> = SubmittableExtrinsicFunction<ApiType>;
@@ -366,42 +366,46 @@ declare module "@polkadot/api-base/types/submittable" {
366
366
  H256
367
367
  ]>;
368
368
  /**
369
- * Deletes a file from a provider's forest, changing its root
369
+ * Deletes files from a provider's forest, changing its root
370
370
  *
371
371
  * This extrinsic allows any actor to execute file deletion based on signed intentions
372
- * from the `FileDeletionRequested` event. It requires a valid forest proof showing that the
373
- * file exists in the specified provider's forest before allowing deletion.
372
+ * from the `FileDeletionRequested` event. It requires a valid forest proof showing that
373
+ * all files exist in the specified provider's forest before allowing deletion.
374
374
  *
375
- * If `bsp_id` is `None`, the file will be deleted from the bucket forest.
376
- * If `bsp_id` is `Some(id)`, the file will be deleted from the specified BSP's forest.
375
+ * Multiple files can be deleted in a single call using one forest proof bounded by [`MaxFileDeletionsPerExtrinsic`](Config::MaxFileDeletionsPerExtrinsic).
376
+ *
377
+ * If `bsp_id` is `None`, files will be deleted from the bucket forest.
378
+ * If `bsp_id` is `Some(id)`, files will be deleted from the specified BSP's forest.
377
379
  **/
378
- deleteFile: AugmentedSubmittable<(fileOwner: AccountId20 | string | Uint8Array, signedIntention: PalletFileSystemFileOperationIntention | {
379
- fileKey?: any;
380
- operation?: any;
381
- } | string | Uint8Array, signature: FpAccountEthereumSignature | string | Uint8Array, bucketId: H256 | string | Uint8Array, location: Bytes | string | Uint8Array, size: u64 | AnyNumber | Uint8Array, fingerprint: H256 | string | Uint8Array, bspId: Option<H256> | null | Uint8Array | H256 | string, forestProof: SpTrieStorageProofCompactProof | {
380
+ deleteFiles: AugmentedSubmittable<(fileDeletions: Vec<PalletFileSystemFileDeletionRequest> | (PalletFileSystemFileDeletionRequest | {
381
+ fileOwner?: any;
382
+ signedIntention?: any;
383
+ signature?: any;
384
+ bucketId?: any;
385
+ location?: any;
386
+ size_?: any;
387
+ fingerprint?: any;
388
+ } | string | Uint8Array)[], bspId: Option<H256> | null | Uint8Array | H256 | string, forestProof: SpTrieStorageProofCompactProof | {
382
389
  encodedNodes?: any;
383
390
  } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [
384
- AccountId20,
385
- PalletFileSystemFileOperationIntention,
386
- FpAccountEthereumSignature,
387
- H256,
388
- Bytes,
389
- u64,
390
- H256,
391
+ Vec<PalletFileSystemFileDeletionRequest>,
391
392
  Option<H256>,
392
393
  SpTrieStorageProofCompactProof
393
394
  ]>;
394
395
  /**
395
- * Delete a file from an incomplete (rejected, expired or revoked) storage request.
396
+ * Delete files from an incomplete (rejected, expired or revoked) storage request.
397
+ *
398
+ * This extrinsic allows fisherman nodes to delete files from providers when IncompleteStorageRequestMetadata
399
+ * for the given file keys exist in the IncompleteStorageRequests mapping. It validates that the metadata exists
400
+ * for each file, that the provider has the files in its Merkle Patricia Forest, and verifies the file keys match
401
+ * the metadata.
396
402
  *
397
- * This extrinsic allows fisherman nodes to delete files from providers when an IncompleteStorageRequestMetadata for the given file_key
398
- * exist in the IncompleteStorageRequests mapping. It validates that the IncompleteStorageRequestMetadata exists,
399
- * that the provider has the file in its Merkle Patricia Forest, and verifies the file key matches the metadata.
403
+ * Multiple files can be deleted in a single call using one forest proof bounded by [`MaxFileDeletionsPerExtrinsic`](Config::MaxFileDeletionsPerExtrinsic).
400
404
  **/
401
- deleteFileForIncompleteStorageRequest: AugmentedSubmittable<(fileKey: H256 | string | Uint8Array, bspId: Option<H256> | null | Uint8Array | H256 | string, forestProof: SpTrieStorageProofCompactProof | {
405
+ deleteFilesForIncompleteStorageRequest: AugmentedSubmittable<(fileKeys: Vec<H256> | (H256 | string | Uint8Array)[], bspId: Option<H256> | null | Uint8Array | H256 | string, forestProof: SpTrieStorageProofCompactProof | {
402
406
  encodedNodes?: any;
403
407
  } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [
404
- H256,
408
+ Vec<H256>,
405
409
  Option<H256>,
406
410
  SpTrieStorageProofCompactProof
407
411
  ]>;