Table of Contents

Class Parameter

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

Parameter to the init function or entrypoint.

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

Constructors

Parameter(byte[])

Parameter to the init function or entrypoint.

public Parameter(byte[] Param)

Parameters

Param byte[]

Properties

Param

public byte[] Param { get; init; }

Property Value

byte[]

Methods

Empty()

Construct an empty smart contract parameter.

public static Parameter Empty()

Returns

Parameter

Equals(Parameter?)

Check for equality.

public bool Equals(Parameter? other)

Parameters

other Parameter

Returns

bool

FromJson(SchemaType, Utf8Json)

Create a parameter from JSON representation using the smart contract schema type.

public static Parameter FromJson(SchemaType schemaType, Utf8Json jsonParameter)

Parameters

schemaType SchemaType

The smart contract schema type for the parameter.

jsonParameter Utf8Json

The UTF8 encoding of the JSON representation of the smart contract parameter.

Returns

Parameter

GetHashCode()

Gets hash code.

public override int GetHashCode()

Returns

int

InitJson(VersionedModuleSchema, ContractIdentifier, Utf8Json)

Create a parameter from JSON representation using the smart contract module schema for a smart contract init transaction.

public static Parameter InitJson(VersionedModuleSchema moduleSchema, ContractIdentifier contractName, Utf8Json jsonParameter)

Parameters

moduleSchema VersionedModuleSchema

The smart contract module schema.

contractName ContractIdentifier

The name of the contract.

jsonParameter Utf8Json

The UTF8 encoding of the JSON representation of the smart contract parameter.

Returns

Parameter

ToBytes()

Copies the parameters to a byte array which has the length preprended.

public byte[] ToBytes()

Returns

byte[]

ToHexString()

Convert parameters to hex string.

public string ToHexString()

Returns

string

TryDeserial(ReadOnlySpan<byte>, out (Parameter? Parameter, string? Error))

Create a parameter from a byte array.

public static bool TryDeserial(ReadOnlySpan<byte> bytes, out (Parameter? Parameter, string? Error) output)

Parameters

bytes ReadOnlySpan<byte>

The serialized parameters.

output (Parameter Parameter, string Error)

Where to write the result of the operation.

Returns

bool

UpdateJson(VersionedModuleSchema, ContractIdentifier, EntryPoint, Utf8Json)

Create a parameter from JSON representation using the smart contract module schema for a smart contract update transaction.

public static Parameter UpdateJson(VersionedModuleSchema moduleSchema, ContractIdentifier contractName, EntryPoint functionName, Utf8Json jsonParameter)

Parameters

moduleSchema VersionedModuleSchema

The smart contract module schema.

contractName ContractIdentifier

The name of the contract.

functionName EntryPoint

The name of entrypoint of the smart contract.

jsonParameter Utf8Json

The UTF8 encoding of the JSON representation of the smart contract parameter.

Returns

Parameter