Table of Contents

Class BlockItemSummary

Namespace
Concordium.Sdk.Types
Assembly
Concordium.Sdk.dll

Summary of the outcome of a block item in structured form. The summary determines which transaction type it was.

public sealed record BlockItemSummary : IEquatable<BlockItemSummary>
Inheritance
BlockItemSummary
Implements
Inherited Members

Constructors

BlockItemSummary(ulong, EnergyAmount, TransactionHash, IBlockItemSummaryDetails)

Summary of the outcome of a block item in structured form. The summary determines which transaction type it was.

public BlockItemSummary(ulong Index, EnergyAmount EnergyCost, TransactionHash TransactionHash, IBlockItemSummaryDetails Details)

Parameters

Index ulong

Index of the transaction in the block where it is included.

EnergyCost EnergyAmount

The amount of NRG the transaction cost.

TransactionHash TransactionHash

Hash of the transaction.

Details IBlockItemSummaryDetails

Details that are specific to different transaction types. For successful transactions there is a one to one mapping of transaction types and variants (together with subvariants) of this type.

Properties

Details

Details that are specific to different transaction types. For successful transactions there is a one to one mapping of transaction types and variants (together with subvariants) of this type.

public IBlockItemSummaryDetails Details { get; init; }

Property Value

IBlockItemSummaryDetails

EnergyCost

The amount of NRG the transaction cost.

public EnergyAmount EnergyCost { get; init; }

Property Value

EnergyAmount

Index

Index of the transaction in the block where it is included.

public ulong Index { get; init; }

Property Value

ulong

TransactionHash

Hash of the transaction.

public TransactionHash TransactionHash { get; init; }

Property Value

TransactionHash

Methods

AffectedAddresses()

Return the list of addresses affected by a account transaction. OBS! this doesn't include account creation transaction. Use AffectedAndCreatedAddresses() if these should be included.

public IList<AccountAddress> AffectedAddresses()

Returns

IList<AccountAddress>

list of affected addresses in block

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

AffectedAndCreatedAddresses()

Return the list of affected addresses included account creation.

public IList<AccountAddress> AffectedAndCreatedAddresses()

Returns

IList<AccountAddress>

List of affected addresses included created accounts.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

AffectedContracts()

Returns affected contracts. Only relevant if transaction is a account transaction and effect of the transaction was contract initialization or contract update.

public IList<ContractAddress> AffectedContracts()

Returns

IList<ContractAddress>

List of affected contract addresses.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

GetCost()

Returns transaction cost.

public CcdAmount GetCost()

Returns

CcdAmount

IsReject()

Return whether the transaction has failed to achieve the intended effects.

public bool IsReject()

Returns

bool

bool representing if transaction is rejected

IsSuccess()

Return whether the transaction was successful, i.e., the intended effect happened.

public bool IsSuccess()

Returns

bool

bool representing if transaction succeeded.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

TryGetContractInit(out ContractInitializedEvent?)

If the block item is a smart contract init transaction then return the initialization data.

public bool TryGetContractInit(out ContractInitializedEvent? contractInitializedEventEvent)

Parameters

contractInitializedEventEvent ContractInitializedEvent

Output as a contract initialization event when transaction was of type contract initialization.

Returns

bool

bool representing if transaction of type contract initialization.

TryGetContractUpdateLogs(out IList<(ContractAddress, IList<ContractEvent>)>)

If the block item is a smart contract update transaction then return an iterator over pairs of a contract address that was affected, and the logs that were produced.

public bool TryGetContractUpdateLogs(out IList<(ContractAddress, IList<ContractEvent>)> items)

Parameters

items IList<(ContractAddress, IList<ContractEvent>)>

Output as list of contract event for all updated contract when transaction of type contract update.

Returns

bool

bool representing if transaction of type contract update.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

TryGetRejectedAccountTransaction(out IRejectReason?)

When transaction is rejected this method will return true and rejected reason will be return in out param.

public bool TryGetRejectedAccountTransaction(out IRejectReason? rejectReason)

Parameters

rejectReason IRejectReason

If rejected then reject reason not null.

Returns

bool

bool representing if transaction is rejected.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known

TryGetSenderAccount(out AccountAddress?)

Returns true and set sender account if of account transaction type.

public bool TryGetSenderAccount(out AccountAddress? sender)

Parameters

sender AccountAddress

Output given when sender present.

Returns

bool

If sender account present.

Exceptions

MissingEnumException<T>

Throws exception when returned type not known