Class ExitPlan
- Namespace
- NArk.Abstractions.Exit
- Assembly
- NArk.Abstractions.dll
Carries the minimum state the SDK needs to advance from a broadcast
chain to a matured claim. Returned by
UnilateralExitService.BroadcastExitChainAsync and consumed by
UnilateralExitService.ClaimMaturedExitAsync.
The stateless exit path doesn't persist anything itself — the caller owns this record. Serialize it however you like (JSON, a settings entry, a file on disk) and feed it back once you believe the CSV timelock has matured. The SDK re-derives any other state (chain confirmation, current block height, contract data, fee rate) at claim time from the live broadcaster and configured stores.
public record ExitPlan : IEquatable<ExitPlan>
- Inheritance
-
ExitPlan
- Implements
- Inherited Members
Constructors
ExitPlan(string, string, uint, string, string, int, uint)
Carries the minimum state the SDK needs to advance from a broadcast
chain to a matured claim. Returned by
UnilateralExitService.BroadcastExitChainAsync and consumed by
UnilateralExitService.ClaimMaturedExitAsync.
The stateless exit path doesn't persist anything itself — the caller owns this record. Serialize it however you like (JSON, a settings entry, a file on disk) and feed it back once you believe the CSV timelock has matured. The SDK re-derives any other state (chain confirmation, current block height, contract data, fee rate) at claim time from the live broadcaster and configured stores.
public ExitPlan(string WalletId, string VtxoTxid, uint VtxoVout, string ClaimAddress, string LeafTxid, int CsvDelay, uint ExitSequence = 0)
Parameters
WalletIdstringOwning wallet — used to look up the signer and the contract for the VTXO at claim time.
VtxoTxidstringVTXO parent txid (hex).
VtxoVoutuintVTXO parent output index.
ClaimAddressstringBitcoin address that receives the funds on successful claim. Encoded as a string so the record stays serialisable across networks without carrying network metadata.
LeafTxidstringTxid of the leaf virtual tx whose confirmation starts the CSV countdown. The caller can poll an explorer / broadcaster for its confirmation status; maturity is evaluated from ExitDelay against that confirmation.
CsvDelayintCSV delay in blocks, for a height-based ExitDelay;
0when the server's delay is time-based (a block count is meaningless there — read ExitDelay instead). Maturity height isconfirmHeight + CsvDelay.ExitSequenceuintRaw BIP-68
nSequenceof the server's unilateral-exit delay at broadcast time, captured so the claim path can tell a height-based lock from a time-based one without a second server call. Prefer the decoded ExitDelay over this field.
Properties
ClaimAddress
Bitcoin address that receives the funds on successful claim. Encoded as a string so the record stays serialisable across networks without carrying network metadata.
public string ClaimAddress { get; init; }
Property Value
CsvDelay
CSV delay in blocks, for a height-based
ExitDelay; 0 when the server's delay is time-based
(a block count is meaningless there — read ExitDelay
instead). Maturity height is confirmHeight + CsvDelay.
public int CsvDelay { get; init; }
Property Value
ExitDelay
The server's unilateral-exit delay as a BIP-68 relative timelock. Branch on NBitcoin.Sequence.LockType before doing any arithmetic with it: a time-based lock stores 512-second units with bit 22 set, so its raw NBitcoin.Sequence.Value is not a block count.
public Sequence ExitDelay { get; }
Property Value
- Sequence
Exceptions
- InvalidOperationException
The plan predates ExitSequence and its CsvDelay is outside the block range BIP 68 can encode — the signature of a plan captured by an older SDK against a time-based server, where the recorded delay was a raw nSequence misread as blocks. Re-run
BroadcastExitChainAsyncto capture a correct plan.
ExitSequence
Raw BIP-68 nSequence of the server's
unilateral-exit delay at broadcast time, captured so the claim path can
tell a height-based lock from a time-based one without a second server
call. Prefer the decoded ExitDelay over this field.
public uint ExitSequence { get; init; }
Property Value
LeafTxid
Txid of the leaf virtual tx whose confirmation starts the CSV countdown. The caller can poll an explorer / broadcaster for its confirmation status; maturity is evaluated from ExitDelay against that confirmation.
public string LeafTxid { get; init; }
Property Value
VtxoTxid
VTXO parent txid (hex).
public string VtxoTxid { get; init; }
Property Value
VtxoVout
VTXO parent output index.
public uint VtxoVout { get; init; }
Property Value
WalletId
Owning wallet — used to look up the signer and the contract for the VTXO at claim time.
public string WalletId { get; init; }