compass_api_sdk 0.9.3__py3-none-any.whl → 0.9.5__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.
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/models/__init__.py +16 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_marketstate.py +44 -5
- compass_api_sdk/models/pendleredeemyieldparams.py +28 -0
- compass_api_sdk/models/pendleredeemyieldrequest.py +39 -0
- compass_api_sdk/models/useroperation.py +20 -14
- compass_api_sdk/pendle.py +214 -0
- {compass_api_sdk-0.9.3.dist-info → compass_api_sdk-0.9.5.dist-info}/METADATA +2 -1
- {compass_api_sdk-0.9.3.dist-info → compass_api_sdk-0.9.5.dist-info}/RECORD +10 -8
- {compass_api_sdk-0.9.3.dist-info → compass_api_sdk-0.9.5.dist-info}/WHEEL +0 -0
compass_api_sdk/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "compass_api_sdk"
|
|
6
|
-
__version__: str = "0.9.
|
|
6
|
+
__version__: str = "0.9.5"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.1"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.9.
|
|
8
|
+
__gen_version__: str = "2.618.0"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.9.5 2.618.0 0.0.1 compass_api_sdk"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
|
@@ -605,6 +605,14 @@ if TYPE_CHECKING:
|
|
|
605
605
|
PendleListUserPositionsResponseTypedDict,
|
|
606
606
|
)
|
|
607
607
|
from .pendlemarket import PendleMarket, PendleMarketTypedDict
|
|
608
|
+
from .pendleredeemyieldparams import (
|
|
609
|
+
PendleRedeemYieldParams,
|
|
610
|
+
PendleRedeemYieldParamsTypedDict,
|
|
611
|
+
)
|
|
612
|
+
from .pendleredeemyieldrequest import (
|
|
613
|
+
PendleRedeemYieldRequest,
|
|
614
|
+
PendleRedeemYieldRequestTypedDict,
|
|
615
|
+
)
|
|
608
616
|
from .pendlesellptparams import (
|
|
609
617
|
PendleSellPtParams,
|
|
610
618
|
PendleSellPtParamsAmount,
|
|
@@ -1356,6 +1364,10 @@ __all__ = [
|
|
|
1356
1364
|
"PendlePositionsChain",
|
|
1357
1365
|
"PendlePositionsRequest",
|
|
1358
1366
|
"PendlePositionsRequestTypedDict",
|
|
1367
|
+
"PendleRedeemYieldParams",
|
|
1368
|
+
"PendleRedeemYieldParamsTypedDict",
|
|
1369
|
+
"PendleRedeemYieldRequest",
|
|
1370
|
+
"PendleRedeemYieldRequestTypedDict",
|
|
1359
1371
|
"PendleSellPtParams",
|
|
1360
1372
|
"PendleSellPtParamsAmount",
|
|
1361
1373
|
"PendleSellPtParamsAmountTypedDict",
|
|
@@ -2030,6 +2042,10 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2030
2042
|
"PendleListUserPositionsResponseTypedDict": ".pendlelistuserpositionsresponse",
|
|
2031
2043
|
"PendleMarket": ".pendlemarket",
|
|
2032
2044
|
"PendleMarketTypedDict": ".pendlemarket",
|
|
2045
|
+
"PendleRedeemYieldParams": ".pendleredeemyieldparams",
|
|
2046
|
+
"PendleRedeemYieldParamsTypedDict": ".pendleredeemyieldparams",
|
|
2047
|
+
"PendleRedeemYieldRequest": ".pendleredeemyieldrequest",
|
|
2048
|
+
"PendleRedeemYieldRequestTypedDict": ".pendleredeemyieldrequest",
|
|
2033
2049
|
"PendleSellPtParams": ".pendlesellptparams",
|
|
2034
2050
|
"PendleSellPtParamsAmount": ".pendlesellptparams",
|
|
2035
2051
|
"PendleSellPtParamsAmountTypedDict": ".pendlesellptparams",
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_marketstate.py
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from compass_api_sdk.types import
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
import pydantic
|
|
6
|
-
from
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
7
14
|
|
|
8
15
|
|
|
9
16
|
class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketStateTypedDict(TypedDict):
|
|
10
17
|
utilization: str
|
|
11
18
|
collateral_assets: str
|
|
12
|
-
collateral_assets_usd: str
|
|
13
19
|
borrow_assets: str
|
|
14
20
|
borrow_assets_usd: str
|
|
15
21
|
liquidity_assets: str
|
|
16
22
|
liquidity_assets_usd: str
|
|
17
23
|
total_liquidity: str
|
|
18
24
|
total_liquidity_usd: str
|
|
25
|
+
collateral_assets_usd: NotRequired[Nullable[str]]
|
|
19
26
|
|
|
20
27
|
|
|
21
28
|
class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketState(BaseModel):
|
|
@@ -23,8 +30,6 @@ class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketState(BaseModel):
|
|
|
23
30
|
|
|
24
31
|
collateral_assets: Annotated[str, pydantic.Field(alias="collateralAssets")]
|
|
25
32
|
|
|
26
|
-
collateral_assets_usd: Annotated[str, pydantic.Field(alias="collateralAssetsUsd")]
|
|
27
|
-
|
|
28
33
|
borrow_assets: Annotated[str, pydantic.Field(alias="borrowAssets")]
|
|
29
34
|
|
|
30
35
|
borrow_assets_usd: Annotated[str, pydantic.Field(alias="borrowAssetsUsd")]
|
|
@@ -36,3 +41,37 @@ class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketState(BaseModel):
|
|
|
36
41
|
total_liquidity: Annotated[str, pydantic.Field(alias="totalLiquidity")]
|
|
37
42
|
|
|
38
43
|
total_liquidity_usd: Annotated[str, pydantic.Field(alias="totalLiquidityUsd")]
|
|
44
|
+
|
|
45
|
+
collateral_assets_usd: Annotated[
|
|
46
|
+
OptionalNullable[str], pydantic.Field(alias="collateralAssetsUsd")
|
|
47
|
+
] = UNSET
|
|
48
|
+
|
|
49
|
+
@model_serializer(mode="wrap")
|
|
50
|
+
def serialize_model(self, handler):
|
|
51
|
+
optional_fields = ["collateralAssetsUsd"]
|
|
52
|
+
nullable_fields = ["collateralAssetsUsd"]
|
|
53
|
+
null_default_fields = []
|
|
54
|
+
|
|
55
|
+
serialized = handler(self)
|
|
56
|
+
|
|
57
|
+
m = {}
|
|
58
|
+
|
|
59
|
+
for n, f in type(self).model_fields.items():
|
|
60
|
+
k = f.alias or n
|
|
61
|
+
val = serialized.get(k)
|
|
62
|
+
serialized.pop(k, None)
|
|
63
|
+
|
|
64
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
65
|
+
is_set = (
|
|
66
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
67
|
+
or k in null_default_fields
|
|
68
|
+
) # pylint: disable=no-member
|
|
69
|
+
|
|
70
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
71
|
+
m[k] = val
|
|
72
|
+
elif val != UNSET_SENTINEL and (
|
|
73
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
74
|
+
):
|
|
75
|
+
m[k] = val
|
|
76
|
+
|
|
77
|
+
return m
|
|
@@ -0,0 +1,28 @@
|
|
|
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 validate_const
|
|
6
|
+
import pydantic
|
|
7
|
+
from pydantic.functional_validators import AfterValidator
|
|
8
|
+
from typing import Literal, Optional
|
|
9
|
+
from typing_extensions import Annotated, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PendleRedeemYieldParamsTypedDict(TypedDict):
|
|
13
|
+
market_address: str
|
|
14
|
+
r"""The address of the market identifying which Yield Token (YT) you would like to claim yield from."""
|
|
15
|
+
action_type: Literal["PENDLE_REDEEM_YIELD"]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PendleRedeemYieldParams(BaseModel):
|
|
19
|
+
market_address: str
|
|
20
|
+
r"""The address of the market identifying which Yield Token (YT) you would like to claim yield from."""
|
|
21
|
+
|
|
22
|
+
ACTION_TYPE: Annotated[
|
|
23
|
+
Annotated[
|
|
24
|
+
Optional[Literal["PENDLE_REDEEM_YIELD"]],
|
|
25
|
+
AfterValidator(validate_const("PENDLE_REDEEM_YIELD")),
|
|
26
|
+
],
|
|
27
|
+
pydantic.Field(alias="action_type"),
|
|
28
|
+
] = "PENDLE_REDEEM_YIELD"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional
|
|
10
|
+
from typing_extensions import Annotated, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PendleRedeemYieldRequestTypedDict(TypedDict):
|
|
14
|
+
market_address: str
|
|
15
|
+
r"""The address of the market identifying which Yield Token (YT) you would like to claim yield from."""
|
|
16
|
+
chain: Chain
|
|
17
|
+
r"""The chain to use."""
|
|
18
|
+
sender: str
|
|
19
|
+
r"""The address of the transaction sender."""
|
|
20
|
+
action_type: Literal["PENDLE_REDEEM_YIELD"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PendleRedeemYieldRequest(BaseModel):
|
|
24
|
+
market_address: str
|
|
25
|
+
r"""The address of the market identifying which Yield Token (YT) you would like to claim yield from."""
|
|
26
|
+
|
|
27
|
+
chain: Chain
|
|
28
|
+
r"""The chain to use."""
|
|
29
|
+
|
|
30
|
+
sender: str
|
|
31
|
+
r"""The address of the transaction sender."""
|
|
32
|
+
|
|
33
|
+
ACTION_TYPE: Annotated[
|
|
34
|
+
Annotated[
|
|
35
|
+
Optional[Literal["PENDLE_REDEEM_YIELD"]],
|
|
36
|
+
AfterValidator(validate_const("PENDLE_REDEEM_YIELD")),
|
|
37
|
+
],
|
|
38
|
+
pydantic.Field(alias="action_type"),
|
|
39
|
+
] = "PENDLE_REDEEM_YIELD"
|
|
@@ -47,6 +47,10 @@ from .morphowithdrawcollateralparams import (
|
|
|
47
47
|
from .morphowithdrawparams import MorphoWithdrawParams, MorphoWithdrawParamsTypedDict
|
|
48
48
|
from .pendlebuyptparams import PendleBuyPtParams, PendleBuyPtParamsTypedDict
|
|
49
49
|
from .pendlebuyytparams import PendleBuyYtParams, PendleBuyYtParamsTypedDict
|
|
50
|
+
from .pendleredeemyieldparams import (
|
|
51
|
+
PendleRedeemYieldParams,
|
|
52
|
+
PendleRedeemYieldParamsTypedDict,
|
|
53
|
+
)
|
|
50
54
|
from .pendlesellptparams import PendleSellPtParams, PendleSellPtParamsTypedDict
|
|
51
55
|
from .pendlesellytparams import PendleSellYtParams, PendleSellYtParamsTypedDict
|
|
52
56
|
from .skybuyparams import SkyBuyParams, SkyBuyParamsTypedDict
|
|
@@ -89,39 +93,40 @@ from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
|
89
93
|
BodyTypedDict = TypeAliasType(
|
|
90
94
|
"BodyTypedDict",
|
|
91
95
|
Union[
|
|
92
|
-
|
|
96
|
+
PendleRedeemYieldParamsTypedDict,
|
|
93
97
|
WrapEthParamsTypedDict,
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
UnwrapWethParamsTypedDict,
|
|
99
|
+
SkySellParamsTypedDict,
|
|
96
100
|
PendleSellYtParamsTypedDict,
|
|
97
101
|
UniswapWithdrawLiquidityProvisionParamsTypedDict,
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
SkyWithdrawParamsTypedDict,
|
|
103
|
+
SkyDepositParamsTypedDict,
|
|
100
104
|
AerodromeSlipstreamWithdrawLiquidityProvisionParamsTypedDict,
|
|
105
|
+
SkyBuyParamsTypedDict,
|
|
106
|
+
PendleBuyYtParamsTypedDict,
|
|
101
107
|
PendleBuyPtParamsTypedDict,
|
|
102
|
-
SkyDepositParamsTypedDict,
|
|
103
108
|
PendleSellPtParamsTypedDict,
|
|
104
|
-
|
|
109
|
+
MorphoSetVaultAllowanceParamsTypedDict,
|
|
105
110
|
MorphoDepositParamsTypedDict,
|
|
111
|
+
TokenTransferErc20ParamsTypedDict,
|
|
112
|
+
AaveWithdrawParamsTypedDict,
|
|
106
113
|
IncreaseAllowanceParamsTypedDict,
|
|
107
114
|
MorphoWithdrawParamsTypedDict,
|
|
108
|
-
AaveWithdrawParamsTypedDict,
|
|
109
|
-
TokenTransferErc20ParamsTypedDict,
|
|
110
115
|
AaveSupplyParamsTypedDict,
|
|
111
|
-
MorphoBorrowParamsTypedDict,
|
|
112
|
-
MorphoSupplyCollateralParamsTypedDict,
|
|
113
|
-
MorphoRepayParamsTypedDict,
|
|
114
116
|
MorphoWithdrawCollateralParamsTypedDict,
|
|
115
117
|
AaveRepayParamsTypedDict,
|
|
118
|
+
MorphoSupplyCollateralParamsTypedDict,
|
|
119
|
+
MorphoRepayParamsTypedDict,
|
|
120
|
+
MorphoBorrowParamsTypedDict,
|
|
116
121
|
AaveBorrowParamsTypedDict,
|
|
122
|
+
AerodromeSlipstreamSellExactlyParamsTypedDict,
|
|
117
123
|
UniswapIncreaseLiquidityProvisionParamsTypedDict,
|
|
118
124
|
AerodromeSlipstreamIncreaseLiquidityProvisionParamsTypedDict,
|
|
119
125
|
AerodromeSlipstreamBuyExactlyParamsTypedDict,
|
|
120
|
-
AerodromeSlipstreamSellExactlyParamsTypedDict,
|
|
121
126
|
UniswapBuyExactlyParamsTypedDict,
|
|
122
127
|
UniswapSellExactlyParamsTypedDict,
|
|
123
|
-
AerodromeSlipstreamMintLiquidityProvisionParamsTypedDict,
|
|
124
128
|
UniswapMintLiquidityProvisionParamsTypedDict,
|
|
129
|
+
AerodromeSlipstreamMintLiquidityProvisionParamsTypedDict,
|
|
125
130
|
],
|
|
126
131
|
)
|
|
127
132
|
|
|
@@ -161,6 +166,7 @@ Body = Annotated[
|
|
|
161
166
|
Annotated[MorphoWithdrawCollateralParams, Tag("MORPHO_WITHDRAW_COLLATERAL")],
|
|
162
167
|
Annotated[PendleBuyPtParams, Tag("PENDLE_BUY_PT")],
|
|
163
168
|
Annotated[PendleBuyYtParams, Tag("PENDLE_BUY_YT")],
|
|
169
|
+
Annotated[PendleRedeemYieldParams, Tag("PENDLE_REDEEM_YIELD")],
|
|
164
170
|
Annotated[PendleSellPtParams, Tag("PENDLE_SELL_PT")],
|
|
165
171
|
Annotated[PendleSellYtParams, Tag("PENDLE_SELL_YT")],
|
|
166
172
|
Annotated[SkyBuyParams, Tag("SKY_BUY")],
|
compass_api_sdk/pendle.py
CHANGED
|
@@ -1743,3 +1743,217 @@ class Pendle(BaseSDK):
|
|
|
1743
1743
|
http_res_text,
|
|
1744
1744
|
http_res,
|
|
1745
1745
|
)
|
|
1746
|
+
|
|
1747
|
+
def redeem_yield(
|
|
1748
|
+
self,
|
|
1749
|
+
*,
|
|
1750
|
+
market_address: str,
|
|
1751
|
+
chain: models.Chain,
|
|
1752
|
+
sender: str,
|
|
1753
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1754
|
+
server_url: Optional[str] = None,
|
|
1755
|
+
timeout_ms: Optional[int] = None,
|
|
1756
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1757
|
+
) -> models.TxResponse:
|
|
1758
|
+
r"""Redeem Claimable Yield
|
|
1759
|
+
|
|
1760
|
+
Redeem claimable yield from the market's associated Yield Token (YT).
|
|
1761
|
+
|
|
1762
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to claim yield from.
|
|
1763
|
+
:param chain: The chain to use.
|
|
1764
|
+
:param sender: The address of the transaction sender.
|
|
1765
|
+
:param retries: Override the default retry configuration for this method
|
|
1766
|
+
:param server_url: Override the default server URL for this method
|
|
1767
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1768
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1769
|
+
"""
|
|
1770
|
+
base_url = None
|
|
1771
|
+
url_variables = None
|
|
1772
|
+
if timeout_ms is None:
|
|
1773
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1774
|
+
|
|
1775
|
+
if server_url is not None:
|
|
1776
|
+
base_url = server_url
|
|
1777
|
+
else:
|
|
1778
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1779
|
+
|
|
1780
|
+
request = models.PendleRedeemYieldRequest(
|
|
1781
|
+
market_address=market_address,
|
|
1782
|
+
chain=chain,
|
|
1783
|
+
sender=sender,
|
|
1784
|
+
)
|
|
1785
|
+
|
|
1786
|
+
req = self._build_request(
|
|
1787
|
+
method="POST",
|
|
1788
|
+
path="/v0/pendle/redeem_yield",
|
|
1789
|
+
base_url=base_url,
|
|
1790
|
+
url_variables=url_variables,
|
|
1791
|
+
request=request,
|
|
1792
|
+
request_body_required=True,
|
|
1793
|
+
request_has_path_params=False,
|
|
1794
|
+
request_has_query_params=True,
|
|
1795
|
+
user_agent_header="user-agent",
|
|
1796
|
+
accept_header_value="application/json",
|
|
1797
|
+
http_headers=http_headers,
|
|
1798
|
+
security=self.sdk_configuration.security,
|
|
1799
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1800
|
+
request, False, False, "json", models.PendleRedeemYieldRequest
|
|
1801
|
+
),
|
|
1802
|
+
timeout_ms=timeout_ms,
|
|
1803
|
+
)
|
|
1804
|
+
|
|
1805
|
+
if retries == UNSET:
|
|
1806
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1807
|
+
retries = self.sdk_configuration.retry_config
|
|
1808
|
+
|
|
1809
|
+
retry_config = None
|
|
1810
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1811
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1812
|
+
|
|
1813
|
+
http_res = self.do_request(
|
|
1814
|
+
hook_ctx=HookContext(
|
|
1815
|
+
config=self.sdk_configuration,
|
|
1816
|
+
base_url=base_url or "",
|
|
1817
|
+
operation_id="pendle_redeem_yield",
|
|
1818
|
+
oauth2_scopes=[],
|
|
1819
|
+
security_source=self.sdk_configuration.security,
|
|
1820
|
+
),
|
|
1821
|
+
request=req,
|
|
1822
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1823
|
+
retry_config=retry_config,
|
|
1824
|
+
)
|
|
1825
|
+
|
|
1826
|
+
response_data: Any = None
|
|
1827
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1828
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
1829
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1830
|
+
response_data = utils.unmarshal_json(
|
|
1831
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1832
|
+
)
|
|
1833
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1834
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1835
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1836
|
+
raise errors.APIError(
|
|
1837
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1838
|
+
)
|
|
1839
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1840
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1841
|
+
raise errors.APIError(
|
|
1842
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1843
|
+
)
|
|
1844
|
+
|
|
1845
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1846
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1847
|
+
raise errors.APIError(
|
|
1848
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1849
|
+
http_res.status_code,
|
|
1850
|
+
http_res_text,
|
|
1851
|
+
http_res,
|
|
1852
|
+
)
|
|
1853
|
+
|
|
1854
|
+
async def redeem_yield_async(
|
|
1855
|
+
self,
|
|
1856
|
+
*,
|
|
1857
|
+
market_address: str,
|
|
1858
|
+
chain: models.Chain,
|
|
1859
|
+
sender: str,
|
|
1860
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1861
|
+
server_url: Optional[str] = None,
|
|
1862
|
+
timeout_ms: Optional[int] = None,
|
|
1863
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1864
|
+
) -> models.TxResponse:
|
|
1865
|
+
r"""Redeem Claimable Yield
|
|
1866
|
+
|
|
1867
|
+
Redeem claimable yield from the market's associated Yield Token (YT).
|
|
1868
|
+
|
|
1869
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to claim yield from.
|
|
1870
|
+
:param chain: The chain to use.
|
|
1871
|
+
:param sender: The address of the transaction sender.
|
|
1872
|
+
:param retries: Override the default retry configuration for this method
|
|
1873
|
+
:param server_url: Override the default server URL for this method
|
|
1874
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1875
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1876
|
+
"""
|
|
1877
|
+
base_url = None
|
|
1878
|
+
url_variables = None
|
|
1879
|
+
if timeout_ms is None:
|
|
1880
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1881
|
+
|
|
1882
|
+
if server_url is not None:
|
|
1883
|
+
base_url = server_url
|
|
1884
|
+
else:
|
|
1885
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1886
|
+
|
|
1887
|
+
request = models.PendleRedeemYieldRequest(
|
|
1888
|
+
market_address=market_address,
|
|
1889
|
+
chain=chain,
|
|
1890
|
+
sender=sender,
|
|
1891
|
+
)
|
|
1892
|
+
|
|
1893
|
+
req = self._build_request_async(
|
|
1894
|
+
method="POST",
|
|
1895
|
+
path="/v0/pendle/redeem_yield",
|
|
1896
|
+
base_url=base_url,
|
|
1897
|
+
url_variables=url_variables,
|
|
1898
|
+
request=request,
|
|
1899
|
+
request_body_required=True,
|
|
1900
|
+
request_has_path_params=False,
|
|
1901
|
+
request_has_query_params=True,
|
|
1902
|
+
user_agent_header="user-agent",
|
|
1903
|
+
accept_header_value="application/json",
|
|
1904
|
+
http_headers=http_headers,
|
|
1905
|
+
security=self.sdk_configuration.security,
|
|
1906
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1907
|
+
request, False, False, "json", models.PendleRedeemYieldRequest
|
|
1908
|
+
),
|
|
1909
|
+
timeout_ms=timeout_ms,
|
|
1910
|
+
)
|
|
1911
|
+
|
|
1912
|
+
if retries == UNSET:
|
|
1913
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1914
|
+
retries = self.sdk_configuration.retry_config
|
|
1915
|
+
|
|
1916
|
+
retry_config = None
|
|
1917
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1918
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1919
|
+
|
|
1920
|
+
http_res = await self.do_request_async(
|
|
1921
|
+
hook_ctx=HookContext(
|
|
1922
|
+
config=self.sdk_configuration,
|
|
1923
|
+
base_url=base_url or "",
|
|
1924
|
+
operation_id="pendle_redeem_yield",
|
|
1925
|
+
oauth2_scopes=[],
|
|
1926
|
+
security_source=self.sdk_configuration.security,
|
|
1927
|
+
),
|
|
1928
|
+
request=req,
|
|
1929
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1930
|
+
retry_config=retry_config,
|
|
1931
|
+
)
|
|
1932
|
+
|
|
1933
|
+
response_data: Any = None
|
|
1934
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1935
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
1936
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1937
|
+
response_data = utils.unmarshal_json(
|
|
1938
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1939
|
+
)
|
|
1940
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1941
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1942
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1943
|
+
raise errors.APIError(
|
|
1944
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1945
|
+
)
|
|
1946
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1947
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1948
|
+
raise errors.APIError(
|
|
1949
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1950
|
+
)
|
|
1951
|
+
|
|
1952
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1953
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1954
|
+
raise errors.APIError(
|
|
1955
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1956
|
+
http_res.status_code,
|
|
1957
|
+
http_res_text,
|
|
1958
|
+
http_res,
|
|
1959
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: compass_api_sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
4
4
|
Summary: Compass API SDK.
|
|
5
5
|
Author: royalnine
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -245,6 +245,7 @@ with CompassAPI(
|
|
|
245
245
|
* [sell_pt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#sell_pt) - Sell Principal Token (PT)
|
|
246
246
|
* [buy_yt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#buy_yt) - Buy Yield Token (YT)
|
|
247
247
|
* [sell_yt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#sell_yt) - Sell Yield Token (YT)
|
|
248
|
+
* [redeem_yield](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#redeem_yield) - Redeem Claimable Yield
|
|
248
249
|
|
|
249
250
|
### [sky](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md)
|
|
250
251
|
|
|
@@ -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=4qXm6dEntJOC2QeOdTklcc53oFzTU3HBb1xGdZ-kBXY,3059
|
|
5
|
-
compass_api_sdk/_version.py,sha256=
|
|
5
|
+
compass_api_sdk/_version.py,sha256=jo2GDT5YHe3HOdgGBL4MeuZSFXwDqHFpEFB9R4hS928,472
|
|
6
6
|
compass_api_sdk/aave_v3.py,sha256=bYNO0yNcWQ4IUZkhSzM8lLTO2ukD6YqPljBUwwB7ii8,126948
|
|
7
7
|
compass_api_sdk/aerodrome_slipstream.py,sha256=19Sluif_xvZzWIfU-2L5_wN0R7g63KfvMmn5WB64g2s,83991
|
|
8
8
|
compass_api_sdk/basesdk.py,sha256=xDxC-X-LHCwtVy8SPM6nckSu1NmF8uKhHUUQd3X-syo,11810
|
|
@@ -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=
|
|
13
|
+
compass_api_sdk/models/__init__.py,sha256=Cwhz-MWJjQN0gMqR60Lwr3ApF11Zm6nMpZXxFOjQ7hM,114914
|
|
14
14
|
compass_api_sdk/models/aave_avg_rateop.py,sha256=5R3QctTFTUSYojW_RXQX-2MBl-Gv6bmdupBcSyANqRs,3718
|
|
15
15
|
compass_api_sdk/models/aave_historical_transactionsop.py,sha256=lAyNItLIAR3aHVmtbCjsV8C4h2LOdFToCwUbCWKhZ6s,3121
|
|
16
16
|
compass_api_sdk/models/aave_liquidity_changeop.py,sha256=Z7wAv9HyV357yfg6rg0VuulZJbp63_ibMYJ3MWCJ07s,4111
|
|
@@ -66,7 +66,7 @@ compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_use
|
|
|
66
66
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_vaultstate.py,sha256=d35pPUuS2S2PS92QMcswYRqRx6qbr_gyDC-O-_4SNaY,642
|
|
67
67
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_apydata.py,sha256=p6oN-4Dh-4JNjG3048l6mu5oApqvpVWLe7mYEPaWWJI,753
|
|
68
68
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_asset.py,sha256=dcnk2hsf77NhGtZA8wGZwjqnEoPhwoFZ5qvseMdpibw,1663
|
|
69
|
-
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_marketstate.py,sha256=
|
|
69
|
+
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_marketstate.py,sha256=B_xxWuQ4rhl3Zjt_FyTajFe9B4wrYnuQUU5VFLSls_Y,2424
|
|
70
70
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_asset.py,sha256=pMWAh-oYo4YBmeVpoh2XoPn8PmFWSrvRH0Gg7sPT8xQ,488
|
|
71
71
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_marketstate.py,sha256=wour5BGvKGddpI_qfs7WHfDewE5-cLdRjq7L-QTAQLg,2133
|
|
72
72
|
compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_asset.py,sha256=bWO0t2sKFS3Cx3j7zUXPgGK9i1QIUcrdnyQksunbNQU,1661
|
|
@@ -142,6 +142,8 @@ compass_api_sdk/models/pendlegetuserpositionresponse.py,sha256=VZGVNNdvqKwNDB9Lk
|
|
|
142
142
|
compass_api_sdk/models/pendlelistmarketsresponse.py,sha256=-DlImGBzAP-yc0B1F9Cfer1ruFHLUEsRv2F1MQt2-hE,570
|
|
143
143
|
compass_api_sdk/models/pendlelistuserpositionsresponse.py,sha256=7QQ5xeGxlPo1mPrzR9LRwSlx7veUN3u2qnZDi6iVWj0,572
|
|
144
144
|
compass_api_sdk/models/pendlemarket.py,sha256=4eLXsYRw9c7CSFOsciOA4MCA57-1Su6B2vx4RoRBlew,918
|
|
145
|
+
compass_api_sdk/models/pendleredeemyieldparams.py,sha256=B2PtfZ64JtlHk1aMLYYJyWfX0ifnACBE9fY87Q67GRw,1027
|
|
146
|
+
compass_api_sdk/models/pendleredeemyieldrequest.py,sha256=cft5omEOtDojyd429l_ID0I_58PVIy6q6XnAXwuotzQ,1280
|
|
145
147
|
compass_api_sdk/models/pendlesellptparams.py,sha256=coeWfgS1P4QY6uG9NuJ2eiBuqPIm3JD4cRCjVs6IfUE,1719
|
|
146
148
|
compass_api_sdk/models/pendlesellptrequest.py,sha256=kFPS-iB4KgVVsSYAYK7y3CGRqTcFc6U_Y9q9CZEwLbo,1984
|
|
147
149
|
compass_api_sdk/models/pendlesellytparams.py,sha256=WCmbNaEeV0Dr7pcMOwFbsjEhHutoTmbHvymcwgLTE6A,1695
|
|
@@ -203,7 +205,7 @@ compass_api_sdk/models/unsignedtransaction.py,sha256=DHPEOKI-xgmu7tLiVxsv4JJp93k
|
|
|
203
205
|
compass_api_sdk/models/unwrapwethparams.py,sha256=ChsTqUYi88jHqkeRVIskzfBHAPyI_J2fBJqR81Qc6dg,1308
|
|
204
206
|
compass_api_sdk/models/unwrapwethrequest.py,sha256=pt-eqvKWN6qir5bN6d9EWBZIDrXs_51z7X8ODoFzLWU,1561
|
|
205
207
|
compass_api_sdk/models/usageascollateral.py,sha256=hHBgh83BO9WA6u-9xzTvBlPOLoiYV1N21G6vDeo_b30,1561
|
|
206
|
-
compass_api_sdk/models/useroperation.py,sha256=
|
|
208
|
+
compass_api_sdk/models/useroperation.py,sha256=uDp8H-WskZRE5sY-ZKRwySiSJO7zQ-ESq0rq2_DMaLY,8489
|
|
207
209
|
compass_api_sdk/models/useroperationresponse.py,sha256=z0o0N-EC30XlrkFiR3vLO_EXbpXojUCJlWQxuOir5VM,671
|
|
208
210
|
compass_api_sdk/models/userstate.py,sha256=xK6ZrhqogPE32JH7J4i1_oK7KxYkmebJU-jfcBp8FOo,1003
|
|
209
211
|
compass_api_sdk/models/validationerror.py,sha256=01WnpU7Tgin0B_poO97_hl6b5CNJ_9VGzpcmoeJs4GU,532
|
|
@@ -214,7 +216,7 @@ compass_api_sdk/models/wrapethparams.py,sha256=nw1fZiDrj5wZnI25Vmg0DcNI01k-uhot6
|
|
|
214
216
|
compass_api_sdk/models/wrapethrequest.py,sha256=pjo0BZtzdOZKuwgnc05LsCWO1A6ZAGLwFixLuXQNKDg,1476
|
|
215
217
|
compass_api_sdk/models/yieldrange.py,sha256=WEpZR24JddnCS1_13y2P1CdD0lBi6dPktysCNu3TUic,324
|
|
216
218
|
compass_api_sdk/morpho.py,sha256=iGvZTZ410xtwjHGDcu7rdntW49YADk9s3qv1XDk22R4,136270
|
|
217
|
-
compass_api_sdk/pendle.py,sha256=
|
|
219
|
+
compass_api_sdk/pendle.py,sha256=AQe6ZqpU3DAUV-8ihzPbUfaVn0_HKHN3BMAEjoMUgvY,79098
|
|
218
220
|
compass_api_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
219
221
|
compass_api_sdk/sdk.py,sha256=AGJs2VvvUdJ2wo29jEA2UpER8kd3mJ9HooZVlKzqpxw,7692
|
|
220
222
|
compass_api_sdk/sdkconfiguration.py,sha256=5nec4ViMLCsNWBd3DyEv8zWqU5Z77YZfzwX69jkdSnM,1607
|
|
@@ -242,6 +244,6 @@ compass_api_sdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFId
|
|
|
242
244
|
compass_api_sdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
243
245
|
compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
244
246
|
compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
245
|
-
compass_api_sdk-0.9.
|
|
246
|
-
compass_api_sdk-0.9.
|
|
247
|
-
compass_api_sdk-0.9.
|
|
247
|
+
compass_api_sdk-0.9.5.dist-info/METADATA,sha256=h8I7GfDj92UoE_8fZ-15wIeYh42eSJvAKrw7OPPTF-A,26391
|
|
248
|
+
compass_api_sdk-0.9.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
249
|
+
compass_api_sdk-0.9.5.dist-info/RECORD,,
|
|
File without changes
|