defillama-sdk 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- defillama_api/__init__.py +71 -0
- defillama_api/client.py +157 -0
- defillama_api/constants/__init__.py +11 -0
- defillama_api/constants/dimensions.py +69 -0
- defillama_api/errors.py +41 -0
- defillama_api/modules/__init__.py +29 -0
- defillama_api/modules/account.py +29 -0
- defillama_api/modules/bridges.py +81 -0
- defillama_api/modules/dat.py +31 -0
- defillama_api/modules/ecosystem.py +54 -0
- defillama_api/modules/emissions.py +32 -0
- defillama_api/modules/etfs.py +58 -0
- defillama_api/modules/fees.py +242 -0
- defillama_api/modules/prices.py +122 -0
- defillama_api/modules/stablecoins.py +76 -0
- defillama_api/modules/tvl.py +84 -0
- defillama_api/modules/volumes.py +116 -0
- defillama_api/modules/yields.py +85 -0
- defillama_api/py.typed +0 -0
- defillama_api/types/__init__.py +14 -0
- defillama_api/types/account.py +10 -0
- defillama_api/types/bridges.py +147 -0
- defillama_api/types/dat.py +144 -0
- defillama_api/types/ecosystem.py +175 -0
- defillama_api/types/emissions.py +154 -0
- defillama_api/types/etfs.py +37 -0
- defillama_api/types/fees.py +217 -0
- defillama_api/types/prices.py +99 -0
- defillama_api/types/stablecoins.py +159 -0
- defillama_api/types/tvl.py +189 -0
- defillama_api/types/volumes.py +147 -0
- defillama_api/types/yields.py +170 -0
- defillama_sdk-0.1.0.dist-info/METADATA +688 -0
- defillama_sdk-0.1.0.dist-info/RECORD +36 -0
- defillama_sdk-0.1.0.dist-info/WHEEL +5 -0
- defillama_sdk-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""Emission type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional, TypedDict, Union
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EmissionEvent(TypedDict, total=False):
|
|
7
|
+
description: str
|
|
8
|
+
timestamp: int
|
|
9
|
+
noOfTokens: List[float]
|
|
10
|
+
category: str
|
|
11
|
+
unlockType: str
|
|
12
|
+
rateDurationDays: Optional[int]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class NextEvent(TypedDict):
|
|
16
|
+
date: int
|
|
17
|
+
toUnlock: float
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EmissionToken(TypedDict, total=False):
|
|
21
|
+
token: str
|
|
22
|
+
sources: List[str]
|
|
23
|
+
protocolId: str
|
|
24
|
+
name: str
|
|
25
|
+
circSupply: float
|
|
26
|
+
circSupply30d: float
|
|
27
|
+
totalLocked: float
|
|
28
|
+
maxSupply: float
|
|
29
|
+
gecko_id: str
|
|
30
|
+
events: List[EmissionEvent]
|
|
31
|
+
unlockEvents: Optional[List[object]]
|
|
32
|
+
nextEvent: Optional[NextEvent]
|
|
33
|
+
unlocksPerDay: Optional[float]
|
|
34
|
+
mcap: float
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class UnlockDataPoint(TypedDict):
|
|
38
|
+
timestamp: int
|
|
39
|
+
unlocked: float
|
|
40
|
+
rawEmission: float
|
|
41
|
+
burned: float
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class EmissionCategoryData(TypedDict):
|
|
45
|
+
label: str
|
|
46
|
+
data: List[UnlockDataPoint]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
TokenAllocationBreakdown = Dict[str, float]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class TokenAllocationBySection(TypedDict):
|
|
53
|
+
current: Dict[str, float]
|
|
54
|
+
final: Dict[str, float]
|
|
55
|
+
progress: Dict[str, float]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class TokenAllocation(TypedDict, total=False):
|
|
59
|
+
current: TokenAllocationBreakdown
|
|
60
|
+
final: TokenAllocationBreakdown
|
|
61
|
+
progress: TokenAllocationBreakdown
|
|
62
|
+
bySection: Optional[TokenAllocationBySection]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class EmissionDocumentedData(TypedDict):
|
|
66
|
+
data: List[EmissionCategoryData]
|
|
67
|
+
tokenAllocation: TokenAllocation
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class CliffAllocation(TypedDict):
|
|
71
|
+
recipient: str
|
|
72
|
+
category: str
|
|
73
|
+
unlockType: str
|
|
74
|
+
amount: float
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class LinearAllocation(TypedDict):
|
|
78
|
+
recipient: str
|
|
79
|
+
category: str
|
|
80
|
+
unlockType: str
|
|
81
|
+
previousRatePerWeek: float
|
|
82
|
+
newRatePerWeek: float
|
|
83
|
+
endTimestamp: int
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class UnlockEventSummary(TypedDict, total=False):
|
|
87
|
+
totalTokensCliff: Optional[float]
|
|
88
|
+
netChangeInWeeklyRate: Optional[float]
|
|
89
|
+
totalNewWeeklyRate: Optional[float]
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class UnlockEventItem(TypedDict):
|
|
93
|
+
timestamp: int
|
|
94
|
+
cliffAllocations: List[CliffAllocation]
|
|
95
|
+
linearAllocations: List[LinearAllocation]
|
|
96
|
+
summary: UnlockEventSummary
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class EmissionMetadata(TypedDict, total=False):
|
|
100
|
+
token: str
|
|
101
|
+
sources: List[str]
|
|
102
|
+
protocolIds: List[str]
|
|
103
|
+
events: List[EmissionEvent]
|
|
104
|
+
notes: List[str]
|
|
105
|
+
total: Optional[float]
|
|
106
|
+
chain: Optional[str]
|
|
107
|
+
unlockEvents: List[UnlockEventItem]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class SupplyMetrics(TypedDict, total=False):
|
|
111
|
+
maxSupply: Optional[float]
|
|
112
|
+
adjustedSupply: Optional[float]
|
|
113
|
+
tbdAmount: Optional[float]
|
|
114
|
+
incentiveAmount: Optional[float]
|
|
115
|
+
nonIncentiveAmount: Optional[float]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class EmissionBody(TypedDict, total=False):
|
|
119
|
+
documentedData: EmissionDocumentedData
|
|
120
|
+
metadata: EmissionMetadata
|
|
121
|
+
name: str
|
|
122
|
+
gecko_id: str
|
|
123
|
+
defillamaIds: List[str]
|
|
124
|
+
categories: Dict[str, List[str]]
|
|
125
|
+
protocolCategory: str
|
|
126
|
+
chainName: str
|
|
127
|
+
pId: str
|
|
128
|
+
unlockUsdChart: List[object]
|
|
129
|
+
supplyMetrics: SupplyMetrics
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class EmissionDetailResponse(TypedDict):
|
|
133
|
+
body: EmissionBody
|
|
134
|
+
lastModified: str
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
__all__ = [
|
|
138
|
+
"EmissionEvent",
|
|
139
|
+
"NextEvent",
|
|
140
|
+
"EmissionToken",
|
|
141
|
+
"UnlockDataPoint",
|
|
142
|
+
"EmissionCategoryData",
|
|
143
|
+
"TokenAllocationBreakdown",
|
|
144
|
+
"TokenAllocationBySection",
|
|
145
|
+
"TokenAllocation",
|
|
146
|
+
"EmissionDocumentedData",
|
|
147
|
+
"CliffAllocation",
|
|
148
|
+
"LinearAllocation",
|
|
149
|
+
"UnlockEventItem",
|
|
150
|
+
"EmissionMetadata",
|
|
151
|
+
"SupplyMetrics",
|
|
152
|
+
"EmissionBody",
|
|
153
|
+
"EmissionDetailResponse",
|
|
154
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""ETF type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, TypedDict, Literal
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EtfOverviewItem(TypedDict):
|
|
7
|
+
ticker: str
|
|
8
|
+
timestamp: int
|
|
9
|
+
asset: str
|
|
10
|
+
issuer: str
|
|
11
|
+
etf_name: str
|
|
12
|
+
custodian: str
|
|
13
|
+
pct_fee: float
|
|
14
|
+
url: str
|
|
15
|
+
flows: float
|
|
16
|
+
aum: float
|
|
17
|
+
volume: float
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EtfHistoryItem(TypedDict):
|
|
21
|
+
gecko_id: str
|
|
22
|
+
day: str
|
|
23
|
+
total_flow_usd: float
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
FdvPeriod = Literal["7", "30", "ytd", "365"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
FdvPerformanceItem = Dict[str, float]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"EtfOverviewItem",
|
|
34
|
+
"EtfHistoryItem",
|
|
35
|
+
"FdvPeriod",
|
|
36
|
+
"FdvPerformanceItem",
|
|
37
|
+
]
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"""Fees type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional, Tuple, TypedDict
|
|
4
|
+
|
|
5
|
+
from ..constants.dimensions import FeeDataType
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FeesOverviewOptions(TypedDict, total=False):
|
|
9
|
+
excludeTotalDataChart: Optional[bool]
|
|
10
|
+
excludeTotalDataChartBreakdown: Optional[bool]
|
|
11
|
+
dataType: Optional[FeeDataType]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FeesSummaryOptions(TypedDict, total=False):
|
|
15
|
+
dataType: Optional[FeeDataType]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class FeesChartOptions(TypedDict, total=False):
|
|
19
|
+
dataType: Optional[FeeDataType]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class FeesProtocol(TypedDict, total=False):
|
|
23
|
+
id: str
|
|
24
|
+
defillamaId: str
|
|
25
|
+
name: str
|
|
26
|
+
displayName: str
|
|
27
|
+
module: str
|
|
28
|
+
category: str
|
|
29
|
+
logo: str
|
|
30
|
+
chains: List[str]
|
|
31
|
+
protocolType: str
|
|
32
|
+
methodologyURL: str
|
|
33
|
+
methodology: Dict[str, str]
|
|
34
|
+
total24h: Optional[float]
|
|
35
|
+
total48hto24h: Optional[float]
|
|
36
|
+
total7d: Optional[float]
|
|
37
|
+
total14dto7d: Optional[float]
|
|
38
|
+
total30d: Optional[float]
|
|
39
|
+
total60dto30d: Optional[float]
|
|
40
|
+
total1y: Optional[float]
|
|
41
|
+
totalAllTime: Optional[float]
|
|
42
|
+
total7DaysAgo: Optional[float]
|
|
43
|
+
total30DaysAgo: Optional[float]
|
|
44
|
+
average1y: Optional[float]
|
|
45
|
+
monthlyAverage1y: Optional[float]
|
|
46
|
+
change_30dover30d: Optional[float]
|
|
47
|
+
breakdown24h: Optional[Dict[str, Dict[str, float]]]
|
|
48
|
+
breakdown30d: Optional[Dict[str, Dict[str, float]]]
|
|
49
|
+
parentProtocol: Optional[str]
|
|
50
|
+
slug: str
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class FeesOverviewResponse(TypedDict, total=False):
|
|
54
|
+
totalDataChart: List[Tuple[int, float]]
|
|
55
|
+
totalDataChartBreakdown: List["ChartBreakdownDataPoint"]
|
|
56
|
+
breakdown24h: Optional[Dict[str, Dict[str, float]]]
|
|
57
|
+
breakdown30d: Optional[Dict[str, Dict[str, float]]]
|
|
58
|
+
chain: Optional[str]
|
|
59
|
+
allChains: List[str]
|
|
60
|
+
total24h: float
|
|
61
|
+
total48hto24h: float
|
|
62
|
+
total7d: float
|
|
63
|
+
total14dto7d: float
|
|
64
|
+
total30d: float
|
|
65
|
+
total60dto30d: float
|
|
66
|
+
total1y: float
|
|
67
|
+
change_1d: float
|
|
68
|
+
change_7d: float
|
|
69
|
+
change_1m: float
|
|
70
|
+
change_7dover7d: float
|
|
71
|
+
change_30dover30d: float
|
|
72
|
+
total7DaysAgo: float
|
|
73
|
+
total30DaysAgo: float
|
|
74
|
+
totalAllTime: float
|
|
75
|
+
protocols: List[FeesProtocol]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class FeesSummaryChildProtocol(TypedDict, total=False):
|
|
79
|
+
name: str
|
|
80
|
+
defillamaId: str
|
|
81
|
+
displayName: str
|
|
82
|
+
methodologyURL: Optional[str]
|
|
83
|
+
methodology: Optional[Dict[str, str]]
|
|
84
|
+
defaultChartView: Optional[str]
|
|
85
|
+
breakdownMethodology: Optional[str]
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class FeesSummaryResponse(TypedDict, total=False):
|
|
89
|
+
id: str
|
|
90
|
+
name: str
|
|
91
|
+
url: str
|
|
92
|
+
description: str
|
|
93
|
+
logo: str
|
|
94
|
+
gecko_id: Optional[str]
|
|
95
|
+
cmcId: Optional[str]
|
|
96
|
+
chains: List[str]
|
|
97
|
+
twitter: Optional[str]
|
|
98
|
+
treasury: Optional[str]
|
|
99
|
+
governanceID: Optional[List[str]]
|
|
100
|
+
github: Optional[List[str]]
|
|
101
|
+
symbol: Optional[str]
|
|
102
|
+
address: Optional[str]
|
|
103
|
+
linkedProtocols: Optional[List[str]]
|
|
104
|
+
childProtocols: Optional[List[FeesSummaryChildProtocol]]
|
|
105
|
+
defillamaId: str
|
|
106
|
+
displayName: str
|
|
107
|
+
module: Optional[str]
|
|
108
|
+
category: Optional[str]
|
|
109
|
+
methodologyURL: Optional[str]
|
|
110
|
+
methodology: Optional[Dict[str, str]]
|
|
111
|
+
forkedFrom: Optional[List[str]]
|
|
112
|
+
audits: Optional[str]
|
|
113
|
+
audit_links: Optional[List[str]]
|
|
114
|
+
parentProtocol: Optional[str]
|
|
115
|
+
previousNames: Optional[List[str]]
|
|
116
|
+
hallmarks: Optional[List[List[object]]]
|
|
117
|
+
defaultChartView: Optional[str]
|
|
118
|
+
doublecounted: Optional[bool]
|
|
119
|
+
breakdownMethodology: Optional[str]
|
|
120
|
+
slug: str
|
|
121
|
+
protocolType: str
|
|
122
|
+
total24h: Optional[float]
|
|
123
|
+
total48hto24h: Optional[float]
|
|
124
|
+
total7d: Optional[float]
|
|
125
|
+
total30d: Optional[float]
|
|
126
|
+
totalAllTime: Optional[float]
|
|
127
|
+
totalDataChart: List[Tuple[int, float]]
|
|
128
|
+
totalDataChartBreakdown: List["NestedChartBreakdownDataPoint"]
|
|
129
|
+
hasLabelBreakdown: bool
|
|
130
|
+
change_1d: Optional[float]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
ChartDataPoint = Tuple[int, float]
|
|
134
|
+
ChartBreakdownDataPoint = Tuple[int, Dict[str, float]]
|
|
135
|
+
NestedChartBreakdownDataPoint = Tuple[int, Dict[str, Dict[str, float]]]
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class FeesChartResponse(TypedDict):
|
|
139
|
+
data: List[ChartDataPoint]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class FeesChartBreakdownResponse(TypedDict):
|
|
143
|
+
data: List[ChartBreakdownDataPoint]
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class FeesMetricsResponse(TypedDict, total=False):
|
|
147
|
+
total24h: float
|
|
148
|
+
total7d: float
|
|
149
|
+
total30d: float
|
|
150
|
+
total1y: Optional[float]
|
|
151
|
+
change_1d: float
|
|
152
|
+
change_7d: float
|
|
153
|
+
change_1m: float
|
|
154
|
+
protocols: List[FeesProtocol]
|
|
155
|
+
allChains: List[str]
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class FeesMetricsByProtocolResponse(TypedDict, total=False):
|
|
159
|
+
id: str
|
|
160
|
+
name: str
|
|
161
|
+
address: Optional[str]
|
|
162
|
+
symbol: Optional[str]
|
|
163
|
+
url: str
|
|
164
|
+
description: str
|
|
165
|
+
chain: str
|
|
166
|
+
logo: str
|
|
167
|
+
audits: str
|
|
168
|
+
audit_note: Optional[str]
|
|
169
|
+
gecko_id: Optional[str]
|
|
170
|
+
cmcId: Optional[str]
|
|
171
|
+
category: Optional[str]
|
|
172
|
+
chains: List[str]
|
|
173
|
+
module: Optional[str]
|
|
174
|
+
twitter: Optional[str]
|
|
175
|
+
audit_links: Optional[List[str]]
|
|
176
|
+
github: Optional[List[str]]
|
|
177
|
+
dimensions: Optional[Dict[str, object]]
|
|
178
|
+
methodology: Optional[Dict[str, str]]
|
|
179
|
+
misrepresentedTokens: Optional[bool]
|
|
180
|
+
doublecounted: Optional[bool]
|
|
181
|
+
defillamaId: str
|
|
182
|
+
displayName: str
|
|
183
|
+
methodologyURL: Optional[str]
|
|
184
|
+
forkedFrom: Optional[List[str]]
|
|
185
|
+
governanceID: Optional[List[str]]
|
|
186
|
+
treasury: Optional[str]
|
|
187
|
+
parentProtocol: Optional[str]
|
|
188
|
+
previousNames: Optional[List[str]]
|
|
189
|
+
hallmarks: Optional[List[List[object]]]
|
|
190
|
+
defaultChartView: Optional[str]
|
|
191
|
+
breakdownMethodology: Optional[str]
|
|
192
|
+
slug: str
|
|
193
|
+
protocolType: str
|
|
194
|
+
total24h: Optional[float]
|
|
195
|
+
total48hto24h: Optional[float]
|
|
196
|
+
total7d: Optional[float]
|
|
197
|
+
total30d: Optional[float]
|
|
198
|
+
totalAllTime: Optional[float]
|
|
199
|
+
hasLabelBreakdown: bool
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
__all__ = [
|
|
203
|
+
"FeesOverviewOptions",
|
|
204
|
+
"FeesSummaryOptions",
|
|
205
|
+
"FeesChartOptions",
|
|
206
|
+
"FeesProtocol",
|
|
207
|
+
"FeesOverviewResponse",
|
|
208
|
+
"FeesSummaryChildProtocol",
|
|
209
|
+
"FeesSummaryResponse",
|
|
210
|
+
"ChartDataPoint",
|
|
211
|
+
"ChartBreakdownDataPoint",
|
|
212
|
+
"NestedChartBreakdownDataPoint",
|
|
213
|
+
"FeesChartResponse",
|
|
214
|
+
"FeesChartBreakdownResponse",
|
|
215
|
+
"FeesMetricsResponse",
|
|
216
|
+
"FeesMetricsByProtocolResponse",
|
|
217
|
+
]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""Price type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CoinPrice(TypedDict, total=False):
|
|
7
|
+
decimals: Optional[int]
|
|
8
|
+
symbol: str
|
|
9
|
+
price: float
|
|
10
|
+
timestamp: int
|
|
11
|
+
confidence: Optional[float]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CoinPricesResponse(TypedDict):
|
|
15
|
+
coins: Dict[str, CoinPrice]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BatchHistoricalPricePoint(TypedDict, total=False):
|
|
19
|
+
timestamp: int
|
|
20
|
+
price: float
|
|
21
|
+
confidence: Optional[float]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class BatchHistoricalCoinData(TypedDict, total=False):
|
|
25
|
+
prices: List[BatchHistoricalPricePoint]
|
|
26
|
+
symbol: Optional[str]
|
|
27
|
+
decimals: Optional[int]
|
|
28
|
+
confidence: Optional[float]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class BatchHistoricalResponse(TypedDict):
|
|
32
|
+
coins: Dict[str, BatchHistoricalCoinData]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ChartPricePoint(TypedDict):
|
|
36
|
+
timestamp: int
|
|
37
|
+
price: float
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class CoinChartData(TypedDict, total=False):
|
|
41
|
+
prices: List[ChartPricePoint]
|
|
42
|
+
symbol: str
|
|
43
|
+
confidence: Optional[float]
|
|
44
|
+
decimals: Optional[int]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ChartResponse(TypedDict):
|
|
48
|
+
coins: Dict[str, CoinChartData]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class PercentageResponse(TypedDict):
|
|
52
|
+
coins: Dict[str, float]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class FirstPriceData(TypedDict):
|
|
56
|
+
price: float
|
|
57
|
+
timestamp: int
|
|
58
|
+
symbol: str
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class FirstPriceResponse(TypedDict):
|
|
62
|
+
coins: Dict[str, FirstPriceData]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class BlockInfo(TypedDict):
|
|
66
|
+
height: int
|
|
67
|
+
timestamp: int
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class ChartOptions(TypedDict, total=False):
|
|
71
|
+
start: Optional[int]
|
|
72
|
+
end: Optional[int]
|
|
73
|
+
span: Optional[int]
|
|
74
|
+
period: Optional[str]
|
|
75
|
+
searchWidth: Optional[str]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class PercentageOptions(TypedDict, total=False):
|
|
79
|
+
timestamp: Optional[int]
|
|
80
|
+
lookForward: Optional[bool]
|
|
81
|
+
period: Optional[str]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
__all__ = [
|
|
85
|
+
"CoinPrice",
|
|
86
|
+
"CoinPricesResponse",
|
|
87
|
+
"BatchHistoricalPricePoint",
|
|
88
|
+
"BatchHistoricalCoinData",
|
|
89
|
+
"BatchHistoricalResponse",
|
|
90
|
+
"ChartPricePoint",
|
|
91
|
+
"CoinChartData",
|
|
92
|
+
"ChartResponse",
|
|
93
|
+
"PercentageResponse",
|
|
94
|
+
"FirstPriceData",
|
|
95
|
+
"FirstPriceResponse",
|
|
96
|
+
"BlockInfo",
|
|
97
|
+
"ChartOptions",
|
|
98
|
+
"PercentageOptions",
|
|
99
|
+
]
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""Stablecoin type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PeggedAsset(TypedDict, total=False):
|
|
7
|
+
peggedUSD: Optional[float]
|
|
8
|
+
peggedVAR: Optional[float]
|
|
9
|
+
peggedEUR: Optional[float]
|
|
10
|
+
peggedJPY: Optional[float]
|
|
11
|
+
peggedCNY: Optional[float]
|
|
12
|
+
peggedUAH: Optional[float]
|
|
13
|
+
peggedARS: Optional[float]
|
|
14
|
+
peggedGBP: Optional[float]
|
|
15
|
+
peggedCAD: Optional[float]
|
|
16
|
+
peggedAUD: Optional[float]
|
|
17
|
+
peggedSGD: Optional[float]
|
|
18
|
+
peggedCHF: Optional[float]
|
|
19
|
+
peggedREAL: Optional[float]
|
|
20
|
+
peggedRUB: Optional[float]
|
|
21
|
+
peggedMXN: Optional[float]
|
|
22
|
+
peggedPHP: Optional[float]
|
|
23
|
+
peggedTRY: Optional[float]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class StablecoinChainCirculating(TypedDict):
|
|
27
|
+
current: PeggedAsset
|
|
28
|
+
circulatingPrevDay: PeggedAsset
|
|
29
|
+
circulatingPrevWeek: PeggedAsset
|
|
30
|
+
circulatingPrevMonth: PeggedAsset
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Stablecoin(TypedDict, total=False):
|
|
34
|
+
id: str
|
|
35
|
+
name: str
|
|
36
|
+
symbol: str
|
|
37
|
+
gecko_id: Optional[str]
|
|
38
|
+
pegType: str
|
|
39
|
+
pegMechanism: str
|
|
40
|
+
circulating: PeggedAsset
|
|
41
|
+
circulatingPrevDay: PeggedAsset
|
|
42
|
+
circulatingPrevWeek: PeggedAsset
|
|
43
|
+
circulatingPrevMonth: PeggedAsset
|
|
44
|
+
chainCirculating: Dict[str, StablecoinChainCirculating]
|
|
45
|
+
chains: List[str]
|
|
46
|
+
price: Optional[float]
|
|
47
|
+
priceSource: Optional[str]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class StablecoinsResponse(TypedDict):
|
|
51
|
+
peggedAssets: List[Stablecoin]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class StablecoinChartDataPoint(TypedDict, total=False):
|
|
55
|
+
date: str
|
|
56
|
+
totalCirculating: PeggedAsset
|
|
57
|
+
totalUnreleased: Optional[PeggedAsset]
|
|
58
|
+
totalCirculatingUSD: PeggedAsset
|
|
59
|
+
totalMintedToL2: Optional[PeggedAsset]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class StablecoinChainDataPoint(TypedDict):
|
|
63
|
+
date: str
|
|
64
|
+
totalCirculating: PeggedAsset
|
|
65
|
+
totalCirculatingUSD: PeggedAsset
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class StablecoinTokenInfo(TypedDict):
|
|
69
|
+
name: str
|
|
70
|
+
address: str
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class StablecoinChainBreakdown(TypedDict, total=False):
|
|
74
|
+
tokens: Optional[List[StablecoinTokenInfo]]
|
|
75
|
+
circulating: PeggedAsset
|
|
76
|
+
circulatingPrevDay: PeggedAsset
|
|
77
|
+
circulatingPrevWeek: PeggedAsset
|
|
78
|
+
circulatingPrevMonth: PeggedAsset
|
|
79
|
+
bridgedTo: Optional[str]
|
|
80
|
+
minted: Optional[str]
|
|
81
|
+
bridgeInfo: Optional[Dict[str, Dict[str, str]]]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class StablecoinDetails(TypedDict, total=False):
|
|
85
|
+
id: str
|
|
86
|
+
name: str
|
|
87
|
+
address: str
|
|
88
|
+
symbol: str
|
|
89
|
+
url: str
|
|
90
|
+
description: str
|
|
91
|
+
mintRedeemDescription: Optional[str]
|
|
92
|
+
onCoinGecko: str
|
|
93
|
+
gecko_id: Optional[str]
|
|
94
|
+
cmcId: Optional[str]
|
|
95
|
+
pegType: str
|
|
96
|
+
pegMechanism: str
|
|
97
|
+
priceSource: Optional[str]
|
|
98
|
+
auditLinks: Optional[List[str]]
|
|
99
|
+
twitter: Optional[str]
|
|
100
|
+
wiki: Optional[str]
|
|
101
|
+
price: Optional[float]
|
|
102
|
+
tokens: List["StablecoinSupplyPoint"]
|
|
103
|
+
chainBalances: Dict[str, "StablecoinChainBalanceHistory"]
|
|
104
|
+
currentChainBalances: Dict[str, PeggedAsset]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class StablecoinChainMcap(TypedDict, total=False):
|
|
108
|
+
gecko_id: Optional[str]
|
|
109
|
+
totalCirculatingUSD: PeggedAsset
|
|
110
|
+
tokenSymbol: Optional[str]
|
|
111
|
+
name: str
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class StablecoinPricePoint(TypedDict):
|
|
115
|
+
date: int
|
|
116
|
+
prices: Dict[str, Optional[float]]
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class StablecoinSupplyPoint(TypedDict):
|
|
120
|
+
date: int
|
|
121
|
+
circulating: PeggedAsset
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class StablecoinChainBalanceTokenPoint(StablecoinSupplyPoint, total=False):
|
|
125
|
+
bridgedTo: Optional[PeggedAsset]
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class StablecoinChainBalanceHistory(TypedDict):
|
|
129
|
+
tokens: List[StablecoinChainBalanceTokenPoint]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class StablecoinDominanceGreatestMcap(TypedDict):
|
|
133
|
+
gecko_id: str
|
|
134
|
+
symbol: str
|
|
135
|
+
mcap: float
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class StablecoinDominanceDataPoint(TypedDict):
|
|
139
|
+
date: str
|
|
140
|
+
totalCirculatingUSD: PeggedAsset
|
|
141
|
+
greatestMcap: StablecoinDominanceGreatestMcap
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
__all__ = [
|
|
145
|
+
"PeggedAsset",
|
|
146
|
+
"Stablecoin",
|
|
147
|
+
"StablecoinsResponse",
|
|
148
|
+
"StablecoinChartDataPoint",
|
|
149
|
+
"StablecoinChainDataPoint",
|
|
150
|
+
"StablecoinTokenInfo",
|
|
151
|
+
"StablecoinChainBreakdown",
|
|
152
|
+
"StablecoinDetails",
|
|
153
|
+
"StablecoinChainMcap",
|
|
154
|
+
"StablecoinPricePoint",
|
|
155
|
+
"StablecoinSupplyPoint",
|
|
156
|
+
"StablecoinChainBalanceTokenPoint",
|
|
157
|
+
"StablecoinChainBalanceHistory",
|
|
158
|
+
"StablecoinDominanceDataPoint",
|
|
159
|
+
]
|