Casper.Network.SDK
Show / Hide Table of Contents

Class CLValue

The type used in deploy input arguments. And it can also be returned as a result of a query to the network or a contract call.

Inheritance
System.Object
CLValue
Namespace: Casper.Network.SDK.Types
Assembly: Casper.Network.SDK.dll
Syntax
public class CLValue : object

Constructors

CLValue(Byte[], CLType)

Declaration
public CLValue(byte[] bytes, CLType clType)
Parameters
Type Name Description
System.Byte[] bytes
CLType clType

CLValue(Byte[], CLType, Object)

Declaration
public CLValue(byte[] bytes, CLType clType, object parsed)
Parameters
Type Name Description
System.Byte[] bytes
CLType clType
System.Object parsed

CLValue(Byte[], CLTypeInfo)

Declaration
public CLValue(byte[] bytes, CLTypeInfo clType)
Parameters
Type Name Description
System.Byte[] bytes
CLTypeInfo clType

CLValue(Byte[], CLTypeInfo, Object)

Declaration
public CLValue(byte[] bytes, CLTypeInfo typeInfo, object parsed)
Parameters
Type Name Description
System.Byte[] bytes
CLTypeInfo typeInfo
System.Object parsed

CLValue(String, CLTypeInfo, Object)

Declaration
public CLValue(string hexBytes, CLTypeInfo clType, object parsed)
Parameters
Type Name Description
System.String hexBytes
CLTypeInfo clType
System.Object parsed

Properties

Bytes

Byte array representation of underlying data

Declaration
public byte[] Bytes { get; }
Property Value
Type Description
System.Byte[]

Parsed

The optional parsed value of the bytes used when testing

Declaration
public object Parsed { get; }
Property Value
Type Description
System.Object

TypeInfo

Type of the value. Can be simple or constructed

Declaration
public CLTypeInfo TypeInfo { get; }
Property Value
Type Description
CLTypeInfo

Methods

Bool(Boolean)

Returns a CLValue object with a boolean type.

Declaration
public static CLValue Bool(bool value)
Parameters
Type Name Description
System.Boolean value
Returns
Type Description
CLValue

ByteArray(Byte[])

Returns a CLValue object with a ByteArray type.

Declaration
public static CLValue ByteArray(byte[] bytes)
Parameters
Type Name Description
System.Byte[] bytes
Returns
Type Description
CLValue

ByteArray(String)

Returns a CLValue object with a ByteArray type.

Declaration
public static CLValue ByteArray(string hex)
Parameters
Type Name Description
System.String hex
Returns
Type Description
CLValue

EmptyList(CLTypeInfo)

Returns a CLValue object with an empty list for a defined type.

Declaration
public static CLValue EmptyList(CLTypeInfo innerTypeInfo)
Parameters
Type Name Description
CLTypeInfo innerTypeInfo
Returns
Type Description
CLValue

EmptyMap(CLTypeInfo, CLTypeInfo)

Returns a CLValue object with an empty map for a defined key/value types.

Declaration
public static CLValue EmptyMap(CLTypeInfo keyTypeInfo, CLTypeInfo valueTypeInfo)
Parameters
Type Name Description
CLTypeInfo keyTypeInfo
CLTypeInfo valueTypeInfo
Returns
Type Description
CLValue

Err(CLValue, CLTypeInfo)

Returns a Result CLValue with wrapped Err value inside. To be complete, it must be indicated the type for an ok value

Declaration
public static CLValue Err(CLValue err, CLTypeInfo okTypeInfo)
Parameters
Type Name Description
CLValue err
CLTypeInfo okTypeInfo
Returns
Type Description
CLValue

I32(Int32)

Returns a CLValue object with an Int32 type.

Declaration
public static CLValue I32(int value)
Parameters
Type Name Description
System.Int32 value
Returns
Type Description
CLValue

I64(Int64)

Returns a CLValue object with an Int64 type.

Declaration
public static CLValue I64(long value)
Parameters
Type Name Description
System.Int64 value
Returns
Type Description
CLValue

IsNone()

Returns trueif the object has Option type with None value. False otherwise.

Declaration
public bool IsNone()
Returns
Type Description
System.Boolean

IsSome()

Returns trueif the object has Option type with Some value. False otherwise.

Declaration
public bool IsSome()
Returns
Type Description
System.Boolean

