ConnectOracle
contract is designed to interact with the Cosmos blockchain to fetch and process price data for various currency pairs from the Connect oracle.
Import File | Description |
---|---|
ICosmos.sol | Interface for interacting with the Cosmos blockchain. |
JsmnSolLib.sol | Library for JSON parsing. |
IsoToUnix.sol | Library for converting ISO date strings to Unix timestamps. |
uint256 price
: The price value.uint256 timestamp
: The timestamp of the price.uint64 height
: The block height at which the price was recorded.uint64 nonce
: A unique identifier for the price record.uint64 decimal
: The decimal precision of the price.uint64 id
: The ID of the price record.Type | Description |
---|---|
string memory | A JSON string containing all currency pairs |
Name | Type | Description |
---|---|---|
base | string memory | The base currency of the pair |
quote | string memory | The quote currency of the pair |
Type | Description |
---|---|
Price memory | A struct containing the price information |
Name | Type | Description |
---|---|---|
pair_ids | string[] memory | An array of currency pair IDs |
Type | Description |
---|---|
Price[] memory | An array of Price structs containing the price information for each pair |
Name | Type | Description |
---|---|---|
strs | string[] memory | An array of strings to be concatenated |
separator | string memory | A separator to be used between the strings |
Type | Description |
---|---|
string memory | The concatenated string |
Price
struct.
Name | Type | Description |
---|---|---|
json | string memory | The JSON string containing the price information |
tokens | JsmnSolLib.Token[] memory | An array of JSON tokens |
priceObjectIndex | uint256 | The starting index of the price object in the tokens array |
Type | Description |
---|---|
Price memory | A struct containing the parsed price information |