mirror_protocol/
lock.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use cosmwasm_std::Uint128;
5
6#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
7pub struct InstantiateMsg {
8    pub owner: String,
9    pub mint_contract: String,
10    pub base_denom: String,
11    pub lockup_period: u64,
12}
13
14#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
15#[serde(rename_all = "snake_case")]
16pub enum ExecuteMsg {
17    UpdateConfig {
18        owner: Option<String>,
19        mint_contract: Option<String>,
20        base_denom: Option<String>,
21        lockup_period: Option<u64>,
22    },
23    LockPositionFundsHook {
24        position_idx: Uint128,
25        receiver: String,
26    },
27    UnlockPositionFunds {
28        positions_idx: Vec<Uint128>,
29    },
30    ReleasePositionFunds {
31        position_idx: Uint128,
32    },
33}
34
35#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
36pub struct MigrateMsg {}
37
38#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
39#[serde(rename_all = "snake_case")]
40pub enum QueryMsg {
41    Config {},
42    PositionLockInfo { position_idx: Uint128 },
43}
44
45#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
46pub struct ConfigResponse {
47    pub owner: String,
48    pub mint_contract: String,
49    pub base_denom: String,
50    pub lockup_period: u64,
51}
52
53#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
54pub struct PositionLockInfoResponse {
55    pub idx: Uint128,
56    pub receiver: String,
57    pub locked_amount: Uint128,
58    pub unlock_time: u64,
59}