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
SpentboolThe lockup output has been spent.
SweptboolThe lockup output expired and was swept.
NowlongUnix seconds.
RefundLocktimelong?Unix seconds at which the covenant's timelocked path opens, when the corridor has one.
PreimageRevealedboolWhether 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
PastLocktime
True once the timelocked path is open.
public bool PastLocktime { get; }
Property Value
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
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
Swept
The lockup output expired and was swept.
public bool Swept { get; init; }
Property Value
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
vtxoArkVtxoThe lockup output.
nowlongUnix seconds.
refundLocktimelong?The corridor's refund locktime, if it has one.
preimageRevealedboolWhether the spend proved a preimage for this swap.
Returns
- SwapObservation
The observation.