compass_api_sdk 0.9.52__py3-none-any.whl → 1.0.1__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 (138) hide show
  1. compass_api_sdk/_version.py +3 -3
  2. compass_api_sdk/aave_v3.py +78 -124
  3. compass_api_sdk/aerodrome_slipstream.py +86 -88
  4. compass_api_sdk/erc_4626_vaults.py +18 -42
  5. compass_api_sdk/ethena.py +880 -0
  6. compass_api_sdk/models/__init__.py +1050 -989
  7. compass_api_sdk/models/{compass_api_backend_models_aave_transact_request_borrow_aaveborrowrequest.py → aaveborrowrequest.py} +10 -18
  8. compass_api_sdk/models/aavehistoricaltransactionsresponse.py +65 -0
  9. compass_api_sdk/models/{compass_api_backend_models_multicall_transact_request_aave_loop_request_aavelooprequest.py → aavelooprequest.py} +5 -11
  10. compass_api_sdk/models/{compass_api_backend_models_aave_transact_request_repay_aaverepayrequest.py → aaverepayrequest.py} +10 -18
  11. compass_api_sdk/models/{compass_api_backend_models_aave_transact_request_supply_aavesupplyrequest.py → aavesupplyrequest.py} +10 -18
  12. compass_api_sdk/models/{compass_api_backend_models_aave_transact_request_withdraw_aavewithdrawrequest.py → aavewithdrawrequest.py} +11 -19
  13. compass_api_sdk/models/{compass_api_backend_models_aerodrome_slipstream_read_response_positions_aerodromelppositionsresponse.py → aerodromelppositionsresponse.py} +2 -6
  14. compass_api_sdk/models/{compass_api_backend_models_aerodrome_slipstream_transact_request_swap_buy_exactly_aerodromeslipstreambuyexactlyrequest.py → aerodromeslipstreambuyexactlyrequest.py} +17 -27
  15. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +125 -0
  16. compass_api_sdk/models/{compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_mint_aerodromeslipstreammintliquidityprovisionrequest.py → aerodromeslipstreammintliquidityprovisionrequest.py} +33 -39
  17. compass_api_sdk/models/{compass_api_backend_models_aerodrome_slipstream_transact_request_swap_sell_exactly_aerodromeslipstreamsellexactlyrequest.py → aerodromeslipstreamsellexactlyrequest.py} +17 -27
  18. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +66 -0
  19. compass_api_sdk/models/batcheduseroperationsrequest.py +36 -0
  20. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_borrow.py → borrow.py} +2 -4
  21. compass_api_sdk/models/bundlertransactionresponse.py +17 -0
  22. compass_api_sdk/models/{compass_api_backend_config_chain_chain.py → chain.py} +1 -1
  23. compass_api_sdk/models/compass_api_backend_models_vaults_read_response_vault_userposition.py +8 -4
  24. compass_api_sdk/models/cooldownposition.py +35 -0
  25. compass_api_sdk/models/ethenadepositparams.py +82 -0
  26. compass_api_sdk/models/ethenadepositrequest.py +95 -0
  27. compass_api_sdk/models/ethenagetvaultresponse.py +109 -0
  28. compass_api_sdk/models/ethenarequesttowithdrawparams.py +28 -0
  29. compass_api_sdk/models/ethenarequesttowithdrawrequest.py +41 -0
  30. compass_api_sdk/models/ethenarequesttowithdrawtransactionresponse.py +37 -0
  31. compass_api_sdk/models/ethenawithdrawparams.py +70 -0
  32. compass_api_sdk/models/ethenawithdrawrequest.py +83 -0
  33. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_liquidationcall.py → liquidationcall.py} +2 -6
  34. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_marketposition.py → marketposition.py} +2 -6
  35. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_borrow_morphoborrowrequest.py → morphoborrowrequest.py} +11 -19
  36. compass_api_sdk/models/morphocheckuserpositionresponse.py +32 -0
  37. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_deposit_morphodepositrequest.py → morphodepositrequest.py} +11 -23
  38. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_morphogetmarketresponse.py → morphogetmarketresponse.py} +2 -6
  39. compass_api_sdk/models/morphogetmarketsresponse.py +17 -0
  40. compass_api_sdk/models/morphogetvaultsresponse.py +17 -0
  41. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_morphomarket.py → morphomarket.py} +2 -4
  42. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_repay_morphorepayrequest.py → morphorepayrequest.py} +5 -9
  43. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_supply_collateral_morphosupplycollateralrequest.py → morphosupplycollateralrequest.py} +11 -19
  44. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vaults_morphovault.py → morphovault.py} +2 -2
  45. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_withdraw_collateral_morphowithdrawcollateralrequest.py → morphowithdrawcollateralrequest.py} +11 -19
  46. compass_api_sdk/models/{compass_api_backend_models_morpho_transact_request_withdraw_morphowithdrawrequest.py → morphowithdrawrequest.py} +5 -15
  47. compass_api_sdk/models/{compass_api_backend_models_multicall_read_request_get_authorization_multicallauthorizationrequest.py → multicallauthorizationrequest.py} +5 -11
  48. compass_api_sdk/models/{compass_api_backend_models_multicall_transact_request_multicall_execution_request_multicallexecuterequest.py → multicallexecuterequest.py} +8 -21
  49. compass_api_sdk/models/odosswaprequest.py +90 -0
  50. compass_api_sdk/models/odostransactionresponse.py +37 -0
  51. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_positions_openposition.py → openposition.py} +2 -4
  52. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_market_pendlegetmarketresponse.py → pendlegetmarketresponse.py} +2 -4
  53. compass_api_sdk/models/pendlelistmarketsresponse.py +17 -0
  54. compass_api_sdk/models/pendlelistuserpositionsresponse.py +17 -0
  55. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_markets_pendlemarket.py → pendlemarket.py} +2 -2
  56. compass_api_sdk/models/{compass_api_backend_models_pendle_transact_request_redeem_yield_pendleredeemyieldrequest.py → pendleredeemyieldrequest.py} +5 -11
  57. compass_api_sdk/models/pendletxresponse.py +2 -11
  58. compass_api_sdk/models/{compass_api_backend_models_generic_read_response_portfolio_portfolio.py → portfolio.py} +2 -2
  59. compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_positions_position.py → position.py} +7 -18
  60. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_redeemunderlying.py → redeemunderlying.py} +2 -6
  61. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_repay.py → repay.py} +2 -4
  62. compass_api_sdk/models/setallowanceparams.py +1 -0
  63. compass_api_sdk/models/setallowancerequest.py +113 -0
  64. compass_api_sdk/models/{compass_api_backend_models_sky_transact_request_buy_skybuyrequest.py → skybuyrequest.py} +13 -18
  65. compass_api_sdk/models/{compass_api_backend_models_sky_transact_request_deposit_skydepositrequest.py → skydepositrequest.py} +10 -22
  66. compass_api_sdk/models/{compass_api_backend_models_sky_transact_request_sell_skysellrequest.py → skysellrequest.py} +13 -21
  67. compass_api_sdk/models/{compass_api_backend_models_sky_transact_request_withdraw_skywithdrawrequest.py → skywithdrawrequest.py} +5 -13
  68. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_supply.py → supply.py} +2 -4
  69. compass_api_sdk/models/supportedchaininfo.py +19 -0
  70. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_swapborrowrate.py → swapborrowrate.py} +2 -6
  71. compass_api_sdk/models/token_enum.py +31 -25
  72. compass_api_sdk/models/tokentransferparams.py +21 -21
  73. compass_api_sdk/models/tokentransferrequest.py +82 -0
  74. compass_api_sdk/models/transactionresponse.py +2 -11
  75. compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_asset.py → underlyingtoken.py} +2 -2
  76. compass_api_sdk/models/uniswapbuyexactlyrequest.py +111 -0
  77. compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +2 -10
  78. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +115 -0
  79. compass_api_sdk/models/{compass_api_backend_models_uniswap_transact_liquidity_provision_request_mint_uniswapmintliquidityprovisionrequest.py → uniswapmintliquidityprovisionrequest.py} +29 -43
  80. compass_api_sdk/models/uniswapsellexactlyrequest.py +111 -0
  81. compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +2 -10
  82. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +67 -0
  83. compass_api_sdk/models/{compass_api_backend_models_generic_transact_request_unwrap_weth_unwrapwethrequest.py → unwrapwethrequest.py} +10 -22
  84. compass_api_sdk/models/{compass_api_backend_models_aave_read_response_historical_transactions_usageascollateral.py → usageascollateral.py} +2 -6
  85. compass_api_sdk/models/{compass_api_backend_models_multicall_transact_request_multicall_execution_request_useroperation.py → useroperation.py} +27 -25
  86. compass_api_sdk/models/v1_aave_avg_rateop.py +31 -25
  87. compass_api_sdk/models/v1_aave_liquidity_changeop.py +31 -25
  88. compass_api_sdk/models/v1_aave_rateop.py +31 -25
  89. compass_api_sdk/models/v1_aave_reserve_overviewop.py +31 -25
  90. compass_api_sdk/models/v1_aave_std_rateop.py +31 -25
  91. compass_api_sdk/models/v1_aave_token_priceop.py +31 -25
  92. compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +31 -25
  93. compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +62 -50
  94. compass_api_sdk/models/v1_ethena_vaultop.py +75 -0
  95. compass_api_sdk/models/v1_generic_allowanceop.py +1 -0
  96. compass_api_sdk/models/v1_token_addressop.py +31 -25
  97. compass_api_sdk/models/v1_token_priceop.py +4 -16
  98. compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +6 -3
  99. compass_api_sdk/models/v1_uniswap_pool_priceop.py +62 -50
  100. compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +62 -50
  101. compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +62 -50
  102. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_vault.py → vault.py} +2 -4
  103. compass_api_sdk/models/{compass_api_backend_models_vaults_transact_request_deposit_vaultdepositrequest.py → vaultdepositrequest.py} +11 -19
  104. compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_vaultgetvaultresponse.py → vaultgetvaultresponse.py} +5 -10
  105. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_vaultposition.py → vaultposition.py} +5 -12
  106. compass_api_sdk/models/{compass_api_backend_models_vaults_transact_request_withdraw_vaultwithdrawrequest.py → vaultwithdrawrequest.py} +5 -11
  107. compass_api_sdk/models/{compass_api_backend_models_generic_transact_request_wrap_eth_wrapethrequest.py → wrapethrequest.py} +10 -20
  108. compass_api_sdk/morpho.py +82 -170
  109. compass_api_sdk/pendle.py +18 -56
  110. compass_api_sdk/sdk.py +3 -0
  111. compass_api_sdk/sky.py +56 -106
  112. compass_api_sdk/smart_account.py +10 -38
  113. compass_api_sdk/swap.py +16 -30
  114. compass_api_sdk/token_sdk.py +30 -40
  115. compass_api_sdk/transaction_bundler.py +26 -74
  116. compass_api_sdk/uniswap_v3.py +90 -106
  117. compass_api_sdk/universal.py +44 -92
  118. {compass_api_sdk-0.9.52.dist-info → compass_api_sdk-1.0.1.dist-info}/METADATA +150 -135
  119. {compass_api_sdk-0.9.52.dist-info → compass_api_sdk-1.0.1.dist-info}/RECORD +120 -108
  120. compass_api_sdk/models/compass_api_backend_models_aave_read_response_historical_transactions_aavehistoricaltransactionsresponse.py +0 -115
  121. compass_api_sdk/models/compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_increase_aerodromeslipstreamincreaseliquidityprovisionrequest.py +0 -125
  122. compass_api_sdk/models/compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_withdraw_aerodromeslipstreamwithdrawliquidityprovisionrequest.py +0 -68
  123. compass_api_sdk/models/compass_api_backend_models_generic_read_response_chains_supportedchaininfo.py +0 -21
  124. compass_api_sdk/models/compass_api_backend_models_generic_transact_request_allowance_setallowancerequest.py +0 -139
  125. compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_morphocheckuserpositionresponse.py +0 -48
  126. compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_morphogetmarketsresponse.py +0 -26
  127. compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_morphogetvaultsresponse.py +0 -24
  128. compass_api_sdk/models/compass_api_backend_models_pendle_read_response_markets_pendlelistmarketsresponse.py +0 -24
  129. compass_api_sdk/models/compass_api_backend_models_pendle_read_response_positions_pendlelistuserpositionsresponse.py +0 -24
  130. compass_api_sdk/models/compass_api_backend_models_smart_account_transact_request_user_operations_batcheduseroperationsrequest.py +0 -49
  131. compass_api_sdk/models/compass_api_backend_models_swap_transact_request_odos_odosswaprequest.py +0 -108
  132. compass_api_sdk/models/compass_api_backend_models_token_transact_request_transfer_tokentransferrequest.py +0 -98
  133. compass_api_sdk/models/compass_api_backend_models_uniswap_transact_liquidity_provision_request_increase_uniswapincreaseliquidityprovisionrequest.py +0 -129
  134. compass_api_sdk/models/compass_api_backend_models_uniswap_transact_liquidity_provision_request_withdraw_uniswapwithdrawliquidityprovisionrequest.py +0 -68
  135. compass_api_sdk/models/compass_api_backend_models_uniswap_transact_swap_request_buy_exactly_uniswapbuyexactlyrequest.py +0 -123
  136. compass_api_sdk/models/compass_api_backend_models_uniswap_transact_swap_request_sell_exactly_uniswapsellexactlyrequest.py +0 -123
  137. compass_api_sdk/models/tokentransfererc20params.py +0 -63
  138. {compass_api_sdk-0.9.52.dist-info → compass_api_sdk-1.0.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,109 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .apy import Apy, ApyTypedDict
5
+ from .compass_api_backend_models_vaults_read_response_vault_userposition import (
6
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPosition,
7
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict,
8
+ )
9
+ from .cooldownposition import CooldownPosition, CooldownPositionTypedDict
10
+ from .underlyingtoken import UnderlyingToken, UnderlyingTokenTypedDict
11
+ from compass_api_sdk.types import (
12
+ BaseModel,
13
+ Nullable,
14
+ OptionalNullable,
15
+ UNSET,
16
+ UNSET_SENTINEL,
17
+ )
18
+ from pydantic import model_serializer
19
+ from typing_extensions import NotRequired, TypedDict
20
+
21
+
22
+ class EthenaGetVaultResponseTypedDict(TypedDict):
23
+ name: str
24
+ r"""Name of the vault."""
25
+ symbol: str
26
+ r"""Symbol of the vault."""
27
+ decimals: int
28
+ r"""Number of decimals used for the vault's share precision."""
29
+ total_assets: str
30
+ r"""Total amount of assets deposited in the vault."""
31
+ total_supply: str
32
+ r"""Total amount of shares issued from the vault."""
33
+ share_price: str
34
+ r"""The price of one vault share in terms of the underlying asset."""
35
+ underlying_token: UnderlyingTokenTypedDict
36
+ apy: ApyTypedDict
37
+ cooldown_duration_days: int
38
+ r"""The duration of days that must pass before a position can be withdrawn from the Ethena vault after a request to withdraw has been made."""
39
+ user_position: NotRequired[
40
+ Nullable[CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict]
41
+ ]
42
+ r"""The user's position in the vault."""
43
+ cooldown_position: NotRequired[Nullable[CooldownPositionTypedDict]]
44
+ r"""The user's cooldown position."""
45
+
46
+
47
+ class EthenaGetVaultResponse(BaseModel):
48
+ name: str
49
+ r"""Name of the vault."""
50
+
51
+ symbol: str
52
+ r"""Symbol of the vault."""
53
+
54
+ decimals: int
55
+ r"""Number of decimals used for the vault's share precision."""
56
+
57
+ total_assets: str
58
+ r"""Total amount of assets deposited in the vault."""
59
+
60
+ total_supply: str
61
+ r"""Total amount of shares issued from the vault."""
62
+
63
+ share_price: str
64
+ r"""The price of one vault share in terms of the underlying asset."""
65
+
66
+ underlying_token: UnderlyingToken
67
+
68
+ apy: Apy
69
+
70
+ cooldown_duration_days: int
71
+ r"""The duration of days that must pass before a position can be withdrawn from the Ethena vault after a request to withdraw has been made."""
72
+
73
+ user_position: OptionalNullable[
74
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPosition
75
+ ] = UNSET
76
+ r"""The user's position in the vault."""
77
+
78
+ cooldown_position: OptionalNullable[CooldownPosition] = UNSET
79
+ r"""The user's cooldown position."""
80
+
81
+ @model_serializer(mode="wrap")
82
+ def serialize_model(self, handler):
83
+ optional_fields = ["user_position", "cooldown_position"]
84
+ nullable_fields = ["user_position", "cooldown_position"]
85
+ null_default_fields = []
86
+
87
+ serialized = handler(self)
88
+
89
+ m = {}
90
+
91
+ for n, f in type(self).model_fields.items():
92
+ k = f.alias or n
93
+ val = serialized.get(k)
94
+ serialized.pop(k, None)
95
+
96
+ optional_nullable = k in optional_fields and k in nullable_fields
97
+ is_set = (
98
+ self.__pydantic_fields_set__.intersection({n})
99
+ or k in null_default_fields
100
+ ) # pylint: disable=no-member
101
+
102
+ if val is not None and val != UNSET_SENTINEL:
103
+ m[k] = val
104
+ elif val != UNSET_SENTINEL and (
105
+ not k in optional_fields or (optional_nullable and is_set)
106
+ ):
107
+ m[k] = val
108
+
109
+ return m
@@ -0,0 +1,28 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ from compass_api_sdk.utils import validate_const
6
+ import pydantic
7
+ from pydantic.functional_validators import AfterValidator
8
+ from typing import Any, Literal, Optional
9
+ from typing_extensions import Annotated, TypedDict
10
+
11
+
12
+ class EthenaRequestToWithdrawParamsTypedDict(TypedDict):
13
+ amount: Any
14
+ r"""The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn."""
15
+ action_type: Literal["ETHENA_REQUEST_WITHDRAW"]
16
+
17
+
18
+ class EthenaRequestToWithdrawParams(BaseModel):
19
+ amount: Any
20
+ r"""The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn."""
21
+
22
+ ACTION_TYPE: Annotated[
23
+ Annotated[
24
+ Optional[Literal["ETHENA_REQUEST_WITHDRAW"]],
25
+ AfterValidator(validate_const("ETHENA_REQUEST_WITHDRAW")),
26
+ ],
27
+ pydantic.Field(alias="action_type"),
28
+ ] = "ETHENA_REQUEST_WITHDRAW"
@@ -0,0 +1,41 @@
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
+ from enum import Enum
7
+ import pydantic
8
+ from pydantic.functional_validators import AfterValidator
9
+ from typing import Any, Literal, Optional
10
+ from typing_extensions import Annotated, TypedDict
11
+
12
+
13
+ class EthenaRequestToWithdrawRequestChain(str, Enum):
14
+ ETHEREUM = "ethereum"
15
+
16
+
17
+ class EthenaRequestToWithdrawRequestTypedDict(TypedDict):
18
+ amount: Any
19
+ r"""The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn."""
20
+ chain: EthenaRequestToWithdrawRequestChain
21
+ sender: str
22
+ r"""The address of the transaction sender."""
23
+ action_type: Literal["ETHENA_REQUEST_WITHDRAW"]
24
+
25
+
26
+ class EthenaRequestToWithdrawRequest(BaseModel):
27
+ amount: Any
28
+ r"""The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn."""
29
+
30
+ chain: EthenaRequestToWithdrawRequestChain
31
+
32
+ sender: str
33
+ r"""The address of the transaction sender."""
34
+
35
+ ACTION_TYPE: Annotated[
36
+ Annotated[
37
+ Optional[Literal["ETHENA_REQUEST_WITHDRAW"]],
38
+ AfterValidator(validate_const("ETHENA_REQUEST_WITHDRAW")),
39
+ ],
40
+ pydantic.Field(alias="action_type"),
41
+ ] = "ETHENA_REQUEST_WITHDRAW"
@@ -0,0 +1,37 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .unsignedtransaction import UnsignedTransaction, UnsignedTransactionTypedDict
5
+ from .useroperationresponse import UserOperationResponse, UserOperationResponseTypedDict
6
+ from compass_api_sdk.types import BaseModel
7
+ from typing import Union
8
+ from typing_extensions import TypeAliasType, TypedDict
9
+
10
+
11
+ EthenaRequestToWithdrawTransactionResponseTransactionTypedDict = TypeAliasType(
12
+ "EthenaRequestToWithdrawTransactionResponseTransactionTypedDict",
13
+ Union[UserOperationResponseTypedDict, UnsignedTransactionTypedDict],
14
+ )
15
+ r"""The unsigned transaction data. User must sign and broadcast to network."""
16
+
17
+
18
+ EthenaRequestToWithdrawTransactionResponseTransaction = TypeAliasType(
19
+ "EthenaRequestToWithdrawTransactionResponseTransaction",
20
+ Union[UserOperationResponse, UnsignedTransaction],
21
+ )
22
+ r"""The unsigned transaction data. User must sign and broadcast to network."""
23
+
24
+
25
+ class EthenaRequestToWithdrawTransactionResponseTypedDict(TypedDict):
26
+ transaction: EthenaRequestToWithdrawTransactionResponseTransactionTypedDict
27
+ r"""The unsigned transaction data. User must sign and broadcast to network."""
28
+ cooldown_duration_days: int
29
+ r"""The duration of days that must pass before a position can be withdrawn from the Ethena vault after a request to withdraw has been made."""
30
+
31
+
32
+ class EthenaRequestToWithdrawTransactionResponse(BaseModel):
33
+ transaction: EthenaRequestToWithdrawTransactionResponseTransaction
34
+ r"""The unsigned transaction data. User must sign and broadcast to network."""
35
+
36
+ cooldown_duration_days: int
37
+ r"""The duration of days that must pass before a position can be withdrawn from the Ethena vault after a request to withdraw has been made."""
@@ -0,0 +1,70 @@
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 Any, Literal, Optional
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
17
+
18
+
19
+ class EthenaWithdrawParamsTypedDict(TypedDict):
20
+ amount: Any
21
+ r"""The amount of USDe to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be withdrawn."""
22
+ action_type: Literal["ETHENA_WITHDRAW"]
23
+ receiver: NotRequired[Nullable[str]]
24
+ r"""The address which will receive the USDe withdrawn. Defaults to the sender."""
25
+
26
+
27
+ class EthenaWithdrawParams(BaseModel):
28
+ amount: Any
29
+ r"""The amount of USDe to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be withdrawn."""
30
+
31
+ ACTION_TYPE: Annotated[
32
+ Annotated[
33
+ Optional[Literal["ETHENA_WITHDRAW"]],
34
+ AfterValidator(validate_const("ETHENA_WITHDRAW")),
35
+ ],
36
+ pydantic.Field(alias="action_type"),
37
+ ] = "ETHENA_WITHDRAW"
38
+
39
+ receiver: OptionalNullable[str] = UNSET
40
+ r"""The address which will receive the USDe withdrawn. Defaults to the sender."""
41
+
42
+ @model_serializer(mode="wrap")
43
+ def serialize_model(self, handler):
44
+ optional_fields = ["action_type", "receiver"]
45
+ nullable_fields = ["receiver"]
46
+ null_default_fields = []
47
+
48
+ serialized = handler(self)
49
+
50
+ m = {}
51
+
52
+ for n, f in type(self).model_fields.items():
53
+ k = f.alias or n
54
+ val = serialized.get(k)
55
+ serialized.pop(k, None)
56
+
57
+ optional_nullable = k in optional_fields and k in nullable_fields
58
+ is_set = (
59
+ self.__pydantic_fields_set__.intersection({n})
60
+ or k in null_default_fields
61
+ ) # pylint: disable=no-member
62
+
63
+ if val is not None and val != UNSET_SENTINEL:
64
+ m[k] = val
65
+ elif val != UNSET_SENTINEL and (
66
+ not k in optional_fields or (optional_nullable and is_set)
67
+ ):
68
+ m[k] = val
69
+
70
+ return m
@@ -0,0 +1,83 @@
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
+ from enum import Enum
13
+ import pydantic
14
+ from pydantic import model_serializer
15
+ from pydantic.functional_validators import AfterValidator
16
+ from typing import Any, Literal, Optional
17
+ from typing_extensions import Annotated, NotRequired, TypedDict
18
+
19
+
20
+ class EthenaWithdrawRequestChain(str, Enum):
21
+ ETHEREUM = "ethereum"
22
+
23
+
24
+ class EthenaWithdrawRequestTypedDict(TypedDict):
25
+ amount: Any
26
+ r"""The amount of USDe to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be withdrawn."""
27
+ chain: EthenaWithdrawRequestChain
28
+ sender: str
29
+ r"""The address of the transaction sender."""
30
+ action_type: Literal["ETHENA_WITHDRAW"]
31
+ receiver: NotRequired[Nullable[str]]
32
+ r"""The address which will receive the USDe withdrawn. Defaults to the sender."""
33
+
34
+
35
+ class EthenaWithdrawRequest(BaseModel):
36
+ amount: Any
37
+ r"""The amount of USDe to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be withdrawn."""
38
+
39
+ chain: EthenaWithdrawRequestChain
40
+
41
+ sender: str
42
+ r"""The address of the transaction sender."""
43
+
44
+ ACTION_TYPE: Annotated[
45
+ Annotated[
46
+ Optional[Literal["ETHENA_WITHDRAW"]],
47
+ AfterValidator(validate_const("ETHENA_WITHDRAW")),
48
+ ],
49
+ pydantic.Field(alias="action_type"),
50
+ ] = "ETHENA_WITHDRAW"
51
+
52
+ receiver: OptionalNullable[str] = UNSET
53
+ r"""The address which will receive the USDe withdrawn. Defaults to the sender."""
54
+
55
+ @model_serializer(mode="wrap")
56
+ def serialize_model(self, handler):
57
+ optional_fields = ["action_type", "receiver"]
58
+ nullable_fields = ["receiver"]
59
+ null_default_fields = []
60
+
61
+ serialized = handler(self)
62
+
63
+ m = {}
64
+
65
+ for n, f in type(self).model_fields.items():
66
+ k = f.alias or n
67
+ val = serialized.get(k)
68
+ serialized.pop(k, None)
69
+
70
+ optional_nullable = k in optional_fields and k in nullable_fields
71
+ is_set = (
72
+ self.__pydantic_fields_set__.intersection({n})
73
+ or k in null_default_fields
74
+ ) # pylint: disable=no-member
75
+
76
+ if val is not None and val != UNSET_SENTINEL:
77
+ m[k] = val
78
+ elif val != UNSET_SENTINEL and (
79
+ not k in optional_fields or (optional_nullable and is_set)
80
+ ):
81
+ m[k] = val
82
+
83
+ return m
@@ -10,9 +10,7 @@ from typing import Literal
10
10
  from typing_extensions import Annotated, TypedDict
11
11
 
12
12
 
13
- class CompassAPIBackendModelsAaveReadResponseHistoricalTransactionsLiquidationCallTypedDict(
14
- TypedDict
15
- ):
13
+ class LiquidationCallTypedDict(TypedDict):
16
14
  id: str
17
15
  r"""The id of a historical transaction on aave"""
18
16
  timestamp: int
@@ -29,9 +27,7 @@ class CompassAPIBackendModelsAaveReadResponseHistoricalTransactionsLiquidationCa
29
27
  action: Literal["LiquidationCall"]
30
28
 
31
29
 
32
- class CompassAPIBackendModelsAaveReadResponseHistoricalTransactionsLiquidationCall(
33
- BaseModel
34
- ):
30
+ class LiquidationCall(BaseModel):
35
31
  id: str
36
32
  r"""The id of a historical transaction on aave"""
37
33
 
@@ -12,9 +12,7 @@ from pydantic import model_serializer
12
12
  from typing_extensions import Annotated, TypedDict
13
13
 
14
14
 
15
- class CompassAPIBackendModelsMorphoReadResponseCheckUserPositionMarketPositionTypedDict(
16
- TypedDict
17
- ):
15
+ class MarketPositionTypedDict(TypedDict):
18
16
  market: MarketTypedDict
19
17
  health_factor: Nullable[str]
20
18
  price_variation_to_liquidation_price: Nullable[str]
@@ -23,9 +21,7 @@ class CompassAPIBackendModelsMorphoReadResponseCheckUserPositionMarketPositionTy
23
21
  )
