Class ArkadeSwapGates
- Namespace
- NArk.ArkadeIntents.Assets
- Assembly
- NArk.ArkadeIntents.dll
The client's safety gates for the atomic class: pure decisions over a quote and a clock.
public static class ArkadeSwapGates
- Inheritance
-
ArkadeSwapGates
- Inherited Members
Remarks
Shorter than the HTLC corridors' gates, and for a structural reason rather than an oversight.
There is no timelock on this class — neither fulfill nor cancel carries one — so
there is no headroom to check and no refund deadline to stay behind. The covenant itself is what
makes the swap safe: it releases the deposit only to a transaction that pays the quoted amount to
the client's own script. What is left to check is that the terms are the ones that were asked
for, that they have not lapsed, and that the offer is the client's own derivation.
Methods
AssertFundable(RfqQuote<ArkadeSwapQuoteProfile>, string, BigInteger, RfqAmountSide, long, BigInteger?, BigInteger?)
Refuse to fund unless the quote still binds and says what it was asked to say.
public static void AssertFundable(RfqQuote<ArkadeSwapQuoteProfile> quote, string requestedPair, BigInteger requestedAmount, RfqAmountSide amountSide, long now, BigInteger? maxFromAmount = null, BigInteger? minToAmount = null)
Parameters
quoteRfqQuote<ArkadeSwapQuoteProfile>The solver's quote.
requestedPairstringThe pair that was asked for.
requestedAmountBigIntegerThe amount that was asked for, in atomic units.
amountSideRfqAmountSideWhich leg
requestedAmountfixed.nowlongThe current time, unix seconds.
maxFromAmountBigInteger?An optional cap on what the client will deposit.
minToAmountBigInteger?An optional floor on what the client will accept.
Remarks
The two optional bounds are the useful ones, and they bound the side the solver chose. The named side comes back verbatim — asserting it proves nothing about the solver's pricing — so a caller that sets neither is one that funds whatever it is asked for.
Exceptions
- ArkadeSwapNotFundableException
A gate refused.
AssertOfferIsOurs(RfqQuote<ArkadeSwapQuoteProfile>, CreatedOffer)
Accept the solver's offer only when it is, byte for byte, the one the client derived.
public static void AssertOfferIsOurs(RfqQuote<ArkadeSwapQuoteProfile> quote, CreatedOffer derived)
Parameters
quoteRfqQuote<ArkadeSwapQuoteProfile>The quote carrying the compare-only offer.
derivedCreatedOfferThe client's own derivation.
Remarks
Both values are compared, not just the address: the address is what the wallet sends to and the script is what the covenant compiles to, and a solver agreeing about one while differing about the other has not derived the same contract.
Exceptions
- OfferAddressMismatchException
Either value disagrees.