Table of Contents

Interface IDelegationTransformer

Namespace
NArk.Core.Transformers
Assembly
NArk.Core.dll

Checks whether a contract can be delegated to a specific delegator and provides the script builders needed for delegation artifacts. Register multiple transformers to handle different contract types that support delegation.

public interface IDelegationTransformer

Methods

CanDelegate(string, ArkContract, ECPubKey)

Returns true if this transformer recognises the contract as delegatable and the delegator's public key matches the expected delegate key in the contract.

Task<bool> CanDelegate(string walletIdentifier, ArkContract contract, ECPubKey delegatePubkey)

Parameters

walletIdentifier string
contract ArkContract
delegatePubkey ECPubKey

Returns

Task<bool>

GetDelegationScriptBuilders(ArkContract)

Returns the script builders for delegation artifacts:

  • intentScript: collaborative path for the BIP322 intent proof (e.g., User+Server 2-of-2)
  • forfeitScript: delegate path for ACP forfeit tx (e.g., User+Delegate+Server 3-of-3)
(ScriptBuilder intentScript, ScriptBuilder forfeitScript) GetDelegationScriptBuilders(ArkContract contract)

Parameters

contract ArkContract

Returns

(ScriptBuilder intentScript, ScriptBuilder forfeitScript)