Class TransactionRecordExtensions
Extension methods for retrieving transaction records from the network.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class TransactionRecordExtensions
Methods
| Edit this page View SourceGetAccountRecordsAsync(ConsensusClient, EntityId, CancellationToken, Action<IConsensusContext>?)
Retrieves the account records associated with an account that are presently held within the network because they exceeded the receive or send threshold values for autogeneration of records.
Declaration
public static Task<TransactionRecord[]> GetAccountRecordsAsync(this ConsensusClient client, EntityId address, CancellationToken cancellationToken = default, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client to query. |
| EntityId | address | The Hedera Network address to retrieve associated records. |
| CancellationToken | cancellationToken | Optional cancellation token. |
| 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<TransactionRecord[]> | An array of transaction records associated with the given account. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If required arguments are missing. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node create rejected the request upon submission. |
GetAllTransactionRecordsAsync(ConsensusClient, TransactionId, CancellationToken, Action<IConsensusContext>?)
Retrieves all records having the given transaction ID, including duplicates that were rejected or produced errors during execution. Typically there is only one record per transaction, but in some cases, deliberate or accidental there may be more than one for a given transaction ID.
Declaration
public static Task<ReadOnlyCollection<TransactionRecord>> GetAllTransactionRecordsAsync(this ConsensusClient client, TransactionId transaction, CancellationToken cancellationToken = default, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client to query. |
| TransactionId | transaction | TransactionId identifier of the record |
| CancellationToken | cancellationToken | Optional cancellation token. |
| 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<ReadOnlyCollection<TransactionRecord>> | An collection of all the transaction records known to the system at the time of query having the identified transaction id. |
GetTransactionRecordAsync(ConsensusClient, TransactionId, CancellationToken, Action<IConsensusContext>?)
Retrieves the transaction records for a given transaction ID that was successfully processed, otherwise the first one to reach consensus.
Declaration
public static Task<TransactionRecord> GetTransactionRecordAsync(this ConsensusClient client, TransactionId transaction, CancellationToken cancellationToken = default, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client to query. |
| TransactionId | transaction | TransactionId identifier of the record |
| CancellationToken | cancellationToken | Optional cancellation token. |
| 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<TransactionRecord> | A transaction record with the specified id, or an exception if not found. |
Remarks
Generally there is only one record per transaction, but in certain cases where there is a transaction ID collision (deliberate or accidental) there may be more, the GetAllTransactionRecordsAsync(ConsensusClient, TransactionId, CancellationToken, Action<IConsensusContext>?) method may be used to retrieve all records.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If required arguments are missing. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node create rejected the request upon submission. |
| TransactionException | If the network has no records of the transaction or request has invalid or had missing data. |