BuildapireferenceISuperfluidAdapter

ISuperfluidAdapter

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

ISuperfluidAdapter

Extended interface for Superfluid-specific features

Functions

getNetFlowRate

function getNetFlowRate(address account, address token) external view returns (int96 netFlowRate)

Get the net flow rate for an account (incoming - outgoing)

Parameters
NameTypeDescription
accountaddressThe account address
tokenaddressThe super token
Return Values
NameTypeDescription
netFlowRateint96Net flow rate (can be negative)

getRealtimeBalance

function getRealtimeBalance(address account, address token) external view returns (int256 availableBalance, uint256 deposit)

Get the real-time balance of an account

Parameters
NameTypeDescription
accountaddressThe account address
tokenaddressThe super token
Return Values
NameTypeDescription
availableBalanceint256Current available balance
deposituint256Required deposit/buffer

isSolvent

function isSolvent(address account, address token) external view returns (bool solvent)

Check if an account is solvent (positive balance)

Parameters
NameTypeDescription
accountaddressThe account address
tokenaddressThe super token
Return Values
NameTypeDescription
solventboolTrue if account has positive balance

getRequiredBuffer

function getRequiredBuffer(address token, int96 flowRate) external view returns (uint256 bufferAmount)

Get the required buffer/deposit for a flow rate

Parameters
NameTypeDescription
tokenaddressThe super token
flowRateint96Flow rate in wei/second
Return Values
NameTypeDescription
bufferAmountuint256Required buffer deposit

wrapTokens

function wrapTokens(address token, uint256 amount) external

Wrap underlying tokens to super tokens

Parameters
NameTypeDescription
tokenaddressThe underlying token
amountuint256Amount to wrap

unwrapTokens

function unwrapTokens(address token, uint256 amount) external

Unwrap super tokens to underlying

Parameters
NameTypeDescription
tokenaddressThe super token
amountuint256Amount to unwrap