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
object
CLValue
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Casper.Network.SDK.Types
Assembly: Casper.Network.SDK.dll
Syntax
public class CLValue

Constructors

| Edit this page View Source

CLValue(byte[], CLType)

Declaration
public CLValue(byte[] bytes, CLType clType)
Parameters
Type Name Description
byte[] bytes
CLType clType
| Edit this page View Source

CLValue(byte[], CLType, object)

Declaration
public CLValue(byte[] bytes, CLType clType, object parsed)
Parameters
Type Name Description
byte[] bytes
CLType clType
object parsed
| Edit this page View Source

CLValue(byte[], CLTypeInfo)

Declaration
public CLValue(byte[] bytes, CLTypeInfo clType)
Parameters
Type Name Description
byte[] bytes
CLTypeInfo clType
| Edit this page View Source

CLValue(byte[], CLTypeInfo, object)

Declaration
[JsonConstructor]
public CLValue(byte[] bytes, CLTypeInfo typeInfo, object parsed)
Parameters
Type Name Description
byte[] bytes
CLTypeInfo typeInfo
object parsed
| Edit this page View Source

CLValue(string, CLTypeInfo, object)

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

Properties

| Edit this page View Source

Bytes

Byte array representation of underlying data

Declaration
[JsonPropertyName("bytes")]
[JsonConverter(typeof(HexBytesConverter))]
public byte[] Bytes { get; }
Property Value
Type Description
byte[]
| Edit this page View Source

Parsed

The optional parsed value of the bytes used when testing

Declaration
[JsonPropertyName("parsed")]
public object Parsed { get; }
Property Value
Type Description
object
| Edit this page View Source

TypeInfo

Type of the value. Can be simple or constructed

Declaration
[JsonPropertyName("cl_type")]
[JsonConverter(typeof(CLTypeInfoConverter))]
public CLTypeInfo TypeInfo { get; }
Property Value
Type Description
CLTypeInfo

Methods

| Edit this page View Source

Bool(bool)

Returns a CLValue object with a boolean type.

Declaration
public static CLValue Bool(bool value)
Parameters
Type Name Description
bool value
Returns
Type Description
CLValue
| Edit this page View Source

ByteArray(byte[])

Returns a CLValue object with a ByteArray type.

Declaration
public static CLValue ByteArray(byte[] bytes)
Parameters
Type Name Description
byte[] bytes
Returns
Type Description
CLValue
| Edit this page View Source

ByteArray(string)

Returns a CLValue object with a ByteArray type.

Declaration
public static CLValue ByteArray(string hex)
Parameters
Type Name Description
string hex
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

I32(int)

Returns a CLValue object with an Int32 type.

Declaration
public static CLValue I32(int value)
Parameters
Type Name Description
int value
Returns
Type Description
CLValue
| Edit this page View Source

I64(long)

Returns a CLValue object with an Int64 type.

Declaration
public static CLValue I64(long value)
Parameters
Type Name Description
long value
Returns
Type Description
CLValue
| Edit this page View Source

IsNone()

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

Declaration
public bool IsNone()
Returns
Type Description
bool
| Edit this page View Source

IsSome()

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

Declaration
public bool IsSome()
Returns
Type Description
bool
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

List(CLValue[])

Returns a List CLValue object.

Declaration
public static CLValue List(CLValue[] values)
Parameters
Type Name Description
CLValue[] values
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

Option(CLValue[])

Declaration
public static CLValue Option(CLValue[] innerValue)
Parameters
Type Name Description
CLValue[] innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(GlobalStateKey)

Declaration
public static CLValue Option(GlobalStateKey innerValue)
Parameters
Type Name Description
GlobalStateKey innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(PublicKey)

Declaration
public static CLValue Option(PublicKey innerValue)
Parameters
Type Name Description
PublicKey innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(URef)

Declaration
public static CLValue Option(URef innerValue)
Parameters
Type Name Description
URef innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(byte)

Declaration
public static CLValue Option(byte innerValue)
Parameters
Type Name Description
byte innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(byte[])

Declaration
public static CLValue Option(byte[] innerValue)
Parameters
Type Name Description
byte[] innerValue
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

Option(int)

