Table of Contents

Struct SwapObservation

Namespace
NArk.ArkadeIntents.Services
Assembly
NArk.ArkadeIntents.dll

What the chain says about a swap's lockup at one moment.

public readonly record struct SwapObservation : IEquatable<SwapObservation>
Implements
Inherited Members

Constructors

SwapObservation(bool, bool, long, long?, bool)

What the chain says about a swap's lockup at one moment.

public SwapObservation(bool Spent, bool Swept, long Now, long? RefundLocktime, bool PreimageRevealed = false)

Parameters

Spent bool

The lockup output has been spent.

Swept bool

The lockup output expired and was swept.

Now long

Unix seconds.

RefundLocktime long?

Unix seconds at which the covenant's timelocked path opens, when the corridor has one.

PreimageRevealed bool

Whether the transaction that spent the lockup carried a preimage hashing to this swap's payment hash. Supplied by the caller, which is the only party that knows the hash to check against.

Properties

Now

Unix seconds.

public long Now { get; init; }

Property Value

long

PastLocktime

True once the timelocked path is open.

public bool PastLocktime { get; }

Property Value

bool

PreimageRevealed

Whether the transaction that spent the lockup carried a preimage hashing to this swap's payment hash. Supplied by the caller, which is the only party that knows the hash to check against.

public bool PreimageRevealed { get; init; }

Property Value

bool

RefundLocktime

Unix seconds at which the covenant's timelocked path opens, when the corridor has one.

public long? RefundLocktime { get; init; }

Property Value

long?

Spent

The lockup output has been spent.

public bool Spent { get; init; }

Property Value

bool

Swept

The lockup output expired and was swept.

public bool Swept { get; init; }

Property Value

bool

Methods

From(ArkVtxo, long, long?, bool)

Read an observation off a VTXO.

public static SwapObservation From(ArkVtxo vtxo, long now, long? refundLocktime, bool preimageRevealed = false)

Parameters

vtxo ArkVtxo

The lockup output.

now long

Unix seconds.

refundLocktime long?

The corridor's refund locktime, if it has one.

preimageRevealed bool

Whether the spend proved a preimage for this swap.

Returns

SwapObservation

The observation.