Skip to main content

ResQ.Blockchain.INeoClient

INeoClient.GetEventsByIncidentAsync(string, CancellationToken) Method

Retrieves all blockchain events associated with a specific incident.
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<ResQ.Blockchain.BlockchainEvent>> GetEventsByIncidentAsync(string incidentId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

incidentId System.String The unique identifier of the incident. cancellationToken System.Threading.CancellationToken Cancellation token for the operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<BlockchainEvent>>
A read-only list of BlockchainEvent records associated with the incident. Returns an empty list if no events are found.

Exceptions

System.OperationCanceledException
Thrown when the operation is cancelled.

Example

var events = await neoClient.GetEventsByIncidentAsync("inc-001");
foreach (var evt in events)
{
    Console.WriteLine($"{evt.Timestamp}: {evt.EventType}");
}

Remarks

This method queries the blockchain for all events that reference the specified incident. Events are returned in chronological order based on their block height.