Value

Manipulate Cardano Value Easily

Mesh provides a full set of value methods to help converting, operating, accessing and comparing Cardano data.

Value Types Support

Convertor

  • value
  • mValue
  • fromAssets
  • toAssets
  • fromValue
  • toData
  • toJSON

Operators

  • addAsset
  • addAssets
  • negateAsset
  • negateAssets
  • merge

Accessor

  • get
  • units

Comparator

  • geq
  • geqUnit
  • leq
  • leqUnit
  • isEmpty

The utility function to convert assets into Cardano data Value in JSON

value converts assets into Cardano data Value in JSON with parameters:

  • assets - Asset[] to convert
value

Converts assets into MeshValue with parameters - asset[] e.g. ada value, simple token token, complex value.

The utility function to convert assets into Cardano data Value in Mesh Data type

mValue converts assets into Cardano data value in Mesh Data type with parameters:

  • assets - Asset[] to convert
mValue

Converts assets into MeshValue with parameters - asset[] e.g. ada value, simple token token, complex value.

Converts assets into MeshValue with parameters - asset[]

fromAssets converts assets into MeshValue with parameters:

  • assets - the assets to convert
fromAssets

Converts assets into MeshValue with parameters - asset[] e.g. ada value, simple token token, complex value.

Converts the MeshValue object into an array of Asset

toAssets Convert the MeshValue object into an array of Asset

toAssets

Converts the MeshValue object into an array of Asset

Converting Value (the JSON representation of Cardano data Value) into MeshValue

fromValue Convert Value (the JSON representation of Cardano data Value) into MeshValue with parameters:

  • plutusValue - the value to convert
fromValue

Convert Value (the JSON representation of Cardano data Value) into MeshValue.

Converts the MeshValue object into Cardano data Value in Mesh Data type

toData Convert the MashValue object into Cardano data Value in Mesh Data type

toData

Converts the MeshValue object into Cardano data Value in Mesh Data type

Converts the MeshValue object into a JSON representation of Cardano data Value

toJSON Converts the MeshValue object into a JSON representation of Cardano data Value

toJSON

Converts the MeshValue object into a JSON representation of Cardano data Value

Add an asset to the Value class's value record with parameters - asset

addAsset Add an asset to the Value class's value record with parameters:

    asset - Asset to add
addAsset

Add an asset to the Value class's value record with parameters - asset

Add an array of assets to the Value class's value record with parameters - assets

addAssets Add an array of assets to the Value class's value record with parameters:

    assets - Asset[] to add
addAssets

Add an array of assets to the Value class's value record with parameters - assets

Substract an asset from the Value class's value record with parameters - asset

negateAsset Substract an asset from the Value class's value record with parameters:

    asset - Asset to substract
negateAsset

Substract an asset from the Value class's value record with parameters - asset

Substract an array of assets from the Value class's value record with parameters - assets

negateAssets Substract an array of assets from the Value class's value record with parameters:

    assets - Asset[] to substract
negateAssets

Substract an array of assets from the Value class's value record with parameters - assets

Merge the given values with parameters - values

merge Merge the given values

    values - The other values to merge
merge

Merge the given values with parameters - values

Get the quantity of asset object per lovelace unit

get get the quantity of asset object per unit, with parameters

  • unit - the unit to get the quantity of the assets e.g. lovelace
get

Get the quantity of asset object per unit

Get all asset units with no parameters needed

units get all asset units with no parameters (e.g. unit) needed

units

Get all asset units with no parameters needed

Check if the value is greater than or equal to another value with parameters - other

geq Check if the value is greater than or equal to another value with parameters:

  • other - The MeshValue to compare against
geq

Check if the value is greater than or equal to another value with parameters - other

Check if the value is greater than or equal to another value with parameters - unit, other

geqUnit Check if the value is greater than or equal to another value with parameters:

  • unit - The unit to compare
  • other - The MeshValue to compare against
geqUnit

Check if the value is greater than or equal to another value with parameters - unit, other

Check if the value is less than or equal to another value with parameters - other

leq Check if the value is less than or equal to another value with parameters:

  • other - The MeshValue to compare against
leq

Check if the value is less than or equal to another value with parameters - other

Check if the specific unit of value is less than or equal to that unit of another value with parameters - unit, other

leqUnit Check if the specific unit of value is less than or equal to that unit of another value with parameters:

  • unit - The unit to compare
  • other - The MeshValue to compare against
lequnit

Check if the specific unit of value is less than or equal to that unit of another value with parameters - unit, other

Check if the value is empty

isEmpty Check if the value is empty

isEmpty

Check if the value is empty