Class LockupFateReader
- Namespace
- NArk.ArkadeIntents.Recovery
- Assembly
- NArk.ArkadeIntents.dll
Deciding from chain data alone whether a swap lockup settled, came back, or is still live.
public static class LockupFateReader
- Inheritance
-
LockupFateReader
- Inherited Members
Remarks
Corridor-neutral on purpose: all four HTLC corridors settle into the same covenant, so what a spend of it means does not depend on which one negotiated it. The Lightning legs, the off-board and the on-board all read the same way here.
Nothing is taken on the counterparty's word. The solver's RFQ status is a convenience and this is the money path — a funded lockup is equally observable whether or not the solver answers, and a solver that would misreport a settlement is exactly the one whose answer matters least.
Methods
ReadAsync(IClientTransport, IVtxoStorage, string, string, CancellationToken)
Read a lockup's fate.
public static Task<LockupFateResult> ReadAsync(IClientTransport transport, IVtxoStorage vtxoStorage, string swapPkScript, string paymentHashHex, CancellationToken cancellationToken = default)
Parameters
transportIClientTransportWhere spending transactions are fetched from.
vtxoStorageIVtxoStorageThe chain view of the lockup's outputs.
swapPkScriptstringThe lockup's scriptPubKey, hex.
paymentHashHexstringThis swap's payment hash, big-endian hex.
cancellationTokenCancellationTokenCancels the lookups.
Returns
- Task<LockupFateResult>
The verdict, with its proof or its stuck outputs.
Remarks
The unreachable cases are checked before any witness is read, so a lockup with one exited output and one claimed sibling reports Exited rather than a verdict that would suggest there is nothing left to do.