Key(GlobalStateKey)

Returns a CLValue object with a GlobalStateKey in it

Declaration
public static CLValue Key(GlobalStateKey key)
Parameters
Type Name Description
GlobalStateKey key
Returns
Type Description
CLValue

KeyFromPublicKey(PublicKey)

Converts a public key into an account hash an returns it wrapped into a Key CLValue

Declaration
public static CLValue KeyFromPublicKey(PublicKey publicKey)
Parameters
Type Name Description
PublicKey publicKey
Returns
Type Description
CLValue

List(CLValue[])

Returns a List CLValue object.

Declaration
public static CLValue List(CLValue[] values)
Parameters
Type Name Description
CLValue[] values
Returns
Type Description
CLValue

Map(Dictionary<CLValue, CLValue>)

Returns a Map CLValue object.

Declaration
public static CLValue Map(Dictionary<CLValue, CLValue> dict)
Parameters
Type Name Description
Dictionary<CLValue, CLValue> dict
Returns
Type Description
CLValue

Ok(CLValue, CLTypeInfo)

Returns a Result CLValue with wrapped OK value inside. To be complete, it must be indicated the type for an err value

Declaration
public static CLValue Ok(CLValue ok, CLTypeInfo errTypeInfo)
Parameters
Type Name Description
CLValue ok
CLTypeInfo errTypeInfo
Returns
Type Description
CLValue

Option(CLValue)

Wraps a CLValue object into an Option CLValue.

Declaration
public static CLValue Option(CLValue innerValue)
Parameters
Type Name Description
CLValue innerValue
Returns
Type Description
CLValue

Option(CLValue[])

Declaration
public static CLValue Option(CLValue[] innerValue)
Parameters
Type Name Description
CLValue[] innerValue
Returns
Type Description
CLValue

Option(GlobalStateKey)

Declaration
public static CLValue Option(GlobalStateKey innerValue)
Parameters
Type Name Description
GlobalStateKey innerValue
Returns
Type Description
CLValue

Option(PublicKey)

Declaration
public static CLValue Option(PublicKey innerValue)
Parameters
Type Name Description
PublicKey innerValue
Returns
Type Description
CLValue

Option(URef)

Declaration
public static CLValue Option(URef innerValue)
Parameters
Type Name Description
URef innerValue
Returns
Type Description
CLValue

Option(Dictionary<CLValue, CLValue>)

Declaration
public static CLValue Option(Dictionary<CLValue, CLValue> innerValue)
Parameters
Type Name Description
Dictionary<CLValue, CLValue> innerValue
Returns
Type Description
CLValue

Option(Byte)

Declaration
public static CLValue Option(byte innerValue)
Parameters
Type Name Description
System.Byte innerValue
Returns
Type Description
CLValue

Option(Byte[])

Declaration
public static CLValue Option(byte[] innerValue)
Parameters
Type Name Description
System.Byte[] innerValue
Returns
Type Description
CLValue

Option(Int32)

Declaration
public static CLValue Option(int innerValue)
Parameters
Type Name Description
System.Int32 innerValue
Returns
Type Description
CLValue

Option(Int64)

Declaration
public static CLValue Option(long innerValue)
Parameters
Type Name Description
System.Int64 innerValue
Returns
Type Description
CLValue

Option(String)

Declaration
public static CLValue Option(string innerValue)
Parameters
Type Name Description
System.String innerValue
Returns
Type Description
CLValue

Option(UInt32)

Declaration
public static CLValue Option(uint innerValue)
Parameters
Type Name Description
System.UInt32 innerValue
Returns
Type Description
CLValue

Option(UInt64)

Declaration
public static CLValue Option(ulong innerValue)
Parameters
Type Name Description
System.UInt64 innerValue
Returns
Type Description
CLValue

OptionNone(CLTypeInfo)

Declaration
public static CLValue OptionNone(CLTypeInfo innerTypeInfo)
Parameters
Type Name Description
CLTypeInfo innerTypeInfo
Returns
Type Description
CLValue

PublicKey(PublicKey)

Returns a CLValue object with a PublicKey type.

Declaration
public static CLValue PublicKey(PublicKey publicKey)
Parameters
Type Name Description
PublicKey publicKey
Returns
Type Description
CLValue

PublicKey(Byte[], KeyAlgo)

Returns a CLValue object with a PublicKey type.

