Coin

scalus.cardano.ledger.Coin
See theCoin companion object
final case class Coin(value: Long)

Represents an amount of Cardano's native currency (ADA)

On the wire a coin is unsigned (Conway CDDL coin = uint), and the CBOR decoder rejects negative values. The constructor deliberately allows negative amounts: balancing and Value arithmetic produce transient negative differences.

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 +(other: Coin): Coin

Add another coin amount

Add another coin amount

Attributes

infix def -(other: Coin): Coin

Subtract another coin amount

Subtract another coin amount

Attributes

infix def <(other: Coin): Boolean
infix def <=(other: Coin): Boolean
infix def >(other: Coin): Boolean
infix def >=(other: Coin): Boolean
def isZero: Boolean
def nonZero: Boolean
def unary_-: Coin

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product