LatestRoundData
Chainlink Getter Plugin - LatestRoundData
Description
Get the price from the latest round.
Method
latestRoundData()
Input Parameters
Name
Plugin Type
Description
to
FctAddress
Chainlink Datafeed address
Method Parameters
No required method parameters
Returned Values
Name
Plugin Type
Description
roundId
FctValue
The round ID
answer
FctValue
The data
startedAt
FctValue
Timestamp of when the round started.
updatedAt
FctValue
Timestamp of when the round was updated.
answeredInRound
FctValue
The round ID of the round in which the answer was computed.
Example
Example with initParams
const latestRoundData = new Chainlink.getter.LatestRoundData({
chainId: 1,
initParams: {
to: "0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419" // ETH/USD Datafeed
}
})
Example without initParams
const latestRoundData = new Chainlink.getter.LatestRoundData({
chainId: 1
})
latestRoundData.input.set({
to: "0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419" // ETH/USD Datafeed
})
Learn more
Learn more about Chainlink latest round data method here
Last updated