Table of Contents

Interface IClientTransport

Namespace
NArk.Core.Transport
Assembly
NArk.Core.dll
public interface IClientTransport

Methods

ConfirmRegistrationAsync(string, CancellationToken)

Task ConfirmRegistrationAsync(string intentId, CancellationToken cancellationToken)

Parameters

intentId string
cancellationToken CancellationToken

Returns

Task

DeleteIntent(ArkIntent, CancellationToken)

Task DeleteIntent(ArkIntent intent, CancellationToken cancellationToken = default)

Parameters

intent ArkIntent
cancellationToken CancellationToken

Returns

Task

FinalizeTx(string, string[], CancellationToken)

Task FinalizeTx(string arkTxId, string[] finalCheckpointTxs, CancellationToken cancellationToken)

Parameters

arkTxId string
finalCheckpointTxs string[]
cancellationToken CancellationToken

Returns

Task

GetAssetDetailsAsync(string, CancellationToken)

Task<ArkAssetDetails> GetAssetDetailsAsync(string assetId, CancellationToken cancellationToken = default)

Parameters

assetId string
cancellationToken CancellationToken

Returns

Task<ArkAssetDetails>

GetEventStreamAsync(GetEventStreamRequest, CancellationToken)

IAsyncEnumerable<BatchEvent> GetEventStreamAsync(GetEventStreamRequest req, CancellationToken cancellationToken)

Parameters

req GetEventStreamRequest
cancellationToken CancellationToken

Returns

IAsyncEnumerable<BatchEvent>

GetIntentsByProofAsync(string, string, CancellationToken)

Retrieves registered intents by providing a BIP-322 proof of ownership of any input.

Task<ArkIntent[]> GetIntentsByProofAsync(string proof, string message, CancellationToken cancellationToken = default)

Parameters

proof string
message string
cancellationToken CancellationToken

Returns

Task<ArkIntent[]>

GetPendingTxAsync(string, string, CancellationToken)

Retrieves Arkade transactions the server has registered as pending — i.e. the user called SubmitTx(string, string[], CancellationToken) (server locked the inputs as in-flight) but FinalizeTx(string, string[], CancellationToken) never followed. The server enforces "you must finalize that exact pending tx; you cannot spend those inputs another way", so this endpoint is the only way to recover stranded VTXOs after a crash between Submit and Finalize. Authentication uses a BIP-322-style proof of ownership over any input the SDK believes belongs to the wallet — same shape as GetIntentsByProofAsync(string, string, CancellationToken).

Task<PendingArkTransaction[]> GetPendingTxAsync(string proof, string message, CancellationToken cancellationToken = default)

Parameters

proof string
message string
cancellationToken CancellationToken

Returns

Task<PendingArkTransaction[]>

GetServerInfoAsync(CancellationToken)

Task<ArkServerInfo> GetServerInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<ArkServerInfo>

GetVirtualTxsAsync(IReadOnlyList<string>, CancellationToken)

Returns raw tx hex for the given virtual transaction IDs.

Task<IReadOnlyList<string>> GetVirtualTxsAsync(IReadOnlyList<string> txids, CancellationToken cancellationToken = default)

Parameters

txids IReadOnlyList<string>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<string>>

GetVtxoByScriptsAsSnapshot(IReadOnlySet<string>, DateTimeOffset?, DateTimeOffset?, CancellationToken)

Queries arkd indexer for VTXOs by scripts, filtered to those updated within the given time range.

IAsyncEnumerable<ArkVtxo> GetVtxoByScriptsAsSnapshot(IReadOnlySet<string> scripts, DateTimeOffset? after, DateTimeOffset? before, CancellationToken cancellationToken = default)

Parameters

scripts IReadOnlySet<string>
after DateTimeOffset?
before DateTimeOffset?
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ArkVtxo>

GetVtxoByScriptsAsSnapshot(IReadOnlySet<string>, CancellationToken)

IAsyncEnumerable<ArkVtxo> GetVtxoByScriptsAsSnapshot(IReadOnlySet<string> scripts, CancellationToken cancellationToken = default)

Parameters

scripts IReadOnlySet<string>
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ArkVtxo>

GetVtxoChainAsync(OutPoint, string?, string?, CancellationToken)

Returns the chain of virtual txs for the given VTXO, ordered leaf→root: the VTXO's own tx first, then each ancestor in turn, ending at the on-chain Commitment anchor.

When intentProof and intentMessage are supplied (a BIP-322-style ownership proof built by CreateGetVtxoChainOwnershipProofAsync(ArkCoin, IArkadeWalletSigner, Network, CancellationToken)), the call authenticates against the Arkade indexer: on servers running with withheld/private tx exposure this is what makes the indexer return the chain (and, for withheld, the fully-signed virtual txs) instead of stripping it. The proof is presented on the first page; the server issues an auth token that transparently drives cursor pagination for the remaining pages.

