Skip to main content

Value

@harmoniclabs/cardano-ledger-tsDocs


@harmoniclabs/cardano-ledger-ts / Value

Class: Value

Implements

  • ToCbor
  • ToData

Constructors

new Value()

new Value(map): Value

Parameters

map: IValue

Returns

Value

Defined in

src/ledger/Value/Value.ts:47

Properties

lovelaces

readonly lovelaces: bigint

Defined in

src/ledger/Value/Value.ts:114


map

readonly map: NormalizedIValue

Defined in

src/ledger/Value/Value.ts:36

Accessors

zero

get static zero(): Value

Returns

Value

Defined in

src/ledger/Value/Value.ts:178

Methods

[iterator]()

[iterator](): Generator<object, void, unknown>

Returns

Generator<object, void, unknown>

assets

assets: IValueAssetBI[]

policy

policy: string

Defined in

src/ledger/Value/Value.ts:38


clone()

clone(): Value

Returns

Value

Defined in

src/ledger/Value/Value.ts:287


get()

get(policy, assetName): bigint

Parameters

policy: string | Uint8Array | Hash28

assetName: Uint8Array

Returns

bigint

Defined in

src/ledger/Value/Value.ts:116


toCbor()

toCbor(): CborString

Returns

CborString

Implementation of

ToCbor.toCbor

Defined in

src/ledger/Value/Value.ts:313


toCborObj()

toCborObj(): CborObj

Returns

CborObj

Implementation of

ToCbor.toCborObj

Defined in

src/ledger/Value/Value.ts:317


toData()

toData(): DataMap<DataB, DataMap<DataB, DataI>>

Returns

DataMap<DataB, DataMap<DataB, DataI>>

Implementation of

ToData.toData

Defined in

src/ledger/Value/Value.ts:292


toJson()

toJson(): ValueJson

Returns

ValueJson

Defined in

src/ledger/Value/Value.ts:449


toString()

toString(includeLovelaces): string

cardano-cli format

Parameters

includeLovelaces: boolean = true

Returns

string

Defined in

src/ledger/Value/Value.ts:457


toUnits()

toUnits(): ValueUnitsBI

Returns

ValueUnitsBI

Defined in

src/ledger/Value/Value.ts:135


add()

static add(a, b): Value

Parameters

a: Value

b: Value

Returns

Value

Defined in

src/ledger/Value/Value.ts:277


assetEntry()

static assetEntry(name, qty): IValueAssetBI

Parameters

name: Uint8Array

qty: number | bigint

Returns

IValueAssetBI

Defined in

src/ledger/Value/Value.ts:227


entry()

static entry(policy, assets): NormalizedIValuePolicyEntry

Parameters

policy: Hash28

assets: IValueAsset[]

Returns

NormalizedIValuePolicyEntry

Defined in

src/ledger/Value/Value.ts:269


fromCbor()

static fromCbor(cStr): Value

Parameters

cStr: CanBeCborString

Returns

Value

Defined in

src/ledger/Value/Value.ts:350


fromCborObj()

static fromCborObj(cObj): Value

Parameters

cObj: CborObj

Returns

Value

Defined in

src/ledger/Value/Value.ts:354


fromUnits()

static fromUnits(units): Value

Parameters

units: ValueUnits

Returns

Value

Defined in

src/ledger/Value/Value.ts:150


isAdaOnly()

static isAdaOnly(v): boolean

Parameters

v: Value

Returns

boolean

Defined in

src/ledger/Value/Value.ts:204


isPositive()

static isPositive(v): boolean

Parameters

v: Value

Returns

boolean

Defined in

src/ledger/Value/Value.ts:195


isZero()

static isZero(v): boolean

Parameters

v: Value

Returns

boolean

Defined in

src/ledger/Value/Value.ts:183


lovelaceEntry()

static lovelaceEntry(n): NormalizedIValueAdaEntry

Parameters

n: CanBeUInteger

Returns

NormalizedIValueAdaEntry

Defined in

src/ledger/Value/Value.ts:209


lovelaces()

static lovelaces(n): Value

Parameters

n: number | bigint

Returns

Value

Defined in

src/ledger/Value/Value.ts:222


singleAsset()

static singleAsset(policy, name, qty): Value

Parameters

policy: Hash28

name: Uint8Array

qty: number | bigint

Returns

Value

Defined in

src/ledger/Value/Value.ts:254


singleAssetEntry()

static singleAssetEntry(policy, name, qty): NormalizedIValuePolicyEntry

Parameters

policy: Hash28

name: Uint8Array

qty: number | bigint

Returns

NormalizedIValuePolicyEntry

Defined in

src/ledger/Value/Value.ts:242


sub()

static sub(a, b): Value

Parameters

a: Value

b: Value

Returns

Value

Defined in

src/ledger/Value/Value.ts:282