Declaration
public static CLValue PublicKey(byte[] value, KeyAlgo keyAlgorithm)
Parameters
Type Name Description
System.Byte[] value
KeyAlgo keyAlgorithm
Returns
Type Description
CLValue

Some(out Object)

Unwraps the value in an Option object with Some value.

Declaration
public bool Some(out object value)
Parameters
Type Name Description
System.Object value

A .NET object unwrapped from Option.Some().

Returns
Type Description
System.Boolean

True if a value has been unwrapped. False otherwise.

Some<T>(out T)

Unwraps the value in an Option object with Some value.

Declaration
public bool Some<T>(out T value)
Parameters
Type Name Description
T value

An object with type T unwrapped from Option.Some().

Returns
Type Description
System.Boolean

True if a value has been unwrapped. False otherwise.

Type Parameters
Name Description
T

String(String)

Returns a CLValue object with a String type.

Declaration
public static CLValue String(string value)
Parameters
Type Name Description
System.String value
Returns
Type Description
CLValue

ToBigInteger()

Converts a CLValueto a BigInteger

Declaration
public BigInteger ToBigInteger()
Returns
Type Description
BigInteger

ToBoolean()

Converts a CLValueto a boolean

Declaration
public bool ToBoolean()
Returns
Type Description
System.Boolean

ToByte()

Converts a CLValueto a U8/byte

Declaration
public byte ToByte()
Returns
Type Description
System.Byte

ToByteArray()

Converts ByteArray CLValue to a byte[]

Declaration
public byte[] ToByteArray()
Returns
Type Description
System.Byte[]

ToDictionary()

Converts Map CLValue to Dictionary<CLValue,CLValue>.

Declaration
public IDictionary ToDictionary()
Returns
Type Description
IDictionary

ToDictionary<TKey, TValue>()

Converts Map CLValue to Dictionary<TKey,TValue>.

Declaration
public Dictionary<TKey, TValue> ToDictionary<TKey, TValue>()
Returns
Type Description
Dictionary<TKey, TValue>
Type Parameters
Name Description
TKey
TValue

ToGlobalStateKey()

Converts a CLValue to a GlobalStateKey

Declaration
public GlobalStateKey ToGlobalStateKey()
Returns
Type Description
GlobalStateKey

ToInt32()

Converts a CLValueto a Int32

Declaration
public int ToInt32()
Returns
Type Description
System.Int32

ToInt64()

Converts a CLValueto a Int64

Declaration
public long ToInt64()
Returns
Type Description
System.Int64

ToList()

Converts a List CLValue to a List<>.

Declaration
public IList ToList()
Returns
Type Description
IList

ToList<T>()

Converts a List CLValue to a List<T>.

Declaration
public List<T> ToList<T>()
Returns
Type Description
List<T>
Type Parameters
Name Description
T

ToPublicKey()

Converts a CLValueto a PublicKey

Declaration
public PublicKey ToPublicKey()
Returns
Type Description
PublicKey

ToResult<TOk, TErr>()

Declaration
public Result<TOk, TErr> ToResult<TOk, TErr>()
Returns
Type Description
Result<TOk, TErr>
Type Parameters
Name Description
TOk
TErr

ToString()

Converts a CLValueto a String

Declaration
public override string ToString()
Returns
Type Description
System.String

ToTuple1<T1>()

Declaration
public Tuple<T1> ToTuple1<T1>()
Returns
Type Description
Tuple<T1>
Type Parameters
Name Description
T1

ToTuple2<T1, T2>()

Declaration
public Tuple<T1, T2> ToTuple2<T1, T2>()
Returns
Type Description
Tuple<T1, T2>
Type Parameters
Name Description
T1
T2

ToTuple3<T1, T2, T3>()

Declaration
public Tuple<T1, T2, T3> ToTuple3<T1, T2, T3>()
Returns
Type Description
Tuple<T1, T2, T3>
Type Parameters
Name Description
T1
T2
T3

ToUInt32()

Converts a CLValueto a UInt32

Declaration
public uint ToUInt32()
Returns
Type Description
System.UInt32

ToUInt64()

Converts a CLValueto a UInt64

Declaration
public ulong ToUInt64()
Returns
Type Description
System.UInt64

ToUnit()

Converts Unit CLValue to Unit.

Declaration
public Unit ToUnit()
Returns
Type Description
Unit

ToURef()

