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
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
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
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
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
EmptyList(CLTypeInfo)
Returns a CLValue object with an empty list for a defined type.
Declaration
public static CLValue EmptyList(CLTypeInfo innerTypeInfo)
Parameters
Returns
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
Returns
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
Returns
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
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
IsNone()
Returns trueif the object has Option type with None value. False otherwise.
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
IsSome()
Returns trueif the object has Option type with Some value. False otherwise.
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
Key(GlobalStateKey)
Returns a CLValue object with a GlobalStateKey in it
Declaration
public static CLValue Key(GlobalStateKey key)
Parameters
Returns
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
Returns
List(CLValue[])
Returns a List CLValue object.
Declaration
public static CLValue List(CLValue[] values)
Parameters
| Type |
Name |
Description |
| CLValue[] |
values |
|
Returns
Map(Dictionary<CLValue, CLValue>)
Returns a Map CLValue object.
Declaration
public static CLValue Map(Dictionary<CLValue, CLValue> dict)
Parameters
Returns
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
Returns
Option(CLValue)
Wraps a CLValue object into an Option CLValue.
Declaration
public static CLValue Option(CLValue innerValue)
Parameters
| Type |
Name |
Description |
| CLValue |
innerValue |
|
Returns
Option(CLValue[])
Declaration
public static CLValue Option(CLValue[] innerValue)
Parameters
| Type |
Name |
Description |
| CLValue[] |
innerValue |
|
Returns
Option(GlobalStateKey)
Declaration
public static CLValue Option(GlobalStateKey innerValue)
Parameters
Returns
Option(PublicKey)
Declaration
public static CLValue Option(PublicKey innerValue)
Parameters
Returns
Option(URef)
Declaration
public static CLValue Option(URef innerValue)
Parameters
| Type |
Name |
Description |
| URef |
innerValue |
|
Returns
Option(Dictionary<CLValue, CLValue>)
Declaration
public static CLValue Option(Dictionary<CLValue, CLValue> innerValue)
Parameters
Returns
Option(Byte)
Declaration
public static CLValue Option(byte innerValue)
Parameters
| Type |
Name |
Description |
| System.Byte |
innerValue |
|
Returns
Option(Byte[])
Declaration
public static CLValue Option(byte[] innerValue)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
innerValue |
|
Returns
Option(Int32)
Declaration
public static CLValue Option(int innerValue)
Parameters
| Type |
Name |
Description |
| System.Int32 |
innerValue |
|
Returns
Option(Int64)
Declaration
public static CLValue Option(long innerValue)
Parameters
| Type |
Name |
Description |
| System.Int64 |
innerValue |
|
Returns
Option(String)
Declaration
public static CLValue Option(string innerValue)
Parameters
| Type |
Name |
Description |
| System.String |
innerValue |
|
Returns
Option(UInt32)
Declaration
public static CLValue Option(uint innerValue)
Parameters
| Type |
Name |
Description |
| System.UInt32 |
innerValue |
|
Returns
Option(UInt64)
Declaration
public static CLValue Option(ulong innerValue)
Parameters
| Type |
Name |
Description |
| System.UInt64 |
innerValue |
|
Returns
OptionNone(CLTypeInfo)
Declaration
public static CLValue OptionNone(CLTypeInfo innerTypeInfo)
Parameters
Returns
PublicKey(PublicKey)
Returns a CLValue object with a PublicKey type.
Declaration
public static CLValue PublicKey(PublicKey publicKey)
Parameters
Returns
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
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
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
ToBigInteger()
Converts a CLValueto a BigInteger
Declaration
public BigInteger ToBigInteger()
Returns
| Type |
Description |
| BigInteger |
|
ToBoolean()
Converts a CLValueto a boolean
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
ToByte()
Converts a CLValueto a U8/byte
Declaration
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
ToInt32()
Converts a CLValueto a Int32
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
ToInt64()
Converts a CLValueto a Int64
Declaration
Returns
| Type |
Description |
| System.Int64 |
|
ToList()
Converts a List CLValue to a List<>.
Declaration
Returns
ToList<T>()
Converts a List CLValue to a List<T>.
Declaration
public List<T> ToList<T>()
Returns
Type Parameters
ToPublicKey()
Converts a CLValueto a PublicKey
Declaration
public PublicKey ToPublicKey()
Returns
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
ToTuple2<T1, T2>()
Declaration
public Tuple<T1, T2> ToTuple2<T1, T2>()
Returns
| Type |
Description |
| Tuple<T1, T2> |
|
Type Parameters
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
Returns
| Type |
Description |
| System.UInt32 |
|
ToUInt64()
Converts a CLValueto a UInt64
Declaration
Returns
| Type |
Description |
| System.UInt64 |
|
ToUnit()
Converts Unit CLValue to Unit.
Declaration
Returns
ToURef()
Converts a CLValueto a URef
Declaration
Returns
Tuple1(CLValue)
Returns a Tuple1 CLValue object.
Declaration
public static CLValue Tuple1(CLValue t0)
Parameters
Returns
Tuple2(CLValue, CLValue)
Returns a Tuple2 CLValue object.
Declaration
public static CLValue Tuple2(CLValue t0, CLValue t1)
Parameters
Returns
Tuple3(CLValue, CLValue, CLValue)
Returns a Tuple3 CLValue object.
Declaration
public static CLValue Tuple3(CLValue t0, CLValue t1, CLValue t2)
Parameters
Returns
U128(BigInteger)
Returns a CLValue object with an U128 type.
Declaration
public static CLValue U128(BigInteger value)
Parameters
| Type |
Name |
Description |
| BigInteger |
value |
|
Returns
U256(BigInteger)
Returns a CLValue object with an U256 type.
Declaration
public static CLValue U256(BigInteger value)
Parameters
| Type |
Name |
Description |
| BigInteger |
value |
|
Returns
U32(UInt32)
Returns a CLValue object with an UInt32 type.
Declaration
public static CLValue U32(UInt32 value)
Parameters
| Type |
Name |
Description |
| UInt32 |
value |
|
Returns
U512(BigInteger)
Returns a CLValue object with an U512 type.
Declaration
public static CLValue U512(BigInteger value)
Parameters
| Type |
Name |
Description |
| BigInteger |
value |
|
Returns
U512(UInt64)
Returns a CLValue object with an U512 type.
Declaration
public static CLValue U512(UInt64 value)
Parameters
| Type |
Name |
Description |
| UInt64 |
value |
|
Returns
U64(UInt64)
Returns a CLValue object with an UInt64 type.
Declaration
public static CLValue U64(UInt64 value)
Parameters
| Type |
Name |
Description |
| UInt64 |
value |
|
Returns
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
Unit()
Returns a CLValue object with a Unit type.
Declaration
public static CLValue Unit()
Returns
URef(URef)
Returns a CLValue object with a URef type.
Declaration
public static CLValue URef(URef value)
Parameters
| Type |
Name |
Description |
| URef |
value |
|
Returns
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
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
Explicit(CLValue to PublicKey)
Declaration
public static explicit operator PublicKey(CLValue clValue)
Parameters
| Type |
Name |
Description |
| CLValue |
clValue |
|
Returns
Explicit(CLValue to Unit)
Declaration
public static explicit operator Unit(CLValue clValue)
Parameters
| Type |
Name |
Description |
| CLValue |
clValue |
|
Returns
Explicit(CLValue to URef)
Declaration
public static explicit operator URef(CLValue clValue)
Parameters
| Type |
Name |
Description |
| CLValue |
clValue |
|
Returns
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