compass_api_sdk 0.9.35__py3-none-any.whl → 2.0.21rc1__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 (322) 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 +971 -728
  5. compass_api_sdk/aerodrome_slipstream.py +367 -390
  6. compass_api_sdk/basesdk.py +21 -5
  7. compass_api_sdk/bridge.py +536 -0
  8. compass_api_sdk/earn.py +1780 -0
  9. compass_api_sdk/erc_4626_vaults.py +127 -154
  10. compass_api_sdk/errors/__init__.py +38 -4
  11. compass_api_sdk/errors/apierror.py +32 -14
  12. compass_api_sdk/errors/compassapierror.py +30 -0
  13. compass_api_sdk/errors/httpvalidationerror.py +15 -8
  14. compass_api_sdk/errors/mintpreparenotfoundresponse_error.py +49 -0
  15. compass_api_sdk/errors/no_response_error.py +17 -0
  16. compass_api_sdk/errors/responsevalidationerror.py +27 -0
  17. compass_api_sdk/{token_sdk.py → ethena.py} +318 -293
  18. compass_api_sdk/gas_sponsorship.py +446 -0
  19. compass_api_sdk/httpclient.py +0 -1
  20. compass_api_sdk/models/__init__.py +1701 -945
  21. compass_api_sdk/models/aaveborrowparams.py +4 -13
  22. compass_api_sdk/models/aaveborrowrequest.py +19 -19
  23. compass_api_sdk/models/aavehistoricaltransactionsresponse.py +8 -8
  24. compass_api_sdk/models/aavelooprequest.py +88 -36
  25. compass_api_sdk/models/aaveposition.py +49 -0
  26. compass_api_sdk/models/aaverepayparams.py +4 -13
  27. compass_api_sdk/models/aaverepayrequest.py +19 -19
  28. compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
  29. compass_api_sdk/models/aavesetuseremodeparams.py +28 -0
  30. compass_api_sdk/models/aavesetuseremoderequest.py +48 -0
  31. compass_api_sdk/models/aavesupplyparams.py +4 -13
  32. compass_api_sdk/models/aavesupplyrequest.py +19 -19
  33. compass_api_sdk/models/aavesupportedtokenmetadata.py +30 -0
  34. compass_api_sdk/models/aavesupportedtokensresponse.py +20 -0
  35. compass_api_sdk/models/aavevenue.py +27 -0
  36. compass_api_sdk/models/aavewithdrawparams.py +4 -13
  37. compass_api_sdk/models/aavewithdrawrequest.py +19 -19
  38. compass_api_sdk/models/aerodromeenrichedposition.py +109 -0
  39. compass_api_sdk/models/aerodromelppositionsresponse.py +10 -7
  40. compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
  41. compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +21 -31
  42. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +13 -6
  43. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
  44. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +21 -31
  45. compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
  46. compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
  47. compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +20 -30
  48. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +13 -6
  49. compass_api_sdk/models/approvetransferrequest.py +32 -0
  50. compass_api_sdk/models/{curator.py → approvetransferresponse.py} +12 -13
  51. compass_api_sdk/models/apy.py +3 -0
  52. compass_api_sdk/models/batchedsafeoperationsresponse_input.py +52 -0
  53. compass_api_sdk/models/batchedsafeoperationsresponse_output.py +52 -0
  54. compass_api_sdk/models/batcheduseroperationsrequest.py +24 -9
  55. compass_api_sdk/models/bundlertransactionresponse.py +17 -0
  56. compass_api_sdk/models/chain.py +3 -3
  57. compass_api_sdk/models/chainmarketinfo.py +29 -0
  58. 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
  59. 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
  60. 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
  61. 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
  62. compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultposition.py +30 -0
  63. 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
  64. 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
  65. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vault_asset.py → compass_api_backend_v1_models_morpho_read_response_get_market_asset.py} +5 -5
  66. 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
  67. 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
  68. 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
  69. 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
  70. compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_get_vaults_vaultstate.py +73 -0
  71. compass_api_sdk/models/compass_api_backend_v1_models_pendle_read_response_market_userposition.py +82 -0
  72. 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
  73. compass_api_sdk/models/compass_api_backend_v1_models_vaults_read_response_vault_userposition.py +20 -0
  74. compass_api_sdk/models/compass_api_backend_v1_models_wildcat_read_response_market_userposition.py +22 -0
  75. compass_api_sdk/models/compass_api_backend_v2_models_earn_read_response_positions_vaultposition.py +49 -0
  76. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712domain.py +36 -0
  77. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712types.py +36 -0
  78. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712domain.py +37 -0
  79. compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712types.py +32 -0
  80. compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712domain.py +29 -0
  81. compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712types.py +34 -0
  82. compass_api_sdk/models/cooldownposition.py +35 -0
  83. compass_api_sdk/models/createaccountrequest.py +40 -0
  84. compass_api_sdk/models/createaccountresponse.py +56 -0
  85. compass_api_sdk/models/depositforburnrequest.py +77 -0
  86. compass_api_sdk/models/depositforburnresponse.py +100 -0
  87. compass_api_sdk/models/details.py +44 -7
  88. compass_api_sdk/models/earnmanageparams.py +74 -0
  89. compass_api_sdk/models/earnmanagerequest.py +130 -0
  90. compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_asset.py → earnmanageresponse.py} +13 -21
  91. compass_api_sdk/models/earnpositionsresponse.py +39 -0
  92. compass_api_sdk/models/earnswapparams.py +74 -0
  93. compass_api_sdk/models/earnswaprequest.py +90 -0
  94. compass_api_sdk/models/earnswapresponse.py +55 -0
  95. compass_api_sdk/models/earntransferrequest.py +104 -0
  96. compass_api_sdk/models/earntransferresponse.py +71 -0
  97. compass_api_sdk/models/eip712domainfield.py +20 -0
  98. compass_api_sdk/models/eip712field.py +20 -0
  99. compass_api_sdk/models/ethenadepositparams.py +82 -0
  100. compass_api_sdk/models/ethenadepositrequest.py +100 -0
  101. compass_api_sdk/models/ethenagetvaultresponse.py +109 -0
  102. compass_api_sdk/models/ethenarequesttowithdrawparams.py +28 -0
  103. compass_api_sdk/models/ethenarequesttowithdrawrequest.py +46 -0
  104. compass_api_sdk/models/ethenarequesttowithdrawtransactionresponse.py +37 -0
  105. compass_api_sdk/models/ethenaunstakeparams.py +65 -0
  106. compass_api_sdk/models/ethenaunstakerequest.py +83 -0
  107. compass_api_sdk/models/fee.py +42 -0
  108. compass_api_sdk/models/listaavemarketsresponse.py +21 -0
  109. compass_api_sdk/models/marketposition.py +5 -5
  110. compass_api_sdk/models/maxsupplyapyinfo.py +34 -0
  111. compass_api_sdk/models/mintpreparecompletedresponse.py +46 -0
  112. compass_api_sdk/models/mintpreparependingresponse.py +65 -0
  113. compass_api_sdk/models/mintpreparereadyresponse.py +43 -0
  114. compass_api_sdk/models/mintpreparerequest.py +25 -0
  115. compass_api_sdk/models/morphoborrowrequest.py +9 -3
  116. compass_api_sdk/models/morphocheckuserpositionresponse.py +9 -3
  117. compass_api_sdk/models/morphodepositrequest.py +9 -3
  118. compass_api_sdk/models/morphogetmarketresponse.py +72 -31
  119. compass_api_sdk/models/morphomarket.py +26 -20
  120. compass_api_sdk/models/morphorepayrequest.py +14 -3
  121. compass_api_sdk/models/morphosupplycollateralrequest.py +14 -3
  122. compass_api_sdk/models/morphovault.py +10 -10
  123. compass_api_sdk/models/morphowithdrawcollateralrequest.py +9 -3
  124. compass_api_sdk/models/morphowithdrawrequest.py +9 -3
  125. compass_api_sdk/models/movement10percent.py +65 -10
  126. compass_api_sdk/models/multicallauthorizationrequest.py +9 -9
  127. compass_api_sdk/models/multicallexecuterequest.py +59 -11
  128. compass_api_sdk/models/odosswapparams.py +52 -0
  129. compass_api_sdk/models/odosswaprequest.py +72 -0
  130. compass_api_sdk/models/odostransactionresponse.py +37 -0
  131. compass_api_sdk/models/oneinchswapparams.py +59 -0
  132. compass_api_sdk/models/openposition.py +7 -7
  133. compass_api_sdk/models/operationtype.py +11 -0
  134. compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
  135. compass_api_sdk/models/pendlemanageliquidityparams.py +68 -0
  136. compass_api_sdk/models/pendlemanageliquidityrequest.py +87 -0
  137. compass_api_sdk/models/pendleredeemyieldrequest.py +15 -6
  138. compass_api_sdk/models/pendletradeptparams.py +68 -0
  139. compass_api_sdk/models/pendletradeptrequest.py +87 -0
  140. compass_api_sdk/models/pendletradeytparams.py +68 -0
  141. compass_api_sdk/models/pendletradeytrequest.py +87 -0
  142. compass_api_sdk/models/pendletxresponse.py +36 -0
  143. compass_api_sdk/models/permit2typeddata_input.py +46 -0
  144. compass_api_sdk/models/permit2typeddata_output.py +46 -0
  145. compass_api_sdk/models/permitfield.py +20 -0
  146. compass_api_sdk/models/permitmessage.py +39 -0
  147. compass_api_sdk/models/permittransferfrommessage.py +29 -0
  148. compass_api_sdk/models/permittypeddataresponse_input.py +50 -0
  149. compass_api_sdk/models/permittypeddataresponse_output.py +50 -0
  150. compass_api_sdk/models/portfolio.py +5 -5
  151. compass_api_sdk/models/protocol.py +13 -0
  152. compass_api_sdk/models/reserve.py +6 -15
  153. compass_api_sdk/models/safetransactionparams.py +78 -0
  154. compass_api_sdk/models/safetransactionresponse.py +28 -0
  155. compass_api_sdk/models/safetxfield.py +20 -0
  156. compass_api_sdk/models/safetxmessage.py +66 -0
  157. compass_api_sdk/models/setallowanceparams.py +5 -16
  158. compass_api_sdk/models/setallowancerequest.py +19 -22
  159. compass_api_sdk/models/skybuyrequest.py +12 -9
  160. compass_api_sdk/models/skydepositrequest.py +13 -9
  161. compass_api_sdk/models/skysellrequest.py +12 -9
  162. compass_api_sdk/models/skywithdrawrequest.py +13 -9
  163. compass_api_sdk/models/sponsorgasrequest.py +71 -0
  164. compass_api_sdk/models/sponsorgasresponse.py +14 -0
  165. compass_api_sdk/models/supportedchaininfo.py +19 -0
  166. compass_api_sdk/models/tokenbalanceresponse.py +5 -15
  167. compass_api_sdk/models/tokenconfig.py +30 -0
  168. compass_api_sdk/models/tokenlistresponse.py +21 -0
  169. compass_api_sdk/models/tokenmarketdata.py +27 -0
  170. compass_api_sdk/models/tokenpermissions.py +20 -0
  171. compass_api_sdk/models/tokentransferparams.py +54 -0
  172. compass_api_sdk/models/tokentransferrequest.py +23 -27
  173. compass_api_sdk/models/transactionresponse.py +31 -0
  174. compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_asset.py → underlyingtoken.py} +2 -2
  175. compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -41
  176. compass_api_sdk/models/uniswapbuyexactlyrequest.py +31 -44
  177. compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +37 -0
  178. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +15 -6
  179. compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
  180. compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +23 -31
  181. compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
  182. compass_api_sdk/models/uniswappositionssolidityresponse.py +42 -2
  183. compass_api_sdk/models/uniswapsellexactlyparams.py +19 -41
  184. compass_api_sdk/models/uniswapsellexactlyrequest.py +31 -44
  185. compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +37 -0
  186. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +15 -6
  187. compass_api_sdk/models/unsignedmulticalltransaction.py +44 -13
  188. compass_api_sdk/models/unsignedtransaction.py +44 -13
  189. compass_api_sdk/models/unwrapwethrequest.py +15 -6
  190. compass_api_sdk/models/useroperation.py +61 -49
  191. compass_api_sdk/models/useroperationresponse.py +2 -2
  192. compass_api_sdk/models/userstate.py +3 -3
  193. compass_api_sdk/models/v1_aave_aave_supported_tokensop.py +69 -0
  194. compass_api_sdk/models/v1_aave_avg_rateop.py +83 -0
  195. compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +21 -25
  196. compass_api_sdk/models/v1_aave_liquidity_changeop.py +45 -0
  197. compass_api_sdk/models/{pendle_marketop.py → v1_aave_rateop.py} +16 -20
  198. compass_api_sdk/models/v1_aave_reserve_overviewop.py +76 -0
  199. compass_api_sdk/models/v1_aave_std_rateop.py +83 -0
  200. compass_api_sdk/models/v1_aave_token_priceop.py +76 -0
  201. compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +83 -0
  202. compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +16 -20
  203. compass_api_sdk/models/v1_aerodrome_slipstream_liquidity_provision_positionsop.py +76 -0
  204. compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +45 -0
  205. compass_api_sdk/models/v1_ethena_vaultop.py +75 -0
  206. compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +28 -41
  207. compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +8 -14
  208. compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +10 -14
  209. compass_api_sdk/models/v1_generic_supported_chainsop.py +57 -0
  210. compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +11 -10
  211. compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +10 -9
  212. compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +13 -12
  213. compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +10 -9
  214. compass_api_sdk/models/{vaults_vaultop.py → v1_morpho_vaultop.py} +16 -20
  215. compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +11 -10
  216. compass_api_sdk/models/{pendle_positionop.py → v1_pendle_marketop.py} +24 -27
  217. compass_api_sdk/models/v1_pendle_marketsop.py +24 -0
  218. compass_api_sdk/models/{pendle_positionsop.py → v1_pendle_positionsop.py} +10 -14
  219. compass_api_sdk/models/v1_sky_positionop.py +29 -0
  220. compass_api_sdk/models/v1_token_balanceop.py +38 -0
  221. compass_api_sdk/models/v1_token_listop.py +24 -0
  222. compass_api_sdk/models/v1_token_priceop.py +76 -0
  223. compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +27 -0
  224. compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +10 -14
  225. compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +10 -14
  226. compass_api_sdk/models/v1_uniswap_pool_priceop.py +58 -0
  227. compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +79 -0
  228. compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +79 -0
  229. compass_api_sdk/models/v1_vaults_vaultop.py +84 -0
  230. compass_api_sdk/models/v1_wildcat_marketop.py +82 -0
  231. compass_api_sdk/models/v2_cctp_mintop.py +47 -0
  232. compass_api_sdk/models/v2_earn_aave_marketsop.py +57 -0
  233. compass_api_sdk/models/v2_earn_positionsop.py +56 -0
  234. compass_api_sdk/models/v2_earn_vaultsop.py +105 -0
  235. compass_api_sdk/models/v2bundlerequest.py +33 -0
  236. compass_api_sdk/models/v2bundleresponse.py +67 -0
  237. compass_api_sdk/models/v2useroperation.py +37 -0
  238. compass_api_sdk/models/vault.py +14 -14
  239. compass_api_sdk/models/vaultdepositparams.py +85 -0
  240. compass_api_sdk/models/vaultdepositrequest.py +15 -6
  241. compass_api_sdk/models/vaultgetvaultresponse.py +21 -11
  242. compass_api_sdk/models/vaultinfo.py +129 -0
  243. compass_api_sdk/models/vaultsresponse.py +30 -0
  244. compass_api_sdk/models/vaultvenue.py +27 -0
  245. compass_api_sdk/models/vaultwithdrawparams.py +75 -0
  246. compass_api_sdk/models/vaultwithdrawrequest.py +15 -6
  247. compass_api_sdk/models/wildcatgetmarketresponse.py +151 -0
  248. compass_api_sdk/models/{redeemunderlying.py → withdraw.py} +2 -2
  249. compass_api_sdk/models/wrapethrequest.py +15 -6
  250. compass_api_sdk/morpho.py +481 -816
  251. compass_api_sdk/pendle.py +495 -1384
  252. compass_api_sdk/sdk.py +39 -13
  253. compass_api_sdk/sky.py +275 -240
  254. compass_api_sdk/smart_account.py +37 -50
  255. compass_api_sdk/swap.py +248 -0
  256. compass_api_sdk/token.py +1192 -0
  257. compass_api_sdk/transaction_bundler.py +151 -184
  258. compass_api_sdk/uniswap_v3.py +531 -620
  259. compass_api_sdk/universal.py +181 -932
  260. compass_api_sdk/utils/__init__.py +18 -5
  261. compass_api_sdk/utils/annotations.py +32 -8
  262. compass_api_sdk/utils/eventstreaming.py +10 -0
  263. compass_api_sdk/utils/forms.py +21 -10
  264. compass_api_sdk/utils/queryparams.py +14 -2
  265. compass_api_sdk/utils/retries.py +69 -5
  266. compass_api_sdk/utils/serializers.py +3 -2
  267. compass_api_sdk/utils/unmarshal_json_response.py +38 -0
  268. compass_api_sdk/wildcat.py +208 -0
  269. compass_api_sdk-2.0.21rc1.dist-info/METADATA +623 -0
  270. compass_api_sdk-2.0.21rc1.dist-info/RECORD +346 -0
  271. {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-2.0.21rc1.dist-info}/WHEEL +1 -1
  272. compass_api_sdk/models/aave_avg_rateop.py +0 -141
  273. compass_api_sdk/models/aave_liquidity_changeop.py +0 -103
  274. compass_api_sdk/models/aave_rateop.py +0 -134
  275. compass_api_sdk/models/aave_reserve_overviewop.py +0 -134
  276. compass_api_sdk/models/aave_std_rateop.py +0 -141
  277. compass_api_sdk/models/aave_token_priceop.py +0 -134
  278. compass_api_sdk/models/aave_user_position_per_tokenop.py +0 -141
  279. compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +0 -37
  280. compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +0 -159
  281. compass_api_sdk/models/aerodromeposition.py +0 -70
  282. compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_vaultstate.py +0 -53
  283. compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py +0 -32
  284. compass_api_sdk/models/generic_supported_tokensop.py +0 -28
  285. compass_api_sdk/models/generic_visualize_portfolioop.py +0 -37
  286. compass_api_sdk/models/image.py +0 -15
  287. compass_api_sdk/models/liquidity.py +0 -16
  288. compass_api_sdk/models/metadata.py +0 -50
  289. compass_api_sdk/models/morpho_vault_positionop.py +0 -37
  290. compass_api_sdk/models/morpho_vaultop.py +0 -30
  291. compass_api_sdk/models/morphocheckvaultpositionresponse.py +0 -20
  292. compass_api_sdk/models/morphogetvaultresponse.py +0 -86
  293. compass_api_sdk/models/pendle_marketsop.py +0 -28
  294. compass_api_sdk/models/pendleaddliquidityparams.py +0 -50
  295. compass_api_sdk/models/pendleaddliquidityrequest.py +0 -61
  296. compass_api_sdk/models/pendlebuyptparams.py +0 -48
  297. compass_api_sdk/models/pendlebuyptrequest.py +0 -59
  298. compass_api_sdk/models/pendlebuyytparams.py +0 -48
  299. compass_api_sdk/models/pendlebuyytrequest.py +0 -59
  300. compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
  301. compass_api_sdk/models/pendleremoveliquidityparams.py +0 -50
  302. compass_api_sdk/models/pendleremoveliquidityrequest.py +0 -61
  303. compass_api_sdk/models/pendlesellptparams.py +0 -48
  304. compass_api_sdk/models/pendlesellptrequest.py +0 -61
  305. compass_api_sdk/models/pendlesellytparams.py +0 -48
  306. compass_api_sdk/models/pendlesellytrequest.py +0 -61
  307. compass_api_sdk/models/sky_positionop.py +0 -31
  308. compass_api_sdk/models/token_addressop.py +0 -89
  309. compass_api_sdk/models/token_balanceop.py +0 -55
  310. compass_api_sdk/models/token_enum.py +0 -57
  311. compass_api_sdk/models/token_priceop.py +0 -89
  312. compass_api_sdk/models/tokenaddressresponse.py +0 -15
  313. compass_api_sdk/models/tokeninfo.py +0 -17
  314. compass_api_sdk/models/tokentransfererc20params.py +0 -63
  315. compass_api_sdk/models/txresponse.py +0 -27
  316. compass_api_sdk/models/uniswap_pool_priceop.py +0 -170
  317. compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +0 -191
  318. compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +0 -191
  319. compass_api_sdk/models/userposition.py +0 -16
  320. compass_api_sdk/models/vaultposition.py +0 -24
  321. compass_api_sdk-0.9.35.dist-info/METADATA +0 -558
  322. compass_api_sdk-0.9.35.dist-info/RECORD +0 -260
