compass_api_sdk 1.1.1__py3-none-any.whl → 2.2.1rc3__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.
Files changed (263) hide show
  1. compass_api_sdk/_hooks/sdkhooks.py +4 -4
  2. compass_api_sdk/_hooks/types.py +1 -2
  3. compass_api_sdk/_version.py +3 -3
  4. compass_api_sdk/aave_v3.py +386 -114
  5. compass_api_sdk/aerodrome_slipstream.py +104 -54
  6. compass_api_sdk/basesdk.py +6 -0
  7. compass_api_sdk/bridge.py +536 -0
  8. compass_api_sdk/earn.py +2026 -0
  9. compass_api_sdk/erc_4626_vaults.py +28 -10
  10. compass_api_sdk/errors/__init__.py +8 -0
  11. compass_api_sdk/errors/apierror.py +1 -1
  12. compass_api_sdk/errors/compassapierror.py +1 -1
  13. compass_api_sdk/errors/httpvalidationerror.py +1 -1
  14. compass_api_sdk/errors/mintpreparenotfoundresponse_error.py +49 -0
  15. compass_api_sdk/errors/no_response_error.py +1 -1
  16. compass_api_sdk/errors/responsevalidationerror.py +1 -1
  17. compass_api_sdk/ethena.py +36 -10
  18. compass_api_sdk/gas_sponsorship.py +458 -0
  19. compass_api_sdk/httpclient.py +0 -1
  20. compass_api_sdk/models/__init__.py +820 -392
  21. compass_api_sdk/models/aaveborrowparams.py +4 -13
  22. compass_api_sdk/models/aaveborrowrequest.py +10 -14
  23. compass_api_sdk/models/aavehistoricaltransactionsresponse.py +3 -3
  24. compass_api_sdk/models/aavelooprequest.py +32 -28
  25. compass_api_sdk/models/aaveposition.py +104 -0
  26. compass_api_sdk/models/aaverepayparams.py +4 -13
  27. compass_api_sdk/models/aaverepayrequest.py +10 -14
  28. compass_api_sdk/models/aavesetuseremodeparams.py +28 -0
  29. compass_api_sdk/models/aavesetuseremoderequest.py +48 -0
  30. compass_api_sdk/models/aavesupplyparams.py +4 -13
  31. compass_api_sdk/models/aavesupplyrequest.py +10 -14
  32. compass_api_sdk/models/aavevenue.py +27 -0
  33. compass_api_sdk/models/aavewithdrawparams.py +4 -13
  34. compass_api_sdk/models/aavewithdrawrequest.py +10 -14
  35. compass_api_sdk/models/aerodromeenrichedposition.py +109 -0
  36. compass_api_sdk/models/aerodromelppositionsresponse.py +10 -7
  37. compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
  38. compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +14 -26
  39. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +6 -1
  40. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
  41. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +14 -26
  42. compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
  43. compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
  44. compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +13 -25
  45. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +6 -1
  46. compass_api_sdk/models/approvetransferrequest.py +32 -0
  47. compass_api_sdk/models/approvetransferresponse.py +52 -0
  48. compass_api_sdk/models/batchedsafeoperationsresponse_input.py +52 -0
  49. compass_api_sdk/models/batchedsafeoperationsresponse_output.py +52 -0
  50. compass_api_sdk/models/batcheduseroperationsrequest.py +15 -4
  51. compass_api_sdk/models/chainmarketinfo.py +29 -0
  52. compass_api_sdk/models/{compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py → compass_api_backend_v1_models_generic_read_response_portfolio_tokenbalance.py} +6 -15
  53. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_apydata.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_apydata.py} +2 -2
  54. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_asset.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_asset.py} +2 -2
  55. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_marketstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_marketstate.py} +4 -2
  56. compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultposition.py +30 -0
  57. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_vaultstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultstate.py} +2 -2
  58. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_apydata.py → compass_api_backend_v1_models_morpho_read_response_get_market_apydata.py} +2 -2
  59. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_asset.py → compass_api_backend_v1_models_morpho_read_response_get_market_asset.py} +5 -5
  60. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_market_marketstate.py} +4 -2
  61. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_asset.py → compass_api_backend_v1_models_morpho_read_response_get_markets_asset.py} +2 -2
  62. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_markets_marketstate.py} +2 -2
  63. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vaults_asset.py → compass_api_backend_v1_models_morpho_read_response_get_vaults_asset.py} +2 -2
  64. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py → compass_api_backend_v1_models_morpho_read_response_get_vaults_vaultstate.py} +4 -2
  65. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_market_userposition.py → compass_api_backend_v1_models_pendle_read_response_market_userposition.py} +2 -2
  66. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_positions_tokenbalance.py → compass_api_backend_v1_models_pendle_read_response_positions_tokenbalance.py} +2 -2
  67. compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_userposition.py → compass_api_backend_v1_models_vaults_read_response_vault_userposition.py} +2 -2
  68. compass_api_sdk/models/compass_api_backend_v1_models_wildcat_read_response_market_userposition.py +22 -0
  69. compass_api_sdk/models/compass_api_backend_v2_models_earn_read_response_positions_vaultposition.py +103 -0
  70. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712domain.py +36 -0
  71. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712types.py +36 -0
  72. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712domain.py +37 -0
  73. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712types.py +32 -0
  74. compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712domain.py +29 -0
  75. compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712types.py +34 -0
  76. compass_api_sdk/models/createaccountrequest.py +40 -0
  77. compass_api_sdk/models/createaccountresponse.py +56 -0
  78. compass_api_sdk/models/depositevent.py +61 -0
  79. compass_api_sdk/models/depositforburnrequest.py +77 -0
  80. compass_api_sdk/models/depositforburnresponse.py +100 -0
  81. compass_api_sdk/models/earnmanageparams.py +76 -0
  82. compass_api_sdk/models/earnmanagerequest.py +132 -0
  83. compass_api_sdk/models/earnmanageresponse.py +52 -0
  84. compass_api_sdk/models/earnpositionsresponse.py +48 -0
  85. compass_api_sdk/models/earnswapparams.py +74 -0
  86. compass_api_sdk/models/earnswaprequest.py +90 -0
  87. compass_api_sdk/models/earnswapresponse.py +55 -0
  88. compass_api_sdk/models/earntransferrequest.py +104 -0
  89. compass_api_sdk/models/earntransferresponse.py +71 -0
  90. compass_api_sdk/models/eip712domainfield.py +20 -0
  91. compass_api_sdk/models/eip712field.py +20 -0
  92. compass_api_sdk/models/ethenadepositrequest.py +6 -1
  93. compass_api_sdk/models/ethenagetvaultresponse.py +5 -5
  94. compass_api_sdk/models/ethenarequesttowithdrawrequest.py +6 -1
  95. compass_api_sdk/models/ethenaunstakerequest.py +6 -1
  96. compass_api_sdk/models/fee.py +43 -0
  97. compass_api_sdk/models/listaavemarketsresponse.py +21 -0
  98. compass_api_sdk/models/marketposition.py +5 -5
  99. compass_api_sdk/models/maxsupplyapyinfo.py +34 -0
  100. compass_api_sdk/models/mintpreparecompletedresponse.py +46 -0
  101. compass_api_sdk/models/mintpreparependingresponse.py +65 -0
  102. compass_api_sdk/models/mintpreparereadyresponse.py +43 -0
  103. compass_api_sdk/models/mintpreparerequest.py +25 -0
  104. compass_api_sdk/models/morphoborrowrequest.py +6 -1
  105. compass_api_sdk/models/morphocheckuserpositionresponse.py +9 -3
  106. compass_api_sdk/models/morphodepositrequest.py +6 -1
  107. compass_api_sdk/models/morphogetmarketresponse.py +72 -31
  108. compass_api_sdk/models/morphomarket.py +26 -20
  109. compass_api_sdk/models/morphorepayrequest.py +11 -1
  110. compass_api_sdk/models/morphosupplycollateralrequest.py +11 -1
  111. compass_api_sdk/models/morphovault.py +10 -10
  112. compass_api_sdk/models/morphowithdrawcollateralrequest.py +6 -1
  113. compass_api_sdk/models/morphowithdrawrequest.py +6 -1
  114. compass_api_sdk/models/multicallexecuterequest.py +7 -2
  115. compass_api_sdk/models/odosswapparams.py +9 -30
  116. compass_api_sdk/models/odosswaprequest.py +15 -33
  117. compass_api_sdk/models/oneinchswapparams.py +59 -0
  118. compass_api_sdk/models/openposition.py +7 -7
  119. compass_api_sdk/models/operationtype.py +11 -0
  120. compass_api_sdk/models/pendledepositevent.py +49 -0
  121. compass_api_sdk/models/pendlegetmarketresponse.py +5 -5
  122. compass_api_sdk/models/pendlemanageliquidityparams.py +2 -15
  123. compass_api_sdk/models/pendlemanageliquidityrequest.py +8 -16
  124. compass_api_sdk/models/pendlemarketinfo.py +138 -0
  125. compass_api_sdk/models/pendlemarketsresponse.py +30 -0
  126. compass_api_sdk/models/pendleptposition.py +111 -0
  127. compass_api_sdk/models/pendleptvenue.py +78 -0
  128. compass_api_sdk/models/pendleredeemyieldrequest.py +6 -1
  129. compass_api_sdk/models/pendletradeptparams.py +2 -15
  130. compass_api_sdk/models/pendletradeptrequest.py +8 -16
  131. compass_api_sdk/models/pendletradeytparams.py +2 -15
  132. compass_api_sdk/models/pendletradeytrequest.py +8 -16
  133. compass_api_sdk/models/pendlewithdrawalevent.py +54 -0
  134. compass_api_sdk/models/permit2typeddata_input.py +46 -0
  135. compass_api_sdk/models/permit2typeddata_output.py +46 -0
  136. compass_api_sdk/models/permitfield.py +20 -0
  137. compass_api_sdk/models/permitmessage.py +39 -0
  138. compass_api_sdk/models/permittransferfrommessage.py +29 -0
  139. compass_api_sdk/models/permittypeddataresponse_input.py +50 -0
  140. compass_api_sdk/models/permittypeddataresponse_output.py +50 -0
  141. compass_api_sdk/models/portfolio.py +5 -5
  142. compass_api_sdk/models/positionpnl.py +52 -0
  143. compass_api_sdk/models/reserve.py +6 -15
  144. compass_api_sdk/models/safetransactionparams.py +78 -0
  145. compass_api_sdk/models/safetransactionresponse.py +28 -0
  146. compass_api_sdk/models/safetxfield.py +20 -0
  147. compass_api_sdk/models/safetxmessage.py +66 -0
  148. compass_api_sdk/models/setallowanceparams.py +3 -16
  149. compass_api_sdk/models/setallowancerequest.py +9 -17
  150. compass_api_sdk/models/skybuyrequest.py +6 -1
  151. compass_api_sdk/models/skydepositrequest.py +7 -2
  152. compass_api_sdk/models/skysellrequest.py +7 -2
  153. compass_api_sdk/models/skywithdrawrequest.py +7 -2
  154. compass_api_sdk/models/sponsorgasrequest.py +71 -0
  155. compass_api_sdk/models/sponsorgasresponse.py +14 -0
  156. compass_api_sdk/models/tokenbalanceresponse.py +5 -15
  157. compass_api_sdk/models/tokenconfig.py +30 -0
  158. compass_api_sdk/models/tokenlistresponse.py +21 -0
  159. compass_api_sdk/models/tokenmarketdata.py +27 -0
  160. compass_api_sdk/models/tokenpermissions.py +20 -0
  161. compass_api_sdk/models/tokentransferparams.py +2 -15
  162. compass_api_sdk/models/tokentransferrequest.py +8 -16
  163. compass_api_sdk/models/uniswapbuyexactlyparams.py +8 -33
  164. compass_api_sdk/models/uniswapbuyexactlyrequest.py +14 -34
  165. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +6 -1
  166. compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
  167. compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +14 -26
  168. compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
  169. compass_api_sdk/models/uniswapsellexactlyparams.py +4 -29
  170. compass_api_sdk/models/uniswapsellexactlyrequest.py +10 -30
  171. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +6 -1
  172. compass_api_sdk/models/unsignedmulticalltransaction.py +34 -3
  173. compass_api_sdk/models/unsignedtransaction.py +34 -3
  174. compass_api_sdk/models/unwrapwethrequest.py +6 -1
  175. compass_api_sdk/models/useroperation.py +33 -24
  176. compass_api_sdk/models/v1_aave_aave_supported_tokensop.py +1 -1
  177. compass_api_sdk/models/v1_aave_avg_rateop.py +15 -93
  178. compass_api_sdk/models/v1_aave_historical_transactionsop.py +15 -15
  179. compass_api_sdk/models/v1_aave_liquidity_changeop.py +8 -86
  180. compass_api_sdk/models/v1_aave_rateop.py +8 -86
  181. compass_api_sdk/models/v1_aave_reserve_overviewop.py +8 -86
  182. compass_api_sdk/models/v1_aave_std_rateop.py +15 -93
  183. compass_api_sdk/models/v1_aave_token_priceop.py +8 -86
  184. compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +14 -92
  185. compass_api_sdk/models/v1_aave_user_position_summaryop.py +8 -8
  186. compass_api_sdk/models/v1_aerodrome_slipstream_liquidity_provision_positionsop.py +48 -3
  187. compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +12 -168
  188. compass_api_sdk/models/v1_ethena_vaultop.py +1 -1
  189. compass_api_sdk/models/v1_generic_allowanceop.py +12 -26
  190. compass_api_sdk/models/v1_generic_ensop.py +2 -2
  191. compass_api_sdk/models/v1_generic_portfolioop.py +2 -2
  192. compass_api_sdk/models/v1_morpho_market_positionop.py +3 -3
  193. compass_api_sdk/models/v1_morpho_marketop.py +2 -2
  194. compass_api_sdk/models/v1_morpho_marketsop.py +10 -30
  195. compass_api_sdk/models/v1_morpho_user_positionop.py +2 -2
  196. compass_api_sdk/models/v1_morpho_vaultop.py +8 -8
  197. compass_api_sdk/models/v1_morpho_vaultsop.py +6 -16
  198. compass_api_sdk/models/v1_pendle_marketop.py +8 -8
  199. compass_api_sdk/models/v1_pendle_marketsop.py +1 -1
  200. compass_api_sdk/models/v1_pendle_positionsop.py +2 -2
  201. compass_api_sdk/models/v1_sky_positionop.py +5 -6
  202. compass_api_sdk/models/v1_token_balanceop.py +12 -25
  203. compass_api_sdk/models/{v1_generic_supported_tokensop.py → v1_token_listop.py} +6 -6
  204. compass_api_sdk/models/v1_token_priceop.py +8 -9
  205. compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +6 -6
  206. compass_api_sdk/models/v1_uniswap_liquidity_provision_in_rangeop.py +2 -2
  207. compass_api_sdk/models/v1_uniswap_liquidity_provision_positionsop.py +2 -2
  208. compass_api_sdk/models/v1_uniswap_pool_priceop.py +12 -168
  209. compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +20 -176
  210. compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +20 -176
  211. compass_api_sdk/models/v1_vaults_vaultop.py +8 -8
  212. compass_api_sdk/models/v1_wildcat_marketop.py +82 -0
  213. compass_api_sdk/models/v2_cctp_mintop.py +47 -0
  214. compass_api_sdk/models/v2_earn_aave_marketsop.py +57 -0
  215. compass_api_sdk/models/v2_earn_pendle_marketsop.py +105 -0
  216. compass_api_sdk/models/v2_earn_positionsop.py +31 -0
  217. compass_api_sdk/models/v2_earn_vaultsop.py +105 -0
  218. compass_api_sdk/models/v2bundlerequest.py +33 -0
  219. compass_api_sdk/models/v2bundleresponse.py +67 -0
  220. compass_api_sdk/models/v2useroperation.py +37 -0
  221. compass_api_sdk/models/vault.py +14 -14
  222. compass_api_sdk/models/vaultdepositrequest.py +6 -1
  223. compass_api_sdk/models/vaultgetvaultresponse.py +5 -5
  224. compass_api_sdk/models/vaultinfo.py +129 -0
  225. compass_api_sdk/models/vaultsresponse.py +30 -0
  226. compass_api_sdk/models/vaultvenue.py +27 -0
  227. compass_api_sdk/models/vaultwithdrawrequest.py +6 -1
  228. compass_api_sdk/models/wildcatgetmarketresponse.py +151 -0
  229. compass_api_sdk/models/{redeemunderlying.py → withdraw.py} +2 -2
  230. compass_api_sdk/models/withdrawalevent.py +61 -0
  231. compass_api_sdk/models/wrapethrequest.py +6 -1
  232. compass_api_sdk/morpho.py +126 -78
  233. compass_api_sdk/pendle.py +68 -44
  234. compass_api_sdk/sdk.py +18 -11
  235. compass_api_sdk/sky.py +62 -38
  236. compass_api_sdk/smart_account.py +10 -2
  237. compass_api_sdk/swap.py +22 -22
  238. compass_api_sdk/{token_sdk.py → token.py} +511 -103
  239. compass_api_sdk/transaction_bundler.py +46 -16
  240. compass_api_sdk/types/basemodel.py +41 -3
  241. compass_api_sdk/uniswap_v3.py +152 -114
  242. compass_api_sdk/universal.py +44 -606
  243. compass_api_sdk/utils/__init__.py +0 -3
  244. compass_api_sdk/utils/annotations.py +32 -8
  245. compass_api_sdk/utils/enums.py +60 -0
  246. compass_api_sdk/utils/forms.py +21 -10
  247. compass_api_sdk/utils/queryparams.py +14 -2
  248. compass_api_sdk/utils/requestbodies.py +3 -3
  249. compass_api_sdk/utils/retries.py +69 -5
  250. compass_api_sdk/utils/serializers.py +0 -20
  251. compass_api_sdk/utils/unmarshal_json_response.py +15 -1
  252. compass_api_sdk/wildcat.py +208 -0
  253. compass_api_sdk-2.2.1rc3.dist-info/METADATA +624 -0
  254. compass_api_sdk-2.2.1rc3.dist-info/RECORD +356 -0
  255. {compass_api_sdk-1.1.1.dist-info → compass_api_sdk-2.2.1rc3.dist-info}/WHEEL +1 -1
  256. compass_api_sdk/models/aerodromeposition.py +0 -70
  257. compass_api_sdk/models/token_enum.py +0 -81
  258. compass_api_sdk/models/tokenaddressresponse.py +0 -15
  259. compass_api_sdk/models/tokeninfo.py +0 -17
  260. compass_api_sdk/models/v1_token_addressop.py +0 -109
  261. compass_api_sdk/models/vaultposition.py +0 -24
  262. compass_api_sdk-1.1.1.dist-info/METADATA +0 -592
  263. compass_api_sdk-1.1.1.dist-info/RECORD +0 -275
