Table of Contents

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

intent ArkadeSwapIntent

Returns

AssetSwapMetadata

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

intent ArkadeSwapIntent

Returns

EvmSwapMetadata

LightningMetadata(ArkadeSwapIntent)

Read the Lightning view.

public static LightningSwapMetadata LightningMetadata(this ArkadeSwapIntent intent)

Parameters

intent ArkadeSwapIntent

Returns

LightningSwapMetadata

Exceptions

InvalidOperationException

This intent is not a Lightning swap.

OnchainMetadata(ArkadeSwapIntent)

Read the onchain-corridor view.

public static OnchainSwapMetadata OnchainMetadata(this ArkadeSwapIntent intent)

Parameters

intent ArkadeSwapIntent

Returns

OnchainSwapMetadata

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

intent ArkadeSwapIntent

The 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

intent ArkadeSwapIntent

The swap.

Returns

string

WithAssetMetadata(ArkadeSwapIntent, AssetSwapMetadata)

Write the asset-swap view, replacing whatever those keys held.

public static ArkadeSwapIntent WithAssetMetadata(this ArkadeSwapIntent intent, AssetSwapMetadata metadata)

Parameters

intent ArkadeSwapIntent
metadata AssetSwapMetadata

Returns

ArkadeSwapIntent

WithEvmMetadata(ArkadeSwapIntent, EvmSwapMetadata)

Write the Arkade-to-EVM recovery view.

public static ArkadeSwapIntent WithEvmMetadata(this ArkadeSwapIntent intent, EvmSwapMetadata metadata)

Parameters

intent ArkadeSwapIntent
metadata EvmSwapMetadata

Returns

ArkadeSwapIntent

WithLightningMetadata(ArkadeSwapIntent, LightningSwapMetadata)

Write the Lightning view, replacing whatever those keys held.

public static ArkadeSwapIntent WithLightningMetadata(this ArkadeSwapIntent intent, LightningSwapMetadata metadata)

Parameters

intent ArkadeSwapIntent
metadata LightningSwapMetadata

Returns

ArkadeSwapIntent

WithOnchainMetadata(ArkadeSwapIntent, OnchainSwapMetadata)

Write the onchain-corridor view, replacing whatever those keys held.

public static ArkadeSwapIntent WithOnchainMetadata(this ArkadeSwapIntent intent, OnchainSwapMetadata metadata)

Parameters

intent ArkadeSwapIntent
metadata OnchainSwapMetadata

Returns

ArkadeSwapIntent

WithRfqId(ArkadeSwapIntent, string?)

Record the RFQ negotiation this swap was quoted under.

public static ArkadeSwapIntent WithRfqId(this ArkadeSwapIntent intent, string? rfqId)

Parameters

intent ArkadeSwapIntent

The swap.

rfqId string

The correlation id, or null to 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

intent ArkadeSwapIntent

The swap.

solverPubkey string

The solver's x-only key, hex. Ignored when blank.

Returns

ArkadeSwapIntent

The same intent, for chaining.