1use crate::serialization::{Serializable, Deserializable};
9use crate::cryptography::PublicAddress;
10
11#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
12pub struct TransferInput {
13 pub recipient: PublicAddress,
15
16 pub amount: u64
18}
19
20impl Serializable for TransferInput {}
21impl Deserializable for TransferInput {}
22
23#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
24pub struct DeployInput {
25 pub contract: Vec<u8>,
27
28 pub cbi_version: u32
30}
31
32impl Serializable for DeployInput {}
33impl Deserializable for DeployInput {}
34
35#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
36pub struct CallInput {
37 pub target: PublicAddress,
39
40 pub method: String,
42
43 pub arguments: Option<Vec<Vec<u8>>>,
45
46 pub amount: Option<u64>
49}
50
51impl Serializable for CallInput {}
52impl Deserializable for CallInput {}
53
54#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
55pub struct CreatePoolInput {
56 pub commission_rate: u8
59}
60
61impl Serializable for CreatePoolInput {}
62impl Deserializable for CreatePoolInput {}
63
64#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
65pub struct SetPoolSettingsInput {
66 pub commission_rate: u8,
69}
70
71impl Serializable for SetPoolSettingsInput {}
72impl Deserializable for SetPoolSettingsInput {}
73
74#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
75pub struct CreateDepositInput {
76 pub operator: PublicAddress,
78
79 pub balance: u64,
81
82 pub auto_stake_rewards: bool,
85}
86
87impl Serializable for CreateDepositInput {}
88impl Deserializable for CreateDepositInput {}
89
90#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
91pub struct SetDepositSettingsInput {
92 pub operator: PublicAddress,
94
95 pub auto_stake_rewards: bool,
98}
99
100impl Serializable for SetDepositSettingsInput {}
101impl Deserializable for SetDepositSettingsInput {}
102
103#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
104pub struct TopUpDepositInput {
105 pub operator: PublicAddress,
107
108 pub amount: u64,
110}
111
112impl Serializable for TopUpDepositInput {}
113impl Deserializable for TopUpDepositInput {}
114
115#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
116pub struct WithdrawDepositInput {
117 pub operator: PublicAddress,
119
120 pub max_amount: u64,
124}
125
126impl Serializable for WithdrawDepositInput {}
127impl Deserializable for WithdrawDepositInput {}
128
129#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
130pub struct StakeDepositInput {
131 pub operator: PublicAddress,
133
134 pub max_amount: u64,
138}
139
140impl Serializable for StakeDepositInput {}
141impl Deserializable for StakeDepositInput {}
142
143#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
144pub struct UnstakeDepositInput {
145 pub operator: PublicAddress,
147
148 pub max_amount: u64,
152}
153
154impl Serializable for UnstakeDepositInput {}
155impl Deserializable for UnstakeDepositInput {}