forked from Echo-Mirror-Butler/echomirror-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.pyi
More file actions
197 lines (171 loc) · 5.92 KB
/
Copy path__init__.pyi
File metadata and controls
197 lines (171 loc) · 5.92 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
"""Type stubs for the `echomirror` package (native PyO3 extension)."""
from enum import Enum
from typing import List, Optional
__version__: str
class StellarNetwork(Enum):
Mainnet = ...
Testnet = ...
# ── Exceptions ────────────────────────────────────────────────────────────────
class EchoMirrorException(Exception): ...
class AuthError(EchoMirrorException): ...
class NetworkError(EchoMirrorException): ...
class RateLimitError(EchoMirrorException): ...
class NotFoundError(EchoMirrorException): ...
class ConfigError(EchoMirrorException): ...
# ── Mood ──────────────────────────────────────────────────────────────────────
class AiReflection:
id: str
entry_id: str
content: str
sentiment: str
themes: List[str]
generated_at: str
class MoodEntry:
id: str
user_id: str
score: int
note: Optional[str]
tags: List[str]
ai_reflection: Optional[AiReflection]
created_at: str
updated_at: str
class MoodStreak:
current: int
longest: int
last_logged_at: Optional[str]
is_active_today: bool
class MoodSummary:
period: str
average: float
min: int
max: int
total_entries: int
trend: str
class MoodHistoryPage:
entries: List[MoodEntry]
total: int
class MoodClient:
def __init__(self, client: "EchoMirrorClient") -> None: ...
async def log(
self,
score: int,
note: Optional[str] = None,
tags: Optional[List[str]] = None,
) -> MoodEntry: ...
async def get_history(
self,
limit: Optional[int] = None,
offset: Optional[int] = None,
from_date: Optional[str] = None,
to_date: Optional[str] = None,
tags: Optional[List[str]] = None,
min_score: Optional[int] = None,
max_score: Optional[int] = None,
) -> MoodHistoryPage: ...
async def get_entry(self, entry_id: str) -> MoodEntry: ...
async def delete_entry(self, entry_id: str) -> None: ...
async def get_streak(self) -> MoodStreak: ...
async def get_summary(self, period: str = "week") -> MoodSummary: ...
async def request_reflection(self, entry_id: str) -> AiReflection: ...
async def get_reflection(self, entry_id: str) -> Optional[AiReflection]: ...
# ── Stellar ───────────────────────────────────────────────────────────────────
class StellarBalance:
xlm: str
echo: str
public_key: str
network: str
last_fetched: str
class StellarTransaction:
id: str
tx_type: str
asset: str
amount: str
from_address: str
to_address: str
memo: Optional[str]
created_at: str
stellar_tx_hash: str
ledger_sequence: Optional[int]
class UnsignedTransaction:
xdr: str
fee: int
sequence: str
class TransactionHistoryPage:
transactions: List[StellarTransaction]
cursor: Optional[str]
class StellarClient:
def __init__(self, client: "EchoMirrorClient") -> None: ...
async def get_balance(self, public_key: str) -> StellarBalance: ...
async def build_transfer(
self,
from_address: str,
to_address: str,
amount: float,
memo: Optional[str] = None,
) -> UnsignedTransaction: ...
async def submit_transaction(self, signed_xdr: str) -> StellarTransaction: ...
async def get_transaction_history(
self,
public_key: str,
limit: int = 20,
cursor: Optional[str] = None,
) -> TransactionHistoryPage: ...
async def fund_testnet_account(self, public_key: str) -> None: ...
# ── Social ────────────────────────────────────────────────────────────────────
class UserProfile:
id: str
username: str
display_name: str
avatar_url: Optional[str]
echo_balance: str
current_streak: int
total_entries: int
joined_at: str
class LeaderboardEntry:
rank: int
user_id: str
display_name: str
avatar_url: Optional[str]
streak: int
total_entries: int
echo_balance: str
weekly_score: float
class GlobalFeedEntry:
id: str
score: int
tags: List[str]
country: Optional[str]
city: Optional[str]
created_at: str
class SocialClient:
def __init__(self, client: "EchoMirrorClient") -> None: ...
async def get_global_feed(self, limit: int = 50) -> List[GlobalFeedEntry]: ...
async def get_leaderboard(self, limit: int = 100) -> List[LeaderboardEntry]: ...
# ── Client ────────────────────────────────────────────────────────────────────
class EchoMirrorClient:
network: StellarNetwork
def __init__(
self,
api_key: str,
base_url: Optional[str] = None,
network: StellarNetwork = StellarNetwork.Mainnet,
timeout_secs: int = 10,
horizon_url: Optional[str] = None,
friendbot_url: Optional[str] = None,
) -> None: ...
async def set_auth_token(self, token: Optional[str]) -> None: ...
class EchoMirror:
mood: MoodClient
stellar: StellarClient
social: SocialClient
client: EchoMirrorClient
def __init__(
self,
api_key: str,
base_url: Optional[str] = None,
network: StellarNetwork = StellarNetwork.Mainnet,
timeout_secs: int = 10,
horizon_url: Optional[str] = None,
friendbot_url: Optional[str] = None,
) -> None: ...
async def set_auth_token(self, token: Optional[str]) -> None: ...