Converts a CLValueto a URef

Declaration
public URef ToURef()
Returns
Type Description
URef

Tuple1(CLValue)

Returns a Tuple1 CLValue object.

Declaration
public static CLValue Tuple1(CLValue t0)
Parameters
Type Name Description
CLValue t0
Returns
Type Description
CLValue

Tuple2(CLValue, CLValue)

Returns a Tuple2 CLValue object.

Declaration
public static CLValue Tuple2(CLValue t0, CLValue t1)
Parameters
Type Name Description
CLValue t0
CLValue t1
Returns
Type Description
CLValue

Tuple3(CLValue, CLValue, CLValue)

Returns a Tuple3 CLValue object.

Declaration
public static CLValue Tuple3(CLValue t0, CLValue t1, CLValue t2)
Parameters
Type Name Description
CLValue t0
CLValue t1
CLValue t2
Returns
Type Description
CLValue

U128(BigInteger)

Returns a CLValue object with an U128 type.

Declaration
public static CLValue U128(BigInteger value)
Parameters
Type Name Description
BigInteger value
Returns
Type Description
CLValue

U256(BigInteger)

Returns a CLValue object with an U256 type.

Declaration
public static CLValue U256(BigInteger value)
Parameters
Type Name Description
BigInteger value
Returns
Type Description
CLValue

U32(UInt32)

Returns a CLValue object with an UInt32 type.

Declaration
public static CLValue U32(UInt32 value)
Parameters
Type Name Description
UInt32 value
Returns
Type Description
CLValue

U512(BigInteger)

Returns a CLValue object with an U512 type.

Declaration
public static CLValue U512(BigInteger value)
Parameters
Type Name Description
BigInteger value
Returns
Type Description
CLValue

U512(UInt64)

Returns a CLValue object with an U512 type.

Declaration
public static CLValue U512(UInt64 value)
Parameters
Type Name Description
UInt64 value
Returns
Type Description
CLValue

U64(UInt64)

Returns a CLValue object with an UInt64 type.

Declaration
public static CLValue U64(UInt64 value)
Parameters
Type Name Description
UInt64 value
Returns
Type Description
CLValue

U8(Byte)

Returns a CLValue object with an U8/byte type.

Declaration
public static CLValue U8(byte value)
Parameters
Type Name Description
System.Byte value
Returns
Type Description
CLValue

Unit()

Returns a CLValue object with a Unit type.

Declaration
public static CLValue Unit()
Returns
Type Description
CLValue

URef(URef)

Returns a CLValue object with a URef type.

Declaration
public static CLValue URef(URef value)
Parameters
Type Name Description
URef value
Returns
Type Description
CLValue

URef(String)

Returns a CLValue object with a URef type.

Declaration
public static CLValue URef(string value)
Parameters
Type Name Description
System.String value
Returns
Type Description
CLValue

Operators

Explicit(CLValue to BigInteger)

Declaration
public static explicit operator BigInteger(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
BigInteger

Explicit(CLValue to GlobalStateKey)

Declaration
public static explicit operator GlobalStateKey(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
GlobalStateKey

Explicit(CLValue to PublicKey)

Declaration
public static explicit operator PublicKey(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
PublicKey

Explicit(CLValue to Unit)

Declaration
public static explicit operator Unit(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
Unit

Explicit(CLValue to URef)

Declaration
public static explicit operator URef(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
URef

Explicit(CLValue to Boolean)

Declaration
public static explicit operator bool (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.Boolean

Explicit(CLValue to Byte)

Declaration
public static explicit operator byte (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.Byte

Explicit(CLValue to Byte[])

Declaration
public static explicit operator byte[](CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.Byte[]

Explicit(CLValue to Int32)

Declaration
public static explicit operator int (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.Int32

Explicit(CLValue to Int64)

Declaration
public static explicit operator long (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.Int64

Explicit(CLValue to String)

Declaration
public static explicit operator string (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.String

Explicit(CLValue to UInt32)

Declaration
public static explicit operator uint (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.UInt32

Explicit(CLValue to UInt64)

Declaration
public static explicit operator ulong (CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
System.UInt64

Implicit(String to CLValue)

Declaration
public static implicit operator CLValue(string s)
Parameters
Type Name Description
System.String s
Returns
Type Description
CLValue
In This Article
Back to top Maintained by MAKE Technology LLC