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
Equals(Parameter?)
Check for equality.
public bool Equals(Parameter? other)
Parameters
other
Parameter
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
schemaType
SchemaTypeThe smart contract schema type for the parameter.
jsonParameter
Utf8JsonThe 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
moduleSchema
VersionedModuleSchemaThe smart contract module schema.
contractName
ContractIdentifierThe name of the contract.
jsonParameter
Utf8JsonThe 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
bytes
ReadOnlySpan<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
moduleSchema
VersionedModuleSchemaThe smart contract module schema.
contractName
ContractIdentifierThe name of the contract.
functionName
EntryPointThe name of entrypoint of the smart contract.
jsonParameter
Utf8JsonThe UTF8 encoding of the JSON representation of the smart contract parameter.