Declaration
public static CLValue Option(int innerValue)
Parameters
Type Name Description
int innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(long)

Declaration
public static CLValue Option(long innerValue)
Parameters
Type Name Description
long innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(string)

Declaration
public static CLValue Option(string innerValue)
Parameters
Type Name Description
string innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(uint)

Declaration
public static CLValue Option(uint innerValue)
Parameters
Type Name Description
uint innerValue
Returns
Type Description
CLValue
| Edit this page View Source

Option(ulong)

Declaration
public static CLValue Option(ulong innerValue)
Parameters
Type Name Description
ulong innerValue
Returns
Type Description
CLValue
| Edit this page View Source

OptionNone(CLTypeInfo)

Declaration
public static CLValue OptionNone(CLTypeInfo innerTypeInfo)
Parameters
Type Name Description
CLTypeInfo innerTypeInfo
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

PublicKey(byte[], KeyAlgo)

Returns a CLValue object with a PublicKey type.

Declaration
public static CLValue PublicKey(byte[] value, KeyAlgo keyAlgorithm)
Parameters
Type Name Description
byte[] value
KeyAlgo keyAlgorithm
Returns
Type Description
CLValue
| Edit this page View Source

Some(out object)

Unwraps the value in an Option object with Some value.

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

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

Returns
Type Description
bool

True if a value has been unwrapped. False otherwise.

| Edit this page View Source

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
bool

True if a value has been unwrapped. False otherwise.

Type Parameters
Name Description
T
| Edit this page View Source

String(string)

Returns a CLValue object with a String type.

Declaration
public static CLValue String(string value)
Parameters
Type Name Description
string value
Returns
Type Description
CLValue
| Edit this page View Source

ToBigInteger()

Converts a CLValueto a BigInteger

Declaration
public BigInteger ToBigInteger()
Returns
Type Description
BigInteger
| Edit this page View Source

ToBoolean()

Converts a CLValueto a boolean

Declaration
public bool ToBoolean()
Returns
Type Description
bool
| Edit this page View Source

ToByte()

Converts a CLValueto a U8/byte

Declaration
public byte ToByte()
Returns
Type Description
byte
| Edit this page View Source

ToByteArray()

Converts ByteArray CLValue to a byte[]

Declaration
public byte[] ToByteArray()
Returns
Type Description
byte[]
| Edit this page View Source

ToDictionary()

Converts Map CLValue to Dictionary<CLValue,CLValue>.

Declaration
public IDictionary ToDictionary()
Returns
Type Description
IDictionary
| Edit this page View Source

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
| Edit this page View Source

ToGlobalStateKey()

Converts a CLValue to a GlobalStateKey

Declaration
public GlobalStateKey ToGlobalStateKey()
Returns
Type Description
GlobalStateKey
| Edit this page View Source

ToInt32()

Converts a CLValueto a Int32

Declaration
public int ToInt32()
Returns
Type Description
int
| Edit this page View Source

ToInt64()

Converts a CLValueto a Int64

Declaration
public long ToInt64()
Returns
Type Description
long
| Edit this page View Source

ToList()

Converts a List CLValue to a List<>.

Declaration
public IList ToList()
Returns
Type Description
IList
| Edit this page View Source

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
| Edit this page View Source

ToPublicKey()

Converts a CLValueto a PublicKey

Declaration
public PublicKey ToPublicKey()
Returns
Type Description
PublicKey
| Edit this page View Source

ToResult<TOk, TErr>()

Converts Result CLValue to Result<TOk,TErr>.

Declaration
public Result<TOk, TErr> ToResult<TOk, TErr>()
Returns
Type Description
Result<TOk, TErr>
Type Parameters
Name Description
TOk
TErr
| Edit this page View Source

ToString()

Converts a CLValueto a String

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
| Edit this page View Source

ToTuple1<T1>()

Converts Tuple1 CLValue to Tuple<T1>.

Declaration
public Tuple<T1> ToTuple1<T1>()
Returns
Type Description
Tuple<T1>
Type Parameters
Name Description
T1
| Edit this page View Source

ToTuple2<T1, T2>()

Converts Tuple2 CLValue to Tuple<T1,T2>.

