Value

scalus.cardano.ledger.Value
See theValue companion object
case class Value(coin: Coin, assets: MultiAsset = ...)

Represents a value in Cardano, which can be either pure ADA or ADA with multi-assets

Arithmetic throws ArithmeticException when an amount does not fit in a Long, rather than wrapping around.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

infix def +(rhs: Value): Value
infix def -(rhs: Value): Value
def asset(policyId: PolicyId, assetName: AssetName): Long
Extension method from Value

Get amount of specific asset (0 if not present)

Get amount of specific asset (0 if not present)

Attributes

def hasAsset(policyId: PolicyId, assetName: AssetName): Boolean
Extension method from Value

Check if value contains a specific asset

Check if value contains a specific asset

Attributes

def isEmptyAssets: Boolean
def isNegative: Boolean
def isOnlyAda: Boolean
def isOnlyAssets: Boolean
def isPositive: Boolean
def isZero: Boolean
def isZeroAda: Boolean
def nonEmptyAssets: Boolean
def nonZero: Boolean
def nonZeroAda: Boolean
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def unary_-: Value

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product