DevelopersAPI Reference

IServiceFeeDistributor

Source: https://github.com/tangle-network/tnt-core/blob/v2/src/v2/interfaces/IServiceFeeDistributor.sol

IServiceFeeDistributor

Tracks service-fee payouts to restakers across payment tokens

Receives delegation-change hooks from MultiAssetDelegation and fee-distribution calls from Tangle.

Functions

distributeServiceFee

function distributeServiceFee(uint64 serviceId, uint64 blueprintId, address operator, address paymentToken, uint256 amount) external payable

onDelegationChanged

function onDelegationChanged(address delegator, address operator, struct Types.Asset asset, uint256 amount, bool isIncrease, enum Types.BlueprintSelectionMode selectionMode, uint64[] blueprintIds, uint16 lockMultiplierBps) external

onBlueprintAdded

function onBlueprintAdded(address delegator, address operator, struct Types.Asset asset, uint64 blueprintId) external

onBlueprintRemoved

function onBlueprintRemoved(address delegator, address operator, struct Types.Asset asset, uint64 blueprintId) external

getPoolScore

function getPoolScore(address operator, uint64 blueprintId, struct Types.Asset asset) external view returns (uint256 allScore, uint256 fixedScore)

onOperatorLeaving

function onOperatorLeaving(uint64 serviceId, address operator) external

Called when an operator is about to leave a service

Drips all active streams for the operator BEFORE they’re removed

onServiceTerminated

function onServiceTerminated(uint64 serviceId, address refundRecipient) external

Called when a service is terminated early

Cancels streaming payments and refunds remaining amounts to the service owner

Parameters
NameTypeDescription
serviceIduint64The terminated service ID
refundRecipientaddressWhere to send the remaining payment (typically service owner)