Table of Contents

Class DelegationService

Namespace
NArk.Core.Services
Assembly
NArk.Core.dll

Orchestrates VTXO delegation to an external delegator service (e.g. Fulmine). The client creates a partially signed intent and forfeit transactions, then sends them to the delegator which registers the intent and participates in batches on the owner's behalf before VTXOs expire.

public class DelegationService
Inheritance
DelegationService
Inherited Members

Constructors

DelegationService(IEnumerable<IDelegationTransformer>, IDelegatorProvider, ILogger<DelegationService>?)

Orchestrates VTXO delegation to an external delegator service (e.g. Fulmine). The client creates a partially signed intent and forfeit transactions, then sends them to the delegator which registers the intent and participates in batches on the owner's behalf before VTXOs expire.

public DelegationService(IEnumerable<IDelegationTransformer> transformers, IDelegatorProvider delegatorProvider, ILogger<DelegationService>? logger = null)

Parameters

transformers IEnumerable<IDelegationTransformer>
delegatorProvider IDelegatorProvider
logger ILogger<DelegationService>

Properties

Transformers

Returns the registered delegation transformers for checking contract eligibility.

public IEnumerable<IDelegationTransformer> Transformers { get; }

Property Value

IEnumerable<IDelegationTransformer>

Methods

DelegateAsync(string, string, string[], bool, CancellationToken)

Delegates the refresh of VTXOs by sending a partially signed intent and forfeit transactions to the delegator service. The delegator will register the intent and join batches on behalf of the owner when the VTXOs approach expiration.

public Task DelegateAsync(string intentMessage, string intentProof, string[] forfeitTxs, bool rejectReplace = false, CancellationToken cancellationToken = default)

Parameters

intentMessage string

The intent message in plain-text (stringified JSON).

intentProof string

The intent proof tx (PSBT in base64 format).

forfeitTxs string[]

Partially signed forfeit transactions.

rejectReplace bool

If true, the delegator will not replace an existing delegation that includes at least one VTXO from this request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

GetDelegatorInfoAsync(CancellationToken)

Returns information about the delegator service including its public key. Use the pubkey when constructing ArkDelegateContract scripts.

public Task<DelegatorInfo> GetDelegatorInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DelegatorInfo>