Table of Contents

Interface ISettlementService

Namespace
NArk.Abstractions.Settlement
Assembly
NArk.Abstractions.dll

Executes a settlement: moves value out of a wallet to a SettlementDestination.

One implementation per rail. The SDK ships a destination sweep (Arkade address or collaborative exit) in NArk.Core and a BTC chain swap in a swap package; applications add their own — a stablecoin transfer, an exchange deposit — by registering another implementation whose CanSettle(SettlementDestination) accepts that network and asset. CompositeSettlementService routes between them.

public interface ISettlementService

Properties

Available

Whether this rail can be used right now. A rail that is configured but temporarily unusable (provider offline, credentials missing) reports false and is skipped by routing rather than failing a settlement.

bool Available { get; }

Property Value

bool

UnavailableReason

Human-readable reason why Available is false; null when available.

string? UnavailableReason { get; }

Property Value

string

Methods

CanSettle(SettlementDestination)

Whether this rail handles destination. Must be a cheap, side-effect-free check on network and asset.

bool CanSettle(SettlementDestination destination)

Parameters

destination SettlementDestination

Returns

bool

SettleAsync(SettlementRequest, CancellationToken)

Executes the settlement. Throws when the transfer could not be started; once it returns, funds are considered committed to the destination.

Read SourceAsset before spending: the amount is denominated in it, so a rail that only handles BTC must reject a request whose source is an Arkade-issued asset even when the destination looks familiar.

Task<SettlementResult> SettleAsync(SettlementRequest request, CancellationToken cancellationToken = default)

Parameters

request SettlementRequest
cancellationToken CancellationToken

Returns

Task<SettlementResult>

Exceptions

SettlementNotSupportedException

The destination is not handled by this rail.