Skip to main content
GitHub: ConnectOracle

Overview

The ConnectOracle contract interacts with the Cosmos blockchain to fetch and process price data for various currency pairs from the Connect Oracle.

Imports

Structs

Price

A struct to hold price information.
  • 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.

Constructor

The constructor initializes the contract. It does not take any parameters or perform any actions upon deployment.

Functions

get_price

Fetches the price for a specific currency pair from the Cosmos blockchain.

Parameters

Returns

get_prices

Fetches prices for multiple currency pairs from the Cosmos blockchain.

Parameters

Returns

join

Concatenates an array of strings with a specified separator.

Parameters

Returns

get_price_from_tokens

Parses a JSON string to extract price information and populate a Price struct.

Parameters

Returns