CosmWasm

This section contains all the types and messages which are required to be used by cosmwasm contract for requesting data feeds from the yggdrasil data engine .

Price Feed crate

Adding the crate to cosmwasm smart contract

price-feeds = "0.1.1"

Types

Name
Description

PriceFeedReq

Struct for sending the array of data feeds you need to request from the contract (In case of requesting multiple data feeds )

PriceFeedResponse

Response type for a single price feed

PriceFeedsResponse

Response type for multiple price feeds

Execute Messages

Name
Description

RequestPriceFeed

Message for requesting a single price feed from the data feed

RequestPriceFeeds

Message for requsting multiple price feeds , accepts only PriceFeedReq argument .

ExecuteMsg enum

Users need to have this kind of ExecuteMsg enum in their contracts to be able to utilize the data feeds

pub enum ExecuteMsg {
    RequestSinglePrice { pair : String },
    RequestMultiplePrices { pairs : Vec<String> },
    ReceivePrice { price_response: PriceFeedResponse },
    ReceivePrices { prices_response: PriceFeedsResponse },
}
Name
Description

RecievePrice

Message called by the RequestPriceFeed function upon the request of a single price feed .

RecievePrices

Message called by the RequestPriceFeeds function upon the request of multiple price feeds .

QueryMsg enum

[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(Vec<String>)]
    GetAllSymbols {},
}
Name
Description

GetAllSymbols

Query Message for requesting all the available feeds from the data engine

Last updated