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

Files changed (28) hide show
  1. compass_api_sdk/_version.py +3 -3
  2. compass_api_sdk/aave_v3.py +53 -64
  3. compass_api_sdk/aerodrome_slipstream.py +29 -28
  4. compass_api_sdk/erc_4626_vaults.py +13 -12
  5. compass_api_sdk/models/__init__.py +40 -24
  6. compass_api_sdk/models/compass_api_backend_models_pendle_read_response_market_userposition.py +82 -0
  7. compass_api_sdk/models/{userposition.py → compass_api_backend_models_vaults_read_response_vault_userposition.py} +2 -2
  8. compass_api_sdk/models/pendle_marketop.py +10 -2
  9. compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
  10. compass_api_sdk/models/uniswapbuyexactlyparams.py +32 -24
  11. compass_api_sdk/models/uniswapbuyexactlyrequest.py +32 -24
  12. compass_api_sdk/models/vaultgetvaultresponse.py +10 -3
  13. compass_api_sdk/morpho.py +49 -60
  14. compass_api_sdk/pendle.py +71 -268
  15. compass_api_sdk/sky.py +21 -24
  16. compass_api_sdk/smart_account.py +5 -4
  17. compass_api_sdk/token_sdk.py +17 -16
  18. compass_api_sdk/transaction_bundler.py +13 -12
  19. compass_api_sdk/uniswap_v3.py +61 -60
  20. compass_api_sdk/universal.py +33 -32
  21. compass_api_sdk/utils/__init__.py +0 -3
  22. compass_api_sdk/utils/serializers.py +1 -18
  23. compass_api_sdk/utils/unmarshal_json_response.py +24 -0
  24. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/METADATA +2 -3
  25. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/RECORD +26 -26
  26. compass_api_sdk/models/pendle_positionop.py +0 -87
  27. compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
  28. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/WHEEL +0 -0
@@ -4,6 +4,7 @@ from .basesdk import BaseSDK
4
4
  from compass_api_sdk import errors, models, utils
5
5
  from compass_api_sdk._hooks import HookContext
6
6
  from compass_api_sdk.types import OptionalNullable, UNSET
7
+ from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
7
8
  from typing import Any, Mapping, Optional, Union
8
9
 
9
10
 
@@ -99,11 +100,9 @@ class UniswapV3(BaseSDK):
99
100
 
100
101
  response_data: Any = None
101
102
  if utils.match_response(http_res, "200", "application/json"):
102
- return utils.unmarshal_json_response(
103
- models.UniswapBuyQuoteInfoResponse, http_res
104
- )
103
+ return unmarshal_json_response(models.UniswapBuyQuoteInfoResponse, http_res)
105
104
  if utils.match_response(http_res, "422", "application/json"):
