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
ScriptstringTransactionIdstringTransactionOutputIndexuintAmountulongSpentByTransactionIdstringSettledByTransactionIdstringSweptboolCreatedAtDateTimeOffsetExpiresAtDateTimeOffset?ExpiresAtHeightuint?PreconfirmedboolUnrolledboolCommitmentTxidsIReadOnlyList<string>ArkTxidstringAssetsIReadOnlyList<VtxoAsset>MetadataDictionary<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
Properties
Amount
public ulong Amount { get; init; }
Property Value
ArkTxid
public string? ArkTxid { get; init; }
Property Value
Assets
public IReadOnlyList<VtxoAsset>? Assets { get; init; }
Property Value
CommitmentTxids
public IReadOnlyList<string>? CommitmentTxids { get; init; }
Property Value
CreatedAt
public DateTimeOffset CreatedAt { get; init; }
Property Value
ExpiresAt
public DateTimeOffset? ExpiresAt { get; init; }
Property Value
ExpiresAtHeight
public uint? ExpiresAtHeight { get; init; }
Property Value
- uint?
Metadata
public Dictionary<string, string>? Metadata { get; init; }
Property Value
OutPoint
Outpoint identifying this VTXO (txid + vout).
public OutPoint OutPoint { get; }
Property Value
- OutPoint
Preconfirmed
public bool Preconfirmed { get; init; }
Property Value
Script
public string Script { get; init; }
Property Value
SettledByTransactionId
public string? SettledByTransactionId { get; init; }
Property Value
SpentByTransactionId
public string? SpentByTransactionId { get; init; }
Property Value
Swept
public bool Swept { get; init; }
Property Value
TransactionId
public string TransactionId { get; init; }
Property Value
TransactionOutputIndex
public uint TransactionOutputIndex { get; init; }
Property Value
TxOut
The transaction output (amount + scriptPubKey) for PSBT construction.
public TxOut TxOut { get; }
Property Value
- TxOut
Unrolled
public bool Unrolled { get; init; }
Property Value
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
currentTimeHeight
Returns
IsRecoverable(TimeHeight)
True when the VTXO can be redeemed on-chain (swept or past expiry).
public bool IsRecoverable(TimeHeight current)
Parameters
currentTimeHeight
Returns
IsSpent()
True if this VTXO has been spent offchain or settled on-chain.
public bool IsSpent()
Returns
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
ToCoin()
Wraps this VTXO as an NBitcoin NBitcoin.ICoinable for use in PSBT construction.
public ICoinable ToCoin()
Returns
- ICoinable