Structs
Copy // The struct consists of protocol adapter's name
// and array of TokenBalance structs
// with token addresses and absolute amounts.
struct AdapterBalance {
bytes32 protocolAdapterName;
TokenBalance [] tokenBalances;
}
// The struct consists of token address
// and its absolute amount.
struct AbsoluteTokenAmount {
address token;
uint256 amount;
}
// The struct consists of token address
// and its absolute amount (may be negative).
struct TokenBalance {
address token;
int256 amount;
}
view
functions
getBalances
Copy function getBalances (address account) returns (AdapterBalance[])
Iterates over all the supported adapters and supported tokens and appends balances.
NOTE! Filters out zero balances, adapters, and adapters without positive balances.
getAdapterBalances
Copy function getAdapterBalances (address account , bytes32[] protocolAdapterNames) returns (AdapterBalance[])
Iterates over the protocolAdapterNames
and their supported tokens and appends balances.
getAdapterBalance
Copy function getAdapterBalance (
address account ,
address adapter ,
address[] tokens
) returns (AdapterBalance)
Iterates over tokens
and appends balances.
getProtocolAdapterNames
Copy function getProtocolAdapterNames () returns (bytes32[])
Returns list of protocol adapters' names.
getProtocolAdapterAddress
Copy function getProtocolAdapterAddress (bytes32 protocolAdapterName) returns (address)
Returns list of protocol adapters' names.
getSupportedTokens
Copy function getSupportedTokens (bytes32 protocolAdapterName) returns (address[])
Returns adapter's supported tokens.
getTokenAdapterNames
Copy function getTokenAdapterNames () returns (bytes32[])
Returns list of token adapters' names.
onlyOwner
functions
Copy function addProtocolAdapters (
bytes32[] calldata newProtocolAdapterNames ,
address[] calldata newProtocolAdapterAddresses ,
address[][] calldata newSupportedTokens
)
Copy function updateProtocolAdapters (
bytes32[] calldata protocolAdapterNames ,
address[] calldata newProtocolAdapterAddresses ,
address[][] calldata newSupportedTokens
)
Copy function removeProtocolAdapters (
bytes32[] calldata protocolAdapterNames
)