/
IAlloraAdapter.sol
67 lines (55 loc) · 1.83 KB
/
IAlloraAdapter.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// SPDX-License-Identifier: BUSL-1.1
import { IAggregator } from '../interface/IAggregator.sol';
pragma solidity ^0.8.0;
// ***************************************************************
// * ========================= STRUCTS ========================= *
// ***************************************************************
struct NumericData {
uint256 topicId;
uint256 timestamp;
bytes extraData;
uint256[] numericValues;
}
struct AlloraAdapterNumericData {
bytes signature;
NumericData numericData;
bytes extraData;
}
struct TopicValue {
uint192 recentValue;
uint64 recentValueTime;
}
// ***************************************************************
// * ======================= INTERFACE ========================= *
// ***************************************************************
/**
* @title Allora Adapter Interface
*/
interface IAlloraAdapter {
/**
* @notice Get a verified piece of numeric data for a given topic
*
* @param nd The numeric data to aggregate
*/
function verifyData(AlloraAdapterNumericData memory nd) external returns (
uint256 numericValue,
address dataProvider
);
/**
* @notice Get a verified piece of numeric data for a given topic without mutating state
*
* @param pd The numeric data to aggregate
*/
function verifyDataViewOnly(AlloraAdapterNumericData calldata pd) external view returns (
uint256 numericValue,
address dataProvider
);
/**
* @notice Get the topic data for a given topicId
*
* @param topicId The topicId to get the topic data for
* @param extraData The extraData to get the topic data for
* @return topicValue The topic data
*/
function getTopicValue(uint256 topicId, bytes calldata extraData) external view returns (TopicValue memory);
}