Evolution SDK

UTxO.ts

UTxO overview


Table of contents


combinators

add

Add a UTxO to the set.

Signature

export declare const add: (set: UTxOSet, utxo: UTxO) => UTxOSet

Added in v2.0.0

difference

Difference of two UTxO sets (elements in a but not in b).

Signature

export declare const difference: (a: UTxOSet, b: UTxOSet) => UTxOSet

Added in v2.0.0

filter

Filter UTxOs in the set by predicate.

Signature

export declare const filter: (set: UTxOSet, predicate: (utxo: UTxO) => boolean) => UTxOSet

Added in v2.0.0

intersection

Intersection of two UTxO sets.

Signature

export declare const intersection: (a: UTxOSet, b: UTxOSet) => UTxOSet

Added in v2.0.0

remove

Remove a UTxO from the set.

Signature

export declare const remove: (set: UTxOSet, utxo: UTxO) => UTxOSet

Added in v2.0.0

union

Union of two UTxO sets.

Signature

export declare const union: (a: UTxOSet, b: UTxOSet) => UTxOSet

Added in v2.0.0

constructors

empty

Create an empty UTxO set.

Signature

export declare const empty: () => UTxOSet

Added in v2.0.0

fromIterable

Create a UTxO set from an iterable of UTxOs.

Signature

export declare const fromIterable: (utxos: Iterable<UTxO>) => UTxOSet

Added in v2.0.0

conversions

toArray

Convert a UTxO set to an array.

Signature

export declare const toArray: (set: UTxOSet) => Array<UTxO>

Added in v2.0.0

getters

size

Get the number of UTxOs in the set.

Signature

export declare const size: (set: UTxOSet) => number

Added in v2.0.0

toOutRefString

Get the output reference string for a UTxO (txHash#index format).

Signature

export declare const toOutRefString: (utxo: UTxO) => string

Added in v2.0.0

model

UTxO (class)

UTxO (Unspent Transaction Output) - A transaction output with its on-chain reference.

Combines TransactionOutput with the transaction reference (transactionId + index) that uniquely identifies it on the blockchain.

Signature

export declare class UTxO

Added in v2.0.0

toJSON (method)

Signature

toJSON()

toString (method)

Signature

toString(): string

[Equal.symbol] (method)

Signature

[Equal.symbol](that: unknown): boolean

[Hash.symbol] (method)

Signature

[Hash.symbol](): number

models

UTxOSet (type alias)

A set of UTxOs with efficient lookups and set operations. Uses Effect's HashSet for automatic deduplication via Hash protocol.

Signature

export type UTxOSet = HashSet.HashSet<UTxO>

Added in v2.0.0

predicates

has

Check if a UTxO exists in the set.

Signature

export declare const has: (set: UTxOSet, utxo: UTxO) => boolean

Added in v2.0.0

isEmpty

Check if the set is empty.

Signature

export declare const isEmpty: (set: UTxOSet) => boolean

Added in v2.0.0

isUTxO

Check if the given value is a valid UTxO.

Signature

export declare const isUTxO: (u: unknown, overrideOptions?: ParseOptions | number) => u is UTxO

Added in v2.0.0