maestro_rust_sdk/models/
accounts.rs1use crate::utils;
2use serde::Deserialize;
3
4#[derive(Deserialize, Debug, Clone)]
5pub struct AccountAddresses {
6 pub data: Vec<String>,
7 pub last_updated: utils::LastUpdated,
8 pub next_cursor: Option<String>,
9}
10
11#[derive(Deserialize, Debug, Clone)]
12pub struct AccountAsset {
13 pub amount: i64,
14 pub unit: String,
15}
16
17#[derive(Deserialize, Debug, Clone)]
18pub struct AccountAssets {
19 pub data: Vec<AccountAsset>,
20 pub last_updated: utils::LastUpdated,
21 pub next_cursor: Option<String>,
22}
23
24#[derive(Deserialize, Debug, Clone)]
25pub struct StakeAccountHistoryItem {
26 pub active_stake: i64,
27 pub epoch_no: i64,
28 pub pool_id: String,
29}
30
31#[derive(Deserialize, Debug, Clone)]
32pub struct StakeAccountHistory {
33 pub data: Vec<StakeAccountHistoryItem>,
34 pub last_updated: utils::LastUpdated,
35 pub next_cursor: Option<String>,
36}
37
38#[derive(Deserialize, Debug, Clone)]
39pub struct AccountInformation {
40 pub delegated_pool: String,
41 pub registered: bool,
42 pub rewards_available: i64,
43 pub stake_address: String,
44 pub total_balance: i64,
45 pub total_rewarded: i64,
46 pub total_withdrawn: i64,
47 pub utxo_balance: i64,
48}
49
50#[derive(Deserialize, Debug, Clone)]
51pub struct StakeAccountInformation {
52 pub data: AccountInformation,
53 pub last_updated: utils::LastUpdated,
54}
55
56#[derive(Deserialize, Debug, Clone)]
57pub enum StakeRewardType {
58 Member,
59 Leader,
60 Refund,
61}
62
63#[derive(Deserialize, Debug, Clone)]
64pub struct StakeAccountReward {
65 pub amount: i64,
66 pub earned_epoch: i64,
67 pub pool_id: String,
68 pub spendable_epoch: i64,
69 pub r#type: StakeRewardType,
70}
71
72#[derive(Deserialize, Debug, Clone)]
73pub struct StakeAccountRewards {
74 pub data: Vec<StakeAccountReward>,
75 pub last_updated: utils::LastUpdated,
76 pub next_cursor: Option<String>,
77}
78
79#[derive(Deserialize, Debug, Clone)]
80pub enum StakeUpdateAction {
81 Registration,
82 Deregistration,
83 Delegation,
84 Withdrawal,
85}
86
87#[derive(Deserialize, Debug, Clone)]
88pub struct StakeAccountUpdate {
89 pub absolute_slot: i64,
90 pub action: StakeUpdateAction,
91 pub epoch_no: i64,
92 pub tx_hash: String,
93}
94
95#[derive(Deserialize, Debug, Clone)]
96pub struct StakeAccountUpdates {
97 pub data: Vec<StakeAccountUpdate>,
98 pub last_updated: utils::LastUpdated,
99 pub next_cursor: Option<String>,
100}