Storage Contract methods

You need to find or deploy the corresponding endpoint to get the data feed. For example, for the ETHUSDC pair on the Sepolia testnet, the current address is 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e. This address might change in the future since the endpoints are still under continuous development. Check the addresses of the active endpoints on the corresponding page.

decimals

decimals()(uint8)

Returns the precision parameter of the endpoint.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'decimals()(uint8)'

description

description()(string)

Meta info about the endpoint.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'description()(string)'

latestAnswer

latestAnswer()(uint256)

Returns short data for the latest round.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'latestAnswer()(uint256)'

latestRound

latestRound()(uint256)

Returns the index number of the latest round.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'latestRound()(uint256)'

getRoundData

getRoundData(uint80 _roundId) returns (uint80 roundId, uint256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)

Returns full data for the round by index.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'getRoundData(uint80 _roundId) returns (uint80 roundId, uint256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)'

latestRoundData

latestRoundData()(uint80, uint256, uint256, uint256, uint80)

Returns full data for the latest round.

Usage example:

cast call --rpc-url=https://eth-sepolia.g.alchemy.com/v2/%ALCHEMY_KEY% 0x3fdf540bee3dd5cd5009d9bc6f6978370cee3a7e 'latestRoundData()(uint80, uint256, uint256, uint256, uint80)'

Last updated