astrovault/ratio_pool/
handle_msg.rs1use cw20::Cw20ReceiveMsg;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5use cosmwasm_std::Uint128;
6
7use crate::{
8 ratio_pool_factory::handle_msg::RatioPoolSettings,
9 stable_pool::handle_msg::DisabledActionsPerAssetSettings,
10 standard_pool::handle_msg::DirectStaking,
11};
12
13#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
14#[serde(rename_all = "snake_case")]
15pub enum ExecuteMsg {
16 Receive(Cw20ReceiveMsg),
18 UpdateConfig {
20 pool_settings: Option<RatioPoolSettings>,
21 owner_settings: Option<OwnerSettings>,
22 },
23 UpdateDisabledActionsPerAssetSettings {
25 disabled_actions_per_asset_settings: Option<DisabledActionsPerAssetSettings>,
26 },
27 UpdatePermissions {
29 is_deposit_enabled: bool,
30 is_swap_enabled: bool,
31 },
32 ReceiveLockupMetrics {
34 assets_fee_amount: Vec<Uint128>,
35 },
36 UpdateCashback {
38 cashback: Option<String>,
39 },
40 Deposit {
42 assets_amount: [Uint128; 2],
43 receiver: Option<String>,
44 direct_staking: Option<DirectStaking>,
45 expected_return: Option<Uint128>, },
47 Swap {
49 to: Option<String>,
50 expected_return: Option<Uint128>,
51 },
52 SelfCallback {
54 message: SelfHookMsg,
55 },
56}
57
58#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
59#[serde(rename_all = "snake_case")]
60pub enum SelfHookMsg {
61 DirectStaking {
63 from: String,
64 amount: Uint128,
65 not_claim_rewards: Option<bool>,
66 notify: Option<bool>,
67 },
68}
69
70#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
71#[serde(rename_all = "snake_case")]
72pub enum Cw20HookMsg {
73 Swap {
75 to: Option<String>,
76 expected_return: Option<Uint128>,
77 },
78 WithdrawalToLockup(RatioWithdrawalToLockupInputs), }
81
82#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
83pub struct RatioWithdrawalToLockupInputs {
84 pub to: Option<String>, pub is_instant_withdrawal: Option<bool>, pub expected_return: Option<Vec<Uint128>>,
87}
88
89#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
90pub struct OwnerSettings {
91 pub is_deposit_enabled: bool,
92 pub is_withdrawal_to_lockup_enabled: bool,
93 pub is_swap_enabled: bool,
94}
95
96#[derive(Serialize, Deserialize, JsonSchema)]
97pub struct MigrateMsg {}