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
Parambyte[]
Properties
Param
public byte[] Param { get; init; }
Property Value
- byte[]
Methods
Empty()
Construct an empty smart contract parameter.
public static Parameter Empty()
Returns
Equals(Parameter?)
Check for equality.
public bool Equals(Parameter? other)
Parameters
otherParameter
Returns
FromJson(SchemaType, Utf8Json)
Create a parameter from JSON representation using the smart contract schema type.
public static Parameter FromJson(SchemaType schemaType, Utf8Json jsonParameter)
Parameters
schemaTypeSchemaTypeThe smart contract schema type for the parameter.
jsonParameterUtf8JsonThe UTF8 encoding of the JSON representation of the smart contract parameter.
Returns
GetHashCode()
Gets hash code.
public override int GetHashCode()
Returns
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
moduleSchemaVersionedModuleSchemaThe smart contract module schema.
contractNameContractIdentifierThe name of the contract.
jsonParameterUtf8JsonThe UTF8 encoding of the JSON representation of the smart contract parameter.
Returns
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
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
bytesReadOnlySpan<byte>The serialized parameters.
output(Parameter Parameter, string Error)Where to write the result of the operation.
Returns
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
moduleSchemaVersionedModuleSchemaThe smart contract module schema.
contractNameContractIdentifierThe name of the contract.
functionNameEntryPointThe name of entrypoint of the smart contract.
jsonParameterUtf8JsonThe UTF8 encoding of the JSON representation of the smart contract parameter.