Class DeleteFileExtensions
Extension methods for deleting network files.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class DeleteFileExtensions
Methods
| Edit this page View SourceDeleteFileAsync(ConsensusClient, DeleteFileParams, Action<IConsensusContext>?)
Removes a file from the network.
Declaration
public static Task<TransactionReceipt> DeleteFileAsync(this ConsensusClient client, DeleteFileParams deleteParams, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client executing the file deletion. |
| DeleteFileParams | deleteParams | The parameters indicating the file to delete and any additional signatories necessary to authorize the transaction. |
| Action<IConsensusContext> | configure | Optional callback method providing an opportunity to modify the execution configuration for just this method call. It is executed prior to submitting the request to the network. |
Returns
| Type | Description |
|---|---|
| Task<TransactionReceipt> | A transaction receipt indicating success of the file deletion. |
Examples
// Permanently delete a file. At least one of the file's key-list
// endorsements must sign. Deleted files cannot be recovered.
var receipt = await client.DeleteFileAsync(new DeleteFileParams
{
File = file
});
Console.WriteLine($"Delete status: {receipt.Status}");
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If required arguments are missing. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node rejected the request upon submission. |
| ConsensusException | If the network was unable to come to consensus before the duration of the transaction expired. |
| TransactionException | If the network rejected the delete request as invalid or had missing data. |