File tree Expand file tree Collapse file tree 4 files changed +54
-3
lines changed
pages/dev-advanced-concepts/interoperability/precompiles Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Original file line number Diff line number Diff line change 7
7
"cosmwasm" : " CosmWasm" ,
8
8
"ibc" : " IBC" ,
9
9
"json" : " JSON" ,
10
+ "oracle" : " Oracle" ,
10
11
"governance" : " Governance"
11
12
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ This precompile enables funds transfer over IBC protocol.
38
38
- ` transferWithDefaultTimeout ` : Send funds to another chain using IBC protocol. Calculates the timeout
39
39
height/timestamp based on the current block timestamp.
40
40
41
- ``` solidity
41
+ ``` solidity
42
42
/// Send funds to another chain using IBC protocol. Calculates the timeout height/timestamp
43
43
/// based on the current block timestamp.
44
44
/// @param toAddress The recipient's address on the other chain
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ This precompile enables EVM clients to query JSON data.
22
22
```
23
23
24
24
- ` extractAsBytesList ` : Extracts data as a list of bytes from the input using the specified key.
25
- ``` solidity
25
+ ``` solidity
26
26
/// Extracts data as a list of bytes from the input using the specified key.
27
27
/// @param input The input data.
28
28
/// @param key The key to extract.
@@ -33,7 +33,7 @@ This precompile enables EVM clients to query JSON data.
33
33
```
34
34
35
35
- ` extractAsUint256 ` : Extracts data as a uint256 from the input using the specified key.
36
- ``` solidity
36
+ ``` solidity
37
37
/// Extracts data as a list of bytes from the input using the specified key.
38
38
/// @param input The input data.
39
39
/// @param key The key to extract.
Original file line number Diff line number Diff line change
1
+ import { Callout } from " nextra/components" ;
2
+
3
+ # Orcale Precompile
4
+
5
+ ** Address** : ` 0x0000000000000000000000000000000000001008 `
6
+
7
+ This precompile enables EVM clients to query the Oracle module.
8
+
9
+ ## Functions
10
+
11
+ ### Queries
12
+ - ` getExchangeRates ` : Gets the corresponding Sei Address from the given EVM Address
13
+ ``` solidity
14
+ /// Retrieves the exchange rates for all denominations.
15
+ /// @return An array of denomination and exchange rate pairs.
16
+ function getExchangeRates() external view returns (DenomOracleExchangeRatePair[] memory);
17
+
18
+ // Structs
19
+ struct OracleExchangeRate {
20
+ string exchangeRate;
21
+ string lastUpdate;
22
+ int64 lastUpdateTimestamp;
23
+ }
24
+
25
+ struct DenomOracleExchangeRatePair {
26
+ string denom;
27
+ OracleExchangeRate oracleExchangeRateVal;
28
+ }
29
+ ```
30
+
31
+ - ` getOracleTwaps ` : Retrieves Oracle Time-Weighted Average Prices (TWAPs) for the specified lookback period.
32
+ ``` solidity
33
+ /// Retrieves Oracle Time-Weighted Average Prices (TWAPs) for the specified lookback period.
34
+ /// @param lookback_seconds The lookback period in seconds.
35
+ /// @return An array of denomination and TWAP pairs.
36
+ function getOracleTwaps(
37
+ uint64 lookback_seconds) external view returns (OracleTwap[] memory);
38
+
39
+ // Structs
40
+ struct OracleTwap {
41
+ string denom;
42
+ string twap;
43
+ int64 lookbackSeconds;
44
+ }
45
+ ```
46
+
47
+ <Callout type = " info" >
48
+ View the Oracle precompile source code and the contract ABI
49
+ [ here] ( https://github.com/sei-protocol/sei-chain/tree/main/precompiles/oracle ) .
50
+ </Callout >
You can’t perform that action at this time.
0 commit comments