use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::common::OrderBy;
use cosmwasm_std::Decimal;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub owner: String,
pub base_asset: String,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
UpdateConfig {
owner: Option<String>,
},
RegisterAsset {
asset_token: String,
feeder: String,
},
FeedPrice {
prices: Vec<(String, Decimal)>,
},
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {},
Feeder {
asset_token: String,
},
Price {
base_asset: String,
quote_asset: String,
},
Prices {
start_after: Option<String>,
limit: Option<u32>,
order_by: Option<OrderBy>,
},
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
pub owner: String,
pub base_asset: String,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct FeederResponse {
pub asset_token: String,
pub feeder: String,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct PriceResponse {
pub rate: Decimal,
pub last_updated_base: u64,
pub last_updated_quote: u64,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct PricesResponseElem {
pub asset_token: String,
pub price: Decimal,
pub last_updated_time: u64,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct PricesResponse {
pub prices: Vec<PricesResponseElem>,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct MigrateMsg {}