Skip to content

Commit 52dc1dc

Browse files
chore: sync generated _endpoints.py with backend spec (#199)
1 parent a732c30 commit 52dc1dc

1 file changed

Lines changed: 90 additions & 90 deletions

File tree

datamaxi/_responses.py

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,27 @@ def from_dict(cls, data: dict) -> CexAnnouncementsResponse:
5656
@dataclass
5757
class CexAnnouncementsView:
5858
# specifies the category of the announcement
59-
c: str = ""
59+
category: str = ""
6060
# specifies the date of the announcement
61-
d: int = 0
61+
timestamp: int = 0
6262
# specifies the exchange of the announcement
63-
e: str = ""
63+
exchange: str = ""
6464
# specifies the summary of the announcement
65-
s: str = ""
65+
summary: str = ""
6666
# specifies the title of the announcement
67-
t: str = ""
67+
title: str = ""
6868
# specifies the URL of the announcement
69-
u: str = ""
69+
url: str = ""
7070

7171
@classmethod
7272
def from_dict(cls, data: dict) -> CexAnnouncementsView:
7373
return cls(
74-
c=data.get("c", ""),
75-
d=data.get("d", 0),
76-
e=data.get("e", ""),
77-
s=data.get("s", ""),
78-
t=data.get("t", ""),
79-
u=data.get("u", ""),
74+
category=data.get("c", ""),
75+
timestamp=data.get("d", 0),
76+
exchange=data.get("e", ""),
77+
summary=data.get("s", ""),
78+
title=data.get("t", ""),
79+
url=data.get("u", ""),
8080
)
8181

8282

@@ -104,27 +104,27 @@ def from_dict(cls, data: dict) -> CexCandleResponse:
104104
@dataclass
105105
class CexCandleView:
106106
# specifies close price of the candle
107-
c: float = 0.0
107+
close: float = 0.0
108108
# specifies the opening date and time of candle
109-
d: int = 0
109+
timestamp: int = 0
110110
# specifies high price of the candle
111-
h: float = 0.0
111+
high: float = 0.0
112112
# specifies low price of the candle
113-
l: float = 0.0
113+
low: float = 0.0
114114
# specifies open price of the candle
115-
o: float = 0.0
115+
open: float = 0.0
116116
# specifies trading volume (base token) of the candle
117-
v: float = 0.0
117+
volume: float = 0.0
118118

119119
@classmethod
120120
def from_dict(cls, data: dict) -> CexCandleView:
121121
return cls(
122-
c=data.get("c", 0.0),
123-
d=data.get("d", 0),
124-
h=data.get("h", 0.0),
125-
l=data.get("l", 0.0),
126-
o=data.get("o", 0.0),
127-
v=data.get("v", 0.0),
122+
close=data.get("c", 0.0),
123+
timestamp=data.get("d", 0),
124+
high=data.get("h", 0.0),
125+
low=data.get("l", 0.0),
126+
open=data.get("o", 0.0),
127+
volume=data.get("v", 0.0),
128128
)
129129

130130

@@ -153,45 +153,45 @@ def from_dict(cls, data: dict) -> CexTokenUpdatesResponse:
153153
@dataclass
154154
class CexTokenUpdatesView:
155155
# Specifies the base token
156-
b: str = ""
156+
base: str = ""
157157
# Specifies the timestamp
158-
d: int = 0
158+
timestamp: int = 0
159159
# Specifies the exchange
160-
e: str = ""
160+
exchange: str = ""
161161
# Specifies the market
162-
m: str = ""
162+
market: str = ""
163163
# Specifies the quote token
164-
q: str = ""
164+
quote: str = ""
165165
# Specifies the type of the token update (listed or delisted)
166-
t: str = ""
166+
update_type: str = ""
167167

168168
@classmethod
169169
def from_dict(cls, data: dict) -> CexTokenUpdatesView:
170170
return cls(
171-
b=data.get("b", ""),
172-
d=data.get("d", 0),
173-
e=data.get("e", ""),
174-
m=data.get("m", ""),
175-
q=data.get("q", ""),
176-
t=data.get("t", ""),
171+
base=data.get("b", ""),
172+
timestamp=data.get("d", 0),
173+
exchange=data.get("e", ""),
174+
market=data.get("m", ""),
175+
quote=data.get("q", ""),
176+
update_type=data.get("t", ""),
177177
)
178178

179179

180180
@dataclass
181181
class ForexResponse:
182182
# specifies the unix timestamp of the forex rate
183-
d: int = 0
183+
timestamp: int = 0
184184
# specifies the forex rate
185-
r: float = 0.0
185+
rate: float = 0.0
186186
# specifies the name of the forex symbol
187-
s: str = ""
187+
symbol: str = ""
188188

189189
@classmethod
190190
def from_dict(cls, data: dict) -> ForexResponse:
191191
return cls(
192-
d=data.get("d", 0),
193-
r=data.get("r", 0.0),
194-
s=data.get("s", ""),
192+
timestamp=data.get("d", 0),
193+
rate=data.get("r", 0.0),
194+
symbol=data.get("s", ""),
195195
)
196196

197197

@@ -219,48 +219,48 @@ def from_dict(cls, data: dict) -> FundingRateHistoryResponse:
219219
@dataclass
220220
class FundingRateHistoryView:
221221
# specifies the date and time in UNIX timestamp format
222-
d: int = 0
222+
timestamp: int = 0
223223
# specifies the funding rate
224-
f: Optional[float] = None
224+
funding_rate: Optional[float] = None
225225

226226
@classmethod
227227
def from_dict(cls, data: dict) -> FundingRateHistoryView:
228228
return cls(
229-
d=data.get("d", 0),
230-
f=data.get("f"),
229+
timestamp=data.get("d", 0),
230+
funding_rate=data.get("f"),
231231
)
232232

233233

234234
@dataclass
235235
class FundingRateLatestResponse:
236236
# Specifies the base
237-
b: str = ""
237+
base: str = ""
238238
# Specifies the timestamp
239-
d: int = 0
239+
timestamp: int = 0
240240
# Specifies the exchange
241-
e: str = ""
241+
exchange: str = ""
242242
# Specifies the funding rate
243-
f: Optional[float] = None
243+
funding_rate: Optional[float] = None
244244
# Specifies the interval hours
245-
i: Optional[int] = None
245+
interval_hours: Optional[int] = None
246246
# Specifies the token id
247-
id: str = ""
247+
token_id: str = ""
248248
# Specifies the quote
249-
q: str = ""
249+
quote: str = ""
250250
# Specifies the symbol
251-
s: str = ""
251+
symbol: str = ""
252252

253253
@classmethod
254254
def from_dict(cls, data: dict) -> FundingRateLatestResponse:
255255
return cls(
256-
b=data.get("b", ""),
257-
d=data.get("d", 0),
258-
e=data.get("e", ""),
259-
f=data.get("f"),
260-
i=data.get("i"),
261-
id=data.get("id", ""),
262-
q=data.get("q", ""),
263-
s=data.get("s", ""),
256+
base=data.get("b", ""),
257+
timestamp=data.get("d", 0),
258+
exchange=data.get("e", ""),
259+
funding_rate=data.get("f"),
260+
interval_hours=data.get("i"),
261+
token_id=data.get("id", ""),
262+
quote=data.get("q", ""),
263+
symbol=data.get("s", ""),
264264
)
265265

266266

@@ -1269,51 +1269,51 @@ def from_dict(cls, data: dict) -> TickerResponse:
12691269
@dataclass
12701270
class TickerView:
12711271
# specifies the base token
1272-
b: str = ""
1272+
base: str = ""
12731273
# specifies the date and the time in UTC milliseconds
1274-
d: int = 0
1274+
timestamp: int = 0
12751275
# specifies the exchange name
1276-
e: str = ""
1276+
exchange: str = ""
12771277
# highest bid from orderbook
1278-
hb: Optional[float] = None
1278+
highest_bid: Optional[float] = None
12791279
# lowest ask from orderbook
1280-
la: Optional[float] = None
1280+
lowest_ask: Optional[float] = None
12811281
# lower depth(2%)
1282-
ld: Optional[float] = None
1282+
lower_depth: Optional[float] = None
12831283
# specifies the market type
1284-
m: str = ""
1284+
market: str = ""
12851285
# specifies the latest price
1286-
p: Optional[float] = None
1286+
price: Optional[float] = None
12871287
# specifies the price 24 hours ago
1288-
p24h: Optional[float] = None
1288+
price_24h: Optional[float] = None
12891289
# specified price change between the latest price and the price 24 hours ago
1290-
pc: Optional[float] = None
1290+
price_change: Optional[float] = None
12911291
# specifies the quote token
1292-
q: str = ""
1292+
quote: str = ""
12931293
# specifies the symbol (base-quote)
1294-
s: str = ""
1294+
symbol: str = ""
12951295
# upper depth(2%)
1296-
ud: Optional[float] = None
1296+
upper_depth: Optional[float] = None
12971297
# specifies the trading volume in the last 24 hours
1298-
v: Optional[float] = None
1298+
volume: Optional[float] = None
12991299

13001300
@classmethod
13011301
def from_dict(cls, data: dict) -> TickerView:
13021302
return cls(
1303-
b=data.get("b", ""),
1304-
d=data.get("d", 0),
1305-
e=data.get("e", ""),
1306-
hb=data.get("hb"),
1307-
la=data.get("la"),
1308-
ld=data.get("ld"),
1309-
m=data.get("m", ""),
1310-
p=data.get("p"),
1311-
p24h=data.get("p24h"),
1312-
pc=data.get("pc"),
1313-
q=data.get("q", ""),
1314-
s=data.get("s", ""),
1315-
ud=data.get("ud"),
1316-
v=data.get("v"),
1303+
base=data.get("b", ""),
1304+
timestamp=data.get("d", 0),
1305+
exchange=data.get("e", ""),
1306+
highest_bid=data.get("hb"),
1307+
lowest_ask=data.get("la"),
1308+
lower_depth=data.get("ld"),
1309+
market=data.get("m", ""),
1310+
price=data.get("p"),
1311+
price_24h=data.get("p24h"),
1312+
price_change=data.get("pc"),
1313+
quote=data.get("q", ""),
1314+
symbol=data.get("s", ""),
1315+
upper_depth=data.get("ud"),
1316+
volume=data.get("v"),
13171317
)
13181318

13191319

0 commit comments

Comments
 (0)