Class ArkadeSwapIntentMetadataExtensions
- Namespace
- NArk.ArkadeIntents.Models
- Assembly
- NArk.ArkadeIntents.dll
Typed views over Metadata — one per corridor, so the blob is read and written through a shape rather than through string keys at each call site.
public static class ArkadeSwapIntentMetadataExtensions
- Inheritance
-
ArkadeSwapIntentMetadataExtensions
- Inherited Members
Remarks
Each reader checks the intent's Type first. Reading an off-board's
keys off a Lightning swap is not an empty result, it is the wrong question, and answering it with
a record full of nulls turns a mistake at the call site into a NullReferenceException several
frames away.
Methods
AssetMetadata(ArkadeSwapIntent)
Read the asset-swap view.
public static AssetSwapMetadata AssetMetadata(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntent
Returns
Exceptions
- InvalidOperationException
This intent is not an asset swap.
- InvalidOperationException
The row carries no offer, so the cancel path is unreachable.
EvmMetadata(ArkadeSwapIntent)
Read the Arkade-to-EVM recovery view.
public static EvmSwapMetadata EvmMetadata(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntent
Returns
LightningMetadata(ArkadeSwapIntent)
Read the Lightning view.
public static LightningSwapMetadata LightningMetadata(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntent
Returns
Exceptions
- InvalidOperationException
This intent is not a Lightning swap.
OnchainMetadata(ArkadeSwapIntent)
Read the onchain-corridor view.
public static OnchainSwapMetadata OnchainMetadata(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntent
Returns
Exceptions
- InvalidOperationException
This intent is not an onchain corridor swap.
RfqId(ArkadeSwapIntent)
The RFQ negotiation this swap was quoted under, or null if it was not quoted.
public static string? RfqId(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntentThe swap.
Returns
- string
The correlation id, or
null.
SolverPubkey(ArkadeSwapIntent)
The RFQ solver that quoted this swap; broadcast asset offers carry no authenticated solver identity.
public static string? SolverPubkey(this ArkadeSwapIntent intent)
Parameters
intentArkadeSwapIntentThe swap.
Returns
WithAssetMetadata(ArkadeSwapIntent, AssetSwapMetadata)
Write the asset-swap view, replacing whatever those keys held.
public static ArkadeSwapIntent WithAssetMetadata(this ArkadeSwapIntent intent, AssetSwapMetadata metadata)
Parameters
intentArkadeSwapIntentmetadataAssetSwapMetadata
Returns
WithEvmMetadata(ArkadeSwapIntent, EvmSwapMetadata)
Write the Arkade-to-EVM recovery view.
public static ArkadeSwapIntent WithEvmMetadata(this ArkadeSwapIntent intent, EvmSwapMetadata metadata)
Parameters
intentArkadeSwapIntentmetadataEvmSwapMetadata
Returns
WithLightningMetadata(ArkadeSwapIntent, LightningSwapMetadata)
Write the Lightning view, replacing whatever those keys held.
public static ArkadeSwapIntent WithLightningMetadata(this ArkadeSwapIntent intent, LightningSwapMetadata metadata)
Parameters
intentArkadeSwapIntentmetadataLightningSwapMetadata
Returns
WithOnchainMetadata(ArkadeSwapIntent, OnchainSwapMetadata)
Write the onchain-corridor view, replacing whatever those keys held.
public static ArkadeSwapIntent WithOnchainMetadata(this ArkadeSwapIntent intent, OnchainSwapMetadata metadata)
Parameters
intentArkadeSwapIntentmetadataOnchainSwapMetadata
Returns
WithRfqId(ArkadeSwapIntent, string?)
Record the RFQ negotiation this swap was quoted under.
public static ArkadeSwapIntent WithRfqId(this ArkadeSwapIntent intent, string? rfqId)
Parameters
intentArkadeSwapIntentThe swap.
rfqIdstringThe correlation id, or
nullto leave it unrecorded.
Returns
- ArkadeSwapIntent
The same swap, for chaining.
WithSolver(ArkadeSwapIntent, string?)
Record which solver quoted this swap.
public static ArkadeSwapIntent WithSolver(this ArkadeSwapIntent intent, string? solverPubkey)
Parameters
intentArkadeSwapIntentThe swap.
solverPubkeystringThe solver's x-only key, hex. Ignored when blank.
Returns
- ArkadeSwapIntent
The same intent, for chaining.