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
| Name | Type | Description |
|---|---|---|
| account | address | The account address |
| token | address | The super token |
Return Values
| Name | Type | Description |
|---|---|---|
| netFlowRate | int96 | Net 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
| Name | Type | Description |
|---|---|---|
| account | address | The account address |
| token | address | The super token |
Return Values
| Name | Type | Description |
|---|---|---|
| availableBalance | int256 | Current available balance |
| deposit | uint256 | Required deposit/buffer |
isSolvent
function isSolvent(address account, address token) external view returns (bool solvent)Check if an account is solvent (positive balance)
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account address |
| token | address | The super token |
Return Values
| Name | Type | Description |
|---|---|---|
| solvent | bool | True 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
| Name | Type | Description |
|---|---|---|
| token | address | The super token |
| flowRate | int96 | Flow rate in wei/second |
Return Values
| Name | Type | Description |
|---|---|---|
| bufferAmount | uint256 | Required buffer deposit |
wrapTokens
function wrapTokens(address token, uint256 amount) externalWrap underlying tokens to super tokens
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The underlying token |
| amount | uint256 | Amount to wrap |
unwrapTokens
function unwrapTokens(address token, uint256 amount) externalUnwrap super tokens to underlying
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The super token |
| amount | uint256 | Amount to unwrap |