@@ -4,26 +4,33 @@ 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
 
10
- class TokenSDK(BaseSDK):
11
- def address(
11
+ class Ethena(BaseSDK):
12
+ def ethena_vault(
12
13
  self,
13
14
  *,
14
- chain: models.TokenAddressChain = models.TokenAddressChain.ARBITRUM_MAINNET,
15
- token: models.TokenAddressToken = models.TokenAddressToken.WETH,
15
+ chain: models.V1EthenaVaultChain,
16
+ block: OptionalNullable[int] = UNSET,
17
+ user_address: OptionalNullable[str] = UNSET,
16
18
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
17
19
  server_url: Optional[str] = None,
18
20
  timeout_ms: Optional[int] = None,
19
21
  http_headers: Optional[Mapping[str, str]] = None,
20
- ) -> models.TokenAddressResponse:
21
- r"""Token Address
22
+ ) -> models.EthenaGetVaultResponse:
23
+ r"""Get Vault & User Position
22
24
 
23
- This endpoint retrieves the address for a token supported by us.
25
+ Get data & user Position for the Ethena vault on Ethereum.
24
26
 
25
- :param chain: The chain to use.
26
- :param token: The token symbol to get the address for..
27
+ Vault address: 0x9d39a5de30e57443bff2a8307a4256c8797a3497
28
+
29
+ The user position is only included in the response if 'user_address' parameter is included in the request.
30
+
31
+ :param chain:
32
+ :param block: Optional block number (defaults to latest).
33
+ :param user_address: The user address of the desired vault position. Only include if you would like the user position included in the response. Defaults to `None`.
27
34
  :param retries: Override the default retry configuration for this method
28
35
  :param server_url: Override the default server URL for this method
29
36
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -39,14 +46,15 @@ class TokenSDK(BaseSDK):
39
46
  else:
40
47
  base_url = self._get_url(base_url, url_variables)
41
48
 
42
- request = models.TokenAddressRequest(
49
+ request = models.V1EthenaVaultRequest(
43
50
  chain=chain,
44
- token=token,
51
+ block=block,
52
+ user_address=user_address,
45
53
  )
46
54
 
47
55
  req = self._build_request(
48
56
  method="GET",
49
- path="/v0/token/address/get",
57
+ path="/v1/ethena/vault",
50
58
  base_url=base_url,
51
59
  url_variables=url_variables,
52
60
  request=request,
@@ -57,6 +65,7 @@ class TokenSDK(BaseSDK):
57
65
  accept_header_value="application/json",
58
66
  http_headers=http_headers,
59
67
  security=self.sdk_configuration.security,
68
+ allow_empty_value=None,
60
69
  timeout_ms=timeout_ms,
61
70
  )
62
71
 
@@ -72,8 +81,8 @@ class TokenSDK(BaseSDK):
72
81
  hook_ctx=HookContext(
73
82
  config=self.sdk_configuration,
74
83
  base_url=base_url or "",
75
- operation_id="token_address",
76
- oauth2_scopes=[],
84
+ operation_id="v1_ethena_vault",
85
+ oauth2_scopes=None,
77
86
  security_source=self.sdk_configuration.security,
78
87
  ),
79
88
  request=req,
@@ -83,48 +92,43 @@ class TokenSDK(BaseSDK):
83
92
 
84
93
  response_data: Any = None
85
94
  if utils.match_response(http_res, "200", "application/json"):
86
- return utils.unmarshal_json(http_res.text, models.TokenAddressResponse)
95
+ return unmarshal_json_response(models.EthenaGetVaultResponse, http_res)
87
96
  if utils.match_response(http_res, "422", "application/json"):
88
- response_data = utils.unmarshal_json(
89
- http_res.text, errors.HTTPValidationErrorData
97
+ response_data = unmarshal_json_response(
98
+ errors.HTTPValidationErrorData, http_res
90
99
  )
91
- raise errors.HTTPValidationError(data=response_data)
100
+ raise errors.HTTPValidationError(response_data, http_res)
92
101
  if utils.match_response(http_res, "4XX", "*"):
93
102
  http_res_text = utils.stream_to_text(http_res)
94
- raise errors.APIError(
95
- "API error occurred", http_res.status_code, http_res_text, http_res
96
- )
103
+ raise errors.APIError("API error occurred", http_res, http_res_text)
97
104
  if utils.match_response(http_res, "5XX", "*"):
98
105
  http_res_text = utils.stream_to_text(http_res)
99
- raise errors.APIError(
100
- "API error occurred", http_res.status_code, http_res_text, http_res
101
- )
106
+ raise errors.APIError("API error occurred", http_res, http_res_text)
102
107
 
103
- content_type = http_res.headers.get("Content-Type")
104
- http_res_text = utils.stream_to_text(http_res)
105
- raise errors.APIError(
106
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
107
- http_res.status_code,
108
- http_res_text,
109
- http_res,
110
- )
108
+ raise errors.APIError("Unexpected response received", http_res)
111
109
 
112
- async def address_async(
110
+ async def ethena_vault_async(
113
111
  self,
114
112
  *,
115
- chain: models.TokenAddressChain = models.TokenAddressChain.ARBITRUM_MAINNET,
116
- token: models.TokenAddressToken = models.TokenAddressToken.WETH,
113
+ chain: models.V1EthenaVaultChain,
114
+ block: OptionalNullable[int] = UNSET,
115
+ user_address: OptionalNullable[str] = UNSET,
117
116
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
118
117
  server_url: Optional[str] = None,
119
118
  timeout_ms: Optional[int] = None,
120
119
  http_headers: Optional[Mapping[str, str]] = None,
121
- ) -> models.TokenAddressResponse:
122
- r"""Token Address
120
+ ) -> models.EthenaGetVaultResponse:
121
+ r"""Get Vault & User Position
122
+
123
+ Get data & user Position for the Ethena vault on Ethereum.
124
+
125
+ Vault address: 0x9d39a5de30e57443bff2a8307a4256c8797a3497
123
126
 
124
- This endpoint retrieves the address for a token supported by us.
127
+ The user position is only included in the response if 'user_address' parameter is included in the request.
125
128
 
126
- :param chain: The chain to use.
127
- :param token: The token symbol to get the address for..
129
+ :param chain:
130
+ :param block: Optional block number (defaults to latest).
131
+ :param user_address: The user address of the desired vault position. Only include if you would like the user position included in the response. Defaults to `None`.
128
132
  :param retries: Override the default retry configuration for this method
129
133
  :param server_url: Override the default server URL for this method
130
134
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -140,14 +144,15 @@ class TokenSDK(BaseSDK):
140
144
  else:
141
145
  base_url = self._get_url(base_url, url_variables)
142
146
 
143
- request = models.TokenAddressRequest(
147
+ request = models.V1EthenaVaultRequest(
144
148
  chain=chain,
145
- token=token,
149
+ block=block,
150
+ user_address=user_address,
146
151
  )
147
152
 
148
153
  req = self._build_request_async(
149
154
  method="GET",
150
- path="/v0/token/address/get",
155
+ path="/v1/ethena/vault",
151
156
  base_url=base_url,
152
157
  url_variables=url_variables,
153
158
  request=request,
@@ -158,6 +163,7 @@ class TokenSDK(BaseSDK):
158
163
  accept_header_value="application/json",
159
164
  http_headers=http_headers,
160
165
  security=self.sdk_configuration.security,
166
+ allow_empty_value=None,
161
167
  timeout_ms=timeout_ms,
162
168
  )
163
169
 
@@ -173,8 +179,8 @@ class TokenSDK(BaseSDK):
173
179
  hook_ctx=HookContext(
174
180
  config=self.sdk_configuration,
175
181
  base_url=base_url or "",
176
- operation_id="token_address",
177
- oauth2_scopes=[],
182
+ operation_id="v1_ethena_vault",
183
+ oauth2_scopes=None,
178
184
  security_source=self.sdk_configuration.security,
179
185
  ),
180
186
  request=req,
@@ -184,52 +190,56 @@ class TokenSDK(BaseSDK):
184
190
 
185
191
  response_data: Any = None
186
192
  if utils.match_response(http_res, "200", "application/json"):
187
- return utils.unmarshal_json(http_res.text, models.TokenAddressResponse)
193
+ return unmarshal_json_response(models.EthenaGetVaultResponse, http_res)
188
194
  if utils.match_response(http_res, "422", "application/json"):
189
- response_data = utils.unmarshal_json(
190
- http_res.text, errors.HTTPValidationErrorData
195
+ response_data = unmarshal_json_response(
196
+ errors.HTTPValidationErrorData, http_res
191
197
  )
192
- raise errors.HTTPValidationError(data=response_data)
198
+ raise errors.HTTPValidationError(response_data, http_res)
193
199
  if utils.match_response(http_res, "4XX", "*"):
194
200
  http_res_text = await utils.stream_to_text_async(http_res)
195
- raise errors.APIError(
196
- "API error occurred", http_res.status_code, http_res_text, http_res
197
- )
201
+ raise errors.APIError("API error occurred", http_res, http_res_text)
198
202
  if utils.match_response(http_res, "5XX", "*"):
199
203
  http_res_text = await utils.stream_to_text_async(http_res)
200
- raise errors.APIError(
201
- "API error occurred", http_res.status_code, http_res_text, http_res
202
- )
204
+ raise errors.APIError("API error occurred", http_res, http_res_text)
203
205
 
204
- content_type = http_res.headers.get("Content-Type")
205
- http_res_text = await utils.stream_to_text_async(http_res)
206
- raise errors.APIError(
207
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
208
- http_res.status_code,
209
- http_res_text,
210
- http_res,
211
- )
206
+ raise errors.APIError("Unexpected response received", http_res)
212
207
 
213
- def price(
208
+ def ethena_deposit(
214
209
  self,
215
210
  *,
216
- chain: models.TokenPriceChain = models.TokenPriceChain.ETHEREUM_MAINNET,
217
- token: models.TokenPriceToken = models.TokenPriceToken.AAVE,
211
+ amount: Union[
212
+ models.EthenaDepositRequestAmount,
213
+ models.EthenaDepositRequestAmountTypedDict,
214
+ ],
215
+ chain: models.EthenaDepositRequestChain,
216
+ sender: str,
217
+ receiver: OptionalNullable[str] = UNSET,
218
+ estimate_gas: Optional[bool] = None,
218
219
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
219
220
  server_url: Optional[str] = None,
220
221
  timeout_ms: Optional[int] = None,
221
222
  http_headers: Optional[Mapping[str, str]] = None,
222
- ) -> models.TokenPriceResponse:
223
- r"""Token Price
223
+ ) -> models.TransactionResponse:
224
+ r"""Deposit USDe
224
225
 
225
- Retrieves the price of a token in USD using Chainlink's on-chain price feeds.
226
+ Deposit USDe into a Ethena's Vault to earn passive yield.
226
227
 
227
- Chainlink is a decentralized oracle that aggregates price data from off-chain
228
- sources. This ensures the price is tamper-resistant but the price might be stale
229
- with the update frequency of the oracle.
228
+ The shares of a deposit are respresented as sUSDe.
229
+ <Info>
230
+ **Required Allowances**
230
231
 
231
- :param chain: The chain to use.
232
- :param token: The symbol of the token for which to get the price.
232
+ In order to make this transaction, token allowances need to be set for the following contracts.
233
+
234
+ - `EthenaVault`
235
+ </Info>
236
+
237
+
238
+ :param amount: The amount of USDe to deposit into Ethena's vault.
239
+ :param chain:
240
+ :param sender: The address of the transaction sender.
241
+ :param receiver: The address which will receive the shares (sUSDe) from Ethena's vault representing their proportional ownership of the vault's assets. Defaults to the sender.
242
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
233
243
  :param retries: Override the default retry configuration for this method
234
244
  :param server_url: Override the default server URL for this method
235
245
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -245,24 +255,31 @@ class TokenSDK(BaseSDK):
245
255
  else:
246
256
  base_url = self._get_url(base_url, url_variables)
247
257
 
248
- request = models.TokenPriceRequest(
258
+ request = models.EthenaDepositRequest(
259
+ amount=amount,
260
+ receiver=receiver,
249
261
  chain=chain,
250
- token=token,
262
+ sender=sender,
263
+ estimate_gas=estimate_gas,
251
264
  )
252
265
 
253
266
  req = self._build_request(
254
- method="GET",
255
- path="/v0/token/price/get",
267
+ method="POST",
268
+ path="/v1/ethena/deposit",
256
269
  base_url=base_url,
257
270
  url_variables=url_variables,
258
271
  request=request,
259
- request_body_required=False,
272
+ request_body_required=True,
260
273
  request_has_path_params=False,
261
274
  request_has_query_params=True,
262
275
  user_agent_header="user-agent",
263
276
  accept_header_value="application/json",
264
277
  http_headers=http_headers,
265
278
  security=self.sdk_configuration.security,
279
+ get_serialized_body=lambda: utils.serialize_request_body(
280
+ request, False, False, "json", models.EthenaDepositRequest
281
+ ),
282
+ allow_empty_value=None,
266
283
  timeout_ms=timeout_ms,
267
284
  )
268
285
 
@@ -278,8 +295,8 @@ class TokenSDK(BaseSDK):
278
295
  hook_ctx=HookContext(
279
296
  config=self.sdk_configuration,
280
297
  base_url=base_url or "",
281
- operation_id="token_price",
282
- oauth2_scopes=[],
298
+ operation_id="v1_ethena_deposit",
299
+ oauth2_scopes=None,
283
300
  security_source=self.sdk_configuration.security,
284
301
  ),
285
302
  request=req,
@@ -289,52 +306,56 @@ class TokenSDK(BaseSDK):
289
306
 
290
307
  response_data: Any = None
291
308
  if utils.match_response(http_res, "200", "application/json"):
292
- return utils.unmarshal_json(http_res.text, models.TokenPriceResponse)
309
+ return unmarshal_json_response(models.TransactionResponse, http_res)
293
310
  if utils.match_response(http_res, "422", "application/json"):
294
- response_data = utils.unmarshal_json(
295
- http_res.text, errors.HTTPValidationErrorData
311
+ response_data = unmarshal_json_response(
312
+ errors.HTTPValidationErrorData, http_res
296
313
  )
297
- raise errors.HTTPValidationError(data=response_data)
314
+ raise errors.HTTPValidationError(response_data, http_res)
298
315
  if utils.match_response(http_res, "4XX", "*"):
299
316
  http_res_text = utils.stream_to_text(http_res)
300
- raise errors.APIError(
301
- "API error occurred", http_res.status_code, http_res_text, http_res
302
- )
317
+ raise errors.APIError("API error occurred", http_res, http_res_text)
303
318
  if utils.match_response(http_res, "5XX", "*"):
304
319
  http_res_text = utils.stream_to_text(http_res)
305
- raise errors.APIError(
306
- "API error occurred", http_res.status_code, http_res_text, http_res
307
- )
320
+ raise errors.APIError("API error occurred", http_res, http_res_text)
308
321
 
309
- content_type = http_res.headers.get("Content-Type")
310
- http_res_text = utils.stream_to_text(http_res)
311
- raise errors.APIError(
312
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
313
- http_res.status_code,
314
- http_res_text,
315
- http_res,
316
- )
322
+ raise errors.APIError("Unexpected response received", http_res)
317
323
 
318
- async def price_async(
324
+ async def ethena_deposit_async(
319
325
  self,
320
326
  *,
321
- chain: models.TokenPriceChain = models.TokenPriceChain.ETHEREUM_MAINNET,
322
- token: models.TokenPriceToken = models.TokenPriceToken.AAVE,
327
+ amount: Union[
328
+ models.EthenaDepositRequestAmount,
329
+ models.EthenaDepositRequestAmountTypedDict,
330
+ ],
331
+ chain: models.EthenaDepositRequestChain,
332
+ sender: str,
333
+ receiver: OptionalNullable[str] = UNSET,
334
+ estimate_gas: Optional[bool] = None,
323
335
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
324
336
  server_url: Optional[str] = None,
325
337
  timeout_ms: Optional[int] = None,
326
338
  http_headers: Optional[Mapping[str, str]] = None,
327
- ) -> models.TokenPriceResponse:
328
- r"""Token Price
339
+ ) -> models.TransactionResponse:
340
+ r"""Deposit USDe
341
+
342
+ Deposit USDe into a Ethena's Vault to earn passive yield.
343
+
344
+ The shares of a deposit are respresented as sUSDe.
345
+ <Info>
346
+ **Required Allowances**
329
347
 
330
- Retrieves the price of a token in USD using Chainlink's on-chain price feeds.
348
+ In order to make this transaction, token allowances need to be set for the following contracts.
331
349
 
332
- Chainlink is a decentralized oracle that aggregates price data from off-chain
333
- sources. This ensures the price is tamper-resistant but the price might be stale
334
- with the update frequency of the oracle.
350
+ - `EthenaVault`
351
+ </Info>
335
352
 
336
- :param chain: The chain to use.
337
- :param token: The symbol of the token for which to get the price.
353
+
354
+ :param amount: The amount of USDe to deposit into Ethena's vault.
355
+ :param chain:
356
+ :param sender: The address of the transaction sender.
357
+ :param receiver: The address which will receive the shares (sUSDe) from Ethena's vault representing their proportional ownership of the vault's assets. Defaults to the sender.
358
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
338
359
  :param retries: Override the default retry configuration for this method
339
360
  :param server_url: Override the default server URL for this method
340
361
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -350,24 +371,31 @@ class TokenSDK(BaseSDK):
350
371
  else:
351
372
  base_url = self._get_url(base_url, url_variables)
352
373
 
353
- request = models.TokenPriceRequest(
374
+ request = models.EthenaDepositRequest(
375
+ amount=amount,
376
+ receiver=receiver,
354
377
  chain=chain,
355
- token=token,
378
+ sender=sender,
379
+ estimate_gas=estimate_gas,
356
380
  )
357
381
 
358
382
  req = self._build_request_async(
359
- method="GET",
360
- path="/v0/token/price/get",
383
+ method="POST",
384
+ path="/v1/ethena/deposit",
361
385
  base_url=base_url,
362
386
  url_variables=url_variables,
363
387
  request=request,
364
- request_body_required=False,
388
+ request_body_required=True,
365
389
  request_has_path_params=False,
366
390
  request_has_query_params=True,
367
391
  user_agent_header="user-agent",
368
392
  accept_header_value="application/json",
369
393
  http_headers=http_headers,
370
394
  security=self.sdk_configuration.security,
395
+ get_serialized_body=lambda: utils.serialize_request_body(
396
+ request, False, False, "json", models.EthenaDepositRequest
397
+ ),
398
+ allow_empty_value=None,
371
399
  timeout_ms=timeout_ms,
372
400
  )
373
401
 
@@ -383,8 +411,8 @@ class TokenSDK(BaseSDK):
383
411
  hook_ctx=HookContext(
384
412
  config=self.sdk_configuration,
385
413
  base_url=base_url or "",
386
- operation_id="token_price",
387
- oauth2_scopes=[],
414
+ operation_id="v1_ethena_deposit",
415
+ oauth2_scopes=None,
388
416
  security_source=self.sdk_configuration.security,
389
417
  ),
390
418
  request=req,
@@ -394,50 +422,52 @@ class TokenSDK(BaseSDK):
394
422
 
395
423
  response_data: Any = None
396
424
  if utils.match_response(http_res, "200", "application/json"):
397
- return utils.unmarshal_json(http_res.text, models.TokenPriceResponse)
425
+ return unmarshal_json_response(models.TransactionResponse, http_res)
398
426
  if utils.match_response(http_res, "422", "application/json"):
399
- response_data = utils.unmarshal_json(
400
- http_res.text, errors.HTTPValidationErrorData
427
+ response_data = unmarshal_json_response(
428
+ errors.HTTPValidationErrorData, http_res
401
429
  )
402
- raise errors.HTTPValidationError(data=response_data)
430
+ raise errors.HTTPValidationError(response_data, http_res)
403
431
  if utils.match_response(http_res, "4XX", "*"):
404
432
  http_res_text = await utils.stream_to_text_async(http_res)
405
- raise errors.APIError(
406
- "API error occurred", http_res.status_code, http_res_text, http_res
407
- )
433
+ raise errors.APIError("API error occurred", http_res, http_res_text)
408
434
  if utils.match_response(http_res, "5XX", "*"):
409
435
  http_res_text = await utils.stream_to_text_async(http_res)
410
- raise errors.APIError(
411
- "API error occurred", http_res.status_code, http_res_text, http_res
412
- )
436
+ raise errors.APIError("API error occurred", http_res, http_res_text)
413
437
 
414
- content_type = http_res.headers.get("Content-Type")
415
- http_res_text = await utils.stream_to_text_async(http_res)
416
- raise errors.APIError(
417
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
418
- http_res.status_code,
419
- http_res_text,
420
- http_res,
421
- )
438
+ raise errors.APIError("Unexpected response received", http_res)
422
439
 
423
- def balance(
440
+ def ethena_request(
424
441
  self,
425
442
  *,
426
- chain: models.TokenBalanceChain = models.TokenBalanceChain.ARBITRUM_MAINNET,
427
- user: str = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
428
- token: Union[models.TokenBalanceToken, models.TokenBalanceTokenTypedDict],
443
+ amount: Any,
444
+ chain: models.EthenaRequestToWithdrawRequestChain,
445
+ sender: str,
446
+ estimate_gas: Optional[bool] = None,
429
447
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
430
448
  server_url: Optional[str] = None,
431
449
  timeout_ms: Optional[int] = None,
432
450
  http_headers: Optional[Mapping[str, str]] = None,
433
- ) -> models.TokenBalanceResponse:
434
- r"""Token Balance
451
+ ) -> models.EthenaRequestToWithdrawTransactionResponse:
452
+ r"""Request to Withdraw USDe
453
+
454
+ Request to withdraw deposited USDe from Ethena's vault.
455
+
456
+ The Ethena vault requires a cooldown period. Once a request to withdraw a specified
457
+ amount of USDe has been submitted, the alloted cooldown period must pass before the
458
+ withdraw USDe transaction can be submitted.
435
459
 
436
- Returns the balance of a specific ERC20 token for a given user address.
460
+ If an additional amount of USDe is requested to be withdrawn anytime before
461
+ withdrawing the originally requested amount, the cooldown period restarts.
437
462
 
438
- :param chain: The chain to use.
439
- :param user: The user to get the ERC20 balance of.
440
- :param token: The symbol of the token for which the balance is checked..
463
+ Yield is not earned on USDe while in its cooldown period.
464
+
465
+ An allowance does not have to be set to initiate the cooldown period.
466
+
467
+ :param amount: 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.
468
+ :param chain:
469
+ :param sender: The address of the transaction sender.
470
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
441
471
  :param retries: Override the default retry configuration for this method
442
472
  :param server_url: Override the default server URL for this method
443
473
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -453,25 +483,30 @@ class TokenSDK(BaseSDK):
453
483
  else:
454
484
  base_url = self._get_url(base_url, url_variables)
455
485
 
456
- request = models.TokenBalanceRequest(
486
+ request = models.EthenaRequestToWithdrawRequest(
487
+ amount=amount,
457
488
  chain=chain,
458
- user=user,
459
- token=token,
489
+ sender=sender,
490
+ estimate_gas=estimate_gas,
460
491
  )
461
492
 
462
493
  req = self._build_request(
463
- method="GET",
464
- path="/v0/token/balance/get",
494
+ method="POST",
495
+ path="/v1/ethena/request",
465
496
  base_url=base_url,
466
497
  url_variables=url_variables,
467
498
  request=request,
468
- request_body_required=False,
499
+ request_body_required=True,
469
500
  request_has_path_params=False,
470
501
  request_has_query_params=True,
471
502
  user_agent_header="user-agent",
472
503
  accept_header_value="application/json",
473
504
  http_headers=http_headers,
474
505
  security=self.sdk_configuration.security,
506
+ get_serialized_body=lambda: utils.serialize_request_body(
507
+ request, False, False, "json", models.EthenaRequestToWithdrawRequest
508
+ ),
509
+ allow_empty_value=None,
475
510
  timeout_ms=timeout_ms,
476
511
  )
477
512
 
@@ -487,8 +522,8 @@ class TokenSDK(BaseSDK):
487
522
  hook_ctx=HookContext(
488
523
  config=self.sdk_configuration,
489
524
  base_url=base_url or "",
490
- operation_id="token_balance",
491
- oauth2_scopes=[],
525
+ operation_id="v1_ethena_request",
526
+ oauth2_scopes=None,
492
527
  security_source=self.sdk_configuration.security,
493
528
  ),
494
529
  request=req,
@@ -498,50 +533,54 @@ class TokenSDK(BaseSDK):
498
533
 
499
534
  response_data: Any = None
500
535
  if utils.match_response(http_res, "200", "application/json"):
501
- return utils.unmarshal_json(http_res.text, models.TokenBalanceResponse)
536
+ return unmarshal_json_response(
537
+ models.EthenaRequestToWithdrawTransactionResponse, http_res
538
+ )
502
539
  if utils.match_response(http_res, "422", "application/json"):
503
- response_data = utils.unmarshal_json(
504
- http_res.text, errors.HTTPValidationErrorData
540
+ response_data = unmarshal_json_response(
541
+ errors.HTTPValidationErrorData, http_res
505
542
  )
506
- raise errors.HTTPValidationError(data=response_data)
543
+ raise errors.HTTPValidationError(response_data, http_res)
507
544
  if utils.match_response(http_res, "4XX", "*"):
508
545
  http_res_text = utils.stream_to_text(http_res)
509
- raise errors.APIError(
510
- "API error occurred", http_res.status_code, http_res_text, http_res
511
- )
546
+ raise errors.APIError("API error occurred", http_res, http_res_text)
512
547
  if utils.match_response(http_res, "5XX", "*"):
513
548
  http_res_text = utils.stream_to_text(http_res)
514
- raise errors.APIError(
515
- "API error occurred", http_res.status_code, http_res_text, http_res
516
- )
549
+ raise errors.APIError("API error occurred", http_res, http_res_text)
517
550
 
518
- content_type = http_res.headers.get("Content-Type")
519
- http_res_text = utils.stream_to_text(http_res)
520
- raise errors.APIError(
521
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
522
- http_res.status_code,
523
- http_res_text,
524
- http_res,
525
- )
551
+ raise errors.APIError("Unexpected response received", http_res)
526
552
 
527
- async def balance_async(
553
+ async def ethena_request_async(
528
554
  self,
529
555
  *,
530
- chain: models.TokenBalanceChain = models.TokenBalanceChain.ARBITRUM_MAINNET,
531
- user: str = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
532
- token: Union[models.TokenBalanceToken, models.TokenBalanceTokenTypedDict],
556
+ amount: Any,
557
+ chain: models.EthenaRequestToWithdrawRequestChain,
558
+ sender: str,
559
+ estimate_gas: Optional[bool] = None,
533
560
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
534
561
  server_url: Optional[str] = None,
535
562
  timeout_ms: Optional[int] = None,
536
563
  http_headers: Optional[Mapping[str, str]] = None,
537
- ) -> models.TokenBalanceResponse:
538
- r"""Token Balance
564
+ ) -> models.EthenaRequestToWithdrawTransactionResponse:
565
+ r"""Request to Withdraw USDe
539
566
 
540
- Returns the balance of a specific ERC20 token for a given user address.
567
+ Request to withdraw deposited USDe from Ethena's vault.
541
568
 
542
- :param chain: The chain to use.
543
- :param user: The user to get the ERC20 balance of.
544
- :param token: The symbol of the token for which the balance is checked..
569
+ The Ethena vault requires a cooldown period. Once a request to withdraw a specified
570
+ amount of USDe has been submitted, the alloted cooldown period must pass before the
571
+ withdraw USDe transaction can be submitted.
572
+
573
+ If an additional amount of USDe is requested to be withdrawn anytime before
574
+ withdrawing the originally requested amount, the cooldown period restarts.
575
+
576
+ Yield is not earned on USDe while in its cooldown period.
577
+
578
+ An allowance does not have to be set to initiate the cooldown period.
579
+
580
+ :param amount: 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.
581
+ :param chain:
582
+ :param sender: The address of the transaction sender.
583
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
545
584
  :param retries: Override the default retry configuration for this method
546
585
  :param server_url: Override the default server URL for this method
547
586
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -557,25 +596,30 @@ class TokenSDK(BaseSDK):
557
596
  else:
558
597
  base_url = self._get_url(base_url, url_variables)
559
598
 
560
- request = models.TokenBalanceRequest(
599
+ request = models.EthenaRequestToWithdrawRequest(
600
+ amount=amount,
561
601
  chain=chain,
562
- user=user,
563
- token=token,
602
+ sender=sender,
603
+ estimate_gas=estimate_gas,
564
604
  )
565
605
 
566
606
  req = self._build_request_async(
567
- method="GET",
568
- path="/v0/token/balance/get",
607
+ method="POST",
608
+ path="/v1/ethena/request",
569
609
  base_url=base_url,
570
610
  url_variables=url_variables,
571
611
  request=request,
572
- request_body_required=False,
612
+ request_body_required=True,
573
613
  request_has_path_params=False,
574
614
  request_has_query_params=True,
575
615
  user_agent_header="user-agent",
576
616
  accept_header_value="application/json",
577
617
  http_headers=http_headers,
578
618
  security=self.sdk_configuration.security,
619
+ get_serialized_body=lambda: utils.serialize_request_body(
620
+ request, False, False, "json", models.EthenaRequestToWithdrawRequest
621
+ ),
622
+ allow_empty_value=None,
579
623
  timeout_ms=timeout_ms,
580
624
  )
581
625
 
@@ -591,8 +635,8 @@ class TokenSDK(BaseSDK):
591
635
  hook_ctx=HookContext(
592
636
  config=self.sdk_configuration,
593
637
  base_url=base_url or "",
594
- operation_id="token_balance",
595
- oauth2_scopes=[],
638
+ operation_id="v1_ethena_request",
639
+ oauth2_scopes=None,
596
640
  security_source=self.sdk_configuration.security,
597
641
  ),
598
642
  request=req,
@@ -602,59 +646,56 @@ class TokenSDK(BaseSDK):
602
646
 
603
647
  response_data: Any = None
604
648
  if utils.match_response(http_res, "200", "application/json"):
605
- return utils.unmarshal_json(http_res.text, models.TokenBalanceResponse)
649
+ return unmarshal_json_response(
650
+ models.EthenaRequestToWithdrawTransactionResponse, http_res
651
+ )
606
652
  if utils.match_response(http_res, "422", "application/json"):
607
- response_data = utils.unmarshal_json(
608
- http_res.text, errors.HTTPValidationErrorData
653
+ response_data = unmarshal_json_response(
654
+ errors.HTTPValidationErrorData, http_res
609
655
  )
610
- raise errors.HTTPValidationError(data=response_data)
656
+ raise errors.HTTPValidationError(response_data, http_res)
611
657
  if utils.match_response(http_res, "4XX", "*"):
612
658
  http_res_text = await utils.stream_to_text_async(http_res)
613
- raise errors.APIError(
614
- "API error occurred", http_res.status_code, http_res_text, http_res
615
- )
659
+ raise errors.APIError("API error occurred", http_res, http_res_text)
616
660
  if utils.match_response(http_res, "5XX", "*"):
617
661
  http_res_text = await utils.stream_to_text_async(http_res)
618
- raise errors.APIError(
619
- "API error occurred", http_res.status_code, http_res_text, http_res
620
- )
662
+ raise errors.APIError("API error occurred", http_res, http_res_text)
621
663
 
622
- content_type = http_res.headers.get("Content-Type")
623
- http_res_text = await utils.stream_to_text_async(http_res)
624
- raise errors.APIError(
625
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
626
- http_res.status_code,
627
- http_res_text,
628
- http_res,
629
- )
664
+ raise errors.APIError("Unexpected response received", http_res)
630
665
 
631
- def transfer(
666
+ def ethena_unstake(
632
667
  self,
633
668
  *,
634
- amount: Union[
635
- models.TokenTransferRequestAmount,
636
- models.TokenTransferRequestAmountTypedDict,
637
- ],
638
- token: Union[
639
- models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
640
- ],
641
- to: str,
642
- chain: models.Chain,
669
+ chain: models.EthenaUnstakeRequestChain,
643
670
  sender: str,
671
+ receiver: OptionalNullable[str] = UNSET,
672
+ estimate_gas: Optional[bool] = None,
644
673
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
645
674
  server_url: Optional[str] = None,
646
675
  timeout_ms: Optional[int] = None,
647
676
  http_headers: Optional[Mapping[str, str]] = None,
648
- ) -> models.TxResponse:
649
- r"""Transfer ETH or ERC20 Tokens
677
+ ) -> models.TransactionResponse:
678
+ r"""Unstake USDe
650
679
 
651
- Sends native ETH or ERC20 tokens from the sender's address to another address.
680
+ Unstake deposited USDe from Ethena's vault.
652
681
 
653
- :param amount: Amount of token to transfer
654
- :param token: The symbol of the token to transfer..
655
- :param to: The recipient of the tokens.
656
- :param chain: The chain to use.
682
+ Verify that the USDe being unstaked has completed its mandatory cooldown period
683
+ using the Ethena 'Get Vault & User Position' endpoint.
684
+
685
+ This is an all or nothing action. All of the USDe that has completed its cooldown
686
+ period must be withdrawn.
687
+
688
+ The passive yield earned on USDe deposits is represented by the increased value of
689
+ the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
690
+ for the intial USDe deposited and any accrued yield since depositing.
691
+
692
+ An allowance does not have to be set to unstake USDe that has completed its cooldown
693
+ period.
694
+
695
+ :param chain:
657
696
  :param sender: The address of the transaction sender.
697
+ :param receiver: The address which will receive the unstaked USDe. Defaults to the sender.
698
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
658
699
  :param retries: Override the default retry configuration for this method
659
700
  :param server_url: Override the default server URL for this method
660
701
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -670,17 +711,16 @@ class TokenSDK(BaseSDK):
670
711
  else:
671
712
  base_url = self._get_url(base_url, url_variables)
672
713
 
673
- request = models.TokenTransferRequest(
674
- amount=amount,
675
- token=token,
676
- to=to,
714
+ request = models.EthenaUnstakeRequest(
715
+ receiver=receiver,
677
716
  chain=chain,
678
717
  sender=sender,
718
+ estimate_gas=estimate_gas,
679
719
  )
680
720
 
681
721
  req = self._build_request(
682
722
  method="POST",
683
- path="/v0/token/transfer",
723
+ path="/v1/ethena/unstake",
684
724
  base_url=base_url,
685
725
  url_variables=url_variables,
686
726
  request=request,
@@ -692,8 +732,9 @@ class TokenSDK(BaseSDK):
692
732
  http_headers=http_headers,
693
733
  security=self.sdk_configuration.security,
694
734
  get_serialized_body=lambda: utils.serialize_request_body(
695
- request, False, False, "json", models.TokenTransferRequest
735
+ request, False, False, "json", models.EthenaUnstakeRequest
696
736
  ),
737
+ allow_empty_value=None,
697
738
  timeout_ms=timeout_ms,
698
739
  )
699
740
 
@@ -709,8 +750,8 @@ class TokenSDK(BaseSDK):
709
750
  hook_ctx=HookContext(
710
751
  config=self.sdk_configuration,
711
752
  base_url=base_url or "",
712
- operation_id="token_transfer",
713
- oauth2_scopes=[],
753
+ operation_id="v1_ethena_unstake",
754
+ oauth2_scopes=None,
714
755
  security_source=self.sdk_configuration.security,
715
756
  ),
716
757
  request=req,
@@ -720,59 +761,54 @@ class TokenSDK(BaseSDK):
720
761
 
721
762
  response_data: Any = None
722
763
  if utils.match_response(http_res, "200", "application/json"):
723
- return utils.unmarshal_json(http_res.text, models.TxResponse)
764
+ return unmarshal_json_response(models.TransactionResponse, http_res)
724
765
  if utils.match_response(http_res, "422", "application/json"):
725
- response_data = utils.unmarshal_json(
726
- http_res.text, errors.HTTPValidationErrorData
766
+ response_data = unmarshal_json_response(
767
+ errors.HTTPValidationErrorData, http_res
727
768
  )
728
- raise errors.HTTPValidationError(data=response_data)
769
+ raise errors.HTTPValidationError(response_data, http_res)
729
770
  if utils.match_response(http_res, "4XX", "*"):
730
771
  http_res_text = utils.stream_to_text(http_res)
731
- raise errors.APIError(
732
- "API error occurred", http_res.status_code, http_res_text, http_res
733
- )
772
+ raise errors.APIError("API error occurred", http_res, http_res_text)
734
773
  if utils.match_response(http_res, "5XX", "*"):
735
774
  http_res_text = utils.stream_to_text(http_res)
736
- raise errors.APIError(
737
- "API error occurred", http_res.status_code, http_res_text, http_res
738
- )
775
+ raise errors.APIError("API error occurred", http_res, http_res_text)
739
776
 
740
- content_type = http_res.headers.get("Content-Type")
741
- http_res_text = utils.stream_to_text(http_res)
742
- raise errors.APIError(
743
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
744
- http_res.status_code,
745
- http_res_text,
746
- http_res,
747
- )
777
+ raise errors.APIError("Unexpected response received", http_res)
748
778
 
749
- async def transfer_async(
779
+ async def ethena_unstake_async(
750
780
  self,
751
781
  *,
752
- amount: Union[
753
- models.TokenTransferRequestAmount,
754
- models.TokenTransferRequestAmountTypedDict,
755
- ],
756
- token: Union[
757
- models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
758
- ],
759
- to: str,
760
- chain: models.Chain,
782
+ chain: models.EthenaUnstakeRequestChain,
761
783
  sender: str,
784
+ receiver: OptionalNullable[str] = UNSET,
785
+ estimate_gas: Optional[bool] = None,
762
786
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
763
787
  server_url: Optional[str] = None,
764
788
  timeout_ms: Optional[int] = None,
765
789
  http_headers: Optional[Mapping[str, str]] = None,
766
- ) -> models.TxResponse:
767
- r"""Transfer ETH or ERC20 Tokens
790
+ ) -> models.TransactionResponse:
791
+ r"""Unstake USDe
792
+
793
+ Unstake deposited USDe from Ethena's vault.
794
+
795
+ Verify that the USDe being unstaked has completed its mandatory cooldown period
796
+ using the Ethena 'Get Vault & User Position' endpoint.
768
797
 
769
- Sends native ETH or ERC20 tokens from the sender's address to another address.
798
+ This is an all or nothing action. All of the USDe that has completed its cooldown
799
+ period must be withdrawn.
770
800
 
771
- :param amount: Amount of token to transfer
772
- :param token: The symbol of the token to transfer..
773
- :param to: The recipient of the tokens.
774
- :param chain: The chain to use.
801
+ The passive yield earned on USDe deposits is represented by the increased value of
802
+ the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
803
+ for the intial USDe deposited and any accrued yield since depositing.
804
+
805
+ An allowance does not have to be set to unstake USDe that has completed its cooldown
806
+ period.
807
+
808
+ :param chain:
775
809
  :param sender: The address of the transaction sender.
810
+ :param receiver: The address which will receive the unstaked USDe. Defaults to the sender.
811
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
776
812
  :param retries: Override the default retry configuration for this method
777
813
  :param server_url: Override the default server URL for this method
778
814
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -788,17 +824,16 @@ class TokenSDK(BaseSDK):
788
824
  else:
789
825
  base_url = self._get_url(base_url, url_variables)
790
826
 
791
- request = models.TokenTransferRequest(
792
- amount=amount,
793
- token=token,
794
- to=to,
827
+ request = models.EthenaUnstakeRequest(
828
+ receiver=receiver,
795
829
  chain=chain,
796
830
  sender=sender,
831
+ estimate_gas=estimate_gas,
797
832
  )
798
833
 
799
834
  req = self._build_request_async(
800
835
  method="POST",
801
- path="/v0/token/transfer",
836
+ path="/v1/ethena/unstake",
802
837
  base_url=base_url,
803
838
  url_variables=url_variables,
804
839
  request=request,
@@ -810,8 +845,9 @@ class TokenSDK(BaseSDK):
810
845
  http_headers=http_headers,
811
846
  security=self.sdk_configuration.security,
812
847
  get_serialized_body=lambda: utils.serialize_request_body(
813
- request, False, False, "json", models.TokenTransferRequest
848
+ request, False, False, "json", models.EthenaUnstakeRequest
814
849
  ),
850
+ allow_empty_value=None,
815
851
  timeout_ms=timeout_ms,
816
852
  )
817
853
 
@@ -827,8 +863,8 @@ class TokenSDK(BaseSDK):
827
863
  hook_ctx=HookContext(
828
864
  config=self.sdk_configuration,
829
865
  base_url=base_url or "",
830
- operation_id="token_transfer",
831
- oauth2_scopes=[],
866
+ operation_id="v1_ethena_unstake",
867
+ oauth2_scopes=None,
832
868
  security_source=self.sdk_configuration.security,
833
869
  ),
834
870
  request=req,
@@ -838,28 +874,17 @@ class TokenSDK(BaseSDK):
838
874
 
839
875
  response_data: Any = None
840
876
  if utils.match_response(http_res, "200", "application/json"):
841
- return utils.unmarshal_json(http_res.text, models.TxResponse)
877
+ return unmarshal_json_response(models.TransactionResponse, http_res)
842
878
  if utils.match_response(http_res, "422", "application/json"):
843
- response_data = utils.unmarshal_json(
844
- http_res.text, errors.HTTPValidationErrorData
879
+ response_data = unmarshal_json_response(
880
+ errors.HTTPValidationErrorData, http_res
845
881
  )
846
- raise errors.HTTPValidationError(data=response_data)
882
+ raise errors.HTTPValidationError(response_data, http_res)
847
883
  if utils.match_response(http_res, "4XX", "*"):
848
884
  http_res_text = await utils.stream_to_text_async(http_res)
849
- raise errors.APIError(
850
- "API error occurred", http_res.status_code, http_res_text, http_res
851
- )
885
+ raise errors.APIError("API error occurred", http_res, http_res_text)
852
886
  if utils.match_response(http_res, "5XX", "*"):
853
887
  http_res_text = await utils.stream_to_text_async(http_res)
854
- raise errors.APIError(
855
- "API error occurred", http_res.status_code, http_res_text, http_res
856
- )
888
+ raise errors.APIError("API error occurred", http_res, http_res_text)
857
889
 
858
- content_type = http_res.headers.get("Content-Type")
859
- http_res_text = await utils.stream_to_text_async(http_res)
860
- raise errors.APIError(
861
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
862
- http_res.status_code,
863
- http_res_text,
864
- http_res,
865
- )
890
+ raise errors.APIError("Unexpected response received", http_res)