@@ -0,0 +1,59 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from compass_api_sdk.utils import validate_const
6
+ import pydantic
7
+ from pydantic.functional_validators import AfterValidator
8
+ from typing import Literal, Optional, Union
9
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+
11
+
12
+ OneInchSwapParamsAmountInTypedDict = TypeAliasType(
13
+ "OneInchSwapParamsAmountInTypedDict", Union[float, str]
14
+ )
15
+ r"""The amount of token_in to be sold."""
16
+
17
+
18
+ OneInchSwapParamsAmountIn = TypeAliasType(
19
+ "OneInchSwapParamsAmountIn", Union[float, str]
20
+ )
21
+ r"""The amount of token_in to be sold."""
22
+
23
+
24
+ class OneInchSwapParamsTypedDict(TypedDict):
25
+ r"""Parameters for 1inch swap operations."""
26
+
27
+ token_in: str
28
+ r"""The symbol or address of the token that is to be sold."""
29
+ token_out: str
30
+ r"""The symbol or address of the token that is to be bought."""
31
+ amount_in: OneInchSwapParamsAmountInTypedDict
32
+ r"""The amount of token_in to be sold."""
33
+ max_slippage_percent: float
34
+ r"""The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed."""
35
+ action_type: Literal["ONE_INCH_SWAP"]
36
+
37
+
38
+ class OneInchSwapParams(BaseModel):
39
+ r"""Parameters for 1inch swap operations."""
40
+
41
+ token_in: str
42
+ r"""The symbol or address of the token that is to be sold."""
43
+
44
+ token_out: str
45
+ r"""The symbol or address of the token that is to be bought."""
46
+
47
+ amount_in: OneInchSwapParamsAmountIn
48
+ r"""The amount of token_in to be sold."""
49
+
50
+ max_slippage_percent: float
51
+ r"""The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed."""
52
+
53
+ ACTION_TYPE: Annotated[
54
+ Annotated[
55
+ Optional[Literal["ONE_INCH_SWAP"]],
56
+ AfterValidator(validate_const("ONE_INCH_SWAP")),
57
+ ],
58
+ pydantic.Field(alias="action_type"),
59
+ ] = "ONE_INCH_SWAP"
@@ -1,9 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .compass_api_backend_models_pendle_read_response_positions_tokenbalance import (
5
- CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance,
6
- CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict,
4
+ from .compass_api_backend_v1_models_pendle_read_response_positions_tokenbalance import (
5
+ CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalance,
6
+ CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalanceTypedDict,
7
7
  )
8
8
  from .lpbalance import LpBalance, LpBalanceTypedDict
9
9
  from compass_api_sdk.types import BaseModel
@@ -13,16 +13,16 @@ from typing_extensions import Annotated, TypedDict
13
13
 
14
14
  class OpenPositionTypedDict(TypedDict):
15
15
  market_id: str
16
- pt: CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict
17
- yt: CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict
16
+ pt: CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalanceTypedDict
17
+ yt: CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalanceTypedDict
18
18
  lp: LpBalanceTypedDict
19
19
 
20
20
 
21
21
  class OpenPosition(BaseModel):
22
22
  market_id: Annotated[str, pydantic.Field(alias="marketId")]
23
23
 
24
- pt: CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance
24
+ pt: CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalance
25
25
 
26
- yt: CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance
26
+ yt: CompassAPIBackendV1ModelsPendleReadResponsePositionsTokenBalance
27
27
 
28
28
  lp: LpBalance
@@ -0,0 +1,11 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from enum import Enum
5
+
6
+
7
+ class OperationType(int, Enum):
8
+ r"""Safe operation types."""
9
+
10
+ ZERO = 0
11
+ ONE = 1
@@ -0,0 +1,49 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class PendleDepositEventTypedDict(TypedDict):
9
+ r"""Pendle PT deposit event with cost basis at time of deposit."""
10
+
11
+ block_number: int
12
+ r"""Block number when deposit occurred"""
13
+ transaction_hash: str
14
+ r"""Transaction hash of the deposit"""
15
+ input_amount: str
16
+ r"""Amount deposited (token spent)"""
17
+ input_symbol: str
18
+ r"""Symbol of token deposited"""
19
+ output_amount: str
20
+ r"""PT tokens received"""
21
+ output_symbol: str
22
+ r"""Symbol (PT)"""
23
+ cost_per_unit: str
24
+ r"""Cost basis per PT at deposit (SY spent per PT acquired)"""
25
+
26
+
27
+ class PendleDepositEvent(BaseModel):
28
+ r"""Pendle PT deposit event with cost basis at time of deposit."""
29
+
30
+ block_number: int
31
+ r"""Block number when deposit occurred"""
32
+
33
+ transaction_hash: str
34
+ r"""Transaction hash of the deposit"""
35
+
36
+ input_amount: str
37
+ r"""Amount deposited (token spent)"""
38
+
39
+ input_symbol: str
40
+ r"""Symbol of token deposited"""
41
+
42
+ output_amount: str
43
+ r"""PT tokens received"""
44
+
45
+ output_symbol: str
46
+ r"""Symbol (PT)"""
47
+
48
+ cost_per_unit: str
49
+ r"""Cost basis per PT at deposit (SY spent per PT acquired)"""
@@ -1,9 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .compass_api_backend_models_pendle_read_response_market_userposition import (
5
- CompassAPIBackendModelsPendleReadResponseMarketUserPosition,
6
- CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict,
4
+ from .compass_api_backend_v1_models_pendle_read_response_market_userposition import (
5
+ CompassAPIBackendV1ModelsPendleReadResponseMarketUserPosition,
6
+ CompassAPIBackendV1ModelsPendleReadResponseMarketUserPositionTypedDict,
7
7
  )
8
8
  from .markettokens import MarketTokens, MarketTokensTypedDict
9
9
  from compass_api_sdk.types import (
@@ -27,7 +27,7 @@ class PendleGetMarketResponseTypedDict(TypedDict):
27
27
  r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
28
28
  tokens: MarketTokensTypedDict
29
29
  user_position: NotRequired[
30
- Nullable[CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict]
30
+ Nullable[CompassAPIBackendV1ModelsPendleReadResponseMarketUserPositionTypedDict]
31
31
  ]
32
32
  r"""The user's position in the market."""
33
33
 
@@ -45,7 +45,7 @@ class PendleGetMarketResponse(BaseModel):
45
45
  tokens: MarketTokens
46
46
 
47
47
  user_position: OptionalNullable[
48
- CompassAPIBackendModelsPendleReadResponseMarketUserPosition
48
+ CompassAPIBackendV1ModelsPendleReadResponseMarketUserPosition
49
49
  ] = UNSET
50
50
  r"""The user's position in the market."""
51
51
 
@@ -1,7 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .token_enum import TokenEnum
5
4
  from compass_api_sdk.types import BaseModel
6
5
  from compass_api_sdk.utils import validate_const
7
6
  from enum import Enum
@@ -18,18 +17,6 @@ class PendleManageLiquidityParamsAction(str, Enum):
18
17
  WITHDRAW = "WITHDRAW"
19
18
 
20
19
 
21
- PendleManageLiquidityParamsTokenTypedDict = TypeAliasType(
22
- "PendleManageLiquidityParamsTokenTypedDict", Union[TokenEnum, str]
23
- )
24
- r"""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."""
25
-
26
-
27
- PendleManageLiquidityParamsToken = TypeAliasType(
28
- "PendleManageLiquidityParamsToken", Union[TokenEnum, str]
29
- )
30
- r"""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."""
31
-
32
-
33
20
  PendleManageLiquidityParamsAmountInTypedDict = TypeAliasType(
34
21
  "PendleManageLiquidityParamsAmountInTypedDict", Union[float, str]
35
22
  )
@@ -47,7 +34,7 @@ class PendleManageLiquidityParamsTypedDict(TypedDict):
47
34
  r"""The address identifying which Pendle Market you would like to add liquidity to."""
48
35
  action: PendleManageLiquidityParamsAction
49
36
  r"""Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity)."""
50
- token: PendleManageLiquidityParamsTokenTypedDict
37
+ token: str
51
38
  r"""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."""
52
39
  amount_in: PendleManageLiquidityParamsAmountInTypedDict
53
40
  r"""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`."""
@@ -63,7 +50,7 @@ class PendleManageLiquidityParams(BaseModel):
63
50
  action: PendleManageLiquidityParamsAction
64
51
  r"""Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity)."""
65
52
 
66
- token: PendleManageLiquidityParamsToken
53
+ token: str
67
54
  r"""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."""
68
55
 
69
56
  amount_in: PendleManageLiquidityParamsAmountIn
@@ -1,14 +1,13 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .token_enum import TokenEnum
5
4
  from compass_api_sdk.types import BaseModel
6
5
  from compass_api_sdk.utils import validate_const
7
6
  from enum import Enum
8
7
  import pydantic
9
8
  from pydantic.functional_validators import AfterValidator
10
9
  from typing import Literal, Optional, Union
11
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
12
11
 
13
12
 
14
13
  class PendleManageLiquidityRequestAction(str, Enum):
@@ -18,18 +17,6 @@ class PendleManageLiquidityRequestAction(str, Enum):
18
17
  WITHDRAW = "WITHDRAW"
19
18
 
20
19
 
21
- PendleManageLiquidityRequestTokenTypedDict = TypeAliasType(
22
- "PendleManageLiquidityRequestTokenTypedDict", Union[TokenEnum, str]
23
- )
24
- r"""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."""
25
-
26
-
27
- PendleManageLiquidityRequestToken = TypeAliasType(
28
- "PendleManageLiquidityRequestToken", Union[TokenEnum, str]
29
- )
30
- r"""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."""
31
-
32
-
33
20
  PendleManageLiquidityRequestAmountInTypedDict = TypeAliasType(
34
21
  "PendleManageLiquidityRequestAmountInTypedDict", Union[float, str]
35
22
  )
@@ -53,7 +40,7 @@ class PendleManageLiquidityRequestTypedDict(TypedDict):
53
40
  r"""The address identifying which Pendle Market you would like to add liquidity to."""
54
41
  action: PendleManageLiquidityRequestAction
55
42
  r"""Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity)."""
56
- token: PendleManageLiquidityRequestTokenTypedDict
43
+ token: str
57
44
  r"""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."""
58
45
  amount_in: PendleManageLiquidityRequestAmountInTypedDict
59
46
  r"""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`."""
@@ -63,6 +50,8 @@ class PendleManageLiquidityRequestTypedDict(TypedDict):
63
50
  sender: str
64
51
  r"""The address of the transaction sender."""
65
52
  action_type: Literal["PENDLE_MANAGE_LIQUIDITY"]
53
+ estimate_gas: NotRequired[bool]
54
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
66
55
 
67
56
 
68
57
  class PendleManageLiquidityRequest(BaseModel):
@@ -72,7 +61,7 @@ class PendleManageLiquidityRequest(BaseModel):
72
61
  action: PendleManageLiquidityRequestAction
73
62
  r"""Specifies the direction of the liquidity operation for the Pendle market. Valid values are `SUPPLY` (to add liquidity) or `WITHDRAW` (to remove liquidity)."""
74
63
 
75
- token: PendleManageLiquidityRequestToken
64
+ token: str
76
65
  r"""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."""
77
66
 
78
67
  amount_in: PendleManageLiquidityRequestAmountIn
@@ -93,3 +82,6 @@ class PendleManageLiquidityRequest(BaseModel):
93
82
  ],
94
83
  pydantic.Field(alias="action_type"),
95
84
  ] = "PENDLE_MANAGE_LIQUIDITY"
85
+
86
+ estimate_gas: Optional[bool] = None
87
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -0,0 +1,138 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing_extensions import NotRequired, TypedDict
13
+
14
+
15
+ class PendleMarketInfoTypedDict(TypedDict):
16
+ r"""Information about a single Pendle market from the database."""
17
+
18
+ market_address: str
19
+ r"""The Pendle market contract address."""
20
+ chain: str
21
+ r"""Blockchain name (e.g., 'ethereum', 'arbitrum')."""
22
+ pt_address: str
23
+ r"""The Principal Token (PT) address."""
24
+ sy_address: NotRequired[Nullable[str]]
25
+ r"""The Standardized Yield (SY) token address."""
26
+ yt_address: NotRequired[Nullable[str]]
27
+ r"""The Yield Token (YT) address."""
28
+ expiry: NotRequired[Nullable[int]]
29
+ r"""The market maturity timestamp (Unix epoch seconds)."""
30
+ underlying_asset: NotRequired[Nullable[str]]
31
+ r"""The underlying asset contract address."""
32
+ underlying_name: NotRequired[Nullable[str]]
33
+ r"""The name of the underlying asset."""
34
+ underlying_symbol: NotRequired[Nullable[str]]
35
+ r"""The symbol of the underlying asset (e.g., 'USDC')."""
36
+ pt_name: NotRequired[Nullable[str]]
37
+ r"""The name of the Principal Token."""
38
+ pt_symbol: NotRequired[Nullable[str]]
39
+ r"""The symbol of the Principal Token."""
40
+ tvl_usd: NotRequired[Nullable[str]]
41
+ r"""Total Value Locked in USD."""
42
+ implied_apy: NotRequired[Nullable[str]]
43
+ r"""Implied APY as a percentage (e.g., 5.25 = 5.25%)."""
44
+
45
+
46
+ class PendleMarketInfo(BaseModel):
47
+ r"""Information about a single Pendle market from the database."""
48
+
49
+ market_address: str
50
+ r"""The Pendle market contract address."""
51
+
52
+ chain: str
53
+ r"""Blockchain name (e.g., 'ethereum', 'arbitrum')."""
54
+
55
+ pt_address: str
56
+ r"""The Principal Token (PT) address."""
57
+
58
+ sy_address: OptionalNullable[str] = UNSET
59
+ r"""The Standardized Yield (SY) token address."""
60
+
61
+ yt_address: OptionalNullable[str] = UNSET
62
+ r"""The Yield Token (YT) address."""
63
+
64
+ expiry: OptionalNullable[int] = UNSET
65
+ r"""The market maturity timestamp (Unix epoch seconds)."""
66
+
67
+ underlying_asset: OptionalNullable[str] = UNSET
68
+ r"""The underlying asset contract address."""
69
+
70
+ underlying_name: OptionalNullable[str] = UNSET
71
+ r"""The name of the underlying asset."""
72
+
73
+ underlying_symbol: OptionalNullable[str] = UNSET
74
+ r"""The symbol of the underlying asset (e.g., 'USDC')."""
75
+
76
+ pt_name: OptionalNullable[str] = UNSET
77
+ r"""The name of the Principal Token."""
78
+
79
+ pt_symbol: OptionalNullable[str] = UNSET
80
+ r"""The symbol of the Principal Token."""
81
+
82
+ tvl_usd: OptionalNullable[str] = UNSET
83
+ r"""Total Value Locked in USD."""
84
+
85
+ implied_apy: OptionalNullable[str] = UNSET
86
+ r"""Implied APY as a percentage (e.g., 5.25 = 5.25%)."""
87
+
88
+ @model_serializer(mode="wrap")
89
+ def serialize_model(self, handler):
90
+ optional_fields = [
91
+ "sy_address",
92
+ "yt_address",
93
+ "expiry",
94
+ "underlying_asset",
95
+ "underlying_name",
96
+ "underlying_symbol",
97
+ "pt_name",
98
+ "pt_symbol",
99
+ "tvl_usd",
100
+ "implied_apy",
101
+ ]
102
+ nullable_fields = [
103
+ "sy_address",
104
+ "yt_address",
105
+ "expiry",
106
+ "underlying_asset",
107
+ "underlying_name",
108
+ "underlying_symbol",
109
+ "pt_name",
110
+ "pt_symbol",
111
+ "tvl_usd",
112
+ "implied_apy",
113
+ ]
114
+ null_default_fields = []
115
+
116
+ serialized = handler(self)
117
+
118
+ m = {}
119
+
120
+ for n, f in type(self).model_fields.items():
121
+ k = f.alias or n
122
+ val = serialized.get(k)
123
+ serialized.pop(k, None)
124
+
125
+ optional_nullable = k in optional_fields and k in nullable_fields
126
+ is_set = (
127
+ self.__pydantic_fields_set__.intersection({n})
128
+ or k in null_default_fields
129
+ ) # pylint: disable=no-member
130
+
131
+ if val is not None and val != UNSET_SENTINEL:
132
+ m[k] = val
133
+ elif val != UNSET_SENTINEL and (
134
+ not k in optional_fields or (optional_nullable and is_set)
135
+ ):
136
+ m[k] = val
137
+
138
+ return m
@@ -0,0 +1,30 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .pendlemarketinfo import PendleMarketInfo, PendleMarketInfoTypedDict
5
+ from compass_api_sdk.types import BaseModel
6
+ from typing import List
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class PendleMarketsResponseTypedDict(TypedDict):
11
+ r"""Response model for a paginated list of Pendle markets."""
12
+
13
+ total: int
14
+ offset: int
15
+ limit: int
16
+ markets: List[PendleMarketInfoTypedDict]
17
+ r"""A list of Pendle market information objects."""
18
+
19
+
20
+ class PendleMarketsResponse(BaseModel):
21
+ r"""Response model for a paginated list of Pendle markets."""
22
+
23
+ total: int
24
+
25
+ offset: int
26
+
27
+ limit: int
28
+
29
+ markets: List[PendleMarketInfo]
30
+ r"""A list of Pendle market information objects."""
@@ -0,0 +1,111 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .pendledepositevent import PendleDepositEvent, PendleDepositEventTypedDict
5
+ from .pendlewithdrawalevent import PendleWithdrawalEvent, PendleWithdrawalEventTypedDict
6
+ from .positionpnl import PositionPnL, PositionPnLTypedDict
7
+ from compass_api_sdk.types import (
8
+ BaseModel,
9
+ Nullable,
10
+ OptionalNullable,
11
+ UNSET,
12
+ UNSET_SENTINEL,
13
+ )
14
+ from compass_api_sdk.utils import validate_const
15
+ import pydantic
16
+ from pydantic import model_serializer
17
+ from pydantic.functional_validators import AfterValidator
18
+ from typing import List, Literal, Optional
19
+ from typing_extensions import Annotated, NotRequired, TypedDict
20
+
21
+
22
+ class PendlePTPositionTypedDict(TypedDict):
23
+ r"""Pendle Principal Token position."""
24
+
25
+ market_address: str
26
+ r"""The Pendle market address."""
27
+ pt_address: str
28
+ r"""The PT (Principal Token) contract address."""
29
+ underlying_symbol: str
30
+ r"""Symbol of the underlying asset (e.g., rsETH, weETH)."""
31
+ pt_balance: str
32
+ r"""The user's PT token balance."""
33
+ expiry: int
34
+ r"""Market expiry timestamp (Unix seconds)."""
35
+ current_pt_to_sy_rate: str
36
+ r"""Current PT-to-SY exchange rate (SY received per PT if sold now)."""
37
+ type: Literal["PENDLE_PT"]
38
+ r"""The market type discriminator."""
39
+ pnl: NotRequired[Nullable[PositionPnLTypedDict]]
40
+ r"""PnL metrics (in SY terms) for this position."""
41
+ deposits: NotRequired[List[PendleDepositEventTypedDict]]
42
+ r"""All buy PT events for this position."""
43
+ withdrawals: NotRequired[List[PendleWithdrawalEventTypedDict]]
44
+ r"""All sell/redeem PT events for this position."""
45
+
46
+
47
+ class PendlePTPosition(BaseModel):
48
+ r"""Pendle Principal Token position."""
49
+
50
+ market_address: str
51
+ r"""The Pendle market address."""
52
+
53
+ pt_address: str
54
+ r"""The PT (Principal Token) contract address."""
55
+
56
+ underlying_symbol: str
57
+ r"""Symbol of the underlying asset (e.g., rsETH, weETH)."""
58
+
59
+ pt_balance: str
60
+ r"""The user's PT token balance."""
61
+
62
+ expiry: int
63
+ r"""Market expiry timestamp (Unix seconds)."""
64
+
65
+ current_pt_to_sy_rate: str
66
+ r"""Current PT-to-SY exchange rate (SY received per PT if sold now)."""
67
+
68
+ TYPE: Annotated[
69
+ Annotated[Literal["PENDLE_PT"], AfterValidator(validate_const("PENDLE_PT"))],
70
+ pydantic.Field(alias="type"),
71
+ ] = "PENDLE_PT"
72
+ r"""The market type discriminator."""
73
+
74
+ pnl: OptionalNullable[PositionPnL] = UNSET
75
+ r"""PnL metrics (in SY terms) for this position."""
76
+
77
+ deposits: Optional[List[PendleDepositEvent]] = None
78
+ r"""All buy PT events for this position."""
79
+
80
+ withdrawals: Optional[List[PendleWithdrawalEvent]] = None
81
+ r"""All sell/redeem PT events for this position."""
82
+
83
+ @model_serializer(mode="wrap")
84
+ def serialize_model(self, handler):
85
+ optional_fields = ["pnl", "deposits", "withdrawals"]
86
+ nullable_fields = ["pnl"]
87
+ null_default_fields = []
88
+
89
+ serialized = handler(self)
90
+
91
+ m = {}
92
+
93
+ for n, f in type(self).model_fields.items():
94
+ k = f.alias or n
95
+ val = serialized.get(k)
96
+ serialized.pop(k, None)
97
+
98
+ optional_nullable = k in optional_fields and k in nullable_fields
99
+ is_set = (
100
+ self.__pydantic_fields_set__.intersection({n})
101
+ or k in null_default_fields
102
+ ) # pylint: disable=no-member
103
+
104
+ if val is not None and val != UNSET_SENTINEL:
105
+ m[k] = val
106
+ elif val != UNSET_SENTINEL and (
107
+ not k in optional_fields or (optional_nullable and is_set)
108
+ ):
109
+ m[k] = val
110
+
111
+ return m
@@ -0,0 +1,78 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from compass_api_sdk.utils import validate_const
12
+ import pydantic
13
+ from pydantic import model_serializer
14
+ from pydantic.functional_validators import AfterValidator
15
+ from typing import Literal, Optional
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
17
+
18
+
19
+ class PendlePTVenueTypedDict(TypedDict):
20
+ r"""Venue for Pendle Principal Token (PT) positions."""
21
+
22
+ market_address: str
23
+ r"""The Pendle market address identifying which PT to trade."""
24
+ type: Literal["PENDLE_PT"]
25
+ r"""The venue type discriminator."""
26
+ token: NotRequired[Nullable[str]]
27
+ r"""The token to exchange for PT (only used for DEPOSIT/buy). For WITHDRAW/sell, this field must not be provided - withdrawals always return the underlying asset to ensure accurate yield fee calculation."""
28
+ max_slippage_percent: NotRequired[float]
29
+ r"""Maximum slippage allowed in percent (e.g., 1 means 1% slippage)."""
30
+
31
+
32
+ class PendlePTVenue(BaseModel):
33
+ r"""Venue for Pendle Principal Token (PT) positions."""
34
+
35
+ market_address: str
36
+ r"""The Pendle market address identifying which PT to trade."""
37
+
38
+ TYPE: Annotated[
39
+ Annotated[Literal["PENDLE_PT"], AfterValidator(validate_const("PENDLE_PT"))],
40
+ pydantic.Field(alias="type"),
41
+ ] = "PENDLE_PT"
42
+ r"""The venue type discriminator."""
43
+
44
+ token: OptionalNullable[str] = UNSET
45
+ r"""The token to exchange for PT (only used for DEPOSIT/buy). For WITHDRAW/sell, this field must not be provided - withdrawals always return the underlying asset to ensure accurate yield fee calculation."""
46
+
47
+ max_slippage_percent: Optional[float] = None
48
+ r"""Maximum slippage allowed in percent (e.g., 1 means 1% slippage)."""
49
+
50
+ @model_serializer(mode="wrap")
51
+ def serialize_model(self, handler):
52
+ optional_fields = ["token", "max_slippage_percent"]
53
+ nullable_fields = ["token"]
54
+ null_default_fields = []
55
+
56
+ serialized = handler(self)
57
+
58
+ m = {}
59
+
60
+ for n, f in type(self).model_fields.items():
61
+ k = f.alias or n
62
+ val = serialized.get(k)
63
+ serialized.pop(k, None)
64
+
65
+ optional_nullable = k in optional_fields and k in nullable_fields
66
+ is_set = (
67
+ self.__pydantic_fields_set__.intersection({n})
68
+ or k in null_default_fields
69
+ ) # pylint: disable=no-member
70
+
71
+ if val is not None and val != UNSET_SENTINEL:
72
+ m[k] = val
73
+ elif val != UNSET_SENTINEL and (
74
+ not k in optional_fields or (optional_nullable and is_set)
75
+ ):
76
+ m[k] = val
77
+
78
+ return m