This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlib.rs
78 lines (71 loc) · 1.78 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_std::{HumanAddr, Uint128};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InitMsg {
pub name: String,
pub total_supply: Uint128,
pub decimals: u8,
pub symbol: String,
pub initial_exchange_rate: Uint128,
pub reserve_factor: Uint128,
pub borrow_index: Uint128,
pub max_borrow_rate: Uint128,
pub denom: String
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
Mint {},
Redeem {
redeem_tokens_in: Uint128
},
Borrow {
borrow_amount: Uint128
},
RepayBorrow {},
Approve {
spender: HumanAddr,
amount: Uint128,
},
Transfer {
recipient: HumanAddr,
amount: Uint128,
},
TransferFrom {
owner: HumanAddr,
recipient: HumanAddr,
amount: Uint128,
},
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {},
Balance {
address: HumanAddr,
},
Allowance {
owner: HumanAddr,
spender: HumanAddr,
},
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ConfigResponse {
pub name: String,
pub total_supply: Uint128,
pub decimals: u8,
pub symbol: String,
pub intital_exchange_rate: Uint128,
pub reserve_factor: Uint128,
pub borrow_index: Uint128,
pub denom: String
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct BalanceResponse {
pub balance: Uint128,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct AllowanceResponse {
pub allowance: Uint128,
}