Value
@harmoniclabs/cardano-ledger-ts • Docs
@harmoniclabs/cardano-ledger-ts / Value
Class: Value
Implements
ToCbor
ToData
Constructors
new Value()
new Value(
map
):Value
Parameters
• map: IValue
Returns
Defined in
Properties
lovelaces
readonly
lovelaces:bigint
Defined in
map
readonly
map:NormalizedIValue
Defined in
Accessors
zero
get
static
zero():Value
Returns
Defined in
Methods
[iterator]()
[iterator]():
Generator
<object
,void
,unknown
>
Returns
Generator
<object
, void
, unknown
>
assets
assets:
IValueAssetBI
[]
policy
policy:
string
Defined in
clone()
clone():
Value
Returns
Defined in
get()
get(
policy
,assetName
):bigint
Parameters
• policy: string
| Uint8Array
| Hash28
• assetName: Uint8Array
Returns
bigint
Defined in
toCbor()
toCbor():
CborString
Returns
CborString
Implementation of
ToCbor.toCbor
Defined in
toCborObj()
toCborObj():
CborObj
Returns
CborObj
Implementation of
ToCbor.toCborObj
Defined in
toData()
toData():
DataMap
<DataB
,DataMap
<DataB
,DataI
>>
Returns
DataMap
<DataB
, DataMap
<DataB
, DataI
>>
Implementation of
ToData.toData
Defined in
toJson()
toJson():
ValueJson
Returns
Defined in
toString()
toString(
includeLovelaces
):string
cardano-cli format
Parameters
• includeLovelaces: boolean
= true
Returns
string
Defined in
toUnits()
toUnits():
ValueUnitsBI
Returns
Defined in
add()
static
add(a
,b
):Value
Parameters
• a: Value
• b: Value
Returns
Defined in
assetEntry()
static
assetEntry(name
,qty
):IValueAssetBI
Parameters
• name: Uint8Array
• qty: number
| bigint
Returns
Defined in
entry()
static
entry(policy
,assets
):NormalizedIValuePolicyEntry
Parameters
• policy: Hash28
• assets: IValueAsset
[]
Returns
Defined in
fromCbor()
static
fromCbor(cStr
):Value
Parameters
• cStr: CanBeCborString
Returns
Defined in
fromCborObj()
static
fromCborObj(cObj
):Value
Parameters
• cObj: CborObj
Returns
Defined in
fromUnits()
static
fromUnits(units
):Value
Parameters
• units: ValueUnits
Returns
Defined in
isAdaOnly()
static
isAdaOnly(v
):boolean
Parameters
• v: Value
Returns
boolean
Defined in
isPositive()
static
isPositive(v
):boolean
Parameters
• v: Value
Returns
boolean
Defined in
isZero()
static
isZero(v
):boolean
Parameters
• v: Value
Returns
boolean
Defined in
lovelaceEntry()
static
lovelaceEntry(n
):NormalizedIValueAdaEntry
Parameters
• n: CanBeUInteger
Returns
Defined in
lovelaces()
static
lovelaces(n
):Value
Parameters
• n: number
| bigint
Returns
Defined in
singleAsset()
static
singleAsset(policy
,name
,qty
):Value
Parameters
• policy: Hash28
• name: Uint8Array
• qty: number
| bigint
Returns
Defined in
singleAssetEntry()
static
singleAssetEntry(policy
,name
,qty
):NormalizedIValuePolicyEntry
Parameters
• policy: Hash28
• name: Uint8Array
• qty: number
| bigint
Returns
Defined in
sub()
static
sub(a
,b
):Value
Parameters
• a: Value
• b: Value