Table of Contents

Struct EnergyAmount

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

Represents an amount of energy.

public readonly record struct EnergyAmount : IEquatable<EnergyAmount>
Implements
Inherited Members

Constructors

EnergyAmount(ulong)

Represents an amount of energy.

public EnergyAmount(ulong Value)

Parameters

Value ulong

Value of the energy amount.

Fields

BytesLength

Byte length of Energy. Used for serialization.

public const uint BytesLength = 8

Field Value

uint

Properties

Value

Value of the energy amount.

public ulong Value { get; init; }

Property Value

ulong

Methods

ToBytes()

Copies the energy amount represented in big-endian format to byte array.

public byte[] ToBytes()

Returns

byte[]

Operators

operator +(EnergyAmount, EnergyAmount)

Add Energy amounts.

public static EnergyAmount operator +(EnergyAmount a, EnergyAmount b)

Parameters

a EnergyAmount
b EnergyAmount

Returns

EnergyAmount

Exceptions

ArgumentException

The result odoes not fit in ulong

operator -(EnergyAmount, EnergyAmount)

Subtract Energy amounts.

public static EnergyAmount operator -(EnergyAmount a, EnergyAmount b)

Parameters

a EnergyAmount
b EnergyAmount

Returns

EnergyAmount

Exceptions

ArgumentException

The result does not fit in ulong