Table of Contents

Class ArkVtxo

Namespace
NArk.Abstractions.VTXOs
Assembly
NArk.Abstractions.dll

A VTXO stored by the SDK: an off-chain tree output, a boarding UTXO, or an unrolled on-chain output.

public record ArkVtxo : IEquatable<ArkVtxo>
Inheritance
ArkVtxo
Implements
Inherited Members

Constructors

ArkVtxo(string, string, uint, ulong, string?, string?, bool, DateTimeOffset, DateTimeOffset?, uint?, bool, bool, IReadOnlyList<string>?, string?, IReadOnlyList<VtxoAsset>?, Dictionary<string, string>?)

A VTXO stored by the SDK: an off-chain tree output, a boarding UTXO, or an unrolled on-chain output.

public ArkVtxo(string Script, string TransactionId, uint TransactionOutputIndex, ulong Amount, string? SpentByTransactionId, string? SettledByTransactionId, bool Swept, DateTimeOffset CreatedAt, DateTimeOffset? ExpiresAt, uint? ExpiresAtHeight, bool Preconfirmed = false, bool Unrolled = false, IReadOnlyList<string>? CommitmentTxids = null, string? ArkTxid = null, IReadOnlyList<VtxoAsset>? Assets = null, Dictionary<string, string>? Metadata = null)

Parameters

Script string
TransactionId string
TransactionOutputIndex uint
Amount ulong
SpentByTransactionId string
SettledByTransactionId string
Swept bool
CreatedAt DateTimeOffset
ExpiresAt DateTimeOffset?
ExpiresAtHeight uint?
Preconfirmed bool
Unrolled bool
CommitmentTxids IReadOnlyList<string>
ArkTxid string
Assets IReadOnlyList<VtxoAsset>
Metadata Dictionary<string, string>

Fields

ConfirmedMetadataKey

Metadata key carrying the on-chain confirmation state of an unrolled (on-chain) VTXO, as bool.ToString() ("True"/"False"). Populated by the boarding-UTXO sync from the explorer's confirmation status. The writer (BoardingUtxoSyncService) and all readers share this constant.

public const string ConfirmedMetadataKey = "Confirmed"

Field Value

string

Properties

Amount

public ulong Amount { get; init; }

Property Value

ulong

ArkTxid

public string? ArkTxid { get; init; }

Property Value

string

Assets

public IReadOnlyList<VtxoAsset>? Assets { get; init; }

Property Value

IReadOnlyList<VtxoAsset>

CommitmentTxids

public IReadOnlyList<string>? CommitmentTxids { get; init; }

Property Value

IReadOnlyList<string>

CreatedAt

public DateTimeOffset CreatedAt { get; init; }

Property Value

DateTimeOffset

ExpiresAt

public DateTimeOffset? ExpiresAt { get; init; }

Property Value

DateTimeOffset?

ExpiresAtHeight

public uint? ExpiresAtHeight { get; init; }

Property Value

uint?

Metadata

public Dictionary<string, string>? Metadata { get; init; }

Property Value

Dictionary<string, string>

OutPoint

Outpoint identifying this VTXO (txid + vout).

public OutPoint OutPoint { get; }

Property Value

OutPoint

Preconfirmed

public bool Preconfirmed { get; init; }

Property Value

bool

Script

public string Script { get; init; }

Property Value

string

SettledByTransactionId

public string? SettledByTransactionId { get; init; }

Property Value

string

SpentByTransactionId

public string? SpentByTransactionId { get; init; }

Property Value

string

Swept

public bool Swept { get; init; }

Property Value

bool

TransactionId

public string TransactionId { get; init; }

Property Value

string

TransactionOutputIndex

public uint TransactionOutputIndex { get; init; }

Property Value

uint

TxOut

The transaction output (amount + scriptPubKey) for PSBT construction.

public TxOut TxOut { get; }

Property Value

TxOut

Unrolled

public bool Unrolled { get; init; }

Property Value

bool

Methods

CanSpendOffchain(TimeHeight)

True when the VTXO is unspent and not yet recoverable (can participate in an offchain intent).

public bool CanSpendOffchain(TimeHeight current)

Parameters

current TimeHeight

Returns

bool

IsRecoverable(TimeHeight)

True when the VTXO can be redeemed on-chain (swept or past expiry).

public bool IsRecoverable(TimeHeight current)

Parameters

current TimeHeight

Returns

bool

IsSpent()

True if this VTXO has been spent offchain or settled on-chain.

public bool IsSpent()

Returns

bool

IsUnconfirmedOnchain()

True when this VTXO is an on-chain output whose funding transaction is not yet confirmed, and therefore cannot be spent or settled. Reads the ConfirmedMetadataKey flag: a value other than "True" (case-insensitive) means unconfirmed.

Today only boarding UTXOs carry this flag (set by the boarding-UTXO sync from the explorer). VTXOs without the key — off-chain tree VTXOs and arkd-reported unrolled VTXOs, which the indexer does not surface confirmation data for — return false. If confirmation data is later wired for arkd-reported unrolled VTXOs, setting the same flag makes this (and every consumer) generalise without further changes.

public bool IsUnconfirmedOnchain()

Returns

bool

ToCoin()

Wraps this VTXO as an NBitcoin NBitcoin.ICoinable for use in PSBT construction.

public ICoinable ToCoin()

Returns

ICoinable