Struct AccountSequenceNumber
- Namespace
- Concordium.Sdk.Types
- Assembly
- Concordium.Sdk.dll
Represents an account sequence number.
The account sequence number is a 64-bit unsigned integer specific to an account and used when submitting account transactions for that account to the node. The account sequence number is maintained as on-chain state and is incremented with each finalized transaction. The next sequence number to be used in a transaction can be queried with GetNextAccountSequenceNumber(AccountAddress, CancellationToken).
public readonly record struct AccountSequenceNumber : IEquatable<AccountSequenceNumber>
- Implements
- Inherited Members
Fields
BytesLength
The number of bytes used to represent this type when serialized.
public const uint BytesLength = 8
Field Value
Properties
Value
The value of the account sequence number.
public ulong Value { get; init; }
Property Value
Methods
From(ulong)
Creates a new instance of the AccountSequenceNumber class from an integer.
public static AccountSequenceNumber From(ulong sequenceNumber)
Parameters
sequenceNumber
ulongThe account sequence number represented as an integer.
Returns
Exceptions
- ArgumentException
The supplied account sequence number is 0.
GetIncrementedSequenceNumber()
Returns a new sequence number whose value is increased by 1 relative to the current one.
public AccountSequenceNumber GetIncrementedSequenceNumber()
Returns
Exceptions
- OverflowException
The value of the incremented sequence number does not fit in a 64-bit unsigned integer.
ToBytes()
Copies the account sequence represented in big-endian format to a byte array.
public byte[] ToBytes()
Returns
- byte[]
ToProto()
Converts the account sequence number to its corresponding protocol buffer message instance.
This can be used as the input for class methods of RawClient.
public SequenceNumber ToProto()