BuildapireferencegeneratedIServiceFeeDistributor

IServiceFeeDistributor

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

IServiceFeeDistributor

Tracks service-fee payouts to stakers 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

distributeInflationReward

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

Distribute inflation-funded staker rewards using service exposure weights

Intended for InflationPool; rewards are paid in the provided token (TNT).

claimFor

function claimFor(address token, address operator, struct Types.Asset asset) external returns (uint256 amount)

Claim rewards for a specific delegator position and token

claimAll

function claimAll(address token) external returns (uint256 totalAmount)

Claim all pending rewards across all positions for a token

claimAllBatch

function claimAllBatch(address[] tokens) external returns (uint256[] amounts)

Claim all pending rewards for multiple tokens

pendingRewards

function pendingRewards(address delegator, address token) external view returns (uint256 pending)

Preview pending rewards for a delegator across all positions for a token

delegatorOperators

function delegatorOperators(address delegator) external view returns (address[] operators)

Return all operators a delegator has positions with

delegatorAssets

function delegatorAssets(address delegator, address operator) external view returns (bytes32[] assetHashes)

Return all asset hashes a delegator has positions for with an operator

getPosition

function getPosition(address delegator, address operator, bytes32 assetHash) external view returns (uint8 mode, uint256 principal, uint256 score)

Return a delegator’s position details

operatorRewardTokens

function operatorRewardTokens(address operator) external view returns (address[] tokens)

Return reward tokens ever distributed for an operator

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)

getOperatorServiceUsdExposure

function getOperatorServiceUsdExposure(uint64 serviceId, uint64 blueprintId, address operator) external view returns (uint256 totalUsdExposure)

Get USD-weighted exposure for an operator/service

Returns total USD exposure across All+Fixed pools for the service.

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)