Class BatchedTransactionParams
Submits a batch of transactions to the network for processing.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class BatchedTransactionParams
Examples
Atomically execute a mix of transactions — either every inner transaction succeeds or the whole batch reverts:
// Atomic batch: every inner transaction either all succeeds or all
// fails. Pass any combination of TransactionParams subclasses. The
// batch is signed by every inner transaction's signatory plus the
// batch-level Signatory if set.
var receipt = await client.ExecuteAsync(new BatchedTransactionParams
{
TransactionParams = new TransactionParams[]
{
new TransferParams
{
CryptoTransfers = new[]
{
new CryptoTransfer(sender1, -100_000_000),
new CryptoTransfer(receiver, 100_000_000)
}
},
new TransferParams
{
CryptoTransfers = new[]
{
new CryptoTransfer(sender2, -50_000_000),
new CryptoTransfer(receiver, 50_000_000)
}
}
}
});
Console.WriteLine($"Batch status: {receipt.Status}");
Properties
| Edit this page View SourceCancellationToken
Optional Cancellation token that interrupts the transaction submission process.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
Endorsement
Optional explicit endorsement to be applied to the batch of transactions if not specified individually by each inner transaction. If not specified by either the batch transaction entry or this property, the default endorsement will be used, which match the signatories of the client's context.
Declaration
public Endorsement? Endorsement { get; set; }
Property Value
| Type | Description |
|---|---|
| Endorsement |
Signatory
Additional private key, keys or signing callback method, particularly useful if setting the endorsement different from the payer's endorsement.
Declaration
public Signatory? Signatory { get; set; }
Property Value
| Type | Description |
|---|---|
| Signatory |
TransactionParams
The list of individual transaction parameters to include in the batch.
Declaration
public IReadOnlyList<TransactionParams> TransactionParams { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<TransactionParams> |