Table of Contents

Interface ISpendSubmitHandler

Namespace
NArk.Core.Helpers
Assembly
NArk.Core.dll

Plug-point that lets a higher layer (e.g. NArk.Arkade) take over the submission of an offchain Ark transaction, without NArk.Core depending on that layer. Used for covenant spends, where the emulator co-signing service — not arkd directly — is the submission endpoint (it co-signs and fronts arkd).

public interface ISpendSubmitHandler

Remarks

ShouldHandle(IReadOnlyCollection<ArkCoin>) is a cheap per-spend gate (typically "is any input arkade-bound?"). When it returns true, TransactionHelpers user-signs the checkpoint inputs and hands the fully user-signed Arkade transaction + checkpoints to SubmitAsync(IReadOnlyCollection<ArkCoin>, PSBT, IReadOnlyList<PSBT>, CancellationToken), which owns the rest (co-sign + submit + finalize); the normal arkd cooperative submit is skipped. When no registered handler engages, the spend follows the unchanged arkd flow.

Methods

ShouldHandle(IReadOnlyCollection<ArkCoin>)

Cheap check: does this handler own submission for this spend?

bool ShouldHandle(IReadOnlyCollection<ArkCoin> coins)

Parameters

coins IReadOnlyCollection<ArkCoin>

Returns

bool

SubmitAsync(IReadOnlyCollection<ArkCoin>, PSBT, IReadOnlyList<PSBT>, CancellationToken)

Fully submit the spend: co-sign, forward to arkd and finalize. Called only when ShouldHandle(IReadOnlyCollection<ArkCoin>) returned true. The Arkade transaction and every checkpoint already carry the wallet's own signatures.

Task SubmitAsync(IReadOnlyCollection<ArkCoin> coins, PSBT arkTx, IReadOnlyList<PSBT> checkpoints, CancellationToken cancellationToken)

Parameters

coins IReadOnlyCollection<ArkCoin>

The spend inputs, in transaction-input order.

arkTx PSBT

The user-signed ark transaction.

checkpoints IReadOnlyList<PSBT>

The user-signed checkpoint transactions.

cancellationToken CancellationToken

Cancellation token.

Returns

Task