IIFtsoRegistry
Functions
addFtso
function addFtso (
contract IIFtso _ftsoContract
) external returns (
uint256 );
Add a new FTSO contract to the registry.
Parameters
Type
Description
_ftsoContract
contract IIFtso
New target FTSO contract.
Returns
Type
Description
[0]
uint256
The FTSO index assigned to the new asset.
getAllCurrentPrices
function getAllCurrentPrices (
) external view returns (
struct IFtsoRegistry . PriceInfo[]);
Returns the current price of all supported assets.
Returns
Type
Description
[0]
struct IFtsoRegistry.PriceInfo[]
Array of PriceInfo
structures.
getCurrentPrice
function getCurrentPrice (
uint256 _ftsoIndex
) external view returns (
uint256 _price ,
uint256 _timestamp );
Public view function to get the current price of a given active FTSO index.
Reverts if the index is not supported.
Parameters
Type
Description
_ftsoIndex
uint256
Index to query.
Returns
Type
Description
_price
uint256
Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS
.
_timestamp
uint256
Timestamp for when this price was updated, in seconds since UNIX epoch.
getCurrentPrice
function getCurrentPrice (
string _symbol
) external view returns (
uint256 _price ,
uint256 _timestamp );
Public view function to get the current price of a given active asset symbol.
Reverts if the symbol is not supported.
Parameters
Type
Description
_symbol
string
Symbol to query.
Returns
Type
Description
_price
uint256
Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS
.
_timestamp
uint256
Timestamp for when this price was updated, in seconds since UNIX epoch.
getCurrentPriceWithDecimals
function getCurrentPriceWithDecimals (
uint256 _assetIndex
) external view returns (
uint256 _price ,
uint256 _timestamp ,
uint256 _assetPriceUsdDecimals );
Public view function to get the current price and decimals of a given active FTSO index.
Reverts if the index is not supported.
Parameters
Type
Description
_assetIndex
uint256
Index to query.
Returns
Type
Description
_price
uint256
Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals
.
_timestamp
uint256
Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals
uint256
Number of decimals used to return the _price
.
getCurrentPriceWithDecimals
function getCurrentPriceWithDecimals (
string _symbol
) external view returns (
uint256 _price ,
uint256 _timestamp ,
uint256 _assetPriceUsdDecimals );
Public view function to get the current price and decimals of a given active asset symbol.
Reverts if the symbol is not supported.
Parameters
Type
Description
_symbol
string
Symbol to query.
Returns
Type
Description
_price
uint256
Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals
.
_timestamp
uint256
Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals
uint256
Number of decimals used to return the _price
.
getCurrentPricesByIndices
function getCurrentPricesByIndices (
uint256 [] _indices
) external view returns (
struct IFtsoRegistry . PriceInfo[]);
Returns the current price of a list of indices.
Reverts if any of the indices is not supported.
Parameters
Type
Description
_indices
uint256[]
Array of indices to query.
Returns
Type
Description
[0]
struct IFtsoRegistry.PriceInfo[]
Array of PriceInfo
structures.
getCurrentPricesBySymbols
function getCurrentPricesBySymbols (
string [] _symbols
) external view returns (
struct IFtsoRegistry . PriceInfo[]);
Returns the current price of a list of asset symbols.
Reverts if any of the symbols is not supported.
Parameters
Type
Description
_symbols
string[]
Array of symbols to query.
Returns
Type
Description
[0]
struct IFtsoRegistry.PriceInfo[]
Array of PriceInfo
structures.
getFtso
function getFtso (
uint256 _activeFtso
) external view returns (
contract IIFtso _activeFtsoAddress);
Returns the address of the FTSO contract for a given index.
Reverts if unsupported index is passed.
Parameters
Type
Description
_activeFtso
uint256
The queried index.
Returns
Type
Description
_activeFtsoAddress
contract IIFtso
FTSO contract address for the queried index.
getFtsoBySymbol
function getFtsoBySymbol (
string _symbol
) external view returns (
contract IIFtso _activeFtsoAddress);
Returns the address of the FTSO contract for a given symbol.
Reverts if unsupported symbol is passed.
Parameters
Type
Description
_symbol
string
The queried symbol.
Returns
Type
Description
_activeFtsoAddress
contract IIFtso
FTSO contract address for the queried symbol.
getFtsoIndex
function getFtsoIndex (
string _symbol
) external view returns (
uint256 _assetIndex );
Returns the FTSO index corresponding to a given asset symbol.
Reverts if the symbol is not supported.
Parameters
Type
Description
_symbol
string
Symbol to query.
Returns
Type
Description
_assetIndex
uint256
The corresponding asset index.
getFtsoSymbol
function getFtsoSymbol (
uint256 _ftsoIndex
) external view returns (
string _symbol );
Returns the asset symbol corresponding to a given FTSO index.
Reverts if the index is not supported.
Parameters
Type
Description
_ftsoIndex
uint256
Index to query.
Returns
Type
Description
_symbol
string
The corresponding asset symbol.
getFtsos
function getFtsos (
uint256 [] _indices
) external view returns (
contract IFtsoGenesis [] _ftsos);
Get the addresses of the active FTSOs at the given indices.
Reverts if any of the provided indices is non-existing or inactive.
Parameters
Type
Description
_indices
uint256[]
Array of FTSO indices to query.
Returns
Type
Description
_ftsos
contract IFtsoGenesis[]
The array of FTSO addresses.
getSupportedFtsos
function getSupportedFtsos (
) external view returns (
contract IIFtso [] _ftsos);
Get array of all FTSO contracts for all supported asset indices.
The index of FTSO in returned array does not necessarily correspond to the asset's index.
Due to deletion, some indices might be unsupported.
Use getSupportedIndicesAndFtsos
to retrieve pairs of correct indices and FTSOs,
where possible "null" holes are readily apparent.
Returns
Type
Description
_ftsos
contract IIFtso[]
Array of all supported FTSOs.
getSupportedIndices
function getSupportedIndices (
) external view returns (
uint256 [] _supportedIndices);
Returns the indices of the currently supported FTSOs.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedIndices
uint256[]
Array of all active FTSO indices in increasing order.
getSupportedIndicesAndFtsos
function getSupportedIndicesAndFtsos (
) external view returns (
uint256 [] _supportedIndices,
contract IIFtso [] _ftsos);
Get all supported indices and corresponding FTSO addresses.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedIndices
uint256[]
Array of all supported indices.
_ftsos
contract IIFtso[]
Array of all supported FTSO addresses.
getSupportedIndicesAndSymbols
function getSupportedIndicesAndSymbols (
) external view returns (
uint256 [] _supportedIndices,
string [] _supportedSymbols);
Get all supported indices and corresponding symbols.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedIndices
uint256[]
Array of all supported indices.
_supportedSymbols
string[]
Array of all supported symbols.
getSupportedIndicesSymbolsAndFtsos
function getSupportedIndicesSymbolsAndFtsos (
) external view returns (
uint256 [] _supportedIndices,
string [] _supportedSymbols,
contract IIFtso [] _ftsos);
Get all supported indices, symbols, and corresponding FTSO addresses.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedIndices
uint256[]
Array of all supported indices.
_supportedSymbols
string[]
Array of all supported symbols.
_ftsos
contract IIFtso[]
Array of all supported FTSO addresses.
getSupportedSymbols
function getSupportedSymbols (
) external view returns (
string [] _supportedSymbols);
Returns the symbols of the currently supported FTSOs.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedSymbols
string[]
Array of all active FTSO symbols in increasing order.
getSupportedSymbolsAndFtsos
function getSupportedSymbolsAndFtsos (
) external view returns (
string [] _supportedSymbols,
contract IIFtso [] _ftsos);
Get all supported symbols and corresponding FTSO addresses.
Active FTSOs are ones that currently receive price feeds.
Returns
Type
Description
_supportedSymbols
string[]
Array of all supported symbols.
_ftsos
contract IIFtso[]
Array of all supported FTSO addresses.
removeFtso
function removeFtso (
contract IIFtso _ftso
) external ;
Removes the FTSO and keeps part of the history.
Reverts if the provided address is not supported.
From now on, the index this asset was using is "reserved" and cannot be used again.
It will not be returned in any list of currently supported assets.
Parameters
Type
Description
_ftso
contract IIFtso
Address of the FTSO contract to remove.