pylon_gateway/
pool_msg.rs

1use cosmwasm_bignumber::Uint256;
2use cw20::Cw20ReceiveMsg;
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
7pub struct InstantiateMsg {
8    pub start: u64,
9    pub period: u64,
10    pub cliff: u64,
11    pub share_token: String,
12    pub reward_token: String,
13    pub reward_amount: Uint256,
14    pub cap_strategy: Option<String>,
15}
16
17#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
18#[serde(rename_all = "snake_case")]
19pub enum ConfigureMsg {
20    Pool {
21        owner: Option<String>,
22        share_token: Option<String>,
23        reward_token: Option<String>,
24    },
25    Deposit {
26        start: Option<u64>,
27        finish: Option<u64>,
28        user_cap: Option<Uint256>,
29        total_cap: Option<Uint256>,
30    },
31    Withdraw {
32        strategy: Vec<(u64, u64, bool)>,
33    },
34    Claim {
35        start: Option<u64>,
36        finish: Option<u64>,
37    },
38    SubReward {
39        amount: Uint256,
40    },
41    AddReward {
42        amount: Uint256,
43    },
44}
45
46#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
47#[serde(rename_all = "snake_case")]
48pub enum ExecuteMsg {
49    // core
50    Receive(Cw20ReceiveMsg),
51    Update { target: Option<String> },
52    Withdraw { amount: Uint256 },
53    Claim {},
54    // internal
55    DepositInternal { sender: String, amount: Uint256 },
56    WithdrawInternal { sender: String, amount: Uint256 },
57    ClaimInternal { sender: String },
58    // owner
59    Configure(ConfigureMsg),
60}
61
62#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
63#[serde(rename_all = "snake_case")]
64pub enum Cw20HookMsg {
65    Deposit {},
66}
67
68#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
69#[serde(rename_all = "snake_case")]
70pub enum QueryMsg {
71    Config {}, // state::Config
72    Stakers {
73        start_after: Option<String>,
74        limit: Option<u32>,
75    },
76    Reward {}, // state::Reward
77    BalanceOf {
78        owner: String,
79    }, // -> Uint256
80    AvailableCapOf {
81        address: String,
82    },
83    ClaimableReward {
84        owner: String,
85    }, // -> Uint256
86}
87
88/// We currently take no arguments for migrations
89#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
90#[serde(rename_all = "snake_case")]
91pub enum MigrateMsg {}