Class PseudoRandomNumberParams
Creates a Pseudo Random Number request from the Hedera Network.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class PseudoRandomNumberParams : TransactionParams<TransactionReceipt>
Examples
Ask the network for a bounded integer (returned as
RangedPseudoRandomNumberRecord in the mirror record);
omit MaxValue to get 48 raw bytes
(BytesPseudoRandomNumberRecord) instead:
// With MaxValue set, the network returns an int in [0, MaxValue).
// Mirror-node record type will be RangedPseudoRandomNumberRecord.
var receipt = await client.GeneratePseudoRandomNumberAsync(new PseudoRandomNumberParams
{
MaxValue = 100
});
Console.WriteLine($"PRNG tx id: {receipt.TransactionId}");
Properties
| Edit this page View SourceCancellationToken
Optional cancellation token. Cancelling stops the client waiting; it cannot recall a transaction already sent. Cancelled after the send, the outcome is unknown: settle it by its transaction id on a mirror node rather than resubmitting it.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
MaxValue
If specified, the exclusive upper bound of the pseudo random number
generated: the result lies in the range [0, MaxValue).
Declaration
public int? MaxValue { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Signatory
Additional private key, keys or signing callback method.
Declaration
public Signatory? Signatory { get; set; }
Property Value
| Type | Description |
|---|---|
| Signatory |