compass_api_sdk 0.9.51__py3-none-any.whl → 1.0.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.
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/aave_v3.py +198 -198
- compass_api_sdk/aerodrome_slipstream.py +108 -108
- compass_api_sdk/erc_4626_vaults.py +44 -44
- compass_api_sdk/errors/__init__.py +3 -2
- compass_api_sdk/models/__init__.py +900 -746
- compass_api_sdk/models/aaveborrowrequest.py +9 -5
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +5 -5
- compass_api_sdk/models/aavelooprequest.py +59 -11
- compass_api_sdk/models/aaverepayrequest.py +9 -5
- compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
- compass_api_sdk/models/aavesupplyrequest.py +9 -5
- compass_api_sdk/models/aavewithdrawrequest.py +9 -5
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +7 -5
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +7 -5
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +7 -5
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +7 -5
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +7 -5
- compass_api_sdk/models/batcheduseroperationsrequest.py +9 -5
- compass_api_sdk/models/chain.py +3 -3
- compass_api_sdk/models/details.py +44 -7
- compass_api_sdk/models/morphoborrowrequest.py +3 -2
- compass_api_sdk/models/morphodepositrequest.py +3 -2
- compass_api_sdk/models/morphorepayrequest.py +3 -2
- compass_api_sdk/models/morphosupplycollateralrequest.py +3 -2
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +3 -2
- compass_api_sdk/models/morphowithdrawrequest.py +3 -2
- compass_api_sdk/models/movement10percent.py +65 -10
- compass_api_sdk/models/multicallauthorizationrequest.py +9 -5
- compass_api_sdk/models/multicallexecuterequest.py +53 -10
- compass_api_sdk/models/odosswaprequest.py +9 -5
- compass_api_sdk/models/pendlemanageliquidityparams.py +81 -0
- compass_api_sdk/models/pendlemanageliquidityrequest.py +95 -0
- compass_api_sdk/models/pendleredeemyieldrequest.py +9 -5
- compass_api_sdk/models/pendletradeptparams.py +81 -0
- compass_api_sdk/models/pendletradeptrequest.py +95 -0
- compass_api_sdk/models/pendletradeytparams.py +81 -0
- compass_api_sdk/models/pendletradeytrequest.py +95 -0
- compass_api_sdk/models/pendletxresponse.py +45 -0
- compass_api_sdk/models/setallowancerequest.py +8 -5
- compass_api_sdk/models/skybuyrequest.py +7 -9
- compass_api_sdk/models/skydepositrequest.py +7 -8
- compass_api_sdk/models/skysellrequest.py +7 -9
- compass_api_sdk/models/skywithdrawrequest.py +7 -8
- compass_api_sdk/models/token_enum.py +17 -0
- compass_api_sdk/models/tokentransferparams.py +67 -0
- compass_api_sdk/models/tokentransferrequest.py +9 -5
- compass_api_sdk/models/transactionresponse.py +40 -0
- compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -24
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +28 -29
- compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +45 -0
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +9 -5
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +9 -5
- compass_api_sdk/models/uniswapsellexactlyparams.py +43 -40
- compass_api_sdk/models/uniswapsellexactlyrequest.py +52 -45
- compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +45 -0
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +9 -5
- compass_api_sdk/models/unwrapwethrequest.py +9 -5
- compass_api_sdk/models/useroperation.py +34 -40
- compass_api_sdk/models/{aave_aave_supported_tokensop.py → v1_aave_aave_supported_tokensop.py} +9 -13
- compass_api_sdk/models/{aave_avg_rateop.py → v1_aave_avg_rateop.py} +32 -19
- compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +9 -13
- compass_api_sdk/models/{aave_liquidity_changeop.py → v1_aave_liquidity_changeop.py} +30 -17
- compass_api_sdk/models/{aave_rateop.py → v1_aave_rateop.py} +32 -19
- compass_api_sdk/models/{aave_reserve_overviewop.py → v1_aave_reserve_overviewop.py} +32 -19
- compass_api_sdk/models/{aave_std_rateop.py → v1_aave_std_rateop.py} +32 -19
- compass_api_sdk/models/{aave_token_priceop.py → v1_aave_token_priceop.py} +32 -19
- compass_api_sdk/models/{aave_user_position_per_tokenop.py → v1_aave_user_position_per_tokenop.py} +32 -19
- compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +9 -13
- compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_aerodrome_slipstream_liquidity_provision_positionsop.py} +7 -13
- compass_api_sdk/models/{aerodrome_slipstream_pool_priceop.py → v1_aerodrome_slipstream_pool_priceop.py} +53 -25
- compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +24 -25
- compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +7 -13
- compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +9 -13
- compass_api_sdk/models/{generic_supported_chainsop.py → v1_generic_supported_chainsop.py} +2 -2
- compass_api_sdk/models/v1_generic_supported_tokensop.py +24 -0
- compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +9 -8
- compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +9 -8
- compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +9 -8
- compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +9 -8
- compass_api_sdk/models/{morpho_vaultop.py → v1_morpho_vaultop.py} +9 -13
- compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +9 -8
- compass_api_sdk/models/{pendle_marketop.py → v1_pendle_marketop.py} +9 -13
- compass_api_sdk/models/v1_pendle_marketsop.py +24 -0
- compass_api_sdk/models/{pendle_positionsop.py → v1_pendle_positionsop.py} +10 -14
- compass_api_sdk/models/{sky_positionop.py → v1_sky_positionop.py} +14 -15
- compass_api_sdk/models/{token_addressop.py → v1_token_addressop.py} +30 -17
- compass_api_sdk/models/{token_balanceop.py → v1_token_balanceop.py} +14 -18
- compass_api_sdk/models/{token_priceop.py → v1_token_priceop.py} +14 -18
- compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +24 -0
- compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +9 -13
- compass_api_sdk/models/{aerodrome_slipstream_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +9 -13
- compass_api_sdk/models/{uniswap_pool_priceop.py → v1_uniswap_pool_priceop.py} +59 -29
- compass_api_sdk/models/{uniswap_quote_buy_exactlyop.py → v1_uniswap_quote_buy_exactlyop.py} +65 -35
- compass_api_sdk/models/{uniswap_quote_sell_exactlyop.py → v1_uniswap_quote_sell_exactlyop.py} +65 -35
- compass_api_sdk/models/{vaults_vaultop.py → v1_vaults_vaultop.py} +9 -13
- compass_api_sdk/models/vaultdepositparams.py +85 -0
- compass_api_sdk/models/vaultdepositrequest.py +9 -5
- compass_api_sdk/models/vaultwithdrawparams.py +75 -0
- compass_api_sdk/models/vaultwithdrawrequest.py +9 -5
- compass_api_sdk/models/wrapethrequest.py +9 -5
- compass_api_sdk/morpho.py +140 -140
- compass_api_sdk/pendle.py +254 -1066
- compass_api_sdk/sky.py +98 -56
- compass_api_sdk/smart_account.py +10 -10
- compass_api_sdk/swap.py +16 -16
- compass_api_sdk/token_sdk.py +56 -56
- compass_api_sdk/transaction_bundler.py +64 -62
- compass_api_sdk/uniswap_v3.py +222 -214
- compass_api_sdk/universal.py +104 -292
- compass_api_sdk/utils/__init__.py +3 -2
- {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/METADATA +83 -88
- {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/RECORD +114 -117
- compass_api_sdk/models/generic_supported_tokensop.py +0 -28
- compass_api_sdk/models/generic_visualize_portfolioop.py +0 -37
- compass_api_sdk/models/image.py +0 -15
- compass_api_sdk/models/pendle_marketsop.py +0 -28
- compass_api_sdk/models/pendle_quoteop.py +0 -128
- compass_api_sdk/models/pendleaddliquidityparams.py +0 -50
- compass_api_sdk/models/pendleaddliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlebuyptparams.py +0 -48
- compass_api_sdk/models/pendlebuyptrequest.py +0 -59
- compass_api_sdk/models/pendlebuyytparams.py +0 -48
- compass_api_sdk/models/pendlebuyytrequest.py +0 -59
- compass_api_sdk/models/pendlegetquoteresponse.py +0 -15
- compass_api_sdk/models/pendleremoveliquidityparams.py +0 -50
- compass_api_sdk/models/pendleremoveliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlesellptparams.py +0 -48
- compass_api_sdk/models/pendlesellptrequest.py +0 -61
- compass_api_sdk/models/pendlesellytparams.py +0 -48
- compass_api_sdk/models/pendlesellytrequest.py +0 -61
- compass_api_sdk/models/txresponse.py +0 -27
- {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/WHEEL +0 -0
compass_api_sdk/pendle.py
CHANGED
|
@@ -9,10 +9,10 @@ from typing import Any, Mapping, Optional, Union
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Pendle(BaseSDK):
|
|
12
|
-
def
|
|
12
|
+
def pendle_market(
|
|
13
13
|
self,
|
|
14
14
|
*,
|
|
15
|
-
chain: models.
|
|
15
|
+
chain: models.V1PendleMarketChain = models.V1PendleMarketChain.ARBITRUM,
|
|
16
16
|
market_address: str = "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
|
|
17
17
|
block: OptionalNullable[int] = UNSET,
|
|
18
18
|
user_address: OptionalNullable[str] = UNSET,
|
|
@@ -27,7 +27,7 @@ class Pendle(BaseSDK):
|
|
|
27
27
|
|
|
28
28
|
The user position is only included if 'user_address' parameter is included.
|
|
29
29
|
|
|
30
|
-
:param chain:
|
|
30
|
+
:param chain:
|
|
31
31
|
:param market_address: The market address of the desired position.
|
|
32
32
|
:param block: Optional block number (defaults to latest).
|
|
33
33
|
:param user_address: The user address of the desired market position. Only include if you would like the user position included in the response. Defaults to `None`.
|
|
@@ -46,7 +46,7 @@ class Pendle(BaseSDK):
|
|
|
46
46
|
else:
|
|
47
47
|
base_url = self._get_url(base_url, url_variables)
|
|
48
48
|
|
|
49
|
-
request = models.
|
|
49
|
+
request = models.V1PendleMarketRequest(
|
|
50
50
|
chain=chain,
|
|
51
51
|
block=block,
|
|
52
52
|
market_address=market_address,
|
|
@@ -55,7 +55,7 @@ class Pendle(BaseSDK):
|
|
|
55
55
|
|
|
56
56
|
req = self._build_request(
|
|
57
57
|
method="GET",
|
|
58
|
-
path="/
|
|
58
|
+
path="/v1/pendle/market",
|
|
59
59
|
base_url=base_url,
|
|
60
60
|
url_variables=url_variables,
|
|
61
61
|
request=request,
|
|
@@ -81,7 +81,7 @@ class Pendle(BaseSDK):
|
|
|
81
81
|
hook_ctx=HookContext(
|
|
82
82
|
config=self.sdk_configuration,
|
|
83
83
|
base_url=base_url or "",
|
|
84
|
-
operation_id="
|
|
84
|
+
operation_id="v1_pendle_market",
|
|
85
85
|
oauth2_scopes=[],
|
|
86
86
|
security_source=self.sdk_configuration.security,
|
|
87
87
|
),
|
|
@@ -107,10 +107,10 @@ class Pendle(BaseSDK):
|
|
|
107
107
|
|
|
108
108
|
raise errors.APIError("Unexpected response received", http_res)
|
|
109
109
|
|
|
110
|
-
async def
|
|
110
|
+
async def pendle_market_async(
|
|
111
111
|
self,
|
|
112
112
|
*,
|
|
113
|
-
chain: models.
|
|
113
|
+
chain: models.V1PendleMarketChain = models.V1PendleMarketChain.ARBITRUM,
|
|
114
114
|
market_address: str = "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
|
|
115
115
|
block: OptionalNullable[int] = UNSET,
|
|
116
116
|
user_address: OptionalNullable[str] = UNSET,
|
|
@@ -125,7 +125,7 @@ class Pendle(BaseSDK):
|
|
|
125
125
|
|
|
126
126
|
The user position is only included if 'user_address' parameter is included.
|
|
127
127
|
|
|
128
|
-
:param chain:
|
|
128
|
+
:param chain:
|
|
129
129
|
:param market_address: The market address of the desired position.
|
|
130
130
|
:param block: Optional block number (defaults to latest).
|
|
131
131
|
:param user_address: The user address of the desired market position. Only include if you would like the user position included in the response. Defaults to `None`.
|
|
@@ -144,7 +144,7 @@ class Pendle(BaseSDK):
|
|
|
144
144
|
else:
|
|
145
145
|
base_url = self._get_url(base_url, url_variables)
|
|
146
146
|
|
|
147
|
-
request = models.
|
|
147
|
+
request = models.V1PendleMarketRequest(
|
|
148
148
|
chain=chain,
|
|
149
149
|
block=block,
|
|
150
150
|
market_address=market_address,
|
|
@@ -153,7 +153,7 @@ class Pendle(BaseSDK):
|
|
|
153
153
|
|
|
154
154
|
req = self._build_request_async(
|
|
155
155
|
method="GET",
|
|
156
|
-
path="/
|
|
156
|
+
path="/v1/pendle/market",
|
|
157
157
|
base_url=base_url,
|
|
158
158
|
url_variables=url_variables,
|
|
159
159
|
request=request,
|
|
@@ -179,7 +179,7 @@ class Pendle(BaseSDK):
|
|
|
179
179
|
hook_ctx=HookContext(
|
|
180
180
|
config=self.sdk_configuration,
|
|
181
181
|
base_url=base_url or "",
|
|
182
|
-
operation_id="
|
|
182
|
+
operation_id="v1_pendle_market",
|
|
183
183
|
oauth2_scopes=[],
|
|
184
184
|
security_source=self.sdk_configuration.security,
|
|
185
185
|
),
|
|
@@ -205,11 +205,11 @@ class Pendle(BaseSDK):
|
|
|
205
205
|
|
|
206
206
|
raise errors.APIError("Unexpected response received", http_res)
|
|
207
207
|
|
|
208
|
-
def
|
|
208
|
+
def pendle_positions(
|
|
209
209
|
self,
|
|
210
210
|
*,
|
|
211
|
-
chain: models.
|
|
212
|
-
user_address: str = "
|
|
211
|
+
chain: models.V1PendlePositionsChain = models.V1PendlePositionsChain.ARBITRUM,
|
|
212
|
+
user_address: str = "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
|
|
213
213
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
214
214
|
server_url: Optional[str] = None,
|
|
215
215
|
timeout_ms: Optional[int] = None,
|
|
@@ -219,7 +219,7 @@ class Pendle(BaseSDK):
|
|
|
219
219
|
|
|
220
220
|
List the user's SY, PT, YT and LP positions for all markets on a given chain.
|
|
221
221
|
|
|
222
|
-
:param chain:
|
|
222
|
+
:param chain:
|
|
223
223
|
:param user_address: The user address of the desired position.
|
|
224
224
|
:param retries: Override the default retry configuration for this method
|
|
225
225
|
:param server_url: Override the default server URL for this method
|
|
@@ -236,14 +236,14 @@ class Pendle(BaseSDK):
|
|
|
236
236
|
else:
|
|
237
237
|
base_url = self._get_url(base_url, url_variables)
|
|
238
238
|
|
|
239
|
-
request = models.
|
|
239
|
+
request = models.V1PendlePositionsRequest(
|
|
240
240
|
chain=chain,
|
|
241
241
|
user_address=user_address,
|
|
242
242
|
)
|
|
243
243
|
|
|
244
244
|
req = self._build_request(
|
|
245
245
|
method="GET",
|
|
246
|
-
path="/
|
|
246
|
+
path="/v1/pendle/positions",
|
|
247
247
|
base_url=base_url,
|
|
248
248
|
url_variables=url_variables,
|
|
249
249
|
request=request,
|
|
@@ -269,7 +269,7 @@ class Pendle(BaseSDK):
|
|
|
269
269
|
hook_ctx=HookContext(
|
|
270
270
|
config=self.sdk_configuration,
|
|
271
271
|
base_url=base_url or "",
|
|
272
|
-
operation_id="
|
|
272
|
+
operation_id="v1_pendle_positions",
|
|
273
273
|
oauth2_scopes=[],
|
|
274
274
|
security_source=self.sdk_configuration.security,
|
|
275
275
|
),
|
|
@@ -297,11 +297,11 @@ class Pendle(BaseSDK):
|
|
|
297
297
|
|
|
298
298
|
raise errors.APIError("Unexpected response received", http_res)
|
|
299
299
|
|
|
300
|
-
async def
|
|
300
|
+
async def pendle_positions_async(
|
|
301
301
|
self,
|
|
302
302
|
*,
|
|
303
|
-
chain: models.
|
|
304
|
-
user_address: str = "
|
|
303
|
+
chain: models.V1PendlePositionsChain = models.V1PendlePositionsChain.ARBITRUM,
|
|
304
|
+
user_address: str = "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
|
|
305
305
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
306
306
|
server_url: Optional[str] = None,
|
|
307
307
|
timeout_ms: Optional[int] = None,
|
|
@@ -311,7 +311,7 @@ class Pendle(BaseSDK):
|
|
|
311
311
|
|
|
312
312
|
List the user's SY, PT, YT and LP positions for all markets on a given chain.
|
|
313
313
|
|
|
314
|
-
:param chain:
|
|
314
|
+
:param chain:
|
|
315
315
|
:param user_address: The user address of the desired position.
|
|
316
316
|
:param retries: Override the default retry configuration for this method
|
|
317
317
|
:param server_url: Override the default server URL for this method
|
|
@@ -328,14 +328,14 @@ class Pendle(BaseSDK):
|
|
|
328
328
|
else:
|
|
329
329
|
base_url = self._get_url(base_url, url_variables)
|
|
330
330
|
|
|
331
|
-
request = models.
|
|
331
|
+
request = models.V1PendlePositionsRequest(
|
|
332
332
|
chain=chain,
|
|
333
333
|
user_address=user_address,
|
|
334
334
|
)
|
|
335
335
|
|
|
336
336
|
req = self._build_request_async(
|
|
337
337
|
method="GET",
|
|
338
|
-
path="/
|
|
338
|
+
path="/v1/pendle/positions",
|
|
339
339
|
base_url=base_url,
|
|
340
340
|
url_variables=url_variables,
|
|
341
341
|
request=request,
|
|
@@ -361,7 +361,7 @@ class Pendle(BaseSDK):
|
|
|
361
361
|
hook_ctx=HookContext(
|
|
362
362
|
config=self.sdk_configuration,
|
|
363
363
|
base_url=base_url or "",
|
|
364
|
-
operation_id="
|
|
364
|
+
operation_id="v1_pendle_positions",
|
|
365
365
|
oauth2_scopes=[],
|
|
366
366
|
security_source=self.sdk_configuration.security,
|
|
367
367
|
),
|
|
@@ -389,10 +389,10 @@ class Pendle(BaseSDK):
|
|
|
389
389
|
|
|
390
390
|
raise errors.APIError("Unexpected response received", http_res)
|
|
391
391
|
|
|
392
|
-
def
|
|
392
|
+
def pendle_markets(
|
|
393
393
|
self,
|
|
394
394
|
*,
|
|
395
|
-
chain: models.
|
|
395
|
+
chain: models.V1PendleMarketsChain = models.V1PendleMarketsChain.ARBITRUM,
|
|
396
396
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
397
397
|
server_url: Optional[str] = None,
|
|
398
398
|
timeout_ms: Optional[int] = None,
|
|
@@ -402,7 +402,7 @@ class Pendle(BaseSDK):
|
|
|
402
402
|
|
|
403
403
|
Get a list of active markets.
|
|
404
404
|
|
|
405
|
-
:param chain:
|
|
405
|
+
:param chain:
|
|
406
406
|
:param retries: Override the default retry configuration for this method
|
|
407
407
|
:param server_url: Override the default server URL for this method
|
|
408
408
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -418,13 +418,13 @@ class Pendle(BaseSDK):
|
|
|
418
418
|
else:
|
|
419
419
|
base_url = self._get_url(base_url, url_variables)
|
|
420
420
|
|
|
421
|
-
request = models.
|
|
421
|
+
request = models.V1PendleMarketsRequest(
|
|
422
422
|
chain=chain,
|
|
423
423
|
)
|
|
424
424
|
|
|
425
425
|
req = self._build_request(
|
|
426
426
|
method="GET",
|
|
427
|
-
path="/
|
|
427
|
+
path="/v1/pendle/markets",
|
|
428
428
|
base_url=base_url,
|
|
429
429
|
url_variables=url_variables,
|
|
430
430
|
request=request,
|
|
@@ -450,7 +450,7 @@ class Pendle(BaseSDK):
|
|
|
450
450
|
hook_ctx=HookContext(
|
|
451
451
|
config=self.sdk_configuration,
|
|
452
452
|
base_url=base_url or "",
|
|
453
|
-
operation_id="
|
|
453
|
+
operation_id="v1_pendle_markets",
|
|
454
454
|
oauth2_scopes=[],
|
|
455
455
|
security_source=self.sdk_configuration.security,
|
|
456
456
|
),
|
|
@@ -476,10 +476,10 @@ class Pendle(BaseSDK):
|
|
|
476
476
|
|
|
477
477
|
raise errors.APIError("Unexpected response received", http_res)
|
|
478
478
|
|
|
479
|
-
async def
|
|
479
|
+
async def pendle_markets_async(
|
|
480
480
|
self,
|
|
481
481
|
*,
|
|
482
|
-
chain: models.
|
|
482
|
+
chain: models.V1PendleMarketsChain = models.V1PendleMarketsChain.ARBITRUM,
|
|
483
483
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
484
484
|
server_url: Optional[str] = None,
|
|
485
485
|
timeout_ms: Optional[int] = None,
|
|
@@ -489,7 +489,7 @@ class Pendle(BaseSDK):
|
|
|
489
489
|
|
|
490
490
|
Get a list of active markets.
|
|
491
491
|
|
|
492
|
-
:param chain:
|
|
492
|
+
:param chain:
|
|
493
493
|
:param retries: Override the default retry configuration for this method
|
|
494
494
|
:param server_url: Override the default server URL for this method
|
|
495
495
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -505,13 +505,13 @@ class Pendle(BaseSDK):
|
|
|
505
505
|
else:
|
|
506
506
|
base_url = self._get_url(base_url, url_variables)
|
|
507
507
|
|
|
508
|
-
request = models.
|
|
508
|
+
request = models.V1PendleMarketsRequest(
|
|
509
509
|
chain=chain,
|
|
510
510
|
)
|
|
511
511
|
|
|
512
512
|
req = self._build_request_async(
|
|
513
513
|
method="GET",
|
|
514
|
-
path="/
|
|
514
|
+
path="/v1/pendle/markets",
|
|
515
515
|
base_url=base_url,
|
|
516
516
|
url_variables=url_variables,
|
|
517
517
|
request=request,
|
|
@@ -537,7 +537,7 @@ class Pendle(BaseSDK):
|
|
|
537
537
|
hook_ctx=HookContext(
|
|
538
538
|
config=self.sdk_configuration,
|
|
539
539
|
base_url=base_url or "",
|
|
540
|
-
operation_id="
|
|
540
|
+
operation_id="v1_pendle_markets",
|
|
541
541
|
oauth2_scopes=[],
|
|
542
542
|
security_source=self.sdk_configuration.security,
|
|
543
543
|
),
|
|
@@ -563,699 +563,49 @@ class Pendle(BaseSDK):
|
|
|
563
563
|
|
|
564
564
|
raise errors.APIError("Unexpected response received", http_res)
|
|
565
565
|
|
|
566
|
-
def
|
|
567
|
-
self,
|
|
568
|
-
*,
|
|
569
|
-
chain: models.PendleQuoteChain = models.PendleQuoteChain.ARBITRUM_MAINNET,
|
|
570
|
-
market_address: str = "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
|
|
571
|
-
amount: Union[models.PendleQuoteAmount, models.PendleQuoteAmountTypedDict],
|
|
572
|
-
token_type: models.TokenType = models.TokenType.PT,
|
|
573
|
-
trade_type: models.TradeType = models.TradeType.BUY,
|
|
574
|
-
block: OptionalNullable[int] = UNSET,
|
|
575
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
576
|
-
server_url: Optional[str] = None,
|
|
577
|
-
timeout_ms: Optional[int] = None,
|
|
578
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
579
|
-
) -> models.PendleGetQuoteResponse:
|
|
580
|
-
r"""Get Quote
|
|
581
|
-
|
|
582
|
-
Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
|
|
583
|
-
Provider Token (LP) on Pendle.
|
|
584
|
-
|
|
585
|
-
For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
|
|
586
|
-
|
|
587
|
-
For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
|
|
588
|
-
|
|
589
|
-
:param chain: The chain to use.
|
|
590
|
-
:param market_address: The market address of the desired position.
|
|
591
|
-
:param amount: The quantity to trade.
|
|
592
|
-
:param token_type: Specifies the token to quote (`PT`, `YT`, or `LP`)
|
|
593
|
-
:param trade_type: Specifies the trade direction (`BUY` or `SELL`)
|
|
594
|
-
:param block: Optional block number (defaults to latest).
|
|
595
|
-
:param retries: Override the default retry configuration for this method
|
|
596
|
-
:param server_url: Override the default server URL for this method
|
|
597
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
598
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
599
|
-
"""
|
|
600
|
-
base_url = None
|
|
601
|
-
url_variables = None
|
|
602
|
-
if timeout_ms is None:
|
|
603
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
604
|
-
|
|
605
|
-
if server_url is not None:
|
|
606
|
-
base_url = server_url
|
|
607
|
-
else:
|
|
608
|
-
base_url = self._get_url(base_url, url_variables)
|
|
609
|
-
|
|
610
|
-
request = models.PendleQuoteRequest(
|
|
611
|
-
chain=chain,
|
|
612
|
-
block=block,
|
|
613
|
-
market_address=market_address,
|
|
614
|
-
amount=amount,
|
|
615
|
-
token_type=token_type,
|
|
616
|
-
trade_type=trade_type,
|
|
617
|
-
)
|
|
618
|
-
|
|
619
|
-
req = self._build_request(
|
|
620
|
-
method="GET",
|
|
621
|
-
path="/v0/pendle/quote",
|
|
622
|
-
base_url=base_url,
|
|
623
|
-
url_variables=url_variables,
|
|
624
|
-
request=request,
|
|
625
|
-
request_body_required=False,
|
|
626
|
-
request_has_path_params=False,
|
|
627
|
-
request_has_query_params=True,
|
|
628
|
-
user_agent_header="user-agent",
|
|
629
|
-
accept_header_value="application/json",
|
|
630
|
-
http_headers=http_headers,
|
|
631
|
-
security=self.sdk_configuration.security,
|
|
632
|
-
timeout_ms=timeout_ms,
|
|
633
|
-
)
|
|
634
|
-
|
|
635
|
-
if retries == UNSET:
|
|
636
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
637
|
-
retries = self.sdk_configuration.retry_config
|
|
638
|
-
|
|
639
|
-
retry_config = None
|
|
640
|
-
if isinstance(retries, utils.RetryConfig):
|
|
641
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
642
|
-
|
|
643
|
-
http_res = self.do_request(
|
|
644
|
-
hook_ctx=HookContext(
|
|
645
|
-
config=self.sdk_configuration,
|
|
646
|
-
base_url=base_url or "",
|
|
647
|
-
operation_id="pendle_quote",
|
|
648
|
-
oauth2_scopes=[],
|
|
649
|
-
security_source=self.sdk_configuration.security,
|
|
650
|
-
),
|
|
651
|
-
request=req,
|
|
652
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
653
|
-
retry_config=retry_config,
|
|
654
|
-
)
|
|
655
|
-
|
|
656
|
-
response_data: Any = None
|
|
657
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
658
|
-
return unmarshal_json_response(models.PendleGetQuoteResponse, http_res)
|
|
659
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
660
|
-
response_data = unmarshal_json_response(
|
|
661
|
-
errors.HTTPValidationErrorData, http_res
|
|
662
|
-
)
|
|
663
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
664
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
665
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
666
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
667
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
668
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
669
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
670
|
-
|
|
671
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
672
|
-
|
|
673
|
-
async def quote_async(
|
|
674
|
-
self,
|
|
675
|
-
*,
|
|
676
|
-
chain: models.PendleQuoteChain = models.PendleQuoteChain.ARBITRUM_MAINNET,
|
|
677
|
-
market_address: str = "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
|
|
678
|
-
amount: Union[models.PendleQuoteAmount, models.PendleQuoteAmountTypedDict],
|
|
679
|
-
token_type: models.TokenType = models.TokenType.PT,
|
|
680
|
-
trade_type: models.TradeType = models.TradeType.BUY,
|
|
681
|
-
block: OptionalNullable[int] = UNSET,
|
|
682
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
683
|
-
server_url: Optional[str] = None,
|
|
684
|
-
timeout_ms: Optional[int] = None,
|
|
685
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
686
|
-
) -> models.PendleGetQuoteResponse:
|
|
687
|
-
r"""Get Quote
|
|
688
|
-
|
|
689
|
-
Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
|
|
690
|
-
Provider Token (LP) on Pendle.
|
|
691
|
-
|
|
692
|
-
For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
|
|
693
|
-
|
|
694
|
-
For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
|
|
695
|
-
|
|
696
|
-
:param chain: The chain to use.
|
|
697
|
-
:param market_address: The market address of the desired position.
|
|
698
|
-
:param amount: The quantity to trade.
|
|
699
|
-
:param token_type: Specifies the token to quote (`PT`, `YT`, or `LP`)
|
|
700
|
-
:param trade_type: Specifies the trade direction (`BUY` or `SELL`)
|
|
701
|
-
:param block: Optional block number (defaults to latest).
|
|
702
|
-
:param retries: Override the default retry configuration for this method
|
|
703
|
-
:param server_url: Override the default server URL for this method
|
|
704
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
705
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
706
|
-
"""
|
|
707
|
-
base_url = None
|
|
708
|
-
url_variables = None
|
|
709
|
-
if timeout_ms is None:
|
|
710
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
711
|
-
|
|
712
|
-
if server_url is not None:
|
|
713
|
-
base_url = server_url
|
|
714
|
-
else:
|
|
715
|
-
base_url = self._get_url(base_url, url_variables)
|
|
716
|
-
|
|
717
|
-
request = models.PendleQuoteRequest(
|
|
718
|
-
chain=chain,
|
|
719
|
-
block=block,
|
|
720
|
-
market_address=market_address,
|
|
721
|
-
amount=amount,
|
|
722
|
-
token_type=token_type,
|
|
723
|
-
trade_type=trade_type,
|
|
724
|
-
)
|
|
725
|
-
|
|
726
|
-
req = self._build_request_async(
|
|
727
|
-
method="GET",
|
|
728
|
-
path="/v0/pendle/quote",
|
|
729
|
-
base_url=base_url,
|
|
730
|
-
url_variables=url_variables,
|
|
731
|
-
request=request,
|
|
732
|
-
request_body_required=False,
|
|
733
|
-
request_has_path_params=False,
|
|
734
|
-
request_has_query_params=True,
|
|
735
|
-
user_agent_header="user-agent",
|
|
736
|
-
accept_header_value="application/json",
|
|
737
|
-
http_headers=http_headers,
|
|
738
|
-
security=self.sdk_configuration.security,
|
|
739
|
-
timeout_ms=timeout_ms,
|
|
740
|
-
)
|
|
741
|
-
|
|
742
|
-
if retries == UNSET:
|
|
743
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
744
|
-
retries = self.sdk_configuration.retry_config
|
|
745
|
-
|
|
746
|
-
retry_config = None
|
|
747
|
-
if isinstance(retries, utils.RetryConfig):
|
|
748
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
749
|
-
|
|
750
|
-
http_res = await self.do_request_async(
|
|
751
|
-
hook_ctx=HookContext(
|
|
752
|
-
config=self.sdk_configuration,
|
|
753
|
-
base_url=base_url or "",
|
|
754
|
-
operation_id="pendle_quote",
|
|
755
|
-
oauth2_scopes=[],
|
|
756
|
-
security_source=self.sdk_configuration.security,
|
|
757
|
-
),
|
|
758
|
-
request=req,
|
|
759
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
760
|
-
retry_config=retry_config,
|
|
761
|
-
)
|
|
762
|
-
|
|
763
|
-
response_data: Any = None
|
|
764
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
765
|
-
return unmarshal_json_response(models.PendleGetQuoteResponse, http_res)
|
|
766
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
767
|
-
response_data = unmarshal_json_response(
|
|
768
|
-
errors.HTTPValidationErrorData, http_res
|
|
769
|
-
)
|
|
770
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
771
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
772
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
773
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
774
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
775
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
776
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
777
|
-
|
|
778
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
779
|
-
|
|
780
|
-
def buy_pt(
|
|
781
|
-
self,
|
|
782
|
-
*,
|
|
783
|
-
market_address: str,
|
|
784
|
-
amount: Union[
|
|
785
|
-
models.PendleBuyPtRequestAmount, models.PendleBuyPtRequestAmountTypedDict
|
|
786
|
-
],
|
|
787
|
-
max_slippage_percent: float,
|
|
788
|
-
chain: models.Chain,
|
|
789
|
-
sender: str,
|
|
790
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
791
|
-
server_url: Optional[str] = None,
|
|
792
|
-
timeout_ms: Optional[int] = None,
|
|
793
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
794
|
-
) -> models.TxResponse:
|
|
795
|
-
r"""Buy Principal Token (PT)
|
|
796
|
-
|
|
797
|
-
Buy Principal Token (PT) with market's Underlying Token.
|
|
798
|
-
<Info>
|
|
799
|
-
**Required Allowances**
|
|
800
|
-
|
|
801
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
802
|
-
|
|
803
|
-
- `PendleRouter`
|
|
804
|
-
</Info>
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
:param market_address: The address of the market identifying which Principal Token (PT) you would like to buy.
|
|
808
|
-
:param amount: The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
|
|
809
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
810
|
-
:param chain: The chain to use.
|
|
811
|
-
:param sender: The address of the transaction sender.
|
|
812
|
-
:param retries: Override the default retry configuration for this method
|
|
813
|
-
:param server_url: Override the default server URL for this method
|
|
814
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
815
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
816
|
-
"""
|
|
817
|
-
base_url = None
|
|
818
|
-
url_variables = None
|
|
819
|
-
if timeout_ms is None:
|
|
820
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
821
|
-
|
|
822
|
-
if server_url is not None:
|
|
823
|
-
base_url = server_url
|
|
824
|
-
else:
|
|
825
|
-
base_url = self._get_url(base_url, url_variables)
|
|
826
|
-
|
|
827
|
-
request = models.PendleBuyPtRequest(
|
|
828
|
-
market_address=market_address,
|
|
829
|
-
amount=amount,
|
|
830
|
-
max_slippage_percent=max_slippage_percent,
|
|
831
|
-
chain=chain,
|
|
832
|
-
sender=sender,
|
|
833
|
-
)
|
|
834
|
-
|
|
835
|
-
req = self._build_request(
|
|
836
|
-
method="POST",
|
|
837
|
-
path="/v0/pendle/buy_pt",
|
|
838
|
-
base_url=base_url,
|
|
839
|
-
url_variables=url_variables,
|
|
840
|
-
request=request,
|
|
841
|
-
request_body_required=True,
|
|
842
|
-
request_has_path_params=False,
|
|
843
|
-
request_has_query_params=True,
|
|
844
|
-
user_agent_header="user-agent",
|
|
845
|
-
accept_header_value="application/json",
|
|
846
|
-
http_headers=http_headers,
|
|
847
|
-
security=self.sdk_configuration.security,
|
|
848
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
849
|
-
request, False, False, "json", models.PendleBuyPtRequest
|
|
850
|
-
),
|
|
851
|
-
timeout_ms=timeout_ms,
|
|
852
|
-
)
|
|
853
|
-
|
|
854
|
-
if retries == UNSET:
|
|
855
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
856
|
-
retries = self.sdk_configuration.retry_config
|
|
857
|
-
|
|
858
|
-
retry_config = None
|
|
859
|
-
if isinstance(retries, utils.RetryConfig):
|
|
860
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
861
|
-
|
|
862
|
-
http_res = self.do_request(
|
|
863
|
-
hook_ctx=HookContext(
|
|
864
|
-
config=self.sdk_configuration,
|
|
865
|
-
base_url=base_url or "",
|
|
866
|
-
operation_id="pendle_buy_pt",
|
|
867
|
-
oauth2_scopes=[],
|
|
868
|
-
security_source=self.sdk_configuration.security,
|
|
869
|
-
),
|
|
870
|
-
request=req,
|
|
871
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
872
|
-
retry_config=retry_config,
|
|
873
|
-
)
|
|
874
|
-
|
|
875
|
-
response_data: Any = None
|
|
876
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
877
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
878
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
879
|
-
response_data = unmarshal_json_response(
|
|
880
|
-
errors.HTTPValidationErrorData, http_res
|
|
881
|
-
)
|
|
882
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
883
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
884
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
885
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
886
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
887
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
888
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
889
|
-
|
|
890
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
891
|
-
|
|
892
|
-
async def buy_pt_async(
|
|
893
|
-
self,
|
|
894
|
-
*,
|
|
895
|
-
market_address: str,
|
|
896
|
-
amount: Union[
|
|
897
|
-
models.PendleBuyPtRequestAmount, models.PendleBuyPtRequestAmountTypedDict
|
|
898
|
-
],
|
|
899
|
-
max_slippage_percent: float,
|
|
900
|
-
chain: models.Chain,
|
|
901
|
-
sender: str,
|
|
902
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
903
|
-
server_url: Optional[str] = None,
|
|
904
|
-
timeout_ms: Optional[int] = None,
|
|
905
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
906
|
-
) -> models.TxResponse:
|
|
907
|
-
r"""Buy Principal Token (PT)
|
|
908
|
-
|
|
909
|
-
Buy Principal Token (PT) with market's Underlying Token.
|
|
910
|
-
<Info>
|
|
911
|
-
**Required Allowances**
|
|
912
|
-
|
|
913
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
914
|
-
|
|
915
|
-
- `PendleRouter`
|
|
916
|
-
</Info>
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
:param market_address: The address of the market identifying which Principal Token (PT) you would like to buy.
|
|
920
|
-
:param amount: The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
|
|
921
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
922
|
-
:param chain: The chain to use.
|
|
923
|
-
:param sender: The address of the transaction sender.
|
|
924
|
-
:param retries: Override the default retry configuration for this method
|
|
925
|
-
:param server_url: Override the default server URL for this method
|
|
926
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
927
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
928
|
-
"""
|
|
929
|
-
base_url = None
|
|
930
|
-
url_variables = None
|
|
931
|
-
if timeout_ms is None:
|
|
932
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
933
|
-
|
|
934
|
-
if server_url is not None:
|
|
935
|
-
base_url = server_url
|
|
936
|
-
else:
|
|
937
|
-
base_url = self._get_url(base_url, url_variables)
|
|
938
|
-
|
|
939
|
-
request = models.PendleBuyPtRequest(
|
|
940
|
-
market_address=market_address,
|
|
941
|
-
amount=amount,
|
|
942
|
-
max_slippage_percent=max_slippage_percent,
|
|
943
|
-
chain=chain,
|
|
944
|
-
sender=sender,
|
|
945
|
-
)
|
|
946
|
-
|
|
947
|
-
req = self._build_request_async(
|
|
948
|
-
method="POST",
|
|
949
|
-
path="/v0/pendle/buy_pt",
|
|
950
|
-
base_url=base_url,
|
|
951
|
-
url_variables=url_variables,
|
|
952
|
-
request=request,
|
|
953
|
-
request_body_required=True,
|
|
954
|
-
request_has_path_params=False,
|
|
955
|
-
request_has_query_params=True,
|
|
956
|
-
user_agent_header="user-agent",
|
|
957
|
-
accept_header_value="application/json",
|
|
958
|
-
http_headers=http_headers,
|
|
959
|
-
security=self.sdk_configuration.security,
|
|
960
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
961
|
-
request, False, False, "json", models.PendleBuyPtRequest
|
|
962
|
-
),
|
|
963
|
-
timeout_ms=timeout_ms,
|
|
964
|
-
)
|
|
965
|
-
|
|
966
|
-
if retries == UNSET:
|
|
967
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
968
|
-
retries = self.sdk_configuration.retry_config
|
|
969
|
-
|
|
970
|
-
retry_config = None
|
|
971
|
-
if isinstance(retries, utils.RetryConfig):
|
|
972
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
973
|
-
|
|
974
|
-
http_res = await self.do_request_async(
|
|
975
|
-
hook_ctx=HookContext(
|
|
976
|
-
config=self.sdk_configuration,
|
|
977
|
-
base_url=base_url or "",
|
|
978
|
-
operation_id="pendle_buy_pt",
|
|
979
|
-
oauth2_scopes=[],
|
|
980
|
-
security_source=self.sdk_configuration.security,
|
|
981
|
-
),
|
|
982
|
-
request=req,
|
|
983
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
984
|
-
retry_config=retry_config,
|
|
985
|
-
)
|
|
986
|
-
|
|
987
|
-
response_data: Any = None
|
|
988
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
989
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
990
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
991
|
-
response_data = unmarshal_json_response(
|
|
992
|
-
errors.HTTPValidationErrorData, http_res
|
|
993
|
-
)
|
|
994
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
995
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
996
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
997
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
998
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
999
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1000
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1001
|
-
|
|
1002
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1003
|
-
|
|
1004
|
-
def sell_pt(
|
|
1005
|
-
self,
|
|
1006
|
-
*,
|
|
1007
|
-
market_address: str,
|
|
1008
|
-
amount: Union[
|
|
1009
|
-
models.PendleSellPtRequestAmount, models.PendleSellPtRequestAmountTypedDict
|
|
1010
|
-
],
|
|
1011
|
-
max_slippage_percent: float,
|
|
1012
|
-
chain: models.Chain,
|
|
1013
|
-
sender: str,
|
|
1014
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1015
|
-
server_url: Optional[str] = None,
|
|
1016
|
-
timeout_ms: Optional[int] = None,
|
|
1017
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1018
|
-
) -> models.TxResponse:
|
|
1019
|
-
r"""Sell Principal Token (PT)
|
|
1020
|
-
|
|
1021
|
-
Sell Principal Token (PT) for the market's Underlying Token.
|
|
1022
|
-
<Info>
|
|
1023
|
-
**Required Allowances**
|
|
1024
|
-
|
|
1025
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
1026
|
-
|
|
1027
|
-
- `PendleRouter`
|
|
1028
|
-
</Info>
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
:param market_address: The address of the market identifying which Principal Token (PT) you would like to sell.
|
|
1032
|
-
:param amount: The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
|
|
1033
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1034
|
-
:param chain: The chain to use.
|
|
1035
|
-
:param sender: The address of the transaction sender.
|
|
1036
|
-
:param retries: Override the default retry configuration for this method
|
|
1037
|
-
:param server_url: Override the default server URL for this method
|
|
1038
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1039
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1040
|
-
"""
|
|
1041
|
-
base_url = None
|
|
1042
|
-
url_variables = None
|
|
1043
|
-
if timeout_ms is None:
|
|
1044
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1045
|
-
|
|
1046
|
-
if server_url is not None:
|
|
1047
|
-
base_url = server_url
|
|
1048
|
-
else:
|
|
1049
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1050
|
-
|
|
1051
|
-
request = models.PendleSellPtRequest(
|
|
1052
|
-
market_address=market_address,
|
|
1053
|
-
amount=amount,
|
|
1054
|
-
max_slippage_percent=max_slippage_percent,
|
|
1055
|
-
chain=chain,
|
|
1056
|
-
sender=sender,
|
|
1057
|
-
)
|
|
1058
|
-
|
|
1059
|
-
req = self._build_request(
|
|
1060
|
-
method="POST",
|
|
1061
|
-
path="/v0/pendle/sell_pt",
|
|
1062
|
-
base_url=base_url,
|
|
1063
|
-
url_variables=url_variables,
|
|
1064
|
-
request=request,
|
|
1065
|
-
request_body_required=True,
|
|
1066
|
-
request_has_path_params=False,
|
|
1067
|
-
request_has_query_params=True,
|
|
1068
|
-
user_agent_header="user-agent",
|
|
1069
|
-
accept_header_value="application/json",
|
|
1070
|
-
http_headers=http_headers,
|
|
1071
|
-
security=self.sdk_configuration.security,
|
|
1072
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1073
|
-
request, False, False, "json", models.PendleSellPtRequest
|
|
1074
|
-
),
|
|
1075
|
-
timeout_ms=timeout_ms,
|
|
1076
|
-
)
|
|
1077
|
-
|
|
1078
|
-
if retries == UNSET:
|
|
1079
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1080
|
-
retries = self.sdk_configuration.retry_config
|
|
1081
|
-
|
|
1082
|
-
retry_config = None
|
|
1083
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1084
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1085
|
-
|
|
1086
|
-
http_res = self.do_request(
|
|
1087
|
-
hook_ctx=HookContext(
|
|
1088
|
-
config=self.sdk_configuration,
|
|
1089
|
-
base_url=base_url or "",
|
|
1090
|
-
operation_id="pendle_sell_pt",
|
|
1091
|
-
oauth2_scopes=[],
|
|
1092
|
-
security_source=self.sdk_configuration.security,
|
|
1093
|
-
),
|
|
1094
|
-
request=req,
|
|
1095
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1096
|
-
retry_config=retry_config,
|
|
1097
|
-
)
|
|
1098
|
-
|
|
1099
|
-
response_data: Any = None
|
|
1100
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1101
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
1102
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1103
|
-
response_data = unmarshal_json_response(
|
|
1104
|
-
errors.HTTPValidationErrorData, http_res
|
|
1105
|
-
)
|
|
1106
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
1107
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1108
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1109
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1110
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1111
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1112
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1113
|
-
|
|
1114
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1115
|
-
|
|
1116
|
-
async def sell_pt_async(
|
|
1117
|
-
self,
|
|
1118
|
-
*,
|
|
1119
|
-
market_address: str,
|
|
1120
|
-
amount: Union[
|
|
1121
|
-
models.PendleSellPtRequestAmount, models.PendleSellPtRequestAmountTypedDict
|
|
1122
|
-
],
|
|
1123
|
-
max_slippage_percent: float,
|
|
1124
|
-
chain: models.Chain,
|
|
1125
|
-
sender: str,
|
|
1126
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1127
|
-
server_url: Optional[str] = None,
|
|
1128
|
-
timeout_ms: Optional[int] = None,
|
|
1129
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1130
|
-
) -> models.TxResponse:
|
|
1131
|
-
r"""Sell Principal Token (PT)
|
|
1132
|
-
|
|
1133
|
-
Sell Principal Token (PT) for the market's Underlying Token.
|
|
1134
|
-
<Info>
|
|
1135
|
-
**Required Allowances**
|
|
1136
|
-
|
|
1137
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
1138
|
-
|
|
1139
|
-
- `PendleRouter`
|
|
1140
|
-
</Info>
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
:param market_address: The address of the market identifying which Principal Token (PT) you would like to sell.
|
|
1144
|
-
:param amount: The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
|
|
1145
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1146
|
-
:param chain: The chain to use.
|
|
1147
|
-
:param sender: The address of the transaction sender.
|
|
1148
|
-
:param retries: Override the default retry configuration for this method
|
|
1149
|
-
:param server_url: Override the default server URL for this method
|
|
1150
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1151
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1152
|
-
"""
|
|
1153
|
-
base_url = None
|
|
1154
|
-
url_variables = None
|
|
1155
|
-
if timeout_ms is None:
|
|
1156
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1157
|
-
|
|
1158
|
-
if server_url is not None:
|
|
1159
|
-
base_url = server_url
|
|
1160
|
-
else:
|
|
1161
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1162
|
-
|
|
1163
|
-
request = models.PendleSellPtRequest(
|
|
1164
|
-
market_address=market_address,
|
|
1165
|
-
amount=amount,
|
|
1166
|
-
max_slippage_percent=max_slippage_percent,
|
|
1167
|
-
chain=chain,
|
|
1168
|
-
sender=sender,
|
|
1169
|
-
)
|
|
1170
|
-
|
|
1171
|
-
req = self._build_request_async(
|
|
1172
|
-
method="POST",
|
|
1173
|
-
path="/v0/pendle/sell_pt",
|
|
1174
|
-
base_url=base_url,
|
|
1175
|
-
url_variables=url_variables,
|
|
1176
|
-
request=request,
|
|
1177
|
-
request_body_required=True,
|
|
1178
|
-
request_has_path_params=False,
|
|
1179
|
-
request_has_query_params=True,
|
|
1180
|
-
user_agent_header="user-agent",
|
|
1181
|
-
accept_header_value="application/json",
|
|
1182
|
-
http_headers=http_headers,
|
|
1183
|
-
security=self.sdk_configuration.security,
|
|
1184
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1185
|
-
request, False, False, "json", models.PendleSellPtRequest
|
|
1186
|
-
),
|
|
1187
|
-
timeout_ms=timeout_ms,
|
|
1188
|
-
)
|
|
1189
|
-
|
|
1190
|
-
if retries == UNSET:
|
|
1191
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1192
|
-
retries = self.sdk_configuration.retry_config
|
|
1193
|
-
|
|
1194
|
-
retry_config = None
|
|
1195
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1196
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1197
|
-
|
|
1198
|
-
http_res = await self.do_request_async(
|
|
1199
|
-
hook_ctx=HookContext(
|
|
1200
|
-
config=self.sdk_configuration,
|
|
1201
|
-
base_url=base_url or "",
|
|
1202
|
-
operation_id="pendle_sell_pt",
|
|
1203
|
-
oauth2_scopes=[],
|
|
1204
|
-
security_source=self.sdk_configuration.security,
|
|
1205
|
-
),
|
|
1206
|
-
request=req,
|
|
1207
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1208
|
-
retry_config=retry_config,
|
|
1209
|
-
)
|
|
1210
|
-
|
|
1211
|
-
response_data: Any = None
|
|
1212
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1213
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
1214
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1215
|
-
response_data = unmarshal_json_response(
|
|
1216
|
-
errors.HTTPValidationErrorData, http_res
|
|
1217
|
-
)
|
|
1218
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
1219
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1220
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1221
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1222
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1223
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1224
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1225
|
-
|
|
1226
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1227
|
-
|
|
1228
|
-
def buy_yt(
|
|
566
|
+
def pendle_pt(
|
|
1229
567
|
self,
|
|
1230
568
|
*,
|
|
1231
569
|
market_address: str,
|
|
1232
|
-
|
|
1233
|
-
|
|
570
|
+
action: models.PendleTradePtRequestAction,
|
|
571
|
+
token: Union[
|
|
572
|
+
models.PendleTradePtRequestToken, models.PendleTradePtRequestTokenTypedDict
|
|
573
|
+
],
|
|
574
|
+
amount_in: Union[
|
|
575
|
+
models.PendleTradePtRequestAmountIn,
|
|
576
|
+
models.PendleTradePtRequestAmountInTypedDict,
|
|
1234
577
|
],
|
|
1235
578
|
max_slippage_percent: float,
|
|
1236
|
-
chain: models.
|
|
579
|
+
chain: models.PendleTradePtRequestChain,
|
|
1237
580
|
sender: str,
|
|
1238
581
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1239
582
|
server_url: Optional[str] = None,
|
|
1240
583
|
timeout_ms: Optional[int] = None,
|
|
1241
584
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1242
|
-
) -> models.
|
|
1243
|
-
r"""
|
|
585
|
+
) -> models.PendleTxResponse:
|
|
586
|
+
r"""Trade Principal Token (PT)
|
|
587
|
+
|
|
588
|
+
Trade market's Principal Token (PT) for fixed yield.
|
|
1244
589
|
|
|
1245
|
-
|
|
590
|
+
PT is traded with a token of the user's choice.
|
|
591
|
+
|
|
592
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
593
|
+
beforehand. For `action` set to `BUY`, this is the `token` contract. For `action` set to `SELL`, this is the PT contract.
|
|
1246
594
|
<Info>
|
|
1247
595
|
**Required Allowances**
|
|
1248
596
|
|
|
1249
|
-
In order to make this transaction, token allowances need to be set
|
|
597
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1250
598
|
|
|
1251
599
|
- `PendleRouter`
|
|
1252
600
|
</Info>
|
|
1253
601
|
|
|
1254
602
|
|
|
1255
|
-
:param market_address: The address of the market identifying which
|
|
1256
|
-
:param
|
|
603
|
+
:param market_address: The address of the market identifying which Principal Token (PT) you would like to trade.
|
|
604
|
+
:param action: Specifies the direction of the PT trade. Valid values are `BUY` (to buy PT) or `SELL` (to sell PT).
|
|
605
|
+
:param token: TThe symbol or address of the token to trade PT with. For `action` set to `BUY`, this is the token to buy PT with. For `action` set to `SELL`, this is the token to sell PT for.
|
|
606
|
+
:param amount_in: For `action` set to `BUY`, this is the amount in of `token` to buy PT with. For `action` set to `SELL`, this is the amount in of PT to sell for `token`.
|
|
1257
607
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1258
|
-
:param chain:
|
|
608
|
+
:param chain:
|
|
1259
609
|
:param sender: The address of the transaction sender.
|
|
1260
610
|
:param retries: Override the default retry configuration for this method
|
|
1261
611
|
:param server_url: Override the default server URL for this method
|
|
@@ -1272,9 +622,11 @@ class Pendle(BaseSDK):
|
|
|
1272
622
|
else:
|
|
1273
623
|
base_url = self._get_url(base_url, url_variables)
|
|
1274
624
|
|
|
1275
|
-
request = models.
|
|
625
|
+
request = models.PendleTradePtRequest(
|
|
1276
626
|
market_address=market_address,
|
|
1277
|
-
|
|
627
|
+
action=action,
|
|
628
|
+
token=token,
|
|
629
|
+
amount_in=amount_in,
|
|
1278
630
|
max_slippage_percent=max_slippage_percent,
|
|
1279
631
|
chain=chain,
|
|
1280
632
|
sender=sender,
|
|
@@ -1282,7 +634,7 @@ class Pendle(BaseSDK):
|
|
|
1282
634
|
|
|
1283
635
|
req = self._build_request(
|
|
1284
636
|
method="POST",
|
|
1285
|
-
path="/
|
|
637
|
+
path="/v1/pendle/pt",
|
|
1286
638
|
base_url=base_url,
|
|
1287
639
|
url_variables=url_variables,
|
|
1288
640
|
request=request,
|
|
@@ -1294,7 +646,7 @@ class Pendle(BaseSDK):
|
|
|
1294
646
|
http_headers=http_headers,
|
|
1295
647
|
security=self.sdk_configuration.security,
|
|
1296
648
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1297
|
-
request, False, False, "json", models.
|
|
649
|
+
request, False, False, "json", models.PendleTradePtRequest
|
|
1298
650
|
),
|
|
1299
651
|
timeout_ms=timeout_ms,
|
|
1300
652
|
)
|
|
@@ -1311,7 +663,7 @@ class Pendle(BaseSDK):
|
|
|
1311
663
|
hook_ctx=HookContext(
|
|
1312
664
|
config=self.sdk_configuration,
|
|
1313
665
|
base_url=base_url or "",
|
|
1314
|
-
operation_id="
|
|
666
|
+
operation_id="v1_pendle_pt",
|
|
1315
667
|
oauth2_scopes=[],
|
|
1316
668
|
security_source=self.sdk_configuration.security,
|
|
1317
669
|
),
|
|
@@ -1322,7 +674,7 @@ class Pendle(BaseSDK):
|
|
|
1322
674
|
|
|
1323
675
|
response_data: Any = None
|
|
1324
676
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1325
|
-
return unmarshal_json_response(models.
|
|
677
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
1326
678
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1327
679
|
response_data = unmarshal_json_response(
|
|
1328
680
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -1337,37 +689,49 @@ class Pendle(BaseSDK):
|
|
|
1337
689
|
|
|
1338
690
|
raise errors.APIError("Unexpected response received", http_res)
|
|
1339
691
|
|
|
1340
|
-
async def
|
|
692
|
+
async def pendle_pt_async(
|
|
1341
693
|
self,
|
|
1342
694
|
*,
|
|
1343
695
|
market_address: str,
|
|
1344
|
-
|
|
1345
|
-
|
|
696
|
+
action: models.PendleTradePtRequestAction,
|
|
697
|
+
token: Union[
|
|
698
|
+
models.PendleTradePtRequestToken, models.PendleTradePtRequestTokenTypedDict
|
|
699
|
+
],
|
|
700
|
+
amount_in: Union[
|
|
701
|
+
models.PendleTradePtRequestAmountIn,
|
|
702
|
+
models.PendleTradePtRequestAmountInTypedDict,
|
|
1346
703
|
],
|
|
1347
704
|
max_slippage_percent: float,
|
|
1348
|
-
chain: models.
|
|
705
|
+
chain: models.PendleTradePtRequestChain,
|
|
1349
706
|
sender: str,
|
|
1350
707
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1351
708
|
server_url: Optional[str] = None,
|
|
1352
709
|
timeout_ms: Optional[int] = None,
|
|
1353
710
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1354
|
-
) -> models.
|
|
1355
|
-
r"""
|
|
711
|
+
) -> models.PendleTxResponse:
|
|
712
|
+
r"""Trade Principal Token (PT)
|
|
713
|
+
|
|
714
|
+
Trade market's Principal Token (PT) for fixed yield.
|
|
715
|
+
|
|
716
|
+
PT is traded with a token of the user's choice.
|
|
1356
717
|
|
|
1357
|
-
|
|
718
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
719
|
+
beforehand. For `action` set to `BUY`, this is the `token` contract. For `action` set to `SELL`, this is the PT contract.
|
|
1358
720
|
<Info>
|
|
1359
721
|
**Required Allowances**
|
|
1360
722
|
|
|
1361
|
-
In order to make this transaction, token allowances need to be set
|
|
723
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1362
724
|
|
|
1363
725
|
- `PendleRouter`
|
|
1364
726
|
</Info>
|
|
1365
727
|
|
|
1366
728
|
|
|
1367
|
-
:param market_address: The address of the market identifying which
|
|
1368
|
-
:param
|
|
729
|
+
:param market_address: The address of the market identifying which Principal Token (PT) you would like to trade.
|
|
730
|
+
:param action: Specifies the direction of the PT trade. Valid values are `BUY` (to buy PT) or `SELL` (to sell PT).
|
|
731
|
+
:param token: TThe symbol or address of the token to trade PT with. For `action` set to `BUY`, this is the token to buy PT with. For `action` set to `SELL`, this is the token to sell PT for.
|
|
732
|
+
:param amount_in: For `action` set to `BUY`, this is the amount in of `token` to buy PT with. For `action` set to `SELL`, this is the amount in of PT to sell for `token`.
|
|
1369
733
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1370
|
-
:param chain:
|
|
734
|
+
:param chain:
|
|
1371
735
|
:param sender: The address of the transaction sender.
|
|
1372
736
|
:param retries: Override the default retry configuration for this method
|
|
1373
737
|
:param server_url: Override the default server URL for this method
|
|
@@ -1384,9 +748,11 @@ class Pendle(BaseSDK):
|
|
|
1384
748
|
else:
|
|
1385
749
|
base_url = self._get_url(base_url, url_variables)
|
|
1386
750
|
|
|
1387
|
-
request = models.
|
|
751
|
+
request = models.PendleTradePtRequest(
|
|
1388
752
|
market_address=market_address,
|
|
1389
|
-
|
|
753
|
+
action=action,
|
|
754
|
+
token=token,
|
|
755
|
+
amount_in=amount_in,
|
|
1390
756
|
max_slippage_percent=max_slippage_percent,
|
|
1391
757
|
chain=chain,
|
|
1392
758
|
sender=sender,
|
|
@@ -1394,7 +760,7 @@ class Pendle(BaseSDK):
|
|
|
1394
760
|
|
|
1395
761
|
req = self._build_request_async(
|
|
1396
762
|
method="POST",
|
|
1397
|
-
path="/
|
|
763
|
+
path="/v1/pendle/pt",
|
|
1398
764
|
base_url=base_url,
|
|
1399
765
|
url_variables=url_variables,
|
|
1400
766
|
request=request,
|
|
@@ -1406,7 +772,7 @@ class Pendle(BaseSDK):
|
|
|
1406
772
|
http_headers=http_headers,
|
|
1407
773
|
security=self.sdk_configuration.security,
|
|
1408
774
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1409
|
-
request, False, False, "json", models.
|
|
775
|
+
request, False, False, "json", models.PendleTradePtRequest
|
|
1410
776
|
),
|
|
1411
777
|
timeout_ms=timeout_ms,
|
|
1412
778
|
)
|
|
@@ -1423,7 +789,7 @@ class Pendle(BaseSDK):
|
|
|
1423
789
|
hook_ctx=HookContext(
|
|
1424
790
|
config=self.sdk_configuration,
|
|
1425
791
|
base_url=base_url or "",
|
|
1426
|
-
operation_id="
|
|
792
|
+
operation_id="v1_pendle_pt",
|
|
1427
793
|
oauth2_scopes=[],
|
|
1428
794
|
security_source=self.sdk_configuration.security,
|
|
1429
795
|
),
|
|
@@ -1434,7 +800,7 @@ class Pendle(BaseSDK):
|
|
|
1434
800
|
|
|
1435
801
|
response_data: Any = None
|
|
1436
802
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1437
|
-
return unmarshal_json_response(models.
|
|
803
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
1438
804
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1439
805
|
response_data = unmarshal_json_response(
|
|
1440
806
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -1449,37 +815,49 @@ class Pendle(BaseSDK):
|
|
|
1449
815
|
|
|
1450
816
|
raise errors.APIError("Unexpected response received", http_res)
|
|
1451
817
|
|
|
1452
|
-
def
|
|
818
|
+
def pendle_yt(
|
|
1453
819
|
self,
|
|
1454
820
|
*,
|
|
1455
821
|
market_address: str,
|
|
1456
|
-
|
|
1457
|
-
|
|
822
|
+
action: models.PendleTradeYtRequestAction,
|
|
823
|
+
token: Union[
|
|
824
|
+
models.PendleTradeYtRequestToken, models.PendleTradeYtRequestTokenTypedDict
|
|
825
|
+
],
|
|
826
|
+
amount_in: Union[
|
|
827
|
+
models.PendleTradeYtRequestAmountIn,
|
|
828
|
+
models.PendleTradeYtRequestAmountInTypedDict,
|
|
1458
829
|
],
|
|
1459
830
|
max_slippage_percent: float,
|
|
1460
|
-
chain: models.
|
|
831
|
+
chain: models.PendleTradeYtRequestChain,
|
|
1461
832
|
sender: str,
|
|
1462
833
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1463
834
|
server_url: Optional[str] = None,
|
|
1464
835
|
timeout_ms: Optional[int] = None,
|
|
1465
836
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1466
|
-
) -> models.
|
|
1467
|
-
r"""
|
|
837
|
+
) -> models.PendleTxResponse:
|
|
838
|
+
r"""Trade Yield Token (YT)
|
|
839
|
+
|
|
840
|
+
Trade Yield Token (YT) for variable yield.
|
|
1468
841
|
|
|
1469
|
-
|
|
842
|
+
YT is traded with a token of the user's choice.
|
|
843
|
+
|
|
844
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
845
|
+
beforehand. For `action` set to `BUY`, this is the `token` contract. For `action` set to `SELL`, this is the YT contract.
|
|
1470
846
|
<Info>
|
|
1471
847
|
**Required Allowances**
|
|
1472
848
|
|
|
1473
|
-
In order to make this transaction, token allowances need to be set
|
|
849
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1474
850
|
|
|
1475
851
|
- `PendleRouter`
|
|
1476
852
|
</Info>
|
|
1477
853
|
|
|
1478
854
|
|
|
1479
|
-
:param market_address: The address of the market identifying which Yield Token (YT) you would like to
|
|
1480
|
-
:param
|
|
855
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to trade.
|
|
856
|
+
:param action: Specifies the direction of the YT trade. Valid values are `BUY` (to buy YT) or `SELL` (to sell YT).
|
|
857
|
+
:param token: TThe symbol or address of the token to trade YT with. For `action` set to `BUY`, this is the token to buy YT with. For `action` set to `SELL`, this is the token to sell YT for.
|
|
858
|
+
:param amount_in: For `action` set to `BUY`, this is the amount in of `token` to buy YT with. For `action` set to `SELL`, this is the amount in of YT to sell for `token`.
|
|
1481
859
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1482
|
-
:param chain:
|
|
860
|
+
:param chain:
|
|
1483
861
|
:param sender: The address of the transaction sender.
|
|
1484
862
|
:param retries: Override the default retry configuration for this method
|
|
1485
863
|
:param server_url: Override the default server URL for this method
|
|
@@ -1496,9 +874,11 @@ class Pendle(BaseSDK):
|
|
|
1496
874
|
else:
|
|
1497
875
|
base_url = self._get_url(base_url, url_variables)
|
|
1498
876
|
|
|
1499
|
-
request = models.
|
|
877
|
+
request = models.PendleTradeYtRequest(
|
|
1500
878
|
market_address=market_address,
|
|
1501
|
-
|
|
879
|
+
action=action,
|
|
880
|
+
token=token,
|
|
881
|
+
amount_in=amount_in,
|
|
1502
882
|
max_slippage_percent=max_slippage_percent,
|
|
1503
883
|
chain=chain,
|
|
1504
884
|
sender=sender,
|
|
@@ -1506,7 +886,7 @@ class Pendle(BaseSDK):
|
|
|
1506
886
|
|
|
1507
887
|
req = self._build_request(
|
|
1508
888
|
method="POST",
|
|
1509
|
-
path="/
|
|
889
|
+
path="/v1/pendle/yt",
|
|
1510
890
|
base_url=base_url,
|
|
1511
891
|
url_variables=url_variables,
|
|
1512
892
|
request=request,
|
|
@@ -1518,7 +898,7 @@ class Pendle(BaseSDK):
|
|
|
1518
898
|
http_headers=http_headers,
|
|
1519
899
|
security=self.sdk_configuration.security,
|
|
1520
900
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1521
|
-
request, False, False, "json", models.
|
|
901
|
+
request, False, False, "json", models.PendleTradeYtRequest
|
|
1522
902
|
),
|
|
1523
903
|
timeout_ms=timeout_ms,
|
|
1524
904
|
)
|
|
@@ -1535,7 +915,7 @@ class Pendle(BaseSDK):
|
|
|
1535
915
|
hook_ctx=HookContext(
|
|
1536
916
|
config=self.sdk_configuration,
|
|
1537
917
|
base_url=base_url or "",
|
|
1538
|
-
operation_id="
|
|
918
|
+
operation_id="v1_pendle_yt",
|
|
1539
919
|
oauth2_scopes=[],
|
|
1540
920
|
security_source=self.sdk_configuration.security,
|
|
1541
921
|
),
|
|
@@ -1546,7 +926,7 @@ class Pendle(BaseSDK):
|
|
|
1546
926
|
|
|
1547
927
|
response_data: Any = None
|
|
1548
928
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1549
|
-
return unmarshal_json_response(models.
|
|
929
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
1550
930
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1551
931
|
response_data = unmarshal_json_response(
|
|
1552
932
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -1561,247 +941,49 @@ class Pendle(BaseSDK):
|
|
|
1561
941
|
|
|
1562
942
|
raise errors.APIError("Unexpected response received", http_res)
|
|
1563
943
|
|
|
1564
|
-
async def
|
|
944
|
+
async def pendle_yt_async(
|
|
1565
945
|
self,
|
|
1566
946
|
*,
|
|
1567
947
|
market_address: str,
|
|
1568
|
-
|
|
1569
|
-
|
|
948
|
+
action: models.PendleTradeYtRequestAction,
|
|
949
|
+
token: Union[
|
|
950
|
+
models.PendleTradeYtRequestToken, models.PendleTradeYtRequestTokenTypedDict
|
|
951
|
+
],
|
|
952
|
+
amount_in: Union[
|
|
953
|
+
models.PendleTradeYtRequestAmountIn,
|
|
954
|
+
models.PendleTradeYtRequestAmountInTypedDict,
|
|
1570
955
|
],
|
|
1571
956
|
max_slippage_percent: float,
|
|
1572
|
-
chain: models.
|
|
1573
|
-
sender: str,
|
|
1574
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1575
|
-
server_url: Optional[str] = None,
|
|
1576
|
-
timeout_ms: Optional[int] = None,
|
|
1577
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1578
|
-
) -> models.TxResponse:
|
|
1579
|
-
r"""Sell Yield Token (YT)
|
|
1580
|
-
|
|
1581
|
-
Sell Yield Token (YT) for the market's Underlying Token.
|
|
1582
|
-
<Info>
|
|
1583
|
-
**Required Allowances**
|
|
1584
|
-
|
|
1585
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
1586
|
-
|
|
1587
|
-
- `PendleRouter`
|
|
1588
|
-
</Info>
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
:param market_address: The address of the market identifying which Yield Token (YT) you would like to sell.
|
|
1592
|
-
:param amount: The amount of market's Yield Token (YT) you would like to sell for market's Underlying Token.
|
|
1593
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1594
|
-
:param chain: The chain to use.
|
|
1595
|
-
:param sender: The address of the transaction sender.
|
|
1596
|
-
:param retries: Override the default retry configuration for this method
|
|
1597
|
-
:param server_url: Override the default server URL for this method
|
|
1598
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1599
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1600
|
-
"""
|
|
1601
|
-
base_url = None
|
|
1602
|
-
url_variables = None
|
|
1603
|
-
if timeout_ms is None:
|
|
1604
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1605
|
-
|
|
1606
|
-
if server_url is not None:
|
|
1607
|
-
base_url = server_url
|
|
1608
|
-
else:
|
|
1609
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1610
|
-
|
|
1611
|
-
request = models.PendleSellYtRequest(
|
|
1612
|
-
market_address=market_address,
|
|
1613
|
-
amount=amount,
|
|
1614
|
-
max_slippage_percent=max_slippage_percent,
|
|
1615
|
-
chain=chain,
|
|
1616
|
-
sender=sender,
|
|
1617
|
-
)
|
|
1618
|
-
|
|
1619
|
-
req = self._build_request_async(
|
|
1620
|
-
method="POST",
|
|
1621
|
-
path="/v0/pendle/sell_yt",
|
|
1622
|
-
base_url=base_url,
|
|
1623
|
-
url_variables=url_variables,
|
|
1624
|
-
request=request,
|
|
1625
|
-
request_body_required=True,
|
|
1626
|
-
request_has_path_params=False,
|
|
1627
|
-
request_has_query_params=True,
|
|
1628
|
-
user_agent_header="user-agent",
|
|
1629
|
-
accept_header_value="application/json",
|
|
1630
|
-
http_headers=http_headers,
|
|
1631
|
-
security=self.sdk_configuration.security,
|
|
1632
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1633
|
-
request, False, False, "json", models.PendleSellYtRequest
|
|
1634
|
-
),
|
|
1635
|
-
timeout_ms=timeout_ms,
|
|
1636
|
-
)
|
|
1637
|
-
|
|
1638
|
-
if retries == UNSET:
|
|
1639
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1640
|
-
retries = self.sdk_configuration.retry_config
|
|
1641
|
-
|
|
1642
|
-
retry_config = None
|
|
1643
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1644
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1645
|
-
|
|
1646
|
-
http_res = await self.do_request_async(
|
|
1647
|
-
hook_ctx=HookContext(
|
|
1648
|
-
config=self.sdk_configuration,
|
|
1649
|
-
base_url=base_url or "",
|
|
1650
|
-
operation_id="pendle_sell_yt",
|
|
1651
|
-
oauth2_scopes=[],
|
|
1652
|
-
security_source=self.sdk_configuration.security,
|
|
1653
|
-
),
|
|
1654
|
-
request=req,
|
|
1655
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1656
|
-
retry_config=retry_config,
|
|
1657
|
-
)
|
|
1658
|
-
|
|
1659
|
-
response_data: Any = None
|
|
1660
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1661
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
1662
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1663
|
-
response_data = unmarshal_json_response(
|
|
1664
|
-
errors.HTTPValidationErrorData, http_res
|
|
1665
|
-
)
|
|
1666
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
1667
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1668
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1669
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1670
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1671
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1672
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1673
|
-
|
|
1674
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
1675
|
-
|
|
1676
|
-
def redeem_yield(
|
|
1677
|
-
self,
|
|
1678
|
-
*,
|
|
1679
|
-
market_address: str,
|
|
1680
|
-
chain: models.Chain,
|
|
957
|
+
chain: models.PendleTradeYtRequestChain,
|
|
1681
958
|
sender: str,
|
|
1682
959
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1683
960
|
server_url: Optional[str] = None,
|
|
1684
961
|
timeout_ms: Optional[int] = None,
|
|
1685
962
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1686
|
-
) -> models.
|
|
1687
|
-
r"""
|
|
1688
|
-
|
|
1689
|
-
Redeem claimable yield from the market's associated Yield Token (YT).
|
|
1690
|
-
<Info>
|
|
1691
|
-
**Required Allowances**
|
|
1692
|
-
|
|
1693
|
-
In order to make this transaction, token allowances need to be set on the following contracts.
|
|
1694
|
-
|
|
1695
|
-
- `PendleRouter`
|
|
1696
|
-
</Info>
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
:param market_address: The address of the market identifying which Yield Token (YT) you would like to claim yield from.
|
|
1700
|
-
:param chain: The chain to use.
|
|
1701
|
-
:param sender: The address of the transaction sender.
|
|
1702
|
-
:param retries: Override the default retry configuration for this method
|
|
1703
|
-
:param server_url: Override the default server URL for this method
|
|
1704
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1705
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1706
|
-
"""
|
|
1707
|
-
base_url = None
|
|
1708
|
-
url_variables = None
|
|
1709
|
-
if timeout_ms is None:
|
|
1710
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1711
|
-
|
|
1712
|
-
if server_url is not None:
|
|
1713
|
-
base_url = server_url
|
|
1714
|
-
else:
|
|
1715
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1716
|
-
|
|
1717
|
-
request = models.PendleRedeemYieldRequest(
|
|
1718
|
-
market_address=market_address,
|
|
1719
|
-
chain=chain,
|
|
1720
|
-
sender=sender,
|
|
1721
|
-
)
|
|
1722
|
-
|
|
1723
|
-
req = self._build_request(
|
|
1724
|
-
method="POST",
|
|
1725
|
-
path="/v0/pendle/redeem_yield",
|
|
1726
|
-
base_url=base_url,
|
|
1727
|
-
url_variables=url_variables,
|
|
1728
|
-
request=request,
|
|
1729
|
-
request_body_required=True,
|
|
1730
|
-
request_has_path_params=False,
|
|
1731
|
-
request_has_query_params=True,
|
|
1732
|
-
user_agent_header="user-agent",
|
|
1733
|
-
accept_header_value="application/json",
|
|
1734
|
-
http_headers=http_headers,
|
|
1735
|
-
security=self.sdk_configuration.security,
|
|
1736
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1737
|
-
request, False, False, "json", models.PendleRedeemYieldRequest
|
|
1738
|
-
),
|
|
1739
|
-
timeout_ms=timeout_ms,
|
|
1740
|
-
)
|
|
1741
|
-
|
|
1742
|
-
if retries == UNSET:
|
|
1743
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1744
|
-
retries = self.sdk_configuration.retry_config
|
|
1745
|
-
|
|
1746
|
-
retry_config = None
|
|
1747
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1748
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1749
|
-
|
|
1750
|
-
http_res = self.do_request(
|
|
1751
|
-
hook_ctx=HookContext(
|
|
1752
|
-
config=self.sdk_configuration,
|
|
1753
|
-
base_url=base_url or "",
|
|
1754
|
-
operation_id="pendle_redeem_yield",
|
|
1755
|
-
oauth2_scopes=[],
|
|
1756
|
-
security_source=self.sdk_configuration.security,
|
|
1757
|
-
),
|
|
1758
|
-
request=req,
|
|
1759
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1760
|
-
retry_config=retry_config,
|
|
1761
|
-
)
|
|
1762
|
-
|
|
1763
|
-
response_data: Any = None
|
|
1764
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1765
|
-
return unmarshal_json_response(models.TxResponse, http_res)
|
|
1766
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1767
|
-
response_data = unmarshal_json_response(
|
|
1768
|
-
errors.HTTPValidationErrorData, http_res
|
|
1769
|
-
)
|
|
1770
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
1771
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1772
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1773
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1774
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1775
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1776
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
963
|
+
) -> models.PendleTxResponse:
|
|
964
|
+
r"""Trade Yield Token (YT)
|
|
1777
965
|
|
|
1778
|
-
|
|
966
|
+
Trade Yield Token (YT) for variable yield.
|
|
1779
967
|
|
|
1780
|
-
|
|
1781
|
-
self,
|
|
1782
|
-
*,
|
|
1783
|
-
market_address: str,
|
|
1784
|
-
chain: models.Chain,
|
|
1785
|
-
sender: str,
|
|
1786
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1787
|
-
server_url: Optional[str] = None,
|
|
1788
|
-
timeout_ms: Optional[int] = None,
|
|
1789
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1790
|
-
) -> models.TxResponse:
|
|
1791
|
-
r"""Redeem Claimable Yield
|
|
968
|
+
YT is traded with a token of the user's choice.
|
|
1792
969
|
|
|
1793
|
-
|
|
970
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
971
|
+
beforehand. For `action` set to `BUY`, this is the `token` contract. For `action` set to `SELL`, this is the YT contract.
|
|
1794
972
|
<Info>
|
|
1795
973
|
**Required Allowances**
|
|
1796
974
|
|
|
1797
|
-
In order to make this transaction, token allowances need to be set
|
|
975
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1798
976
|
|
|
1799
977
|
- `PendleRouter`
|
|
1800
978
|
</Info>
|
|
1801
979
|
|
|
1802
980
|
|
|
1803
|
-
:param market_address: The address of the market identifying which Yield Token (YT) you would like to
|
|
1804
|
-
:param
|
|
981
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to trade.
|
|
982
|
+
:param action: Specifies the direction of the YT trade. Valid values are `BUY` (to buy YT) or `SELL` (to sell YT).
|
|
983
|
+
:param token: TThe symbol or address of the token to trade YT with. For `action` set to `BUY`, this is the token to buy YT with. For `action` set to `SELL`, this is the token to sell YT for.
|
|
984
|
+
:param amount_in: For `action` set to `BUY`, this is the amount in of `token` to buy YT with. For `action` set to `SELL`, this is the amount in of YT to sell for `token`.
|
|
985
|
+
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
986
|
+
:param chain:
|
|
1805
987
|
:param sender: The address of the transaction sender.
|
|
1806
988
|
:param retries: Override the default retry configuration for this method
|
|
1807
989
|
:param server_url: Override the default server URL for this method
|
|
@@ -1818,15 +1000,19 @@ class Pendle(BaseSDK):
|
|
|
1818
1000
|
else:
|
|
1819
1001
|
base_url = self._get_url(base_url, url_variables)
|
|
1820
1002
|
|
|
1821
|
-
request = models.
|
|
1003
|
+
request = models.PendleTradeYtRequest(
|
|
1822
1004
|
market_address=market_address,
|
|
1005
|
+
action=action,
|
|
1006
|
+
token=token,
|
|
1007
|
+
amount_in=amount_in,
|
|
1008
|
+
max_slippage_percent=max_slippage_percent,
|
|
1823
1009
|
chain=chain,
|
|
1824
1010
|
sender=sender,
|
|
1825
1011
|
)
|
|
1826
1012
|
|
|
1827
1013
|
req = self._build_request_async(
|
|
1828
1014
|
method="POST",
|
|
1829
|
-
path="/
|
|
1015
|
+
path="/v1/pendle/yt",
|
|
1830
1016
|
base_url=base_url,
|
|
1831
1017
|
url_variables=url_variables,
|
|
1832
1018
|
request=request,
|
|
@@ -1838,7 +1024,7 @@ class Pendle(BaseSDK):
|
|
|
1838
1024
|
http_headers=http_headers,
|
|
1839
1025
|
security=self.sdk_configuration.security,
|
|
1840
1026
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1841
|
-
request, False, False, "json", models.
|
|
1027
|
+
request, False, False, "json", models.PendleTradeYtRequest
|
|
1842
1028
|
),
|
|
1843
1029
|
timeout_ms=timeout_ms,
|
|
1844
1030
|
)
|
|
@@ -1855,7 +1041,7 @@ class Pendle(BaseSDK):
|
|
|
1855
1041
|
hook_ctx=HookContext(
|
|
1856
1042
|
config=self.sdk_configuration,
|
|
1857
1043
|
base_url=base_url or "",
|
|
1858
|
-
operation_id="
|
|
1044
|
+
operation_id="v1_pendle_yt",
|
|
1859
1045
|
oauth2_scopes=[],
|
|
1860
1046
|
security_source=self.sdk_configuration.security,
|
|
1861
1047
|
),
|
|
@@ -1866,7 +1052,7 @@ class Pendle(BaseSDK):
|
|
|
1866
1052
|
|
|
1867
1053
|
response_data: Any = None
|
|
1868
1054
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1869
|
-
return unmarshal_json_response(models.
|
|
1055
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
1870
1056
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1871
1057
|
response_data = unmarshal_json_response(
|
|
1872
1058
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -1881,41 +1067,53 @@ class Pendle(BaseSDK):
|
|
|
1881
1067
|
|
|
1882
1068
|
raise errors.APIError("Unexpected response received", http_res)
|
|
1883
1069
|
|
|
1884
|
-
def
|
|
1070
|
+
def pendle_liquidity(
|
|
1885
1071
|
self,
|
|
1886
1072
|
*,
|
|
1887
1073
|
market_address: str,
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
models.
|
|
1074
|
+
action: models.PendleManageLiquidityRequestAction,
|
|
1075
|
+
token: Union[
|
|
1076
|
+
models.PendleManageLiquidityRequestToken,
|
|
1077
|
+
models.PendleManageLiquidityRequestTokenTypedDict,
|
|
1078
|
+
],
|
|
1079
|
+
amount_in: Union[
|
|
1080
|
+
models.PendleManageLiquidityRequestAmountIn,
|
|
1081
|
+
models.PendleManageLiquidityRequestAmountInTypedDict,
|
|
1891
1082
|
],
|
|
1892
1083
|
max_slippage_percent: float,
|
|
1893
|
-
chain: models.
|
|
1084
|
+
chain: models.PendleManageLiquidityRequestChain,
|
|
1894
1085
|
sender: str,
|
|
1895
1086
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1896
1087
|
server_url: Optional[str] = None,
|
|
1897
1088
|
timeout_ms: Optional[int] = None,
|
|
1898
1089
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1899
|
-
) -> models.
|
|
1900
|
-
r"""
|
|
1090
|
+
) -> models.PendleTxResponse:
|
|
1091
|
+
r"""Manage Liquidity (LP)
|
|
1092
|
+
|
|
1093
|
+
Manage liquidity in a Pendle Market.
|
|
1901
1094
|
|
|
1902
|
-
|
|
1095
|
+
Liquidity is supplied to or withdrawn from the market with a token of the user's choice.
|
|
1903
1096
|
|
|
1904
|
-
|
|
1905
|
-
|
|
1097
|
+
Representation of the liquidity provided is in the form of market's Liquidity
|
|
1098
|
+
Provider Token (LP) received by the user.
|
|
1099
|
+
|
|
1100
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
1101
|
+
beforehand. For `action` set to `SUPPLY`, this is the `token` contract. For `action` set to `WTIHDRAW`, this is the market contract (LP).
|
|
1906
1102
|
<Info>
|
|
1907
1103
|
**Required Allowances**
|
|
1908
1104
|
|
|
1909
|
-
In order to make this transaction, token allowances need to be set
|
|
1105
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1910
1106
|
|
|
1911
1107
|
- `PendleRouter`
|
|
1912
1108
|
</Info>
|
|
1913
1109
|
|
|
1914
1110
|
|
|
1915
1111
|
:param market_address: The address identifying which Pendle Market you would like to add liquidity to.
|
|
1916
|
-
:param
|
|
1112
|
+
:param action: Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity).
|
|
1113
|
+
:param token: The symbol or address of the token to manage liquidity with. For `action` set to `SUPPLY`, this is the token to add as liquidity. For `action` set to `WITHDRAW`, this is the token to remove from liquidity.
|
|
1114
|
+
:param amount_in: For `action` set to `SUPPLY`, this is the amount in of `token` to add as liquidity in exchange for Liquidity Provider (LP) tokens. For `action` set to `WITHDRAW`, this is the amount in of LP tokens to redeem for `token`.
|
|
1917
1115
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
1918
|
-
:param chain:
|
|
1116
|
+
:param chain:
|
|
1919
1117
|
:param sender: The address of the transaction sender.
|
|
1920
1118
|
:param retries: Override the default retry configuration for this method
|
|
1921
1119
|
:param server_url: Override the default server URL for this method
|
|
@@ -1932,9 +1130,11 @@ class Pendle(BaseSDK):
|
|
|
1932
1130
|
else:
|
|
1933
1131
|
base_url = self._get_url(base_url, url_variables)
|
|
1934
1132
|
|
|
1935
|
-
request = models.
|
|
1133
|
+
request = models.PendleManageLiquidityRequest(
|
|
1936
1134
|
market_address=market_address,
|
|
1937
|
-
|
|
1135
|
+
action=action,
|
|
1136
|
+
token=token,
|
|
1137
|
+
amount_in=amount_in,
|
|
1938
1138
|
max_slippage_percent=max_slippage_percent,
|
|
1939
1139
|
chain=chain,
|
|
1940
1140
|
sender=sender,
|
|
@@ -1942,7 +1142,7 @@ class Pendle(BaseSDK):
|
|
|
1942
1142
|
|
|
1943
1143
|
req = self._build_request(
|
|
1944
1144
|
method="POST",
|
|
1945
|
-
path="/
|
|
1145
|
+
path="/v1/pendle/liquidity",
|
|
1946
1146
|
base_url=base_url,
|
|
1947
1147
|
url_variables=url_variables,
|
|
1948
1148
|
request=request,
|
|
@@ -1954,7 +1154,7 @@ class Pendle(BaseSDK):
|
|
|
1954
1154
|
http_headers=http_headers,
|
|
1955
1155
|
security=self.sdk_configuration.security,
|
|
1956
1156
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1957
|
-
request, False, False, "json", models.
|
|
1157
|
+
request, False, False, "json", models.PendleManageLiquidityRequest
|
|
1958
1158
|
),
|
|
1959
1159
|
timeout_ms=timeout_ms,
|
|
1960
1160
|
)
|
|
@@ -1971,7 +1171,7 @@ class Pendle(BaseSDK):
|
|
|
1971
1171
|
hook_ctx=HookContext(
|
|
1972
1172
|
config=self.sdk_configuration,
|
|
1973
1173
|
base_url=base_url or "",
|
|
1974
|
-
operation_id="
|
|
1174
|
+
operation_id="v1_pendle_liquidity",
|
|
1975
1175
|
oauth2_scopes=[],
|
|
1976
1176
|
security_source=self.sdk_configuration.security,
|
|
1977
1177
|
),
|
|
@@ -1982,7 +1182,7 @@ class Pendle(BaseSDK):
|
|
|
1982
1182
|
|
|
1983
1183
|
response_data: Any = None
|
|
1984
1184
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1985
|
-
return unmarshal_json_response(models.
|
|
1185
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
1986
1186
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1987
1187
|
response_data = unmarshal_json_response(
|
|
1988
1188
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -1997,41 +1197,53 @@ class Pendle(BaseSDK):
|
|
|
1997
1197
|
|
|
1998
1198
|
raise errors.APIError("Unexpected response received", http_res)
|
|
1999
1199
|
|
|
2000
|
-
async def
|
|
1200
|
+
async def pendle_liquidity_async(
|
|
2001
1201
|
self,
|
|
2002
1202
|
*,
|
|
2003
1203
|
market_address: str,
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
models.
|
|
1204
|
+
action: models.PendleManageLiquidityRequestAction,
|
|
1205
|
+
token: Union[
|
|
1206
|
+
models.PendleManageLiquidityRequestToken,
|
|
1207
|
+
models.PendleManageLiquidityRequestTokenTypedDict,
|
|
1208
|
+
],
|
|
1209
|
+
amount_in: Union[
|
|
1210
|
+
models.PendleManageLiquidityRequestAmountIn,
|
|
1211
|
+
models.PendleManageLiquidityRequestAmountInTypedDict,
|
|
2007
1212
|
],
|
|
2008
1213
|
max_slippage_percent: float,
|
|
2009
|
-
chain: models.
|
|
1214
|
+
chain: models.PendleManageLiquidityRequestChain,
|
|
2010
1215
|
sender: str,
|
|
2011
1216
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2012
1217
|
server_url: Optional[str] = None,
|
|
2013
1218
|
timeout_ms: Optional[int] = None,
|
|
2014
1219
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2015
|
-
) -> models.
|
|
2016
|
-
r"""
|
|
1220
|
+
) -> models.PendleTxResponse:
|
|
1221
|
+
r"""Manage Liquidity (LP)
|
|
1222
|
+
|
|
1223
|
+
Manage liquidity in a Pendle Market.
|
|
1224
|
+
|
|
1225
|
+
Liquidity is supplied to or withdrawn from the market with a token of the user's choice.
|
|
2017
1226
|
|
|
2018
|
-
|
|
1227
|
+
Representation of the liquidity provided is in the form of market's Liquidity
|
|
1228
|
+
Provider Token (LP) received by the user.
|
|
2019
1229
|
|
|
2020
|
-
|
|
2021
|
-
the
|
|
1230
|
+
A sufficient allowance for the Pendle Router on the appropriate token contract must be set
|
|
1231
|
+
beforehand. For `action` set to `SUPPLY`, this is the `token` contract. For `action` set to `WTIHDRAW`, this is the market contract (LP).
|
|
2022
1232
|
<Info>
|
|
2023
1233
|
**Required Allowances**
|
|
2024
1234
|
|
|
2025
|
-
In order to make this transaction, token allowances need to be set
|
|
1235
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2026
1236
|
|
|
2027
1237
|
- `PendleRouter`
|
|
2028
1238
|
</Info>
|
|
2029
1239
|
|
|
2030
1240
|
|
|
2031
1241
|
:param market_address: The address identifying which Pendle Market you would like to add liquidity to.
|
|
2032
|
-
:param
|
|
1242
|
+
:param action: Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity).
|
|
1243
|
+
:param token: The symbol or address of the token to manage liquidity with. For `action` set to `SUPPLY`, this is the token to add as liquidity. For `action` set to `WITHDRAW`, this is the token to remove from liquidity.
|
|
1244
|
+
:param amount_in: For `action` set to `SUPPLY`, this is the amount in of `token` to add as liquidity in exchange for Liquidity Provider (LP) tokens. For `action` set to `WITHDRAW`, this is the amount in of LP tokens to redeem for `token`.
|
|
2033
1245
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
2034
|
-
:param chain:
|
|
1246
|
+
:param chain:
|
|
2035
1247
|
:param sender: The address of the transaction sender.
|
|
2036
1248
|
:param retries: Override the default retry configuration for this method
|
|
2037
1249
|
:param server_url: Override the default server URL for this method
|
|
@@ -2048,9 +1260,11 @@ class Pendle(BaseSDK):
|
|
|
2048
1260
|
else:
|
|
2049
1261
|
base_url = self._get_url(base_url, url_variables)
|
|
2050
1262
|
|
|
2051
|
-
request = models.
|
|
1263
|
+
request = models.PendleManageLiquidityRequest(
|
|
2052
1264
|
market_address=market_address,
|
|
2053
|
-
|
|
1265
|
+
action=action,
|
|
1266
|
+
token=token,
|
|
1267
|
+
amount_in=amount_in,
|
|
2054
1268
|
max_slippage_percent=max_slippage_percent,
|
|
2055
1269
|
chain=chain,
|
|
2056
1270
|
sender=sender,
|
|
@@ -2058,7 +1272,7 @@ class Pendle(BaseSDK):
|
|
|
2058
1272
|
|
|
2059
1273
|
req = self._build_request_async(
|
|
2060
1274
|
method="POST",
|
|
2061
|
-
path="/
|
|
1275
|
+
path="/v1/pendle/liquidity",
|
|
2062
1276
|
base_url=base_url,
|
|
2063
1277
|
url_variables=url_variables,
|
|
2064
1278
|
request=request,
|
|
@@ -2070,7 +1284,7 @@ class Pendle(BaseSDK):
|
|
|
2070
1284
|
http_headers=http_headers,
|
|
2071
1285
|
security=self.sdk_configuration.security,
|
|
2072
1286
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2073
|
-
request, False, False, "json", models.
|
|
1287
|
+
request, False, False, "json", models.PendleManageLiquidityRequest
|
|
2074
1288
|
),
|
|
2075
1289
|
timeout_ms=timeout_ms,
|
|
2076
1290
|
)
|
|
@@ -2087,7 +1301,7 @@ class Pendle(BaseSDK):
|
|
|
2087
1301
|
hook_ctx=HookContext(
|
|
2088
1302
|
config=self.sdk_configuration,
|
|
2089
1303
|
base_url=base_url or "",
|
|
2090
|
-
operation_id="
|
|
1304
|
+
operation_id="v1_pendle_liquidity",
|
|
2091
1305
|
oauth2_scopes=[],
|
|
2092
1306
|
security_source=self.sdk_configuration.security,
|
|
2093
1307
|
),
|
|
@@ -2098,7 +1312,7 @@ class Pendle(BaseSDK):
|
|
|
2098
1312
|
|
|
2099
1313
|
response_data: Any = None
|
|
2100
1314
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2101
|
-
return unmarshal_json_response(models.
|
|
1315
|
+
return unmarshal_json_response(models.PendleTxResponse, http_res)
|
|
2102
1316
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2103
1317
|
response_data = unmarshal_json_response(
|
|
2104
1318
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -2113,42 +1327,31 @@ class Pendle(BaseSDK):
|
|
|
2113
1327
|
|
|
2114
1328
|
raise errors.APIError("Unexpected response received", http_res)
|
|
2115
1329
|
|
|
2116
|
-
def
|
|
1330
|
+
def pendle_redeem_yield(
|
|
2117
1331
|
self,
|
|
2118
1332
|
*,
|
|
2119
1333
|
market_address: str,
|
|
2120
|
-
|
|
2121
|
-
models.PendleRemoveLiquidityRequestAmount,
|
|
2122
|
-
models.PendleRemoveLiquidityRequestAmountTypedDict,
|
|
2123
|
-
],
|
|
2124
|
-
max_slippage_percent: float,
|
|
2125
|
-
chain: models.Chain,
|
|
1334
|
+
chain: models.PendleRedeemYieldRequestChain,
|
|
2126
1335
|
sender: str,
|
|
2127
1336
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2128
1337
|
server_url: Optional[str] = None,
|
|
2129
1338
|
timeout_ms: Optional[int] = None,
|
|
2130
1339
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2131
|
-
) -> models.
|
|
2132
|
-
r"""
|
|
2133
|
-
|
|
2134
|
-
Remove liquidity from a Pendle Market.
|
|
1340
|
+
) -> models.TransactionResponse:
|
|
1341
|
+
r"""Redeem Claimable Yield
|
|
2135
1342
|
|
|
2136
|
-
|
|
2137
|
-
the market's Underlying Token. An appropriate allowance for the Pendle Router on the
|
|
2138
|
-
market contract must be set beforehand
|
|
1343
|
+
Redeem claimable yield from the market's associated Yield Token (YT).
|
|
2139
1344
|
<Info>
|
|
2140
1345
|
**Required Allowances**
|
|
2141
1346
|
|
|
2142
|
-
In order to make this transaction, token allowances need to be set
|
|
1347
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2143
1348
|
|
|
2144
1349
|
- `PendleRouter`
|
|
2145
1350
|
</Info>
|
|
2146
1351
|
|
|
2147
1352
|
|
|
2148
|
-
:param market_address: The address identifying which
|
|
2149
|
-
:param
|
|
2150
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
2151
|
-
:param chain: The chain to use.
|
|
1353
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to claim yield from.
|
|
1354
|
+
:param chain:
|
|
2152
1355
|
:param sender: The address of the transaction sender.
|
|
2153
1356
|
:param retries: Override the default retry configuration for this method
|
|
2154
1357
|
:param server_url: Override the default server URL for this method
|
|
@@ -2165,17 +1368,15 @@ class Pendle(BaseSDK):
|
|
|
2165
1368
|
else:
|
|
2166
1369
|
base_url = self._get_url(base_url, url_variables)
|
|
2167
1370
|
|
|
2168
|
-
request = models.
|
|
1371
|
+
request = models.PendleRedeemYieldRequest(
|
|
2169
1372
|
market_address=market_address,
|
|
2170
|
-
amount=amount,
|
|
2171
|
-
max_slippage_percent=max_slippage_percent,
|
|
2172
1373
|
chain=chain,
|
|
2173
1374
|
sender=sender,
|
|
2174
1375
|
)
|
|
2175
1376
|
|
|
2176
1377
|
req = self._build_request(
|
|
2177
1378
|
method="POST",
|
|
2178
|
-
path="/
|
|
1379
|
+
path="/v1/pendle/redeem_yield",
|
|
2179
1380
|
base_url=base_url,
|
|
2180
1381
|
url_variables=url_variables,
|
|
2181
1382
|
request=request,
|
|
@@ -2187,7 +1388,7 @@ class Pendle(BaseSDK):
|
|
|
2187
1388
|
http_headers=http_headers,
|
|
2188
1389
|
security=self.sdk_configuration.security,
|
|
2189
1390
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2190
|
-
request, False, False, "json", models.
|
|
1391
|
+
request, False, False, "json", models.PendleRedeemYieldRequest
|
|
2191
1392
|
),
|
|
2192
1393
|
timeout_ms=timeout_ms,
|
|
2193
1394
|
)
|
|
@@ -2204,7 +1405,7 @@ class Pendle(BaseSDK):
|
|
|
2204
1405
|
hook_ctx=HookContext(
|
|
2205
1406
|
config=self.sdk_configuration,
|
|
2206
1407
|
base_url=base_url or "",
|
|
2207
|
-
operation_id="
|
|
1408
|
+
operation_id="v1_pendle_redeem_yield",
|
|
2208
1409
|
oauth2_scopes=[],
|
|
2209
1410
|
security_source=self.sdk_configuration.security,
|
|
2210
1411
|
),
|
|
@@ -2215,7 +1416,7 @@ class Pendle(BaseSDK):
|
|
|
2215
1416
|
|
|
2216
1417
|
response_data: Any = None
|
|
2217
1418
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2218
|
-
return unmarshal_json_response(models.
|
|
1419
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2219
1420
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2220
1421
|
response_data = unmarshal_json_response(
|
|
2221
1422
|
errors.HTTPValidationErrorData, http_res
|
|
@@ -2230,42 +1431,31 @@ class Pendle(BaseSDK):
|
|
|
2230
1431
|
|
|
2231
1432
|
raise errors.APIError("Unexpected response received", http_res)
|
|
2232
1433
|
|
|
2233
|
-
async def
|
|
1434
|
+
async def pendle_redeem_yield_async(
|
|
2234
1435
|
self,
|
|
2235
1436
|
*,
|
|
2236
1437
|
market_address: str,
|
|
2237
|
-
|
|
2238
|
-
models.PendleRemoveLiquidityRequestAmount,
|
|
2239
|
-
models.PendleRemoveLiquidityRequestAmountTypedDict,
|
|
2240
|
-
],
|
|
2241
|
-
max_slippage_percent: float,
|
|
2242
|
-
chain: models.Chain,
|
|
1438
|
+
chain: models.PendleRedeemYieldRequestChain,
|
|
2243
1439
|
sender: str,
|
|
2244
1440
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2245
1441
|
server_url: Optional[str] = None,
|
|
2246
1442
|
timeout_ms: Optional[int] = None,
|
|
2247
1443
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2248
|
-
) -> models.
|
|
2249
|
-
r"""
|
|
2250
|
-
|
|
2251
|
-
Remove liquidity from a Pendle Market.
|
|
1444
|
+
) -> models.TransactionResponse:
|
|
1445
|
+
r"""Redeem Claimable Yield
|
|
2252
1446
|
|
|
2253
|
-
|
|
2254
|
-
the market's Underlying Token. An appropriate allowance for the Pendle Router on the
|
|
2255
|
-
market contract must be set beforehand
|
|
1447
|
+
Redeem claimable yield from the market's associated Yield Token (YT).
|
|
2256
1448
|
<Info>
|
|
2257
1449
|
**Required Allowances**
|
|
2258
1450
|
|
|
2259
|
-
In order to make this transaction, token allowances need to be set
|
|
1451
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2260
1452
|
|
|
2261
1453
|
- `PendleRouter`
|
|
2262
1454
|
</Info>
|
|
2263
1455
|
|
|
2264
1456
|
|
|
2265
|
-
:param market_address: The address identifying which
|
|
2266
|
-
:param
|
|
2267
|
-
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
2268
|
-
:param chain: The chain to use.
|
|
1457
|
+
:param market_address: The address of the market identifying which Yield Token (YT) you would like to claim yield from.
|
|
1458
|
+
:param chain:
|
|
2269
1459
|
:param sender: The address of the transaction sender.
|
|
2270
1460
|
:param retries: Override the default retry configuration for this method
|
|
2271
1461
|
:param server_url: Override the default server URL for this method
|
|
@@ -2282,17 +1472,15 @@ class Pendle(BaseSDK):
|
|
|
2282
1472
|
else:
|
|
2283
1473
|
base_url = self._get_url(base_url, url_variables)
|
|
2284
1474
|
|
|
2285
|
-
request = models.
|
|
1475
|
+
request = models.PendleRedeemYieldRequest(
|
|
2286
1476
|
market_address=market_address,
|
|
2287
|
-
amount=amount,
|
|
2288
|
-
max_slippage_percent=max_slippage_percent,
|
|
2289
1477
|
chain=chain,
|
|
2290
1478
|
sender=sender,
|
|
2291
1479
|
)
|
|
2292
1480
|
|
|
2293
1481
|
req = self._build_request_async(
|
|
2294
1482
|
method="POST",
|
|
2295
|
-
path="/
|
|
1483
|
+
path="/v1/pendle/redeem_yield",
|
|
2296
1484
|
base_url=base_url,
|
|
2297
1485
|
url_variables=url_variables,
|
|
2298
1486
|
request=request,
|
|
@@ -2304,7 +1492,7 @@ class Pendle(BaseSDK):
|
|
|
2304
1492
|
http_headers=http_headers,
|
|
2305
1493
|
security=self.sdk_configuration.security,
|
|
2306
1494
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2307
|
-
request, False, False, "json", models.
|
|
1495
|
+
request, False, False, "json", models.PendleRedeemYieldRequest
|
|
2308
1496
|
),
|
|
2309
1497
|
timeout_ms=timeout_ms,
|
|
2310
1498
|
)
|
|
@@ -2321,7 +1509,7 @@ class Pendle(BaseSDK):
|
|
|
2321
1509
|
hook_ctx=HookContext(
|
|
2322
1510
|
config=self.sdk_configuration,
|
|
2323
1511
|
base_url=base_url or "",
|
|
2324
|
-
operation_id="
|
|
1512
|
+
operation_id="v1_pendle_redeem_yield",
|
|
2325
1513
|
oauth2_scopes=[],
|
|
2326
1514
|
security_source=self.sdk_configuration.security,
|
|
2327
1515
|
),
|
|
@@ -2332,7 +1520,7 @@ class Pendle(BaseSDK):
|
|
|
2332
1520
|
|
|
2333
1521
|
response_data: Any = None
|
|
2334
1522
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2335
|
-
return unmarshal_json_response(models.
|
|
1523
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2336
1524
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2337
1525
|
response_data = unmarshal_json_response(
|
|
2338
1526
|
errors.HTTPValidationErrorData, http_res
|