price_feeds/
msg.rs

1use crate::state::Price;
2use cosmwasm_schema::{cw_serde, QueryResponses};
3use cosmwasm_std::{Decimal256, Uint128};
4
5
6
7#[cw_serde]
8pub struct InstantiateMsg {
9    pub denom: String,
10}
11#[cw_serde]
12pub struct PriceFeedReq  {
13    pub pairs  : Vec<String>
14}
15
16#[cw_serde]
17pub enum ExecMsg {
18    UpdatePrice { symbol: String, price: Price },
19    RequestPriceFeed { symbol: String },
20    RequestPriceFeeds { request: PriceFeedReq },
21    ReceivePrices { prices_response : PriceFeedsResponse },
22    ReceivePrice { price_response : PriceFeedResponse },
23    SetCostPerRequest { cost_per_request: Uint128 },
24    ChangeAdmin { address: String },
25}
26
27
28#[cw_serde]
29#[derive(QueryResponses)]
30pub enum QueryMsg {
31    #[returns(Vec<String>)]
32    GetAllSymbols {},
33}
34
35
36#[cw_serde]
37pub struct PriceFeedResponse {
38    pub symbol: String,
39    pub price: Decimal256,
40}
41
42/// Structure for multiple price feeds response
43#[cw_serde]
44pub struct PriceFeedsResponse {
45    pub price_feeds: Vec<PriceFeedResponse>,
46}
47
48#[cw_serde]
49pub enum MigrateMsg {}