Class ArkadeSwapProfile
- Namespace
- NArk.ArkadeIntents.Rfq.Profiles.Asset
- Assembly
- NArk.ArkadeIntents.dll
The arkade:X->arkade:Y profile: an Arkade-to-Arkade swap negotiated over RFQ.
public static class ArkadeSwapProfile
- Inheritance
-
ArkadeSwapProfile
- Inherited Members
Remarks
This is the atomic class, and it differs from the four HTLC corridors in what it does not
have. There is no hash lock, no refund_locktime and no refund path, because the covenant
the client funds only releases the deposit to a transaction that pays the quoted amount to the
client's own script in the same transaction. The solver fills or nothing moves; an offer that is
never filled is reclaimed cooperatively by cancelling it.
The only clock is valid_until. Funding past it is a deposit the solver will decline to
fill, recoverable only by that cancel — which is why this profile's gate checks a clock and
nothing else.
Amounts travel as canonical decimal strings, not JSON numbers: one leg is always an Arkade asset whose atomic unit is 256-bit, and a whole unit of an 18-decimal asset is a hundred times what a double represents exactly.
Fields
BtcLeg
The leg spelling for Arkade sats.
public const string BtcLeg = "arkade:BTC"
Field Value
Methods
Leg(AssetId)
The leg spelling for an Arkade-issued asset.
public static string Leg(AssetId asset)
Parameters
assetAssetIdThe asset.
Returns
- string
arkade:followed by the asset's 68-character hex id.
Pair(AssetId?, AssetId?)
The pair string for a swap between two Arkade legs.
public static string Pair(AssetId? offerAsset, AssetId? wantAsset)
Parameters
offerAssetAssetIdThe asset deposited, or
nullto deposit sats.wantAssetAssetIdThe asset wanted, or
nullto want sats.
Returns
- string
The pair, as the solver spells it.
Exceptions
- ArgumentException
Neither leg names an asset.
Request(AssetId?, AssetId?, BigInteger, RfqAmountSide, byte[], byte[], string?)
Build the request. The pair names the assets; the profile names the client.
public static RfqRequest<ArkadeSwapRequestProfile> Request(AssetId? offerAsset, AssetId? wantAsset, BigInteger amount, RfqAmountSide amountSide, byte[] makerPkScript, byte[] makerPublicKey, string? rfqId = null)
Parameters
offerAssetAssetIdThe asset deposited, or
nullto deposit sats.wantAssetAssetIdThe asset wanted, or
nullto want sats.amountBigIntegerAtomic units of whichever leg
amountSidenames.amountSideRfqAmountSideWhich leg
amountfixes.makerPkScriptbyte[]The client's taproot scriptPubKey, 34 bytes.
makerPublicKeybyte[]The client's x-only key, 32 bytes.
rfqIdstringA correlation id, or
nullto draw a fresh one.
Returns
- RfqRequest<ArkadeSwapRequestProfile>
The request.
Remarks
Unlike the Lightning send profile, where a BOLT11 carries the amount, nothing here implies
one: there is no invoice, and the offer that would state it does not exist until this quote
has been answered. So amount is always required, on whichever side.
Exceptions
- ArgumentException
A parameter is not the shape the covenant needs.