When the proof is omitted the call uses the legacy anonymous outpoint lookup, which only returns data on servers configured with public tx exposure.

Task<IReadOnlyList<VtxoChainEntry>> GetVtxoChainAsync(OutPoint vtxoOutpoint, string? intentProof = null, string? intentMessage = null, CancellationToken cancellationToken = default)

Parameters

vtxoOutpoint OutPoint
intentProof string
intentMessage string
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<VtxoChainEntry>>

GetVtxoTreeAsync(OutPoint, CancellationToken)

Returns the full VTXO tree structure for a batch outpoint.

Task<IReadOnlyList<VtxoTreeNode>> GetVtxoTreeAsync(OutPoint batchOutpoint, CancellationToken cancellationToken = default)

Parameters

batchOutpoint OutPoint
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<VtxoTreeNode>>

GetVtxosByOutpoints(IReadOnlyCollection<OutPoint>, bool, CancellationToken)

Queries arkd indexer for VTXOs by outpoints, optionally filtering by spent status.

IAsyncEnumerable<ArkVtxo> GetVtxosByOutpoints(IReadOnlyCollection<OutPoint> outpoints, bool spentOnly = false, CancellationToken cancellationToken = default)

Parameters

outpoints IReadOnlyCollection<OutPoint>
spentOnly bool
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ArkVtxo>

OpenSubscriptionStreamAsync(IReadOnlySet<string>?, string?, CancellationToken)

Opens a server-streaming subscription for VTXO script events.

When existingSubscriptionId is null, the server creates a new subscription. The first yielded event is always VtxoSubscriptionStarted carrying the server-assigned ID. Pass initialScripts to register the initial watched set at stream-open time (only honoured on new subscriptions).

When existingSubscriptionId is provided, the server reconnects to an existing subscription. If the subscription was GC'd the stream throws a NotFound error; the caller should retry with a null ID to open a fresh subscription.

IAsyncEnumerable<VtxoSubscriptionEvent> OpenSubscriptionStreamAsync(IReadOnlySet<string>? initialScripts, string? existingSubscriptionId, CancellationToken cancellationToken = default)

Parameters

initialScripts IReadOnlySet<string>
existingSubscriptionId string
cancellationToken CancellationToken

Returns

IAsyncEnumerable<VtxoSubscriptionEvent>

RegisterIntent(ArkIntent, CancellationToken)

Task<string> RegisterIntent(ArkIntent intent, CancellationToken cancellationToken = default)

Parameters

intent ArkIntent
cancellationToken CancellationToken

Returns

Task<string>

SubmitSignedForfeitTxsAsync(SubmitSignedForfeitTxsRequest, CancellationToken)

Task SubmitSignedForfeitTxsAsync(SubmitSignedForfeitTxsRequest req, CancellationToken cancellationToken)

Parameters

req SubmitSignedForfeitTxsRequest
cancellationToken CancellationToken

Returns

Task

SubmitTreeNoncesAsync(SubmitTreeNoncesRequest, CancellationToken)

Task SubmitTreeNoncesAsync(SubmitTreeNoncesRequest treeNonces, CancellationToken cancellationToken)

Parameters

treeNonces SubmitTreeNoncesRequest
cancellationToken CancellationToken

Returns

Task

SubmitTreeSignaturesRequest(SubmitTreeSignaturesRequest, CancellationToken)

Task SubmitTreeSignaturesRequest(SubmitTreeSignaturesRequest treeSigs, CancellationToken cancellationToken)

Parameters

treeSigs SubmitTreeSignaturesRequest
cancellationToken CancellationToken

Returns

Task

SubmitTx(string, string[], CancellationToken)

Task<SubmitTxResponse> SubmitTx(string signedArkTx, string[] checkpointTxs, CancellationToken cancellationToken = default)

Parameters

signedArkTx string
checkpointTxs string[]
cancellationToken CancellationToken

Returns

Task<SubmitTxResponse>

UpdateStreamTopicsAsync(string, string[]?, string[]?, CancellationToken)

Task UpdateStreamTopicsAsync(string streamId, string[]? addTopics, string[]? removeTopics, CancellationToken cancellationToken = default)

Parameters

streamId string
addTopics string[]
removeTopics string[]
cancellationToken CancellationToken

Returns

Task

UpdateSubscriptionScriptsAsync(string, IReadOnlySet<string>?, IReadOnlySet<string>?, CancellationToken)

Updates the script set of an existing subscription in place without tearing the stream down. Both add and remove are optional; when both are null or empty the call is a no-op. Throws NotFound when the subscription was GC'd.

Task UpdateSubscriptionScriptsAsync(string subscriptionId, IReadOnlySet<string>? add, IReadOnlySet<string>? remove, CancellationToken cancellationToken = default)

Parameters

subscriptionId string
add IReadOnlySet<string>
remove IReadOnlySet<string>
cancellationToken CancellationToken

Returns

Task