File tree 3 files changed +24
-23
lines changed
3 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,13 @@ class AggregatedOnchainResponse(BaseModel):
32
32
macd : str = Field (default = "N/A" , description = "Moving Average Convergence Divergence" )
33
33
error : str | None = Field (default = None , description = "Error message if any" )
34
34
isUnsupported : bool = Field (default = False , description = "Flag indicating if the pair is unsupported" )
35
+
36
+
37
+ class GetEntryParams (BaseModel ):
38
+ """Parameters for entry requests."""
39
+
40
+ aggregation : str | None = None
41
+ entry_type : str | None = None
42
+ interval : str | None = None
43
+ routing : bool = True
44
+ timestamp : int | None = None
Original file line number Diff line number Diff line change
1
+ """Utility functions for the models"""
2
+
3
+ DEFAULT_PAIRS = ["ETH/USD" , "BTC/USD" ]
4
+
5
+ # Default entry parameters matching API.devnet
6
+ DEFAULT_ENTRY_PARAMS = {
7
+ "aggregation" : "median" ,
8
+ "entry_type" : None , # Changeable from the frontend
9
+ "interval" : None , # Changeable from the frontend
10
+ "routing" : True ,
11
+ "timestamp" : None ,
12
+ }
Original file line number Diff line number Diff line change 4
4
import httpx
5
5
from fastapi import APIRouter , Depends , Query
6
6
from fastapi .responses import StreamingResponse
7
- from pydantic import BaseModel
8
7
9
8
from pragma .client .client import PragmaApiClient
10
9
from pragma .client .token import get_api_client
10
+ from pragma .models .schemas import GetEntryParams
11
+ from pragma .models .utils import DEFAULT_ENTRY_PARAMS
11
12
from pragma .utils .logging import logger
12
13
13
14
app = APIRouter (
14
15
prefix = "/data/multi" ,
15
16
)
16
17
17
18
18
- class GetEntryParams (BaseModel ):
19
- """Parameters for entry requests."""
20
-
21
- aggregation : str | None = None
22
- entry_type : str | None = None
23
- interval : str | None = None
24
- routing : bool = True
25
- timestamp : int | None = None
26
-
27
-
28
- DEFAULT_PAIRS = ["ETH/USD" , "BTC/USD" ]
29
-
30
- # Default entry parameters matching API.devnet
31
- DEFAULT_ENTRY_PARAMS = {
32
- "aggregation" : "median" ,
33
- "entry_type" : None , # Changeable from the frontend
34
- "interval" : None , # Changeable from the frontend
35
- "routing" : True ,
36
- "timestamp" : None ,
37
- }
38
-
39
-
40
19
@app .get (
41
20
"/stream" ,
42
21
responses = {
You can’t perform that action at this time.
0 commit comments