compass_api_sdk 0.9.8__py3-none-any.whl → 0.9.9__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 +2 -14
- compass_api_sdk/aerodrome_slipstream.py +0 -12
- compass_api_sdk/models/__init__.py +68 -6
- compass_api_sdk/models/aave_avg_rateop.py +1 -1
- compass_api_sdk/models/aave_historical_transactionsop.py +1 -46
- compass_api_sdk/models/aave_liquidity_changeop.py +2 -47
- compass_api_sdk/models/aavelooprequest.py +17 -9
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +1 -46
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +1 -46
- compass_api_sdk/models/generic_allowanceop.py +1 -46
- compass_api_sdk/models/generic_ensop.py +1 -46
- compass_api_sdk/models/generic_portfolioop.py +1 -46
- compass_api_sdk/models/generic_supported_tokensop.py +2 -47
- compass_api_sdk/models/generic_visualize_portfolioop.py +1 -46
- compass_api_sdk/models/morpho_market_positionop.py +2 -47
- compass_api_sdk/models/morpho_marketop.py +2 -47
- compass_api_sdk/models/morpho_marketsop.py +2 -10
- compass_api_sdk/models/morpho_user_positionop.py +2 -47
- compass_api_sdk/models/morpho_vault_positionop.py +2 -47
- compass_api_sdk/models/morpho_vaultop.py +2 -47
- compass_api_sdk/models/morpho_vaultsop.py +2 -10
- compass_api_sdk/models/pendle_marketop.py +2 -47
- compass_api_sdk/models/pendle_marketsop.py +2 -47
- compass_api_sdk/models/pendle_positionop.py +2 -47
- compass_api_sdk/models/pendle_positionsop.py +2 -47
- compass_api_sdk/models/pendleaddliquidityparams.py +45 -0
- compass_api_sdk/models/pendleaddliquidityrequest.py +56 -0
- compass_api_sdk/models/pendlegetmarketresponse.py +5 -0
- compass_api_sdk/models/pendlegetuserpositionresponse.py +5 -0
- compass_api_sdk/models/pendleremoveliquidityparams.py +45 -0
- compass_api_sdk/models/pendleremoveliquidityrequest.py +56 -0
- compass_api_sdk/models/sky_positionop.py +2 -47
- compass_api_sdk/models/token_addressop.py +2 -47
- compass_api_sdk/models/token_balanceop.py +2 -47
- compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +2 -47
- compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +1 -46
- compass_api_sdk/models/uniswap_pool_priceop.py +2 -47
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +2 -47
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +2 -47
- compass_api_sdk/models/useroperation.py +25 -13
- compass_api_sdk/morpho.py +0 -42
- compass_api_sdk/pendle.py +508 -66
- compass_api_sdk/sky.py +0 -6
- compass_api_sdk/token_sdk.py +0 -12
- compass_api_sdk/transaction_batching.py +14 -14
- compass_api_sdk/uniswap_v3.py +0 -30
- compass_api_sdk/universal.py +6 -34
- {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/METADATA +5 -3
- {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/RECORD +51 -47
- {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/WHEEL +0 -0
compass_api_sdk/pendle.py
CHANGED
|
@@ -14,7 +14,6 @@ class Pendle(BaseSDK):
|
|
|
14
14
|
chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
|
|
15
15
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
16
16
|
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
17
|
-
block: OptionalNullable[int] = UNSET,
|
|
18
17
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
18
|
server_url: Optional[str] = None,
|
|
20
19
|
timeout_ms: Optional[int] = None,
|
|
@@ -27,7 +26,6 @@ class Pendle(BaseSDK):
|
|
|
27
26
|
:param chain: The chain to use.
|
|
28
27
|
:param user_address: The user address of the desired position.
|
|
29
28
|
:param market_address: The market address of the desired position.
|
|
30
|
-
:param block: Optional block number (defaults to latest).
|
|
31
29
|
:param retries: Override the default retry configuration for this method
|
|
32
30
|
:param server_url: Override the default server URL for this method
|
|
33
31
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -45,7 +43,6 @@ class Pendle(BaseSDK):
|
|
|
45
43
|
|
|
46
44
|
request = models.PendlePositionRequest(
|
|
47
45
|
chain=chain,
|
|
48
|
-
block=block,
|
|
49
46
|
user_address=user_address,
|
|
50
47
|
market_address=market_address,
|
|
51
48
|
)
|
|
@@ -123,7 +120,6 @@ class Pendle(BaseSDK):
|
|
|
123
120
|
chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
|
|
124
121
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
125
122
|
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
126
|
-
block: OptionalNullable[int] = UNSET,
|
|
127
123
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
128
124
|
server_url: Optional[str] = None,
|
|
129
125
|
timeout_ms: Optional[int] = None,
|
|
@@ -136,7 +132,6 @@ class Pendle(BaseSDK):
|
|
|
136
132
|
:param chain: The chain to use.
|
|
137
133
|
:param user_address: The user address of the desired position.
|
|
138
134
|
:param market_address: The market address of the desired position.
|
|
139
|
-
:param block: Optional block number (defaults to latest).
|
|
140
135
|
:param retries: Override the default retry configuration for this method
|
|
141
136
|
:param server_url: Override the default server URL for this method
|
|
142
137
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -154,7 +149,6 @@ class Pendle(BaseSDK):
|
|
|
154
149
|
|
|
155
150
|
request = models.PendlePositionRequest(
|
|
156
151
|
chain=chain,
|
|
157
|
-
block=block,
|
|
158
152
|
user_address=user_address,
|
|
159
153
|
market_address=market_address,
|
|
160
154
|
)
|
|
@@ -231,7 +225,6 @@ class Pendle(BaseSDK):
|
|
|
231
225
|
*,
|
|
232
226
|
chain: models.PendlePositionsChain = models.PendlePositionsChain.ETHEREUM_MAINNET,
|
|
233
227
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
234
|
-
block: OptionalNullable[int] = UNSET,
|
|
235
228
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
236
229
|
server_url: Optional[str] = None,
|
|
237
230
|
timeout_ms: Optional[int] = None,
|
|
@@ -243,7 +236,6 @@ class Pendle(BaseSDK):
|
|
|
243
236
|
|
|
244
237
|
:param chain: The chain to use.
|
|
245
238
|
:param user_address: The user address of the desired position.
|
|
246
|
-
:param block: Optional block number (defaults to latest).
|
|
247
239
|
:param retries: Override the default retry configuration for this method
|
|
248
240
|
:param server_url: Override the default server URL for this method
|
|
249
241
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -261,7 +253,6 @@ class Pendle(BaseSDK):
|
|
|
261
253
|
|
|
262
254
|
request = models.PendlePositionsRequest(
|
|
263
255
|
chain=chain,
|
|
264
|
-
block=block,
|
|
265
256
|
user_address=user_address,
|
|
266
257
|
)
|
|
267
258
|
|
|
@@ -337,7 +328,6 @@ class Pendle(BaseSDK):
|
|
|
337
328
|
*,
|
|
338
329
|
chain: models.PendlePositionsChain = models.PendlePositionsChain.ETHEREUM_MAINNET,
|
|
339
330
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
340
|
-
block: OptionalNullable[int] = UNSET,
|
|
341
331
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
342
332
|
server_url: Optional[str] = None,
|
|
343
333
|
timeout_ms: Optional[int] = None,
|
|
@@ -349,7 +339,6 @@ class Pendle(BaseSDK):
|
|
|
349
339
|
|
|
350
340
|
:param chain: The chain to use.
|
|
351
341
|
:param user_address: The user address of the desired position.
|
|
352
|
-
:param block: Optional block number (defaults to latest).
|
|
353
342
|
:param retries: Override the default retry configuration for this method
|
|
354
343
|
:param server_url: Override the default server URL for this method
|
|
355
344
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -367,7 +356,6 @@ class Pendle(BaseSDK):
|
|
|
367
356
|
|
|
368
357
|
request = models.PendlePositionsRequest(
|
|
369
358
|
chain=chain,
|
|
370
|
-
block=block,
|
|
371
359
|
user_address=user_address,
|
|
372
360
|
)
|
|
373
361
|
|
|
@@ -438,22 +426,22 @@ class Pendle(BaseSDK):
|
|
|
438
426
|
http_res,
|
|
439
427
|
)
|
|
440
428
|
|
|
441
|
-
def
|
|
429
|
+
def market(
|
|
442
430
|
self,
|
|
443
431
|
*,
|
|
444
|
-
chain: models.
|
|
445
|
-
|
|
432
|
+
chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
|
|
433
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
446
434
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
447
435
|
server_url: Optional[str] = None,
|
|
448
436
|
timeout_ms: Optional[int] = None,
|
|
449
437
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
450
|
-
) -> models.
|
|
451
|
-
r"""
|
|
438
|
+
) -> models.PendleGetMarketResponse:
|
|
439
|
+
r"""Get Market Data
|
|
452
440
|
|
|
453
|
-
Get
|
|
441
|
+
Get the market's implied APY, maturity date and the associated token data.
|
|
454
442
|
|
|
455
443
|
:param chain: The chain to use.
|
|
456
|
-
:param
|
|
444
|
+
:param market_address: The market address of the desired position.
|
|
457
445
|
:param retries: Override the default retry configuration for this method
|
|
458
446
|
:param server_url: Override the default server URL for this method
|
|
459
447
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -469,14 +457,14 @@ class Pendle(BaseSDK):
|
|
|
469
457
|
else:
|
|
470
458
|
base_url = self._get_url(base_url, url_variables)
|
|
471
459
|
|
|
472
|
-
request = models.
|
|
460
|
+
request = models.PendleMarketRequest(
|
|
473
461
|
chain=chain,
|
|
474
|
-
|
|
462
|
+
market_address=market_address,
|
|
475
463
|
)
|
|
476
464
|
|
|
477
465
|
req = self._build_request(
|
|
478
466
|
method="GET",
|
|
479
|
-
path="/v0/pendle/
|
|
467
|
+
path="/v0/pendle/market",
|
|
480
468
|
base_url=base_url,
|
|
481
469
|
url_variables=url_variables,
|
|
482
470
|
request=request,
|
|
@@ -502,7 +490,7 @@ class Pendle(BaseSDK):
|
|
|
502
490
|
hook_ctx=HookContext(
|
|
503
491
|
config=self.sdk_configuration,
|
|
504
492
|
base_url=base_url or "",
|
|
505
|
-
operation_id="
|
|
493
|
+
operation_id="pendle_market",
|
|
506
494
|
oauth2_scopes=[],
|
|
507
495
|
security_source=self.sdk_configuration.security,
|
|
508
496
|
),
|
|
@@ -513,7 +501,7 @@ class Pendle(BaseSDK):
|
|
|
513
501
|
|
|
514
502
|
response_data: Any = None
|
|
515
503
|
if utils.match_response(http_res, "200", "application/json"):
|
|
516
|
-
return utils.unmarshal_json(http_res.text, models.
|
|
504
|
+
return utils.unmarshal_json(http_res.text, models.PendleGetMarketResponse)
|
|
517
505
|
if utils.match_response(http_res, "422", "application/json"):
|
|
518
506
|
response_data = utils.unmarshal_json(
|
|
519
507
|
http_res.text, errors.HTTPValidationErrorData
|
|
@@ -539,22 +527,22 @@ class Pendle(BaseSDK):
|
|
|
539
527
|
http_res,
|
|
540
528
|
)
|
|
541
529
|
|
|
542
|
-
async def
|
|
530
|
+
async def market_async(
|
|
543
531
|
self,
|
|
544
532
|
*,
|
|
545
|
-
chain: models.
|
|
546
|
-
|
|
533
|
+
chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
|
|
534
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
547
535
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
548
536
|
server_url: Optional[str] = None,
|
|
549
537
|
timeout_ms: Optional[int] = None,
|
|
550
538
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
551
|
-
) -> models.
|
|
552
|
-
r"""
|
|
539
|
+
) -> models.PendleGetMarketResponse:
|
|
540
|
+
r"""Get Market Data
|
|
553
541
|
|
|
554
|
-
Get
|
|
542
|
+
Get the market's implied APY, maturity date and the associated token data.
|
|
555
543
|
|
|
556
544
|
:param chain: The chain to use.
|
|
557
|
-
:param
|
|
545
|
+
:param market_address: The market address of the desired position.
|
|
558
546
|
:param retries: Override the default retry configuration for this method
|
|
559
547
|
:param server_url: Override the default server URL for this method
|
|
560
548
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -570,14 +558,14 @@ class Pendle(BaseSDK):
|
|
|
570
558
|
else:
|
|
571
559
|
base_url = self._get_url(base_url, url_variables)
|
|
572
560
|
|
|
573
|
-
request = models.
|
|
561
|
+
request = models.PendleMarketRequest(
|
|
574
562
|
chain=chain,
|
|
575
|
-
|
|
563
|
+
market_address=market_address,
|
|
576
564
|
)
|
|
577
565
|
|
|
578
566
|
req = self._build_request_async(
|
|
579
567
|
method="GET",
|
|
580
|
-
path="/v0/pendle/
|
|
568
|
+
path="/v0/pendle/market",
|
|
581
569
|
base_url=base_url,
|
|
582
570
|
url_variables=url_variables,
|
|
583
571
|
request=request,
|
|
@@ -603,7 +591,7 @@ class Pendle(BaseSDK):
|
|
|
603
591
|
hook_ctx=HookContext(
|
|
604
592
|
config=self.sdk_configuration,
|
|
605
593
|
base_url=base_url or "",
|
|
606
|
-
operation_id="
|
|
594
|
+
operation_id="pendle_market",
|
|
607
595
|
oauth2_scopes=[],
|
|
608
596
|
security_source=self.sdk_configuration.security,
|
|
609
597
|
),
|
|
@@ -614,7 +602,7 @@ class Pendle(BaseSDK):
|
|
|
614
602
|
|
|
615
603
|
response_data: Any = None
|
|
616
604
|
if utils.match_response(http_res, "200", "application/json"):
|
|
617
|
-
return utils.unmarshal_json(http_res.text, models.
|
|
605
|
+
return utils.unmarshal_json(http_res.text, models.PendleGetMarketResponse)
|
|
618
606
|
if utils.match_response(http_res, "422", "application/json"):
|
|
619
607
|
response_data = utils.unmarshal_json(
|
|
620
608
|
http_res.text, errors.HTTPValidationErrorData
|
|
@@ -640,24 +628,20 @@ class Pendle(BaseSDK):
|
|
|
640
628
|
http_res,
|
|
641
629
|
)
|
|
642
630
|
|
|
643
|
-
def
|
|
631
|
+
def markets(
|
|
644
632
|
self,
|
|
645
633
|
*,
|
|
646
|
-
chain: models.
|
|
647
|
-
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
648
|
-
block: OptionalNullable[int] = UNSET,
|
|
634
|
+
chain: models.PendleMarketsChain = models.PendleMarketsChain.ETHEREUM_MAINNET,
|
|
649
635
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
650
636
|
server_url: Optional[str] = None,
|
|
651
637
|
timeout_ms: Optional[int] = None,
|
|
652
638
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
653
|
-
) -> models.
|
|
654
|
-
r"""
|
|
639
|
+
) -> models.PendleListMarketsResponse:
|
|
640
|
+
r"""List Market Data
|
|
655
641
|
|
|
656
|
-
Get
|
|
642
|
+
Get a list of active markets.
|
|
657
643
|
|
|
658
644
|
:param chain: The chain to use.
|
|
659
|
-
:param market_address: The market address of the desired position.
|
|
660
|
-
:param block: Optional block number (defaults to latest).
|
|
661
645
|
:param retries: Override the default retry configuration for this method
|
|
662
646
|
:param server_url: Override the default server URL for this method
|
|
663
647
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -673,15 +657,13 @@ class Pendle(BaseSDK):
|
|
|
673
657
|
else:
|
|
674
658
|
base_url = self._get_url(base_url, url_variables)
|
|
675
659
|
|
|
676
|
-
request = models.
|
|
660
|
+
request = models.PendleMarketsRequest(
|
|
677
661
|
chain=chain,
|
|
678
|
-
block=block,
|
|
679
|
-
market_address=market_address,
|
|
680
662
|
)
|
|
681
663
|
|
|
682
664
|
req = self._build_request(
|
|
683
665
|
method="GET",
|
|
684
|
-
path="/v0/pendle/
|
|
666
|
+
path="/v0/pendle/markets",
|
|
685
667
|
base_url=base_url,
|
|
686
668
|
url_variables=url_variables,
|
|
687
669
|
request=request,
|
|
@@ -707,7 +689,7 @@ class Pendle(BaseSDK):
|
|
|
707
689
|
hook_ctx=HookContext(
|
|
708
690
|
config=self.sdk_configuration,
|
|
709
691
|
base_url=base_url or "",
|
|
710
|
-
operation_id="
|
|
692
|
+
operation_id="pendle_markets",
|
|
711
693
|
oauth2_scopes=[],
|
|
712
694
|
security_source=self.sdk_configuration.security,
|
|
713
695
|
),
|
|
@@ -718,7 +700,7 @@ class Pendle(BaseSDK):
|
|
|
718
700
|
|
|
719
701
|
response_data: Any = None
|
|
720
702
|
if utils.match_response(http_res, "200", "application/json"):
|
|
721
|
-
return utils.unmarshal_json(http_res.text, models.
|
|
703
|
+
return utils.unmarshal_json(http_res.text, models.PendleListMarketsResponse)
|
|
722
704
|
if utils.match_response(http_res, "422", "application/json"):
|
|
723
705
|
response_data = utils.unmarshal_json(
|
|
724
706
|
http_res.text, errors.HTTPValidationErrorData
|
|
@@ -744,24 +726,20 @@ class Pendle(BaseSDK):
|
|
|
744
726
|
http_res,
|
|
745
727
|
)
|
|
746
728
|
|
|
747
|
-
async def
|
|
729
|
+
async def markets_async(
|
|
748
730
|
self,
|
|
749
731
|
*,
|
|
750
|
-
chain: models.
|
|
751
|
-
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
752
|
-
block: OptionalNullable[int] = UNSET,
|
|
732
|
+
chain: models.PendleMarketsChain = models.PendleMarketsChain.ETHEREUM_MAINNET,
|
|
753
733
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
754
734
|
server_url: Optional[str] = None,
|
|
755
735
|
timeout_ms: Optional[int] = None,
|
|
756
736
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
757
|
-
) -> models.
|
|
758
|
-
r"""
|
|
737
|
+
) -> models.PendleListMarketsResponse:
|
|
738
|
+
r"""List Market Data
|
|
759
739
|
|
|
760
|
-
Get
|
|
740
|
+
Get a list of active markets.
|
|
761
741
|
|
|
762
742
|
:param chain: The chain to use.
|
|
763
|
-
:param market_address: The market address of the desired position.
|
|
764
|
-
:param block: Optional block number (defaults to latest).
|
|
765
743
|
:param retries: Override the default retry configuration for this method
|
|
766
744
|
:param server_url: Override the default server URL for this method
|
|
767
745
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -777,15 +755,13 @@ class Pendle(BaseSDK):
|
|
|
777
755
|
else:
|
|
778
756
|
base_url = self._get_url(base_url, url_variables)
|
|
779
757
|
|
|
780
|
-
request = models.
|
|
758
|
+
request = models.PendleMarketsRequest(
|
|
781
759
|
chain=chain,
|
|
782
|
-
block=block,
|
|
783
|
-
market_address=market_address,
|
|
784
760
|
)
|
|
785
761
|
|
|
786
762
|
req = self._build_request_async(
|
|
787
763
|
method="GET",
|
|
788
|
-
path="/v0/pendle/
|
|
764
|
+
path="/v0/pendle/markets",
|
|
789
765
|
base_url=base_url,
|
|
790
766
|
url_variables=url_variables,
|
|
791
767
|
request=request,
|
|
@@ -811,7 +787,7 @@ class Pendle(BaseSDK):
|
|
|
811
787
|
hook_ctx=HookContext(
|
|
812
788
|
config=self.sdk_configuration,
|
|
813
789
|
base_url=base_url or "",
|
|
814
|
-
operation_id="
|
|
790
|
+
operation_id="pendle_markets",
|
|
815
791
|
oauth2_scopes=[],
|
|
816
792
|
security_source=self.sdk_configuration.security,
|
|
817
793
|
),
|
|
@@ -822,7 +798,7 @@ class Pendle(BaseSDK):
|
|
|
822
798
|
|
|
823
799
|
response_data: Any = None
|
|
824
800
|
if utils.match_response(http_res, "200", "application/json"):
|
|
825
|
-
return utils.unmarshal_json(http_res.text, models.
|
|
801
|
+
return utils.unmarshal_json(http_res.text, models.PendleListMarketsResponse)
|
|
826
802
|
if utils.match_response(http_res, "422", "application/json"):
|
|
827
803
|
response_data = utils.unmarshal_json(
|
|
828
804
|
http_res.text, errors.HTTPValidationErrorData
|
|
@@ -1957,3 +1933,469 @@ class Pendle(BaseSDK):
|
|
|
1957
1933
|
http_res_text,
|
|
1958
1934
|
http_res,
|
|
1959
1935
|
)
|
|
1936
|
+
|
|
1937
|
+
def add_liquidity(
|
|
1938
|
+
self,
|
|
1939
|
+
*,
|
|
1940
|
+
market_address: str,
|
|
1941
|
+
amount: Union[
|
|
1942
|
+
models.PendleAddLiquidityRequestAmount,
|
|
1943
|
+
models.PendleAddLiquidityRequestAmountTypedDict,
|
|
1944
|
+
],
|
|
1945
|
+
chain: models.Chain,
|
|
1946
|
+
sender: str,
|
|
1947
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1948
|
+
server_url: Optional[str] = None,
|
|
1949
|
+
timeout_ms: Optional[int] = None,
|
|
1950
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1951
|
+
) -> models.TxResponse:
|
|
1952
|
+
r"""Add Liquidity
|
|
1953
|
+
|
|
1954
|
+
Add liquidity to a Pendle Market to earn yield.
|
|
1955
|
+
|
|
1956
|
+
Liquidity is added in the form of the market's Underlying Token. Representation of
|
|
1957
|
+
the liquidity received is the market's Liquidity Provider Token (LP).
|
|
1958
|
+
|
|
1959
|
+
:param market_address: The address identifying which Pendle Market you would like to add liquidity to.
|
|
1960
|
+
:param amount: The amount of liquidity you would like to add to the market denominated in the market's Underlying Token.
|
|
1961
|
+
:param chain: The chain to use.
|
|
1962
|
+
:param sender: The address of the transaction sender.
|
|
1963
|
+
:param retries: Override the default retry configuration for this method
|
|
1964
|
+
:param server_url: Override the default server URL for this method
|
|
1965
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1966
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1967
|
+
"""
|
|
1968
|
+
base_url = None
|
|
1969
|
+
url_variables = None
|
|
1970
|
+
if timeout_ms is None:
|
|
1971
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1972
|
+
|
|
1973
|
+
if server_url is not None:
|
|
1974
|
+
base_url = server_url
|
|
1975
|
+
else:
|
|
1976
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1977
|
+
|
|
1978
|
+
request = models.PendleAddLiquidityRequest(
|
|
1979
|
+
market_address=market_address,
|
|
1980
|
+
amount=amount,
|
|
1981
|
+
chain=chain,
|
|
1982
|
+
sender=sender,
|
|
1983
|
+
)
|
|
1984
|
+
|
|
1985
|
+
req = self._build_request(
|
|
1986
|
+
method="POST",
|
|
1987
|
+
path="/v0/pendle/add_liquidity",
|
|
1988
|
+
base_url=base_url,
|
|
1989
|
+
url_variables=url_variables,
|
|
1990
|
+
request=request,
|
|
1991
|
+
request_body_required=True,
|
|
1992
|
+
request_has_path_params=False,
|
|
1993
|
+
request_has_query_params=True,
|
|
1994
|
+
user_agent_header="user-agent",
|
|
1995
|
+
accept_header_value="application/json",
|
|
1996
|
+
http_headers=http_headers,
|
|
1997
|
+
security=self.sdk_configuration.security,
|
|
1998
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1999
|
+
request, False, False, "json", models.PendleAddLiquidityRequest
|
|
2000
|
+
),
|
|
2001
|
+
timeout_ms=timeout_ms,
|
|
2002
|
+
)
|
|
2003
|
+
|
|
2004
|
+
if retries == UNSET:
|
|
2005
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2006
|
+
retries = self.sdk_configuration.retry_config
|
|
2007
|
+
|
|
2008
|
+
retry_config = None
|
|
2009
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2010
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2011
|
+
|
|
2012
|
+
http_res = self.do_request(
|
|
2013
|
+
hook_ctx=HookContext(
|
|
2014
|
+
config=self.sdk_configuration,
|
|
2015
|
+
base_url=base_url or "",
|
|
2016
|
+
operation_id="pendle_add_liquidity",
|
|
2017
|
+
oauth2_scopes=[],
|
|
2018
|
+
security_source=self.sdk_configuration.security,
|
|
2019
|
+
),
|
|
2020
|
+
request=req,
|
|
2021
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
2022
|
+
retry_config=retry_config,
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2025
|
+
response_data: Any = None
|
|
2026
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2027
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
2028
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
2029
|
+
response_data = utils.unmarshal_json(
|
|
2030
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
2031
|
+
)
|
|
2032
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
2033
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2034
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2035
|
+
raise errors.APIError(
|
|
2036
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2037
|
+
)
|
|
2038
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2039
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2040
|
+
raise errors.APIError(
|
|
2041
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2042
|
+
)
|
|
2043
|
+
|
|
2044
|
+
content_type = http_res.headers.get("Content-Type")
|
|
2045
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2046
|
+
raise errors.APIError(
|
|
2047
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2048
|
+
http_res.status_code,
|
|
2049
|
+
http_res_text,
|
|
2050
|
+
http_res,
|
|
2051
|
+
)
|
|
2052
|
+
|
|
2053
|
+
async def add_liquidity_async(
|
|
2054
|
+
self,
|
|
2055
|
+
*,
|
|
2056
|
+
market_address: str,
|
|
2057
|
+
amount: Union[
|
|
2058
|
+
models.PendleAddLiquidityRequestAmount,
|
|
2059
|
+
models.PendleAddLiquidityRequestAmountTypedDict,
|
|
2060
|
+
],
|
|
2061
|
+
chain: models.Chain,
|
|
2062
|
+
sender: str,
|
|
2063
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2064
|
+
server_url: Optional[str] = None,
|
|
2065
|
+
timeout_ms: Optional[int] = None,
|
|
2066
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2067
|
+
) -> models.TxResponse:
|
|
2068
|
+
r"""Add Liquidity
|
|
2069
|
+
|
|
2070
|
+
Add liquidity to a Pendle Market to earn yield.
|
|
2071
|
+
|
|
2072
|
+
Liquidity is added in the form of the market's Underlying Token. Representation of
|
|
2073
|
+
the liquidity received is the market's Liquidity Provider Token (LP).
|
|
2074
|
+
|
|
2075
|
+
:param market_address: The address identifying which Pendle Market you would like to add liquidity to.
|
|
2076
|
+
:param amount: The amount of liquidity you would like to add to the market denominated in the market's Underlying Token.
|
|
2077
|
+
:param chain: The chain to use.
|
|
2078
|
+
:param sender: The address of the transaction sender.
|
|
2079
|
+
:param retries: Override the default retry configuration for this method
|
|
2080
|
+
:param server_url: Override the default server URL for this method
|
|
2081
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2082
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2083
|
+
"""
|
|
2084
|
+
base_url = None
|
|
2085
|
+
url_variables = None
|
|
2086
|
+
if timeout_ms is None:
|
|
2087
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2088
|
+
|
|
2089
|
+
if server_url is not None:
|
|
2090
|
+
base_url = server_url
|
|
2091
|
+
else:
|
|
2092
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2093
|
+
|
|
2094
|
+
request = models.PendleAddLiquidityRequest(
|
|
2095
|
+
market_address=market_address,
|
|
2096
|
+
amount=amount,
|
|
2097
|
+
chain=chain,
|
|
2098
|
+
sender=sender,
|
|
2099
|
+
)
|
|
2100
|
+
|
|
2101
|
+
req = self._build_request_async(
|
|
2102
|
+
method="POST",
|
|
2103
|
+
path="/v0/pendle/add_liquidity",
|
|
2104
|
+
base_url=base_url,
|
|
2105
|
+
url_variables=url_variables,
|
|
2106
|
+
request=request,
|
|
2107
|
+
request_body_required=True,
|
|
2108
|
+
request_has_path_params=False,
|
|
2109
|
+
request_has_query_params=True,
|
|
2110
|
+
user_agent_header="user-agent",
|
|
2111
|
+
accept_header_value="application/json",
|
|
2112
|
+
http_headers=http_headers,
|
|
2113
|
+
security=self.sdk_configuration.security,
|
|
2114
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2115
|
+
request, False, False, "json", models.PendleAddLiquidityRequest
|
|
2116
|
+
),
|
|
2117
|
+
timeout_ms=timeout_ms,
|
|
2118
|
+
)
|
|
2119
|
+
|
|
2120
|
+
if retries == UNSET:
|
|
2121
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2122
|
+
retries = self.sdk_configuration.retry_config
|
|
2123
|
+
|
|
2124
|
+
retry_config = None
|
|
2125
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2126
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2127
|
+
|
|
2128
|
+
http_res = await self.do_request_async(
|
|
2129
|
+
hook_ctx=HookContext(
|
|
2130
|
+
config=self.sdk_configuration,
|
|
2131
|
+
base_url=base_url or "",
|
|
2132
|
+
operation_id="pendle_add_liquidity",
|
|
2133
|
+
oauth2_scopes=[],
|
|
2134
|
+
security_source=self.sdk_configuration.security,
|
|
2135
|
+
),
|
|
2136
|
+
request=req,
|
|
2137
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
2138
|
+
retry_config=retry_config,
|
|
2139
|
+
)
|
|
2140
|
+
|
|
2141
|
+
response_data: Any = None
|
|
2142
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2143
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
2144
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
2145
|
+
response_data = utils.unmarshal_json(
|
|
2146
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
2147
|
+
)
|
|
2148
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
2149
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2150
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2151
|
+
raise errors.APIError(
|
|
2152
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2153
|
+
)
|
|
2154
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2155
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2156
|
+
raise errors.APIError(
|
|
2157
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2158
|
+
)
|
|
2159
|
+
|
|
2160
|
+
content_type = http_res.headers.get("Content-Type")
|
|
2161
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2162
|
+
raise errors.APIError(
|
|
2163
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2164
|
+
http_res.status_code,
|
|
2165
|
+
http_res_text,
|
|
2166
|
+
http_res,
|
|
2167
|
+
)
|
|
2168
|
+
|
|
2169
|
+
def remove_liquidity(
|
|
2170
|
+
self,
|
|
2171
|
+
*,
|
|
2172
|
+
market_address: str,
|
|
2173
|
+
amount: Union[
|
|
2174
|
+
models.PendleRemoveLiquidityRequestAmount,
|
|
2175
|
+
models.PendleRemoveLiquidityRequestAmountTypedDict,
|
|
2176
|
+
],
|
|
2177
|
+
chain: models.Chain,
|
|
2178
|
+
sender: str,
|
|
2179
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2180
|
+
server_url: Optional[str] = None,
|
|
2181
|
+
timeout_ms: Optional[int] = None,
|
|
2182
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2183
|
+
) -> models.TxResponse:
|
|
2184
|
+
r"""Remove Liquidity
|
|
2185
|
+
|
|
2186
|
+
Remove liquidity from a Pendle Market.
|
|
2187
|
+
|
|
2188
|
+
Liquidity is removed in the form of the market's Liquidity Provider Token (LP) into
|
|
2189
|
+
the market's Underlying Token. An appropriate allowance for the Pendle Router on the
|
|
2190
|
+
market contract must be set beforehand
|
|
2191
|
+
|
|
2192
|
+
:param market_address: The address identifying which Pendle Market you would like to remove liquidity from.
|
|
2193
|
+
:param amount: The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP).
|
|
2194
|
+
:param chain: The chain to use.
|
|
2195
|
+
:param sender: The address of the transaction sender.
|
|
2196
|
+
:param retries: Override the default retry configuration for this method
|
|
2197
|
+
:param server_url: Override the default server URL for this method
|
|
2198
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2199
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2200
|
+
"""
|
|
2201
|
+
base_url = None
|
|
2202
|
+
url_variables = None
|
|
2203
|
+
if timeout_ms is None:
|
|
2204
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2205
|
+
|
|
2206
|
+
if server_url is not None:
|
|
2207
|
+
base_url = server_url
|
|
2208
|
+
else:
|
|
2209
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2210
|
+
|
|
2211
|
+
request = models.PendleRemoveLiquidityRequest(
|
|
2212
|
+
market_address=market_address,
|
|
2213
|
+
amount=amount,
|
|
2214
|
+
chain=chain,
|
|
2215
|
+
sender=sender,
|
|
2216
|
+
)
|
|
2217
|
+
|
|
2218
|
+
req = self._build_request(
|
|
2219
|
+
method="POST",
|
|
2220
|
+
path="/v0/pendle/remove_liquidity",
|
|
2221
|
+
base_url=base_url,
|
|
2222
|
+
url_variables=url_variables,
|
|
2223
|
+
request=request,
|
|
2224
|
+
request_body_required=True,
|
|
2225
|
+
request_has_path_params=False,
|
|
2226
|
+
request_has_query_params=True,
|
|
2227
|
+
user_agent_header="user-agent",
|
|
2228
|
+
accept_header_value="application/json",
|
|
2229
|
+
http_headers=http_headers,
|
|
2230
|
+
security=self.sdk_configuration.security,
|
|
2231
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2232
|
+
request, False, False, "json", models.PendleRemoveLiquidityRequest
|
|
2233
|
+
),
|
|
2234
|
+
timeout_ms=timeout_ms,
|
|
2235
|
+
)
|
|
2236
|
+
|
|
2237
|
+
if retries == UNSET:
|
|
2238
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2239
|
+
retries = self.sdk_configuration.retry_config
|
|
2240
|
+
|
|
2241
|
+
retry_config = None
|
|
2242
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2243
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2244
|
+
|
|
2245
|
+
http_res = self.do_request(
|
|
2246
|
+
hook_ctx=HookContext(
|
|
2247
|
+
config=self.sdk_configuration,
|
|
2248
|
+
base_url=base_url or "",
|
|
2249
|
+
operation_id="pendle_remove_liquidity",
|
|
2250
|
+
oauth2_scopes=[],
|
|
2251
|
+
security_source=self.sdk_configuration.security,
|
|
2252
|
+
),
|
|
2253
|
+
request=req,
|
|
2254
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
2255
|
+
retry_config=retry_config,
|
|
2256
|
+
)
|
|
2257
|
+
|
|
2258
|
+
response_data: Any = None
|
|
2259
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2260
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
2261
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
2262
|
+
response_data = utils.unmarshal_json(
|
|
2263
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
2264
|
+
)
|
|
2265
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
2266
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2267
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2268
|
+
raise errors.APIError(
|
|
2269
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2270
|
+
)
|
|
2271
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2272
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2273
|
+
raise errors.APIError(
|
|
2274
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2275
|
+
)
|
|
2276
|
+
|
|
2277
|
+
content_type = http_res.headers.get("Content-Type")
|
|
2278
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2279
|
+
raise errors.APIError(
|
|
2280
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2281
|
+
http_res.status_code,
|
|
2282
|
+
http_res_text,
|
|
2283
|
+
http_res,
|
|
2284
|
+
)
|
|
2285
|
+
|
|
2286
|
+
async def remove_liquidity_async(
|
|
2287
|
+
self,
|
|
2288
|
+
*,
|
|
2289
|
+
market_address: str,
|
|
2290
|
+
amount: Union[
|
|
2291
|
+
models.PendleRemoveLiquidityRequestAmount,
|
|
2292
|
+
models.PendleRemoveLiquidityRequestAmountTypedDict,
|
|
2293
|
+
],
|
|
2294
|
+
chain: models.Chain,
|
|
2295
|
+
sender: str,
|
|
2296
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2297
|
+
server_url: Optional[str] = None,
|
|
2298
|
+
timeout_ms: Optional[int] = None,
|
|
2299
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2300
|
+
) -> models.TxResponse:
|
|
2301
|
+
r"""Remove Liquidity
|
|
2302
|
+
|
|
2303
|
+
Remove liquidity from a Pendle Market.
|
|
2304
|
+
|
|
2305
|
+
Liquidity is removed in the form of the market's Liquidity Provider Token (LP) into
|
|
2306
|
+
the market's Underlying Token. An appropriate allowance for the Pendle Router on the
|
|
2307
|
+
market contract must be set beforehand
|
|
2308
|
+
|
|
2309
|
+
:param market_address: The address identifying which Pendle Market you would like to remove liquidity from.
|
|
2310
|
+
:param amount: The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP).
|
|
2311
|
+
:param chain: The chain to use.
|
|
2312
|
+
:param sender: The address of the transaction sender.
|
|
2313
|
+
:param retries: Override the default retry configuration for this method
|
|
2314
|
+
:param server_url: Override the default server URL for this method
|
|
2315
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2316
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2317
|
+
"""
|
|
2318
|
+
base_url = None
|
|
2319
|
+
url_variables = None
|
|
2320
|
+
if timeout_ms is None:
|
|
2321
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2322
|
+
|
|
2323
|
+
if server_url is not None:
|
|
2324
|
+
base_url = server_url
|
|
2325
|
+
else:
|
|
2326
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2327
|
+
|
|
2328
|
+
request = models.PendleRemoveLiquidityRequest(
|
|
2329
|
+
market_address=market_address,
|
|
2330
|
+
amount=amount,
|
|
2331
|
+
chain=chain,
|
|
2332
|
+
sender=sender,
|
|
2333
|
+
)
|
|
2334
|
+
|
|
2335
|
+
req = self._build_request_async(
|
|
2336
|
+
method="POST",
|
|
2337
|
+
path="/v0/pendle/remove_liquidity",
|
|
2338
|
+
base_url=base_url,
|
|
2339
|
+
url_variables=url_variables,
|
|
2340
|
+
request=request,
|
|
2341
|
+
request_body_required=True,
|
|
2342
|
+
request_has_path_params=False,
|
|
2343
|
+
request_has_query_params=True,
|
|
2344
|
+
user_agent_header="user-agent",
|
|
2345
|
+
accept_header_value="application/json",
|
|
2346
|
+
http_headers=http_headers,
|
|
2347
|
+
security=self.sdk_configuration.security,
|
|
2348
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2349
|
+
request, False, False, "json", models.PendleRemoveLiquidityRequest
|
|
2350
|
+
),
|
|
2351
|
+
timeout_ms=timeout_ms,
|
|
2352
|
+
)
|
|
2353
|
+
|
|
2354
|
+
if retries == UNSET:
|
|
2355
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2356
|
+
retries = self.sdk_configuration.retry_config
|
|
2357
|
+
|
|
2358
|
+
retry_config = None
|
|
2359
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2360
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2361
|
+
|
|
2362
|
+
http_res = await self.do_request_async(
|
|
2363
|
+
hook_ctx=HookContext(
|
|
2364
|
+
config=self.sdk_configuration,
|
|
2365
|
+
base_url=base_url or "",
|
|
2366
|
+
operation_id="pendle_remove_liquidity",
|
|
2367
|
+
oauth2_scopes=[],
|
|
2368
|
+
security_source=self.sdk_configuration.security,
|
|
2369
|
+
),
|
|
2370
|
+
request=req,
|
|
2371
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
2372
|
+
retry_config=retry_config,
|
|
2373
|
+
)
|
|
2374
|
+
|
|
2375
|
+
response_data: Any = None
|
|
2376
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2377
|
+
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
2378
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
2379
|
+
response_data = utils.unmarshal_json(
|
|
2380
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
2381
|
+
)
|
|
2382
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
2383
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2384
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2385
|
+
raise errors.APIError(
|
|
2386
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2387
|
+
)
|
|
2388
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2389
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2390
|
+
raise errors.APIError(
|
|
2391
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2392
|
+
)
|
|
2393
|
+
|
|
2394
|
+
content_type = http_res.headers.get("Content-Type")
|
|
2395
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2396
|
+
raise errors.APIError(
|
|
2397
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2398
|
+
http_res.status_code,
|
|
2399
|
+
http_res_text,
|
|
2400
|
+
http_res,
|
|
2401
|
+
)
|