Class ContractAddress
- Namespace
- Concordium.Sdk.Types
- Assembly
- Concordium.Sdk.dll
Represents a contract address.
A contract is identified by its unique ContractAddress. A contract address consists of a contract index and a contact sub-index both represented as 64-bit unsigned integers.
public sealed record ContractAddress : IAddress, IEquatable<ContractAddress>
- Inheritance
-
ContractAddress
- Implements
- Inherited Members
Constructors
ContractAddress(ulong, ulong)
Represents a contract address.
A contract is identified by its unique ContractAddress. A contract address consists of a contract index and a contact sub-index both represented as 64-bit unsigned integers.
public ContractAddress(ulong Index, ulong SubIndex)
Parameters
Index
ulongThe index part of the address of a contract.
SubIndex
ulongThe sub-index part of the address of a contract.
Fields
BytesLength
Byte size of ContractAddress.
public const uint BytesLength = 16
Field Value
Properties
Index
The index part of the address of a contract.
public ulong Index { get; init; }
Property Value
SubIndex
The sub-index part of the address of a contract.
public ulong SubIndex { get; init; }
Property Value
Methods
From(ulong, ulong)
Creates an instance of contract address.
public static ContractAddress From(ulong index, ulong subIndex)
Parameters
Returns
ToBytes()
Serialize the ContractAddress in big-endian format.
public byte[] ToBytes()
Returns
- byte[]
ToProto()
Converts the contract address to its corresponding protocol buffer message instance.
This can be used as the input for class methods of RawClient.
public ContractAddress ToProto()
Returns
TryDeserial(ReadOnlySpan<byte>, out (ContractAddress? Address, string? Error))
Attempt to deserialize a contract address from a span of bytes.
public static bool TryDeserial(ReadOnlySpan<byte> bytes, out (ContractAddress? Address, string? Error) output)
Parameters
bytes
ReadOnlySpan<byte>The span of bytes.
output
(ContractAddress Address, string Error)Where to write the result of the operation.