Skip to main content

polyester/models/
sub_accounts.rs

1//! Sub-account models (Go `models/sub_accounts.go` thin parity).
2
3use buffa_types::google::protobuf::Timestamp;
4
5#[derive(Debug, Clone, PartialEq)]
6pub struct SubAccount {
7    pub subaccount_id: String,
8    pub label: String,
9    pub smart_account_address: String,
10    pub status: String,
11    pub updated_at: Option<Timestamp>,
12    /// Monotonic resource revision for conditional updates.
13    pub revision: u64,
14}
15
16#[derive(Debug, Clone, PartialEq)]
17pub struct SubAccountsList {
18    pub subaccounts: Vec<SubAccount>,
19}
20
21#[derive(Debug, Clone, PartialEq, Default)]
22pub struct GetSubaccountResult {
23    pub subaccount: Option<SubAccount>,
24}
25
26#[derive(Debug, Clone, PartialEq, Eq, Default)]
27pub struct CreateSubaccountResult {
28    pub subaccount_id: String,
29    /// Initial monotonic revision for the next revision-gated mutation.
30    pub revision: u64,
31}
32
33#[derive(Debug, Clone, PartialEq, Eq, Default)]
34pub struct SubAccountMember {
35    pub grantee_account_id: String,
36    pub role: String,
37}
38
39#[derive(Debug, Clone, PartialEq, Eq, Default)]
40pub struct SubAccountMembersList {
41    pub members: Vec<SubAccountMember>,
42}
43
44#[derive(Debug, Clone, PartialEq, Eq, Default)]
45pub struct SubAccountInvite {
46    pub invite_id: String,
47    pub grantee_account_id: String,
48    pub role: String,
49    pub status: String,
50}
51
52#[derive(Debug, Clone, PartialEq, Eq, Default)]
53pub struct SubAccountInvitesList {
54    pub invites: Vec<SubAccountInvite>,
55}
56
57#[derive(Debug, Clone, PartialEq, Eq, Default)]
58pub struct SubAccountActivityEvent {
59    pub event_type: String,
60    pub ts_ms: i64,
61}
62
63#[derive(Debug, Clone, PartialEq, Eq, Default)]
64pub struct SubAccountActivityList {
65    pub events: Vec<SubAccountActivityEvent>,
66    pub next_page_token: String,
67}