Declaration
public Tuple<T1, T2> ToTuple2<T1, T2>()
Returns
Type Description
Tuple<T1, T2>
Type Parameters
Name Description
T1
T2
| Edit this page View Source

ToTuple3<T1, T2, T3>()

Converts Tuple2 CLValue to Tuple<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
| Edit this page View Source

ToUInt32()

Converts a CLValueto a UInt32

Declaration
public uint ToUInt32()
Returns
Type Description
uint
| Edit this page View Source

ToUInt64()

Converts a CLValueto a UInt64

Declaration
public ulong ToUInt64()
Returns
Type Description
ulong
| Edit this page View Source

ToURef()

Converts a CLValueto a URef

Declaration
public URef ToURef()
Returns
Type Description
URef
| Edit this page View Source

ToUnit()

Converts Unit CLValue to Unit.

Declaration
public Unit ToUnit()
Returns
Type Description
Unit
| Edit this page View Source

Tuple1(CLValue)

Returns a Tuple1 CLValue object.

Declaration
public static CLValue Tuple1(CLValue t0)
Parameters
Type Name Description
CLValue t0
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

U32(uint)

Returns a CLValue object with an UInt32 type.

Declaration
public static CLValue U32(uint value)
Parameters
Type Name Description
uint value
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

U512(ulong)

Returns a CLValue object with an U512 type.

Declaration
public static CLValue U512(ulong value)
Parameters
Type Name Description
ulong value
Returns
Type Description
CLValue
| Edit this page View Source

U64(ulong)

Returns a CLValue object with an UInt64 type.

Declaration
public static CLValue U64(ulong value)
Parameters
Type Name Description
ulong value
Returns
Type Description
CLValue
| Edit this page View Source

U8(byte)

Returns a CLValue object with an U8/byte type.

Declaration
public static CLValue U8(byte value)
Parameters
Type Name Description
byte value
Returns
Type Description
CLValue
| Edit this page View Source

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
| Edit this page View Source

URef(string)

Returns a CLValue object with a URef type.

Declaration
public static CLValue URef(string value)
Parameters
Type Name Description
string value
Returns
Type Description
CLValue
| Edit this page View Source

Unit()

Returns a CLValue object with a Unit type.

Declaration
public static CLValue Unit()
Returns
Type Description
CLValue

Operators

| Edit this page View Source

explicit operator GlobalStateKey(CLValue)

Declaration
public static explicit operator GlobalStateKey(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
GlobalStateKey
| Edit this page View Source

explicit operator PublicKey(CLValue)

Declaration
public static explicit operator PublicKey(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
PublicKey
| Edit this page View Source

explicit operator URef(CLValue)

Declaration
public static explicit operator URef(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
URef
| Edit this page View Source

explicit operator Unit(CLValue)

Declaration
public static explicit operator Unit(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
Unit
| Edit this page View Source

explicit operator bool(CLValue)

Declaration
public static explicit operator bool(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
bool
| Edit this page View Source

explicit operator byte(CLValue)

Declaration
public static explicit operator byte(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
byte
| Edit this page View Source

explicit operator byte[](CLValue)

Declaration
public static explicit operator byte[](CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
byte[]
| Edit this page View Source

explicit operator int(CLValue)

Declaration
public static explicit operator int(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
int
| Edit this page View Source

explicit operator long(CLValue)

Declaration
public static explicit operator long(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
long
| Edit this page View Source

explicit operator BigInteger(CLValue)

Declaration
public static explicit operator BigInteger(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
BigInteger
| Edit this page View Source

explicit operator string(CLValue)

Declaration
public static explicit operator string(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
string
| Edit this page View Source

explicit operator uint(CLValue)

Declaration
public static explicit operator uint(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
uint
| Edit this page View Source

explicit operator ulong(CLValue)

Declaration
public static explicit operator ulong(CLValue clValue)
Parameters
Type Name Description
CLValue clValue
Returns
Type Description
ulong
| Edit this page View Source

implicit operator CLValue(string)

Declaration
public static implicit operator CLValue(string s)
Parameters
Type Name Description
string s
Returns
Type Description
CLValue
  • Edit this page
  • View Source
In this article
Back to top Maintained by MAKE Technology LLC