compass_api_sdk 0.5.1__py3-none-any.whl → 0.5.3__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.

Potentially problematic release.


This version of compass_api_sdk might be problematic. Click here for more details.

@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "compass_api_sdk"
6
- __version__: str = "0.5.1"
6
+ __version__: str = "0.5.3"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
8
  __gen_version__: str = "2.610.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.5.1 2.610.0 0.0.1 compass_api_sdk"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.5.3 2.610.0 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -322,6 +322,7 @@ if TYPE_CHECKING:
322
322
  from .contractname import ContractName
323
323
  from .curator import Curator, CuratorTypedDict
324
324
  from .ensnameinforesponse import EnsNameInfoResponse, EnsNameInfoResponseTypedDict
325
+ from .erc20data import Erc20Data, Erc20DataTypedDict
325
326
  from .feeenum import FeeEnum
326
327
  from .generic_allowanceop import (
327
328
  GenericAllowanceChain,
@@ -535,14 +536,23 @@ if TYPE_CHECKING:
535
536
  MulticallExecuteRequest,
536
537
  MulticallExecuteRequestTypedDict,
537
538
  )
538
- from .pendle_accrued_interestop import (
539
- PendleAccruedInterestChain,
540
- PendleAccruedInterestRequest,
541
- PendleAccruedInterestRequestTypedDict,
539
+ from .pendle_marketop import (
540
+ PendleMarketChain,
541
+ PendleMarketRequest,
542
+ PendleMarketRequestTypedDict,
542
543
  )
543
- from .pendleaccruedinterestresponse import (
544
- PendleAccruedInterestResponse,
545
- PendleAccruedInterestResponseTypedDict,
544
+ from .pendle_positionop import (
545
+ PendlePositionChain,
546
+ PendlePositionRequest,
547
+ PendlePositionRequestTypedDict,
548
+ )
549
+ from .pendlegetmarketresponse import (
550
+ PendleGetMarketResponse,
551
+ PendleGetMarketResponseTypedDict,
552
+ )
553
+ from .pendlegetuserpositionresponse import (
554
+ PendleGetUserPositionResponse,
555
+ PendleGetUserPositionResponseTypedDict,
546
556
  )
547
557
  from .portfolio import Portfolio, PortfolioTypedDict
548
558
  from .redeemunderlying import RedeemUnderlying, RedeemUnderlyingTypedDict
@@ -1071,6 +1081,8 @@ __all__ = [
1071
1081
  "CuratorTypedDict",
1072
1082
  "EnsNameInfoResponse",
1073
1083
  "EnsNameInfoResponseTypedDict",
1084
+ "Erc20Data",
1085
+ "Erc20DataTypedDict",
1074
1086
  "FeeEnum",
1075
1087
  "GenericAllowanceChain",
1076
1088
  "GenericAllowanceContractName",
@@ -1219,11 +1231,16 @@ __all__ = [
1219
1231
  "MulticallAuthorizationResponseTypedDict",
1220
1232
  "MulticallExecuteRequest",
1221
1233
  "MulticallExecuteRequestTypedDict",
1222
- "PendleAccruedInterestChain",
1223
- "PendleAccruedInterestRequest",
1224
- "PendleAccruedInterestRequestTypedDict",
1225
- "PendleAccruedInterestResponse",
1226
- "PendleAccruedInterestResponseTypedDict",
1234
+ "PendleGetMarketResponse",
1235
+ "PendleGetMarketResponseTypedDict",
1236
+ "PendleGetUserPositionResponse",
1237
+ "PendleGetUserPositionResponseTypedDict",
1238
+ "PendleMarketChain",
1239
+ "PendleMarketRequest",
1240
+ "PendleMarketRequestTypedDict",
1241
+ "PendlePositionChain",
1242
+ "PendlePositionRequest",
1243
+ "PendlePositionRequestTypedDict",
1227
1244
  "Portfolio",
1228
1245
  "PortfolioTypedDict",
1229
1246
  "R",
@@ -1682,6 +1699,8 @@ _dynamic_imports: dict[str, str] = {
1682
1699
  "CuratorTypedDict": ".curator",
1683
1700
  "EnsNameInfoResponse": ".ensnameinforesponse",
1684
1701
  "EnsNameInfoResponseTypedDict": ".ensnameinforesponse",
1702
+ "Erc20Data": ".erc20data",
1703
+ "Erc20DataTypedDict": ".erc20data",
1685
1704
  "FeeEnum": ".feeenum",
1686
1705
  "GenericAllowanceChain": ".generic_allowanceop",
1687
1706
  "GenericAllowanceContractName": ".generic_allowanceop",
@@ -1828,11 +1847,16 @@ _dynamic_imports: dict[str, str] = {
1828
1847
  "MulticallAuthorizationResponseTypedDict": ".multicallauthorizationresponse",
1829
1848
  "MulticallExecuteRequest": ".multicallexecuterequest",
1830
1849
  "MulticallExecuteRequestTypedDict": ".multicallexecuterequest",
1831
- "PendleAccruedInterestChain": ".pendle_accrued_interestop",
1832
- "PendleAccruedInterestRequest": ".pendle_accrued_interestop",
1833
- "PendleAccruedInterestRequestTypedDict": ".pendle_accrued_interestop",
1834
- "PendleAccruedInterestResponse": ".pendleaccruedinterestresponse",
1835
- "PendleAccruedInterestResponseTypedDict": ".pendleaccruedinterestresponse",
1850
+ "PendleMarketChain": ".pendle_marketop",
1851
+ "PendleMarketRequest": ".pendle_marketop",
1852
+ "PendleMarketRequestTypedDict": ".pendle_marketop",
1853
+ "PendlePositionChain": ".pendle_positionop",
1854
+ "PendlePositionRequest": ".pendle_positionop",
1855
+ "PendlePositionRequestTypedDict": ".pendle_positionop",
1856
+ "PendleGetMarketResponse": ".pendlegetmarketresponse",
1857
+ "PendleGetMarketResponseTypedDict": ".pendlegetmarketresponse",
1858
+ "PendleGetUserPositionResponse": ".pendlegetuserpositionresponse",
1859
+ "PendleGetUserPositionResponseTypedDict": ".pendlegetuserpositionresponse",
1836
1860
  "Portfolio": ".portfolio",
1837
1861
  "PortfolioTypedDict": ".portfolio",
1838
1862
  "RedeemUnderlying": ".redeemunderlying",
@@ -34,6 +34,8 @@ class ContractName(str, Enum):
34
34
  SKY_DAI_USDS_CONVERTER = "SkyDaiUsdsConverter"
35
35
  SKY_USDC_USDS_CONVERTER = "SkyUsdcUsdsConverter"
36
36
  SKY_USDS_VAULT = "SkyUsdsVault"
37
- PENDLE_YT = "PendleYt"
37
+ PENDLE_ROUTER = "PendleRouter"
38
38
  PENDLE_MARKET = "PendleMarket"
39
+ PENDLE_SY = "PendleSy"
40
+ PENDLE_YT = "PendleYt"
39
41
  MULTICALL = "Multicall"
@@ -0,0 +1,19 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class Erc20DataTypedDict(TypedDict):
9
+ address: str
10
+ symbol: str
11
+ name: str
12
+
13
+
14
+ class Erc20Data(BaseModel):
15
+ address: str
16
+
17
+ symbol: str
18
+
19
+ name: str
@@ -84,6 +84,7 @@ class GenericAllowanceContractName(str, Enum):
84
84
  SKY_DAI_USDS_CONVERTER = "SkyDaiUsdsConverter"
85
85
  SKY_USDC_USDS_CONVERTER = "SkyUsdcUsdsConverter"
86
86
  SKY_USDS_VAULT = "SkyUsdsVault"
87
+ PENDLE_ROUTER = "PendleRouter"
87
88
 
88
89
 
89
90
  class GenericAllowanceRequestTypedDict(TypedDict):
@@ -23,6 +23,7 @@ class IncreaseAllowanceParamsContractName(str, Enum):
23
23
  SKY_DAI_USDS_CONVERTER = "SkyDaiUsdsConverter"
24
24
  SKY_USDC_USDS_CONVERTER = "SkyUsdcUsdsConverter"
25
25
  SKY_USDS_VAULT = "SkyUsdsVault"
26
+ PENDLE_ROUTER = "PendleRouter"
26
27
 
27
28
 
28
29
  IncreaseAllowanceParamsAmountTypedDict = TypeAliasType(
@@ -24,6 +24,7 @@ class IncreaseAllowanceRequestContractName(str, Enum):
24
24
  SKY_DAI_USDS_CONVERTER = "SkyDaiUsdsConverter"
25
25
  SKY_USDC_USDS_CONVERTER = "SkyUsdcUsdsConverter"
26
26
  SKY_USDS_VAULT = "SkyUsdsVault"
27
+ PENDLE_ROUTER = "PendleRouter"
27
28
 
28
29
 
29
30
  IncreaseAllowanceRequestAmountTypedDict = TypeAliasType(
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  from typing_extensions import Annotated, TypedDict
8
8
 
9
9
 
10
- class PendleAccruedInterestChain(str, Enum):
10
+ class PendleMarketChain(str, Enum):
11
11
  r"""The chain to use."""
12
12
 
13
13
  BASE_MAINNET = "base:mainnet"
@@ -15,28 +15,28 @@ class PendleAccruedInterestChain(str, Enum):
15
15
  ARBITRUM_MAINNET = "arbitrum:mainnet"
16
16
 
17
17
 
18
- class PendleAccruedInterestRequestTypedDict(TypedDict):
19
- chain: PendleAccruedInterestChain
18
+ class PendleMarketRequestTypedDict(TypedDict):
19
+ chain: PendleMarketChain
20
20
  r"""The chain to use."""
21
- market_address: str
22
- r"""The address of the market to get the accrued interest for."""
23
21
  user_address: str
24
- r"""The address of the user to get the accrued interest for."""
22
+ r"""The user address of the desired position."""
23
+ market_address: str
24
+ r"""The market address of the desired position."""
25
25
 
26
26
 
27
- class PendleAccruedInterestRequest(BaseModel):
27
+ class PendleMarketRequest(BaseModel):
28
28
  chain: Annotated[
29
- PendleAccruedInterestChain,
29
+ PendleMarketChain,
30
30
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
31
- ] = PendleAccruedInterestChain.ARBITRUM_MAINNET
31
+ ] = PendleMarketChain.ETHEREUM_MAINNET
32
32
  r"""The chain to use."""
33
33
 
34
- market_address: Annotated[
34
+ user_address: Annotated[
35
35
  str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
36
- ] = "0xff4d6991658c5844856faef5da9232c252896fca"
37
- r"""The address of the market to get the accrued interest for."""
36
+ ] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
37
+ r"""The user address of the desired position."""
38
38
 
39
- user_address: Annotated[
39
+ market_address: Annotated[
40
40
  str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
41
- ] = "0xebdddbafc3fc3742fe2a3cfec17a20a50e84d598"
42
- r"""The address of the user to get the accrued interest for."""
41
+ ] = "0xdace1121e10500e9e29d071f01593fd76b000f08"
42
+ r"""The market address of the desired position."""
@@ -0,0 +1,42 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
6
+ from enum import Enum
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class PendlePositionChain(str, Enum):
11
+ r"""The chain to use."""
12
+
13
+ BASE_MAINNET = "base:mainnet"
14
+ ETHEREUM_MAINNET = "ethereum:mainnet"
15
+ ARBITRUM_MAINNET = "arbitrum:mainnet"
16
+
17
+
18
+ class PendlePositionRequestTypedDict(TypedDict):
19
+ chain: PendlePositionChain
20
+ r"""The chain to use."""
21
+ user_address: str
22
+ r"""The user address of the desired position."""
23
+ market_address: str
24
+ r"""The market address of the desired position."""
25
+
26
+
27
+ class PendlePositionRequest(BaseModel):
28
+ chain: Annotated[
29
+ PendlePositionChain,
30
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
31
+ ] = PendlePositionChain.ETHEREUM_MAINNET
32
+ r"""The chain to use."""
33
+
34
+ user_address: Annotated[
35
+ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
36
+ ] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
37
+ r"""The user address of the desired position."""
38
+
39
+ market_address: Annotated[
40
+ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
41
+ ] = "0xdace1121e10500e9e29d071f01593fd76b000f08"
42
+ r"""The market address of the desired position."""
@@ -0,0 +1,34 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .erc20data import Erc20Data, Erc20DataTypedDict
5
+ from compass_api_sdk.types import BaseModel
6
+ from datetime import datetime
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class PendleGetMarketResponseTypedDict(TypedDict):
11
+ implied_apy: str
12
+ r"""The implied APY of the market."""
13
+ maturity_date: datetime
14
+ r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
15
+ underlying_token: Erc20DataTypedDict
16
+ sy: Erc20DataTypedDict
17
+ pt: Erc20DataTypedDict
18
+ yt: Erc20DataTypedDict
19
+
20
+
21
+ class PendleGetMarketResponse(BaseModel):
22
+ implied_apy: str
23
+ r"""The implied APY of the market."""
24
+
25
+ maturity_date: datetime
26
+ r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
27
+
28
+ underlying_token: Erc20Data
29
+
30
+ sy: Erc20Data
31
+
32
+ pt: Erc20Data
33
+
34
+ yt: Erc20Data
@@ -0,0 +1,51 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from datetime import datetime
6
+ from typing_extensions import TypedDict
7
+
8
+
9
+ class PendleGetUserPositionResponseTypedDict(TypedDict):
10
+ claimable_yield: str
11
+ r"""The amount of yield that can be claimed in the underlying token."""
12
+ sy_balance: str
13
+ r"""The amount of SY tokens the user currently holds."""
14
+ pt_balance: str
15
+ r"""The amount of PT tokens the user currently holds."""
16
+ yt_balance: str
17
+ r"""The amount of YT tokens the user currently holds."""
18
+ underlying_token_balance: str
19
+ r"""The amount of underlying tokens the user currently holds."""
20
+ underlying_token_name: str
21
+ r"""The name of the underlying token."""
22
+ underlying_token_symbol: str
23
+ r"""The symbol of the underlying token."""
24
+ maturity_date: datetime
25
+ r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
26
+
27
+
28
+ class PendleGetUserPositionResponse(BaseModel):
29
+ claimable_yield: str
30
+ r"""The amount of yield that can be claimed in the underlying token."""
31
+
32
+ sy_balance: str
33
+ r"""The amount of SY tokens the user currently holds."""
34
+
35
+ pt_balance: str
36
+ r"""The amount of PT tokens the user currently holds."""
37
+
38
+ yt_balance: str
39
+ r"""The amount of YT tokens the user currently holds."""
40
+
41
+ underlying_token_balance: str
42
+ r"""The amount of underlying tokens the user currently holds."""
43
+
44
+ underlying_token_name: str
45
+ r"""The name of the underlying token."""
46
+
47
+ underlying_token_symbol: str
48
+ r"""The symbol of the underlying token."""
49
+
50
+ maturity_date: datetime
51
+ r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
compass_api_sdk/pendle.py CHANGED
@@ -8,22 +8,24 @@ from typing import Any, Mapping, Optional
8
8
 
9
9
 
10
10
  class Pendle(BaseSDK):
11
- def accrued_interest(
11
+ def position(
12
12
  self,
13
13
  *,
14
- chain: models.PendleAccruedInterestChain = models.PendleAccruedInterestChain.ARBITRUM_MAINNET,
15
- market_address: str = "0xff4d6991658c5844856faef5da9232c252896fca",
16
- user_address: str = "0xebdddbafc3fc3742fe2a3cfec17a20a50e84d598",
14
+ chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
15
+ user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
16
+ market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
17
17
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
18
18
  server_url: Optional[str] = None,
19
19
  timeout_ms: Optional[int] = None,
20
20
  http_headers: Optional[Mapping[str, str]] = None,
21
- ) -> models.PendleAccruedInterestResponse:
22
- r"""Get Accrued Interest
21
+ ) -> models.PendleGetUserPositionResponse:
22
+ r"""Check User's Market Position
23
+
24
+ Check the SY, PT, YT and Underlying Token positions for a given market.
23
25
 
24
26
  :param chain: The chain to use.
25
- :param market_address: The address of the market to get the accrued interest for.
26
- :param user_address: The address of the user to get the accrued interest for.
27
+ :param user_address: The user address of the desired position.
28
+ :param market_address: The market address of the desired position.
27
29
  :param retries: Override the default retry configuration for this method
28
30
  :param server_url: Override the default server URL for this method
29
31
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -39,15 +41,15 @@ class Pendle(BaseSDK):
39
41
  else:
40
42
  base_url = self._get_url(base_url, url_variables)
41
43
 
42
- request = models.PendleAccruedInterestRequest(
44
+ request = models.PendlePositionRequest(
43
45
  chain=chain,
44
- market_address=market_address,
45
46
  user_address=user_address,
47
+ market_address=market_address,
46
48
  )
47
49
 
48
50
  req = self._build_request(
49
51
  method="GET",
50
- path="/v0/pendle/accrued_interest",
52
+ path="/v0/pendle/position",
51
53
  base_url=base_url,
52
54
  url_variables=url_variables,
53
55
  request=request,
@@ -72,7 +74,7 @@ class Pendle(BaseSDK):
72
74
  http_res = self.do_request(
73
75
  hook_ctx=HookContext(
74
76
  base_url=base_url or "",
75
- operation_id="pendle_accrued_interest",
77
+ operation_id="pendle_position",
76
78
  oauth2_scopes=[],
77
79
  security_source=self.sdk_configuration.security,
78
80
  ),
@@ -84,7 +86,7 @@ class Pendle(BaseSDK):
84
86
  response_data: Any = None
85
87
  if utils.match_response(http_res, "200", "application/json"):
86
88
  return utils.unmarshal_json(
87
- http_res.text, models.PendleAccruedInterestResponse
89
+ http_res.text, models.PendleGetUserPositionResponse
88
90
  )
89
91
  if utils.match_response(http_res, "422", "application/json"):
90
92
  response_data = utils.unmarshal_json(
@@ -111,22 +113,24 @@ class Pendle(BaseSDK):
111
113
  http_res,
112
114
  )
113
115
 
114
- async def accrued_interest_async(
116
+ async def position_async(
115
117
  self,
116
118
  *,
117
- chain: models.PendleAccruedInterestChain = models.PendleAccruedInterestChain.ARBITRUM_MAINNET,
118
- market_address: str = "0xff4d6991658c5844856faef5da9232c252896fca",
119
- user_address: str = "0xebdddbafc3fc3742fe2a3cfec17a20a50e84d598",
119
+ chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
120
+ user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
121
+ market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
120
122
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
121
123
  server_url: Optional[str] = None,
122
124
  timeout_ms: Optional[int] = None,
123
125
  http_headers: Optional[Mapping[str, str]] = None,
124
- ) -> models.PendleAccruedInterestResponse:
125
- r"""Get Accrued Interest
126
+ ) -> models.PendleGetUserPositionResponse:
127
+ r"""Check User's Market Position
128
+
129
+ Check the SY, PT, YT and Underlying Token positions for a given market.
126
130
 
127
131
  :param chain: The chain to use.
128
- :param market_address: The address of the market to get the accrued interest for.
129
- :param user_address: The address of the user to get the accrued interest for.
132
+ :param user_address: The user address of the desired position.
133
+ :param market_address: The market address of the desired position.
130
134
  :param retries: Override the default retry configuration for this method
131
135
  :param server_url: Override the default server URL for this method
132
136
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -142,15 +146,15 @@ class Pendle(BaseSDK):
142
146
  else:
143
147
  base_url = self._get_url(base_url, url_variables)
144
148
 
145
- request = models.PendleAccruedInterestRequest(
149
+ request = models.PendlePositionRequest(
146
150
  chain=chain,
147
- market_address=market_address,
148
151
  user_address=user_address,
152
+ market_address=market_address,
149
153
  )
150
154
 
151
155
  req = self._build_request_async(
152
156
  method="GET",
153
- path="/v0/pendle/accrued_interest",
157
+ path="/v0/pendle/position",
154
158
  base_url=base_url,
155
159
  url_variables=url_variables,
156
160
  request=request,
@@ -175,7 +179,7 @@ class Pendle(BaseSDK):
175
179
  http_res = await self.do_request_async(
176
180
  hook_ctx=HookContext(
177
181
  base_url=base_url or "",
178
- operation_id="pendle_accrued_interest",
182
+ operation_id="pendle_position",
179
183
  oauth2_scopes=[],
180
184
  security_source=self.sdk_configuration.security,
181
185
  ),
@@ -187,8 +191,214 @@ class Pendle(BaseSDK):
187
191
  response_data: Any = None
188
192
  if utils.match_response(http_res, "200", "application/json"):
189
193
  return utils.unmarshal_json(
190
- http_res.text, models.PendleAccruedInterestResponse
194
+ http_res.text, models.PendleGetUserPositionResponse
195
+ )
196
+ if utils.match_response(http_res, "422", "application/json"):
197
+ response_data = utils.unmarshal_json(
198
+ http_res.text, errors.HTTPValidationErrorData
199
+ )
200
+ raise errors.HTTPValidationError(data=response_data)
201
+ if utils.match_response(http_res, "4XX", "*"):
202
+ http_res_text = await utils.stream_to_text_async(http_res)
203
+ raise errors.APIError(
204
+ "API error occurred", http_res.status_code, http_res_text, http_res
205
+ )
206
+ if utils.match_response(http_res, "5XX", "*"):
207
+ http_res_text = await utils.stream_to_text_async(http_res)
208
+ raise errors.APIError(
209
+ "API error occurred", http_res.status_code, http_res_text, http_res
210
+ )
211
+
212
+ content_type = http_res.headers.get("Content-Type")
213
+ http_res_text = await utils.stream_to_text_async(http_res)
214
+ raise errors.APIError(
215
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
216
+ http_res.status_code,
217
+ http_res_text,
218
+ http_res,
219
+ )
220
+
221
+ def market(
222
+ self,
223
+ *,
224
+ chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
225
+ user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
226
+ market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
227
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
228
+ server_url: Optional[str] = None,
229
+ timeout_ms: Optional[int] = None,
230
+ http_headers: Optional[Mapping[str, str]] = None,
231
+ ) -> models.PendleGetMarketResponse:
232
+ r"""Get Market Data
233
+
234
+ Get the market's implied APY, maturity date and the associated token data.
235
+
236
+ :param chain: The chain to use.
237
+ :param user_address: The user address of the desired position.
238
+ :param market_address: The market address of the desired position.
239
+ :param retries: Override the default retry configuration for this method
240
+ :param server_url: Override the default server URL for this method
241
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
242
+ :param http_headers: Additional headers to set or replace on requests.
243
+ """
244
+ base_url = None
245
+ url_variables = None
246
+ if timeout_ms is None:
247
+ timeout_ms = self.sdk_configuration.timeout_ms
248
+
249
+ if server_url is not None:
250
+ base_url = server_url
251
+ else:
252
+ base_url = self._get_url(base_url, url_variables)
253
+
254
+ request = models.PendleMarketRequest(
255
+ chain=chain,
256
+ user_address=user_address,
257
+ market_address=market_address,
258
+ )
259
+
260
+ req = self._build_request(
261
+ method="GET",
262
+ path="/v0/pendle/market",
263
+ base_url=base_url,
264
+ url_variables=url_variables,
265
+ request=request,
266
+ request_body_required=False,
267
+ request_has_path_params=False,
268
+ request_has_query_params=True,
269
+ user_agent_header="user-agent",
270
+ accept_header_value="application/json",
271
+ http_headers=http_headers,
272
+ security=self.sdk_configuration.security,
273
+ timeout_ms=timeout_ms,
274
+ )
275
+
276
+ if retries == UNSET:
277
+ if self.sdk_configuration.retry_config is not UNSET:
278
+ retries = self.sdk_configuration.retry_config
279
+
280
+ retry_config = None
281
+ if isinstance(retries, utils.RetryConfig):
282
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
283
+
284
+ http_res = self.do_request(
285
+ hook_ctx=HookContext(
286
+ base_url=base_url or "",
287
+ operation_id="pendle_market",
288
+ oauth2_scopes=[],
289
+ security_source=self.sdk_configuration.security,
290
+ ),
291
+ request=req,
292
+ error_status_codes=["422", "4XX", "5XX"],
293
+ retry_config=retry_config,
294
+ )
295
+
296
+ response_data: Any = None
297
+ if utils.match_response(http_res, "200", "application/json"):
298
+ return utils.unmarshal_json(http_res.text, models.PendleGetMarketResponse)
299
+ if utils.match_response(http_res, "422", "application/json"):
300
+ response_data = utils.unmarshal_json(
301
+ http_res.text, errors.HTTPValidationErrorData
302
+ )
303
+ raise errors.HTTPValidationError(data=response_data)
304
+ if utils.match_response(http_res, "4XX", "*"):
305
+ http_res_text = utils.stream_to_text(http_res)
306
+ raise errors.APIError(
307
+ "API error occurred", http_res.status_code, http_res_text, http_res
308
+ )
309
+ if utils.match_response(http_res, "5XX", "*"):
310
+ http_res_text = utils.stream_to_text(http_res)
311
+ raise errors.APIError(
312
+ "API error occurred", http_res.status_code, http_res_text, http_res
191
313
  )
314
+
315
+ content_type = http_res.headers.get("Content-Type")
316
+ http_res_text = utils.stream_to_text(http_res)
317
+ raise errors.APIError(
318
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
319
+ http_res.status_code,
320
+ http_res_text,
321
+ http_res,
322
+ )
323
+
324
+ async def market_async(
325
+ self,
326
+ *,
327
+ chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
328
+ user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
329
+ market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
330
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
331
+ server_url: Optional[str] = None,
332
+ timeout_ms: Optional[int] = None,
333
+ http_headers: Optional[Mapping[str, str]] = None,
334
+ ) -> models.PendleGetMarketResponse:
335
+ r"""Get Market Data
336
+
337
+ Get the market's implied APY, maturity date and the associated token data.
338
+
339
+ :param chain: The chain to use.
340
+ :param user_address: The user address of the desired position.
341
+ :param market_address: The market address of the desired position.
342
+ :param retries: Override the default retry configuration for this method
343
+ :param server_url: Override the default server URL for this method
344
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
345
+ :param http_headers: Additional headers to set or replace on requests.
346
+ """
347
+ base_url = None
348
+ url_variables = None
349
+ if timeout_ms is None:
350
+ timeout_ms = self.sdk_configuration.timeout_ms
351
+
352
+ if server_url is not None:
353
+ base_url = server_url
354
+ else:
355
+ base_url = self._get_url(base_url, url_variables)
356
+
357
+ request = models.PendleMarketRequest(
358
+ chain=chain,
359
+ user_address=user_address,
360
+ market_address=market_address,
361
+ )
362
+
363
+ req = self._build_request_async(
364
+ method="GET",
365
+ path="/v0/pendle/market",
366
+ base_url=base_url,
367
+ url_variables=url_variables,
368
+ request=request,
369
+ request_body_required=False,
370
+ request_has_path_params=False,
371
+ request_has_query_params=True,
372
+ user_agent_header="user-agent",
373
+ accept_header_value="application/json",
374
+ http_headers=http_headers,
375
+ security=self.sdk_configuration.security,
376
+ timeout_ms=timeout_ms,
377
+ )
378
+
379
+ if retries == UNSET:
380
+ if self.sdk_configuration.retry_config is not UNSET:
381
+ retries = self.sdk_configuration.retry_config
382
+
383
+ retry_config = None
384
+ if isinstance(retries, utils.RetryConfig):
385
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
386
+
387
+ http_res = await self.do_request_async(
388
+ hook_ctx=HookContext(
389
+ base_url=base_url or "",
390
+ operation_id="pendle_market",
391
+ oauth2_scopes=[],
392
+ security_source=self.sdk_configuration.security,
393
+ ),
394
+ request=req,
395
+ error_status_codes=["422", "4XX", "5XX"],
396
+ retry_config=retry_config,
397
+ )
398
+
399
+ response_data: Any = None
400
+ if utils.match_response(http_res, "200", "application/json"):
401
+ return utils.unmarshal_json(http_res.text, models.PendleGetMarketResponse)
192
402
  if utils.match_response(http_res, "422", "application/json"):
193
403
  response_data = utils.unmarshal_json(
194
404
  http_res.text, errors.HTTPValidationErrorData
compass_api_sdk/sdk.py CHANGED
@@ -36,9 +36,9 @@ class CompassAPI(BaseSDK):
36
36
  token: "TokenSDK"
37
37
  uniswap_v3: "UniswapV3"
38
38
  universal: "Universal"
39
+ pendle: "Pendle"
39
40
  transaction_batching: "TransactionBatching"
40
41
  smart_account: "SmartAccount"
41
- pendle: "Pendle"
42
42
  _sub_sdk_map = {
43
43
  "aave_v3": ("compass_api_sdk.aave_v3", "AaveV3"),
44
44
  "aerodrome_slipstream": (
@@ -50,12 +50,12 @@ class CompassAPI(BaseSDK):
50
50
  "token": ("compass_api_sdk.token_sdk", "TokenSDK"),
51
51
  "uniswap_v3": ("compass_api_sdk.uniswap_v3", "UniswapV3"),
52
52
  "universal": ("compass_api_sdk.universal", "Universal"),
53
+ "pendle": ("compass_api_sdk.pendle", "Pendle"),
53
54
  "transaction_batching": (
54
55
  "compass_api_sdk.transaction_batching",
55
56
  "TransactionBatching",
56
57
  ),
57
58
  "smart_account": ("compass_api_sdk.smart_account", "SmartAccount"),
58
- "pendle": ("compass_api_sdk.pendle", "Pendle"),
59
59
  }
60
60
 
61
61
  def __init__(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: compass_api_sdk
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: Compass API SDK.
5
5
  Author: royalnine
6
6
  Requires-Python: >=3.9.2
@@ -236,7 +236,8 @@ with CompassAPI(
236
236
 
237
237
  ### [pendle](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md)
238
238
 
239
- * [accrued_interest](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#accrued_interest) - Get Accrued Interest
239
+ * [position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#position) - Check User's Market Position
240
+ * [market](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#market) - Get Market Data
240
241
 
241
242
  ### [sky](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md)
242
243
 
@@ -2,7 +2,7 @@ compass_api_sdk/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,4
2
2
  compass_api_sdk/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
3
3
  compass_api_sdk/_hooks/sdkhooks.py,sha256=eVxHB2Q_JG6zZx5xn74i208ij-fpTHqq2jod6fbghRQ,2503
4
4
  compass_api_sdk/_hooks/types.py,sha256=VC7TZz0BiM721MghXneEovG3UkaktRkt1OhMY3iLmZM,2818
5
- compass_api_sdk/_version.py,sha256=e34HL0KxIxbx4eGLle7zuRCjGt8WbquYP8_oeOFNo0g,472
5
+ compass_api_sdk/_version.py,sha256=ZaxxVMrqv0FNbY9IVX2BDiA1g8sFdqC_gjGKTspkcHQ,472
6
6
  compass_api_sdk/aave_v3.py,sha256=A6iCHMbBmOLRFobOR-QIkBro81GolKA6cxNAVvXzZEs,123270
7
7
  compass_api_sdk/aerodrome_slipstream.py,sha256=w_Q84q8iIDthqX0myByQ1SE5-B2iZPqZvcNVzSLYBZ0,82785
8
8
  compass_api_sdk/basesdk.py,sha256=29RfgnfgQq_cRx8OHdQEdJuJ2DrgRZlzGIPC-_6-2bM,12136
@@ -10,7 +10,7 @@ compass_api_sdk/errors/__init__.py,sha256=V3vSSmUvxXtgwHL60IBI0MzLWll8h373LvT3el
10
10
  compass_api_sdk/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
11
11
  compass_api_sdk/errors/httpvalidationerror.py,sha256=KBdpK3fYQoeMB-3m9dLKiMYimFN7B9VLma6YqMKX5k0,671
12
12
  compass_api_sdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
13
- compass_api_sdk/models/__init__.py,sha256=YJ4frD70hlHlIpaCUwyytGlrswEJlGxeZNqV3fd86R0,105209
13
+ compass_api_sdk/models/__init__.py,sha256=9aUClGAI9ReL5wsJbQh-NYzyfke3oyHOsijL6F67dLs,105978
14
14
  compass_api_sdk/models/aave_avg_rateop.py,sha256=PEdn3yManrwWI6SCD8nrgAFp4KJoXn4nwo56exPhRPA,2392
15
15
  compass_api_sdk/models/aave_historical_transactionsop.py,sha256=7Ghmin3AWvh2knbC-M0CZ0chL8q3fJU-GeDgXeoY0s4,1789
16
16
  compass_api_sdk/models/aave_liquidity_changeop.py,sha256=o9G4dD2foyhbunziTv_177Qr2AK37KTIQsQfvPxo5Fs,2785
@@ -72,19 +72,20 @@ compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault
72
72
  compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_vaultstate.py,sha256=PAHNVh5aU1z4t8N63_D4fYixGb_ZlOFZLAh3bVH2WLM,1624
73
73
  compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_asset.py,sha256=zlxZwigsUocOnYo2Q43JLDSiFL6w26r-jaqcy4Ds2NU,562
74
74
  compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py,sha256=WwlaoKcfHa18irpBwR95FIV5TD0_2jVN_hIqo1R55rE,796
75
- compass_api_sdk/models/contractname.py,sha256=RkV3ojwb53u8tKFpfr9_KabQ0wHFv-jW-Z5oTesLivU,1457
75
+ compass_api_sdk/models/contractname.py,sha256=M42omcEviZISWigXvhw2xm7kACf94oRguBBhPhkSCwk,1519
76
76
  compass_api_sdk/models/curator.py,sha256=FEyFGfhBNu1xFlSACdFPpBK2kGzLNBvLi8KfaEKy0rY,1392
77
77
  compass_api_sdk/models/ensnameinforesponse.py,sha256=p7y3TYD3lApa8hzHTCKDUEmSpmH2QmJAHG7wzef9rLk,626
78
+ compass_api_sdk/models/erc20data.py,sha256=u-Ln_Wj4mpuW5sk1Ull0ir8dJwYRU4Ij7C75R51pZmY,357
78
79
  compass_api_sdk/models/feeenum.py,sha256=TIYaeNWCG9KFGV7CZeXHvZ_4tmlqdlk-Pcg04pc7ynM,363
79
- compass_api_sdk/models/generic_allowanceop.py,sha256=hby2OpJYO1SSXgwxynPWMu7Zv1AXL9M9LkTdvUy4rtA,3596
80
+ compass_api_sdk/models/generic_allowanceop.py,sha256=dHOIHy7rTkh9tSM_Uud1BN1VPCsVhzbKkkq9vN0GLeo,3631
80
81
  compass_api_sdk/models/generic_ensop.py,sha256=xH9v260Dw_eF_IAlQqO7eqOKRDNDNV2519ze7VO31CM,1104
81
82
  compass_api_sdk/models/generic_portfolioop.py,sha256=jtsFkKQCYx2cbhK1LKtMB5RjVAAeRhVF2K5CpgoM74U,1175
82
83
  compass_api_sdk/models/generic_supported_tokensop.py,sha256=5ZNzAxmcnaxpGqAn2AoIqdGx0LDF4EnU102mVOXxlO4,884
83
84
  compass_api_sdk/models/generic_visualize_portfolioop.py,sha256=FGVWUHvzG8GODN2OFE6yP7ppRLa4H7hclfz00l72sKE,1229
84
85
  compass_api_sdk/models/image.py,sha256=-qB_S9WX6YZYVKVqTdnB79f57zjrO2G-hYwBxp-KJDQ,355
85
86
  compass_api_sdk/models/increaseallowanceanyparams.py,sha256=KdqYg_G4_xCKdXUnllXpbFrRVPbWc3EZLxBPCwQmjAU,1821
86
- compass_api_sdk/models/increaseallowanceparams.py,sha256=NSwwJkLSgBGbstNKB3xGIb5TiMMCFA3qKiFYn_HAAOE,2428
87
- compass_api_sdk/models/increaseallowancerequest.py,sha256=TxqyUxnXrFmQfBYFcQBziYbUhjObB6gkpuqW6fHyeIE,2684
87
+ compass_api_sdk/models/increaseallowanceparams.py,sha256=IkmPZGa5c5xaV2YRmszbBBmuOSZceLdxBy_wOE-i0yE,2463
88
+ compass_api_sdk/models/increaseallowancerequest.py,sha256=JQKVgYILt-IOLmCzsI3CIag9DRYuXBaB4Q_uL3nRmGQ,2719
88
89
  compass_api_sdk/models/interestratemode.py,sha256=OmOKBSJD0y9O9LuA0rajVkvxiEuU-xiQAuoiHYFmp5s,341
89
90
  compass_api_sdk/models/liquidationcall.py,sha256=-HEwFMuiD2p8x04VQHlnYqlOdvhr0jXrZ6ksmxlffUw,2019
90
91
  compass_api_sdk/models/liquidity.py,sha256=WOPaK4SXj2C5TBLZlfoaQbcnzhcmFCEUFz59mOw1KeM,328
@@ -125,8 +126,10 @@ compass_api_sdk/models/multicallactiontype.py,sha256=zUoQJ_v_lyrIQWydn16iknjjX1J
125
126
  compass_api_sdk/models/multicallauthorizationrequest.py,sha256=h5-2acLlhV9assgIIHyVIgTak1IJathqa-viS-PkvMA,1155
126
127
  compass_api_sdk/models/multicallauthorizationresponse.py,sha256=3jjdz9Mz-tKjhBzZbVaJW51no58HSqcxfHJwuZsgnhg,914
127
128
  compass_api_sdk/models/multicallexecuterequest.py,sha256=iVCfkarzlLYQrdo2sCRB9YJyJ-dayaf321j0Hh4Fit8,1095
128
- compass_api_sdk/models/pendle_accrued_interestop.py,sha256=pStQaGazsuZZzUmx3yvOOyFD-U1RO_-GSKmuVKL-TiU,1530
129
- compass_api_sdk/models/pendleaccruedinterestresponse.py,sha256=vNSdayL8cLY4eC1ldv8jeBuH5MuO_VoYQJq6HVGnAbE,451
129
+ compass_api_sdk/models/pendle_marketop.py,sha256=xKYkYiyZNNBedTIxnGPdCi0Ov4i2AHAD3k0a6duvQrU,1416
130
+ compass_api_sdk/models/pendle_positionop.py,sha256=1e5KREC0HCRu6f5oK6zSo1bk3QznFXIfxCCkRm5FVg0,1428
131
+ compass_api_sdk/models/pendlegetmarketresponse.py,sha256=qupYm6P8CxZ1v6cFmbRyIxCTjZ7PTjxXiuRW7_8KHng,917
132
+ compass_api_sdk/models/pendlegetuserpositionresponse.py,sha256=VZGVNNdvqKwNDB9LkokXX35-jJy_BP-Mbw76xRE3JlI,1750
130
133
  compass_api_sdk/models/portfolio.py,sha256=Ey2gbh7ZqSWIMmfLrflpZS7QzvCR8QMp5bHx6-BMEp4,687
131
134
  compass_api_sdk/models/redeemunderlying.py,sha256=YK6I29RAeIgE4gfxyjgoUiktxqFAnJfvNv4qz1QvmTU,1282
132
135
  compass_api_sdk/models/repay.py,sha256=dCDDG9BvJOnT-OgEs013t7l5xG0r-5M_BUxal4cfU0I,1482
@@ -193,9 +196,9 @@ compass_api_sdk/models/weeklyapys.py,sha256=AaGjDD4NeGsZQBwdRW1G09Pmx17pLPe2oUA9
193
196
  compass_api_sdk/models/wrapethparams.py,sha256=eMIOqxDM3hCwMJiJsMdnO6ZsMXg1K-_E3S5OIi8XGEI,824
194
197
  compass_api_sdk/models/wrapethrequest.py,sha256=aJBhcooob-etvReQEjNdC8HOUQ7oUNkOPYr6A4a3BFE,1077
195
198
  compass_api_sdk/morpho.py,sha256=9b96ovx476ZmNGKpWu5ioIIXkS3N7MI3LYYRrtPQb3s,133036
196
- compass_api_sdk/pendle.py,sha256=9Uk8hbphE9IyRhLhs5XPAoXBIgI9YmzH9jsS67MLp-w,8867
199
+ compass_api_sdk/pendle.py,sha256=kxb1UuYlTEJ3q_YBnKcF4uCuT6wNNcOVfIVw-0bi0B8,17339
197
200
  compass_api_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
198
- compass_api_sdk/sdk.py,sha256=3f4VynZX2_vgEhZhYg3b5maAZIc3NnJERwy1LunXscU,7692
201
+ compass_api_sdk/sdk.py,sha256=RyVwgRGRTz_vr3XcLxVc4o3wvjrLgoA6-qq9mgM9moM,7692
199
202
  compass_api_sdk/sdkconfiguration.py,sha256=K-B67o2xftk7Rh5z59xBL0TcCn_XhX0Yh_JePPegvvU,1764
200
203
  compass_api_sdk/sky.py,sha256=u-1LwuQPGsYGq4MgzhP0KkkKt4RD9ggkHvARaPPZVI0,43495
201
204
  compass_api_sdk/smart_account.py,sha256=qMBOBYPQr_3UUx1t6VAAGBCtKm2s9UHxgh2UnUsJmHA,9356
@@ -221,6 +224,6 @@ compass_api_sdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFId
221
224
  compass_api_sdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
222
225
  compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
223
226
  compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
224
- compass_api_sdk-0.5.1.dist-info/METADATA,sha256=YJDSunCbw5rFRRARb4MvCXcTfOlyw6CYi0BCCq38Wzo,25401
225
- compass_api_sdk-0.5.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
226
- compass_api_sdk-0.5.1.dist-info/RECORD,,
227
+ compass_api_sdk-0.5.3.dist-info/METADATA,sha256=XsXCvxaUJBnjrfvBrdR43LHuTiXAmQk9fUMSYgl8F8E,25505
228
+ compass_api_sdk-0.5.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
229
+ compass_api_sdk-0.5.3.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
-
3
- from __future__ import annotations
4
- from compass_api_sdk.types import BaseModel
5
- from typing_extensions import TypedDict
6
-
7
-
8
- class PendleAccruedInterestResponseTypedDict(TypedDict):
9
- r"""Response model for accrued interest."""
10
-
11
- accrued_interest: int
12
-
13
-
14
- class PendleAccruedInterestResponse(BaseModel):
15
- r"""Response model for accrued interest."""
16
-
17
- accrued_interest: int