106
- response_data = utils.unmarshal_json_response(
105
+ response_data = unmarshal_json_response(
107
106
  errors.HTTPValidationErrorData, http_res
108
107
  )
109
108
  raise errors.HTTPValidationError(response_data, http_res)
@@ -207,11 +206,9 @@ class UniswapV3(BaseSDK):
207
206
 
208
207
  response_data: Any = None
209
208
  if utils.match_response(http_res, "200", "application/json"):
210
- return utils.unmarshal_json_response(
211
- models.UniswapBuyQuoteInfoResponse, http_res
212
- )
209
+ return unmarshal_json_response(models.UniswapBuyQuoteInfoResponse, http_res)
213
210
  if utils.match_response(http_res, "422", "application/json"):
214
- response_data = utils.unmarshal_json_response(
211
+ response_data = unmarshal_json_response(
215
212
  errors.HTTPValidationErrorData, http_res
216
213
  )
217
214
  raise errors.HTTPValidationError(response_data, http_res)
@@ -315,11 +312,11 @@ class UniswapV3(BaseSDK):
315
312
 
316
313
  response_data: Any = None
317
314
  if utils.match_response(http_res, "200", "application/json"):
318
- return utils.unmarshal_json_response(
315
+ return unmarshal_json_response(
319
316
  models.UniswapSellQuoteInfoResponse, http_res
320
317
  )
321
318
  if utils.match_response(http_res, "422", "application/json"):
322
- response_data = utils.unmarshal_json_response(
319
+ response_data = unmarshal_json_response(
323
320
  errors.HTTPValidationErrorData, http_res
324
321
  )
325
322
  raise errors.HTTPValidationError(response_data, http_res)
@@ -423,11 +420,11 @@ class UniswapV3(BaseSDK):
423
420
 
424
421
  response_data: Any = None
425
422
  if utils.match_response(http_res, "200", "application/json"):
426
- return utils.unmarshal_json_response(
423
+ return unmarshal_json_response(
427
424
  models.UniswapSellQuoteInfoResponse, http_res
428
425
  )
429
426
  if utils.match_response(http_res, "422", "application/json"):
430
- response_data = utils.unmarshal_json_response(
427
+ response_data = unmarshal_json_response(
431
428
  errors.HTTPValidationErrorData, http_res
432
429
  )
433
430
  raise errors.HTTPValidationError(response_data, http_res)
@@ -523,11 +520,9 @@ class UniswapV3(BaseSDK):
523
520
 
524
521
  response_data: Any = None
525
522
  if utils.match_response(http_res, "200", "application/json"):
526
- return utils.unmarshal_json_response(
527
- models.UniswapPoolPriceResponse, http_res
528
- )
523
+ return unmarshal_json_response(models.UniswapPoolPriceResponse, http_res)
529
524
  if utils.match_response(http_res, "422", "application/json"):
530
- response_data = utils.unmarshal_json_response(
525
+ response_data = unmarshal_json_response(
531
526
  errors.HTTPValidationErrorData, http_res
532
527
  )
533
528
  raise errors.HTTPValidationError(response_data, http_res)
@@ -623,11 +618,9 @@ class UniswapV3(BaseSDK):
623
618
 
624
619
  response_data: Any = None
625
620
  if utils.match_response(http_res, "200", "application/json"):
626
- return utils.unmarshal_json_response(
627
- models.UniswapPoolPriceResponse, http_res
628
- )
621
+ return unmarshal_json_response(models.UniswapPoolPriceResponse, http_res)
629
622
  if utils.match_response(http_res, "422", "application/json"):
630
- response_data = utils.unmarshal_json_response(
623
+ response_data = unmarshal_json_response(
631
624
  errors.HTTPValidationErrorData, http_res
632
625
  )
633
626
  raise errors.HTTPValidationError(response_data, http_res)
@@ -722,11 +715,9 @@ class UniswapV3(BaseSDK):
722
715
 
723
716
  response_data: Any = None
724
717
  if utils.match_response(http_res, "200", "application/json"):
725
- return utils.unmarshal_json_response(
726
- models.UniswapCheckInRangeResponse, http_res
727
- )
718
+ return unmarshal_json_response(models.UniswapCheckInRangeResponse, http_res)
728
719
  if utils.match_response(http_res, "422", "application/json"):
729
- response_data = utils.unmarshal_json_response(
720
+ response_data = unmarshal_json_response(
730
721
  errors.HTTPValidationErrorData, http_res
731
722
  )
732
723
  raise errors.HTTPValidationError(response_data, http_res)
@@ -821,11 +812,9 @@ class UniswapV3(BaseSDK):
821
812
 
822
813
  response_data: Any = None
823
814
  if utils.match_response(http_res, "200", "application/json"):
824
- return utils.unmarshal_json_response(
825
- models.UniswapCheckInRangeResponse, http_res
826
- )
815
+ return unmarshal_json_response(models.UniswapCheckInRangeResponse, http_res)
827
816
  if utils.match_response(http_res, "422", "application/json"):
828
- response_data = utils.unmarshal_json_response(
817
+ response_data = unmarshal_json_response(
829
818
  errors.HTTPValidationErrorData, http_res
830
819
  )
831
820
  raise errors.HTTPValidationError(response_data, http_res)
@@ -919,11 +908,11 @@ class UniswapV3(BaseSDK):
919
908
 
920
909
  response_data: Any = None
921
910
  if utils.match_response(http_res, "200", "application/json"):
922
- return utils.unmarshal_json_response(
911
+ return unmarshal_json_response(
923
912
  models.UniswapLPPositionsInfoResponse, http_res
924
913
  )
925
914
  if utils.match_response(http_res, "422", "application/json"):
926
- response_data = utils.unmarshal_json_response(
915
+ response_data = unmarshal_json_response(
927
916
  errors.HTTPValidationErrorData, http_res
928
917
  )
929
918
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1017,11 +1006,11 @@ class UniswapV3(BaseSDK):
1017
1006
 
1018
1007
  response_data: Any = None
1019
1008
  if utils.match_response(http_res, "200", "application/json"):
1020
- return utils.unmarshal_json_response(
1009
+ return unmarshal_json_response(
1021
1010
  models.UniswapLPPositionsInfoResponse, http_res
1022
1011
  )
1023
1012
  if utils.match_response(http_res, "422", "application/json"):
1024
- response_data = utils.unmarshal_json_response(
1013
+ response_data = unmarshal_json_response(
1025
1014
  errors.HTTPValidationErrorData, http_res
1026
1015
  )
1027
1016
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1037,8 +1026,14 @@ class UniswapV3(BaseSDK):
1037
1026
  def swap_buy_exactly(
1038
1027
  self,
1039
1028
  *,
1040
- token_in: models.TokenEnum,
1041
- token_out: models.TokenEnum,
1029
+ token_in: Union[
1030
+ models.UniswapBuyExactlyRequestTokenIn,
1031
+ models.UniswapBuyExactlyRequestTokenInTypedDict,
1032
+ ],
1033
+ token_out: Union[
1034
+ models.UniswapBuyExactlyRequestTokenOut,
1035
+ models.UniswapBuyExactlyRequestTokenOutTypedDict,
1036
+ ],
1042
1037
  fee: models.FeeEnum,
1043
1038
  amount: Union[
1044
1039
  models.UniswapBuyExactlyRequestAmount,
@@ -1063,8 +1058,8 @@ class UniswapV3(BaseSDK):
1063
1058
  pay with, and the exact amount to receive. If the token being paid with is WETH and
1064
1059
  needs to be wrapped, the appropriate amount will be wrapped automatically.
1065
1060
 
1066
- :param token_in: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
1067
- :param token_out: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
1061
+ :param token_in: The symbol of the token to swap from.
1062
+ :param token_out: The symbol of the token to swap to.
1068
1063
  :param fee: The transaction fee of a Uniswap pool in bips. Uniswap supports 4 different fee levels.
1069
1064
  :param amount: The amount of the token to swap to
1070
1065
  :param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
@@ -1139,9 +1134,9 @@ class UniswapV3(BaseSDK):
1139
1134
 
1140
1135
  response_data: Any = None
1141
1136
  if utils.match_response(http_res, "200", "application/json"):
1142
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1137
+ return unmarshal_json_response(models.TxResponse, http_res)
1143
1138
  if utils.match_response(http_res, "422", "application/json"):
1144
- response_data = utils.unmarshal_json_response(
1139
+ response_data = unmarshal_json_response(
1145
1140
  errors.HTTPValidationErrorData, http_res
1146
1141
  )
1147
1142
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1157,8 +1152,14 @@ class UniswapV3(BaseSDK):
1157
1152
  async def swap_buy_exactly_async(
1158
1153
  self,
1159
1154
  *,
1160
- token_in: models.TokenEnum,
1161
- token_out: models.TokenEnum,
1155
+ token_in: Union[
1156
+ models.UniswapBuyExactlyRequestTokenIn,
1157
+ models.UniswapBuyExactlyRequestTokenInTypedDict,
1158
+ ],
1159
+ token_out: Union[
1160
+ models.UniswapBuyExactlyRequestTokenOut,
1161
+ models.UniswapBuyExactlyRequestTokenOutTypedDict,
1162
+ ],
1162
1163
  fee: models.FeeEnum,
1163
1164
  amount: Union[
1164
1165
  models.UniswapBuyExactlyRequestAmount,
@@ -1183,8 +1184,8 @@ class UniswapV3(BaseSDK):
1183
1184
  pay with, and the exact amount to receive. If the token being paid with is WETH and
1184
1185
  needs to be wrapped, the appropriate amount will be wrapped automatically.
1185
1186
 
1186
- :param token_in: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
1187
- :param token_out: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
1187
+ :param token_in: The symbol of the token to swap from.
1188
+ :param token_out: The symbol of the token to swap to.
1188
1189
  :param fee: The transaction fee of a Uniswap pool in bips. Uniswap supports 4 different fee levels.
1189
1190
  :param amount: The amount of the token to swap to
1190
1191
  :param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
@@ -1259,9 +1260,9 @@ class UniswapV3(BaseSDK):
1259
1260
 
1260
1261
  response_data: Any = None
1261
1262
  if utils.match_response(http_res, "200", "application/json"):
1262
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1263
+ return unmarshal_json_response(models.TxResponse, http_res)
1263
1264
  if utils.match_response(http_res, "422", "application/json"):
1264
- response_data = utils.unmarshal_json_response(
1265
+ response_data = unmarshal_json_response(
1265
1266
  errors.HTTPValidationErrorData, http_res
1266
1267
  )
1267
1268
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1379,9 +1380,9 @@ class UniswapV3(BaseSDK):
1379
1380
 
1380
1381
  response_data: Any = None
1381
1382
  if utils.match_response(http_res, "200", "application/json"):
1382
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1383
+ return unmarshal_json_response(models.TxResponse, http_res)
1383
1384
  if utils.match_response(http_res, "422", "application/json"):
1384
- response_data = utils.unmarshal_json_response(
1385
+ response_data = unmarshal_json_response(
1385
1386
  errors.HTTPValidationErrorData, http_res
1386
1387
  )
1387
1388
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1499,9 +1500,9 @@ class UniswapV3(BaseSDK):
1499
1500
 
1500
1501
  response_data: Any = None
1501
1502
  if utils.match_response(http_res, "200", "application/json"):
1502
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1503
+ return unmarshal_json_response(models.TxResponse, http_res)
1503
1504
  if utils.match_response(http_res, "422", "application/json"):
1504
- response_data = utils.unmarshal_json_response(
1505
+ response_data = unmarshal_json_response(
1505
1506
  errors.HTTPValidationErrorData, http_res
1506
1507
  )
1507
1508
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1646,9 +1647,9 @@ class UniswapV3(BaseSDK):
1646
1647
 
1647
1648
  response_data: Any = None
1648
1649
  if utils.match_response(http_res, "200", "application/json"):
1649
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1650
+ return unmarshal_json_response(models.TxResponse, http_res)
1650
1651
  if utils.match_response(http_res, "422", "application/json"):
1651
- response_data = utils.unmarshal_json_response(
1652
+ response_data = unmarshal_json_response(
1652
1653
  errors.HTTPValidationErrorData, http_res
1653
1654
  )
1654
1655
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1793,9 +1794,9 @@ class UniswapV3(BaseSDK):
1793
1794
 
1794
1795
  response_data: Any = None
1795
1796
  if utils.match_response(http_res, "200", "application/json"):
1796
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1797
+ return unmarshal_json_response(models.TxResponse, http_res)
1797
1798
  if utils.match_response(http_res, "422", "application/json"):
1798
- response_data = utils.unmarshal_json_response(
1799
+ response_data = unmarshal_json_response(
1799
1800
  errors.HTTPValidationErrorData, http_res
1800
1801
  )
1801
1802
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1925,9 +1926,9 @@ class UniswapV3(BaseSDK):
1925
1926
 
1926
1927
  response_data: Any = None
1927
1928
  if utils.match_response(http_res, "200", "application/json"):
1928
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1929
+ return unmarshal_json_response(models.TxResponse, http_res)
1929
1930
  if utils.match_response(http_res, "422", "application/json"):
1930
- response_data = utils.unmarshal_json_response(
1931
+ response_data = unmarshal_json_response(
1931
1932
  errors.HTTPValidationErrorData, http_res
1932
1933
  )
1933
1934
  raise errors.HTTPValidationError(response_data, http_res)
@@ -2057,9 +2058,9 @@ class UniswapV3(BaseSDK):
2057
2058
 
2058
2059
  response_data: Any = None
2059
2060
  if utils.match_response(http_res, "200", "application/json"):
2060
- return utils.unmarshal_json_response(models.TxResponse, http_res)
2061
+ return unmarshal_json_response(models.TxResponse, http_res)
2061
2062
  if utils.match_response(http_res, "422", "application/json"):
2062
- response_data = utils.unmarshal_json_response(
2063
+ response_data = unmarshal_json_response(
2063
2064
  errors.HTTPValidationErrorData, http_res
2064
2065
  )
2065
2066
  raise errors.HTTPValidationError(response_data, http_res)
@@ -2172,9 +2173,9 @@ class UniswapV3(BaseSDK):
2172
2173
 
2173
2174
  response_data: Any = None
2174
2175
  if utils.match_response(http_res, "200", "application/json"):
2175
- return utils.unmarshal_json_response(models.TxResponse, http_res)
2176
+ return unmarshal_json_response(models.TxResponse, http_res)
2176
2177
  if utils.match_response(http_res, "422", "application/json"):
2177
- response_data = utils.unmarshal_json_response(
2178
+ response_data = unmarshal_json_response(
2178
2179
  errors.HTTPValidationErrorData, http_res
2179
2180
  )
2180
2181
  raise errors.HTTPValidationError(response_data, http_res)
@@ -2287,9 +2288,9 @@ class UniswapV3(BaseSDK):
2287
2288
 
2288
2289
  response_data: Any = None
2289
2290
  if utils.match_response(http_res, "200", "application/json"):
2290
- return utils.unmarshal_json_response(models.TxResponse, http_res)
2291
+ return unmarshal_json_response(models.TxResponse, http_res)
2291
2292
  if utils.match_response(http_res, "422", "application/json"):
2292
- response_data = utils.unmarshal_json_response(
2293
+ response_data = unmarshal_json_response(
2293
2294
  errors.HTTPValidationErrorData, http_res
2294
2295
  )
2295
2296
  raise errors.HTTPValidationError(response_data, http_res)
@@ -4,6 +4,7 @@ from .basesdk import BaseSDK
4
4
  from compass_api_sdk import errors, models, utils
5
5
  from compass_api_sdk._hooks import HookContext
6
6
  from compass_api_sdk.types import OptionalNullable, UNSET
7
+ from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
7
8
  from typing import Any, Mapping, Optional, Union
8
9
 
9
10
 
@@ -86,9 +87,9 @@ class Universal(BaseSDK):
86
87
 
87
88
  response_data: Any = None
88
89
  if utils.match_response(http_res, "200", "application/json"):
89
- return utils.unmarshal_json_response(models.Portfolio, http_res)
90
+ return unmarshal_json_response(models.Portfolio, http_res)
90
91
  if utils.match_response(http_res, "422", "application/json"):
91
- response_data = utils.unmarshal_json_response(
92
+ response_data = unmarshal_json_response(
92
93
  errors.HTTPValidationErrorData, http_res
93
94
  )
94
95
  raise errors.HTTPValidationError(response_data, http_res)
@@ -179,9 +180,9 @@ class Universal(BaseSDK):
179
180
 
180
181
  response_data: Any = None
181
182
  if utils.match_response(http_res, "200", "application/json"):
182
- return utils.unmarshal_json_response(models.Portfolio, http_res)
183
+ return unmarshal_json_response(models.Portfolio, http_res)
183
184
  if utils.match_response(http_res, "422", "application/json"):
184
- response_data = utils.unmarshal_json_response(
185
+ response_data = unmarshal_json_response(
185
186
  errors.HTTPValidationErrorData, http_res
186
187
  )
187
188
  raise errors.HTTPValidationError(response_data, http_res)
@@ -273,9 +274,9 @@ class Universal(BaseSDK):
273
274
 
274
275
  response_data: Any = None
275
276
  if utils.match_response(http_res, "200", "application/json"):
276
- return utils.unmarshal_json_response(models.Image, http_res)
277
+ return unmarshal_json_response(models.Image, http_res)
277
278
  if utils.match_response(http_res, "422", "application/json"):
278
- response_data = utils.unmarshal_json_response(
279
+ response_data = unmarshal_json_response(
279
280
  errors.HTTPValidationErrorData, http_res
280
281
  )
281
282
  raise errors.HTTPValidationError(response_data, http_res)
@@ -367,9 +368,9 @@ class Universal(BaseSDK):
367
368
 
368
369
  response_data: Any = None
369
370
  if utils.match_response(http_res, "200", "application/json"):
370
- return utils.unmarshal_json_response(models.Image, http_res)
371
+ return unmarshal_json_response(models.Image, http_res)
371
372
  if utils.match_response(http_res, "422", "application/json"):
372
- response_data = utils.unmarshal_json_response(
373
+ response_data = unmarshal_json_response(
373
374
  errors.HTTPValidationErrorData, http_res
374
375
  )
375
376
  raise errors.HTTPValidationError(response_data, http_res)
@@ -454,9 +455,9 @@ class Universal(BaseSDK):
454
455
 
455
456
  response_data: Any = None
456
457
  if utils.match_response(http_res, "200", "application/json"):
457
- return utils.unmarshal_json_response(models.TokenInfo, http_res)
458
+ return unmarshal_json_response(models.TokenInfo, http_res)
458
459
  if utils.match_response(http_res, "422", "application/json"):
459
- response_data = utils.unmarshal_json_response(
460
+ response_data = unmarshal_json_response(
460
461
  errors.HTTPValidationErrorData, http_res
461
462
  )
462
463
  raise errors.HTTPValidationError(response_data, http_res)
@@ -541,9 +542,9 @@ class Universal(BaseSDK):
541
542
 
542
543
  response_data: Any = None
543
544
  if utils.match_response(http_res, "200", "application/json"):
544
- return utils.unmarshal_json_response(models.TokenInfo, http_res)
545
+ return unmarshal_json_response(models.TokenInfo, http_res)
545
546
  if utils.match_response(http_res, "422", "application/json"):
546
- response_data = utils.unmarshal_json_response(
547
+ response_data = unmarshal_json_response(
547
548
  errors.HTTPValidationErrorData, http_res
548
549
  )
549
550
  raise errors.HTTPValidationError(response_data, http_res)
@@ -648,9 +649,9 @@ class Universal(BaseSDK):
648
649
 
649
650
  response_data: Any = None
650
651
  if utils.match_response(http_res, "200", "application/json"):
651
- return utils.unmarshal_json_response(models.AllowanceInfoResponse, http_res)
652
+ return unmarshal_json_response(models.AllowanceInfoResponse, http_res)
652
653
  if utils.match_response(http_res, "422", "application/json"):
653
- response_data = utils.unmarshal_json_response(
654
+ response_data = unmarshal_json_response(
654
655
  errors.HTTPValidationErrorData, http_res
655
656
  )
656
657
  raise errors.HTTPValidationError(response_data, http_res)
@@ -755,9 +756,9 @@ class Universal(BaseSDK):
755
756
 
756
757
  response_data: Any = None
757
758
  if utils.match_response(http_res, "200", "application/json"):
758
- return utils.unmarshal_json_response(models.AllowanceInfoResponse, http_res)
759
+ return unmarshal_json_response(models.AllowanceInfoResponse, http_res)
759
760
  if utils.match_response(http_res, "422", "application/json"):
760
- response_data = utils.unmarshal_json_response(
761
+ response_data = unmarshal_json_response(
761
762
  errors.HTTPValidationErrorData, http_res
762
763
  )
763
764
  raise errors.HTTPValidationError(response_data, http_res)
@@ -848,9 +849,9 @@ class Universal(BaseSDK):
848
849
 
849
850
  response_data: Any = None
850
851
  if utils.match_response(http_res, "200", "application/json"):
851
- return utils.unmarshal_json_response(models.EnsNameInfoResponse, http_res)
852
+ return unmarshal_json_response(models.EnsNameInfoResponse, http_res)
852
853
  if utils.match_response(http_res, "422", "application/json"):
853
- response_data = utils.unmarshal_json_response(
854
+ response_data = unmarshal_json_response(
854
855
  errors.HTTPValidationErrorData, http_res
855
856
  )
856
857
  raise errors.HTTPValidationError(response_data, http_res)
@@ -941,9 +942,9 @@ class Universal(BaseSDK):
941
942
 
942
943
  response_data: Any = None
943
944
  if utils.match_response(http_res, "200", "application/json"):
944
- return utils.unmarshal_json_response(models.EnsNameInfoResponse, http_res)
945
+ return unmarshal_json_response(models.EnsNameInfoResponse, http_res)
945
946
  if utils.match_response(http_res, "422", "application/json"):
946
- response_data = utils.unmarshal_json_response(
947
+ response_data = unmarshal_json_response(
947
948
  errors.HTTPValidationErrorData, http_res
948
949
  )
949
950
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1040,9 +1041,9 @@ class Universal(BaseSDK):
1040
1041
 
1041
1042
  response_data: Any = None
1042
1043
  if utils.match_response(http_res, "200", "application/json"):
1043
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1044
+ return unmarshal_json_response(models.TxResponse, http_res)
1044
1045
  if utils.match_response(http_res, "422", "application/json"):
1045
- response_data = utils.unmarshal_json_response(
1046
+ response_data = unmarshal_json_response(
1046
1047
  errors.HTTPValidationErrorData, http_res
1047
1048
  )
1048
1049
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1139,9 +1140,9 @@ class Universal(BaseSDK):
1139
1140
 
1140
1141
  response_data: Any = None
1141
1142
  if utils.match_response(http_res, "200", "application/json"):
1142
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1143
+ return unmarshal_json_response(models.TxResponse, http_res)
1143
1144
  if utils.match_response(http_res, "422", "application/json"):
1144
- response_data = utils.unmarshal_json_response(
1145
+ response_data = unmarshal_json_response(
1145
1146
  errors.HTTPValidationErrorData, http_res
1146
1147
  )
1147
1148
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1238,9 +1239,9 @@ class Universal(BaseSDK):
1238
1239
 
1239
1240
  response_data: Any = None
1240
1241
  if utils.match_response(http_res, "200", "application/json"):
1241
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1242
+ return unmarshal_json_response(models.TxResponse, http_res)
1242
1243
  if utils.match_response(http_res, "422", "application/json"):
1243
- response_data = utils.unmarshal_json_response(
1244
+ response_data = unmarshal_json_response(
1244
1245
  errors.HTTPValidationErrorData, http_res
1245
1246
  )
1246
1247
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1337,9 +1338,9 @@ class Universal(BaseSDK):
1337
1338
 
1338
1339
  response_data: Any = None
1339
1340
  if utils.match_response(http_res, "200", "application/json"):
1340
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1341
+ return unmarshal_json_response(models.TxResponse, http_res)
1341
1342
  if utils.match_response(http_res, "422", "application/json"):
1342
- response_data = utils.unmarshal_json_response(
1343
+ response_data = unmarshal_json_response(
1343
1344
  errors.HTTPValidationErrorData, http_res
1344
1345
  )
1345
1346
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1453,9 +1454,9 @@ class Universal(BaseSDK):
1453
1454
 
1454
1455
  response_data: Any = None
1455
1456
  if utils.match_response(http_res, "200", "application/json"):
1456
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1457
+ return unmarshal_json_response(models.TxResponse, http_res)
1457
1458
  if utils.match_response(http_res, "422", "application/json"):
1458
- response_data = utils.unmarshal_json_response(
1459
+ response_data = unmarshal_json_response(
1459
1460
  errors.HTTPValidationErrorData, http_res
1460
1461
  )
1461
1462
  raise errors.HTTPValidationError(response_data, http_res)
@@ -1569,9 +1570,9 @@ class Universal(BaseSDK):
1569
1570
 
1570
1571
  response_data: Any = None
1571
1572
  if utils.match_response(http_res, "200", "application/json"):
1572
- return utils.unmarshal_json_response(models.TxResponse, http_res)
1573
+ return unmarshal_json_response(models.TxResponse, http_res)
1573
1574
  if utils.match_response(http_res, "422", "application/json"):
1574
- response_data = utils.unmarshal_json_response(
1575
+ response_data = unmarshal_json_response(
1575
1576
  errors.HTTPValidationErrorData, http_res
1576
1577
  )
1577
1578
  raise errors.HTTPValidationError(response_data, http_res)
@@ -28,7 +28,6 @@ if TYPE_CHECKING:
28
28
  marshal_json,
29
29
  unmarshal,
30
30
  unmarshal_json,
31
- unmarshal_json_response,
32
31
  serialize_decimal,
33
32
  serialize_float,
34
33
  serialize_int,
@@ -97,7 +96,6 @@ __all__ = [
97
96
  "template_url",
98
97
  "unmarshal",
99
98
  "unmarshal_json",
100
- "unmarshal_json_response",
101
99
  "validate_decimal",
102
100
  "validate_const",
103
101
  "validate_float",
@@ -151,7 +149,6 @@ _dynamic_imports: dict[str, str] = {
151
149
  "template_url": ".url",
152
150
  "unmarshal": ".serializers",
153
151
  "unmarshal_json": ".serializers",
154
- "unmarshal_json_response": ".serializers",
155
152
  "validate_decimal": ".serializers",
156
153
  "validate_const": ".serializers",
157
154
  "validate_float": ".serializers",
@@ -4,7 +4,7 @@ from decimal import Decimal
4
4
  import functools
5
5
  import json
6
6
  import typing
7
- from typing import Any, Dict, List, Optional, Tuple, Union, get_args
7
+ from typing import Any, Dict, List, Tuple, Union, get_args
8
8
  import typing_extensions
9
9
  from typing_extensions import get_origin
10
10
 
@@ -13,7 +13,6 @@ from pydantic import ConfigDict, create_model
13
13
  from pydantic_core import from_json
14
14
 
15
15
  from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset
16
- from compass_api_sdk import errors
17
16
 
18
17
 
19
18
  def serialize_decimal(as_str: bool):
@@ -141,22 +140,6 @@ def unmarshal_json(raw, typ: Any) -> Any:
141
140
  return unmarshal(from_json(raw), typ)
142
141
 
143
142
 
144
- def unmarshal_json_response(
145
- typ: Any, http_res: httpx.Response, body: Optional[str] = None
146
- ) -> Any:
147
- if body is None:
148
- body = http_res.text
149
- try:
150
- return unmarshal_json(body, typ)
151
- except Exception as e:
152
- raise errors.ResponseValidationError(
153
- "Response validation failed",
154
- http_res,
155
- e,
156
- body,
157
- ) from e
158
-
159
-
160
143
  def unmarshal(val, typ: Any) -> Any:
161
144
  unmarshaller = create_model(
162
145
  "Unmarshaller",
@@ -0,0 +1,24 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from typing import Any, Optional
4
+
5
+ import httpx
6
+
7
+ from .serializers import unmarshal_json
8
+ from compass_api_sdk import errors
9
+
10
+
11
+ def unmarshal_json_response(
12
+ typ: Any, http_res: httpx.Response, body: Optional[str] = None
13
+ ) -> Any:
14
+ if body is None:
15
+ body = http_res.text
16
+ try:
17
+ return unmarshal_json(body, typ)
18
+ except Exception as e:
19
+ raise errors.ResponseValidationError(
20
+ "Response validation failed",
21
+ http_res,
22
+ e,
23
+ body,
24
+ ) from e
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: compass_api_sdk
3
- Version: 0.9.41
3
+ Version: 0.9.43
4
4
  Summary: Compass API SDK.
5
5
  Author: royalnine
6
6
  Requires-Python: >=3.9.2
@@ -241,9 +241,8 @@ with CompassAPI(
241
241
 
242
242
  ### [pendle](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md)
243
243
 
244
- * [position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#position) - Check User's Market Position
244
+ * [market](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#market) - Get Market & User Position
245
245
  * [positions](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#positions) - List User's Market Positions
246
- * [market](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#market) - Get Market Data
247
246
  * [markets](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#markets) - List Market Data
248
247
  * [quote](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#quote) - Get Quote
249
248
  * [buy_pt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#buy_pt) - Buy Principal Token (PT)