24
22
 
25
23
 
26
- class CompassAPIBackendModelsMorphoReadResponseCheckUserPositionMarketPosition(
27
- BaseModel
28
- ):
24
+ class MarketPosition(BaseModel):
29
25
  market: Market
30
26
 
31
27
  health_factor: Annotated[Nullable[str], pydantic.Field(alias="healthFactor")]
@@ -17,38 +17,30 @@ from typing import Literal, Optional, Union
17
17
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
18
18
 
19
19
 
20
- CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmountTypedDict = TypeAliasType(
21
- "CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmountTypedDict",
22
- Union[float, str],
20
+ MorphoBorrowRequestAmountTypedDict = TypeAliasType(
21
+ "MorphoBorrowRequestAmountTypedDict", Union[float, str]
23
22
  )
24
23
  r"""Amount of the token to borrow from the market."""
25
24
 
26
25
 
27
- CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmount = (
28
- TypeAliasType(
29
- "CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmount",
30
- Union[float, str],
31
- )
26
+ MorphoBorrowRequestAmount = TypeAliasType(
27
+ "MorphoBorrowRequestAmount", Union[float, str]
32
28
  )
33
29
  r"""Amount of the token to borrow from the market."""
34
30
 
35
31
 
36
- class CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestChain(
37
- str, Enum
38
- ):
32
+ class MorphoBorrowRequestChain(str, Enum):
39
33
  ARBITRUM = "arbitrum"
40
34
  BASE = "base"
41
35
  ETHEREUM = "ethereum"
42
36
 
43
37
 
44
- class CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestTypedDict(
45
- TypedDict
46
- ):
47
- amount: CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmountTypedDict
38
+ class MorphoBorrowRequestTypedDict(TypedDict):
39
+ amount: MorphoBorrowRequestAmountTypedDict
48
40
  r"""Amount of the token to borrow from the market."""
49
41
  unique_market_key: str
50
42
  r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
51
- chain: CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestChain
43
+ chain: MorphoBorrowRequestChain
52
44
  sender: str
53
45
  r"""The address of the transaction sender."""
54
46
  action_type: Literal["MORPHO_BORROW"]
@@ -58,14 +50,14 @@ class CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestTyped
58
50
  r"""The address of the receiver of the tokens borrowed. Defaults to the transaction sender."""
59
51
 
60
52
 
61
- class CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequest(BaseModel):
62
- amount: CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestAmount
53
+ class MorphoBorrowRequest(BaseModel):
54
+ amount: MorphoBorrowRequestAmount
63
55
  r"""Amount of the token to borrow from the market."""
64
56
 
65
57
  unique_market_key: str
66
58
  r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
67
59
 
68
- chain: CompassAPIBackendModelsMorphoTransactRequestBorrowMorphoBorrowRequestChain
60
+ chain: MorphoBorrowRequestChain
69
61
 
70
62
  sender: str
71
63
  r"""The address of the transaction sender."""
@@ -0,0 +1,32 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .marketposition import MarketPosition, MarketPositionTypedDict
5
+ from .userstate import UserState, UserStateTypedDict
6
+ from .vaultposition import VaultPosition, VaultPositionTypedDict
7
+ from compass_api_sdk.types import BaseModel
8
+ import pydantic
9
+ from typing import List
10
+ from typing_extensions import Annotated, TypedDict
11
+
12
+
13
+ class MorphoCheckUserPositionResponseTypedDict(TypedDict):
14
+ state: UserStateTypedDict
15
+ vault_positions: List[VaultPositionTypedDict]
16
+ r"""A list of the user's vault positions."""
17
+ market_positions: List[MarketPositionTypedDict]
18
+ r"""A list of the user's market positions."""
19
+
20
+
21
+ class MorphoCheckUserPositionResponse(BaseModel):
22
+ state: UserState
23
+
24
+ vault_positions: Annotated[
25
+ List[VaultPosition], pydantic.Field(alias="vaultPositions")
26
+ ]
27
+ r"""A list of the user's vault positions."""
28
+
29
+ market_positions: Annotated[
30
+ List[MarketPosition], pydantic.Field(alias="marketPositions")
31
+ ]
32
+ r"""A list of the user's market positions."""
@@ -17,38 +17,30 @@ from typing import Literal, Optional, Union
17
17
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
18
18
 
19
19
 
20
- CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmountTypedDict = TypeAliasType(
21
- "CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmountTypedDict",
22
- Union[float, str],
20
+ MorphoDepositRequestAmountTypedDict = TypeAliasType(
21
+ "MorphoDepositRequestAmountTypedDict", Union[float, str]
23
22
  )
24
23
  r"""The amount of tokens to deposit into the vault."""
25
24
 
26
25
 
27
- CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmount = (
28
- TypeAliasType(
29
- "CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmount",
30
- Union[float, str],
31
- )
26
+ MorphoDepositRequestAmount = TypeAliasType(
27
+ "MorphoDepositRequestAmount", Union[float, str]
32
28
  )
33
29
  r"""The amount of tokens to deposit into the vault."""
34
30
 
35
31
 
36
- class CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestChain(
37
- str, Enum
38
- ):
32
+ class MorphoDepositRequestChain(str, Enum):
39
33
  ARBITRUM = "arbitrum"
40
34
  BASE = "base"
41
35
  ETHEREUM = "ethereum"
42
36
 
43
37
 
44
- class CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestTypedDict(
45
- TypedDict
46
- ):
38
+ class MorphoDepositRequestTypedDict(TypedDict):
47
39
  vault_address: str
48
40
  r"""The vault address you are depositing to."""
49
- amount: CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmountTypedDict
41
+ amount: MorphoDepositRequestAmountTypedDict
50
42
  r"""The amount of tokens to deposit into the vault."""
51
- chain: CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestChain
43
+ chain: MorphoDepositRequestChain
52
44
  sender: str
53
45
  r"""The address of the transaction sender."""
54
46
  action_type: Literal["MORPHO_DEPOSIT"]
@@ -56,18 +48,14 @@ class CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestTyp
56
48
  r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
57
49
 
58
50
 
59
- class CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequest(
60
- BaseModel
61
- ):
51
+ class MorphoDepositRequest(BaseModel):
62
52
  vault_address: str
63
53
  r"""The vault address you are depositing to."""
64
54
 
65
- amount: (
66
- CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestAmount
67
- )
55
+ amount: MorphoDepositRequestAmount
68
56
  r"""The amount of tokens to deposit into the vault."""
69
57
 
70
- chain: CompassAPIBackendModelsMorphoTransactRequestDepositMorphoDepositRequestChain
58
+ chain: MorphoDepositRequestChain
71
59
 
72
60
  sender: str
73
61
  r"""The address of the transaction sender."""
@@ -18,9 +18,7 @@ import pydantic
18
18
  from typing_extensions import Annotated, TypedDict
19
19
 
20
20
 
21
- class CompassAPIBackendModelsMorphoReadResponseGetMarketMorphoGetMarketResponseTypedDict(
22
- TypedDict
23
- ):
21
+ class MorphoGetMarketResponseTypedDict(TypedDict):
24
22
  whitelisted: bool
25
23
  r"""Whether the market is whitelisted or not."""
26
24
  lltv: str
@@ -35,9 +33,7 @@ class CompassAPIBackendModelsMorphoReadResponseGetMarketMorphoGetMarketResponseT
35
33
  state: CompassAPIBackendModelsMorphoReadResponseGetMarketMarketStateTypedDict
36
34
 
37
35
 
38
- class CompassAPIBackendModelsMorphoReadResponseGetMarketMorphoGetMarketResponse(
39
- BaseModel
40
- ):
36
+ class MorphoGetMarketResponse(BaseModel):
41
37
  whitelisted: bool
42
38
  r"""Whether the market is whitelisted or not."""
43
39
 
@@ -0,0 +1,17 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .morphomarket import MorphoMarket, MorphoMarketTypedDict
5
+ from compass_api_sdk.types import BaseModel
6
+ from typing import List
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class MorphoGetMarketsResponseTypedDict(TypedDict):
11
+ markets: List[MorphoMarketTypedDict]
12
+ r"""A list of markets matching the query."""
13
+
14
+
15
+ class MorphoGetMarketsResponse(BaseModel):
16
+ markets: List[MorphoMarket]
17
+ r"""A list of markets matching the query."""
@@ -0,0 +1,17 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .morphovault import MorphoVault, MorphoVaultTypedDict
5
+ from compass_api_sdk.types import BaseModel
6
+ from typing import List
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class MorphoGetVaultsResponseTypedDict(TypedDict):
11
+ vaults: List[MorphoVaultTypedDict]
12
+ r"""A list of vaults matching the query."""
13
+
14
+
15
+ class MorphoGetVaultsResponse(BaseModel):
16
+ vaults: List[MorphoVault]
17
+ r"""A list of vaults matching the query."""
@@ -16,9 +16,7 @@ from pydantic import model_serializer
16
16
  from typing_extensions import Annotated, TypedDict
17
17
 
18
18
 
19
- class CompassAPIBackendModelsMorphoReadResponseGetMarketsMorphoMarketTypedDict(
20
- TypedDict
21
- ):
19
+ class MorphoMarketTypedDict(TypedDict):
22
20
  unique_key: str
23
21
  lltv: int
24
22
  oracle_address: str
@@ -31,7 +29,7 @@ class CompassAPIBackendModelsMorphoReadResponseGetMarketsMorphoMarketTypedDict(
31
29
  loan_asset: CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict
32
30
 
33
31
 
34
- class CompassAPIBackendModelsMorphoReadResponseGetMarketsMorphoMarket(BaseModel):
32
+ class MorphoMarket(BaseModel):
35
33
  unique_key: Annotated[str, pydantic.Field(alias="uniqueKey")]
36
34
 
37
35
  lltv: int