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
@@ -1,558 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: compass_api_sdk
3
- Version: 0.9.35
4
- Summary: Compass API SDK.
5
- Author: royalnine
6
- Requires-Python: >=3.9.2
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: Programming Language :: Python :: 3.10
9
- Classifier: Programming Language :: Python :: 3.11
10
- Classifier: Programming Language :: Python :: 3.12
11
- Classifier: Programming Language :: Python :: 3.13
12
- Requires-Dist: httpcore (>=1.0.9)
13
- Requires-Dist: httpx (>=0.28.1)
14
- Requires-Dist: pydantic (>=2.11.2)
15
- Project-URL: Repository, https://github.com/CompassLabs/mono.git
16
- Description-Content-Type: text/markdown
17
-
18
- # compass_api_sdk
19
-
20
- Developer-friendly & type-safe Python SDK specifically catered to leverage *compass_api_sdk* API.
21
-
22
- <!-- Start Summary [summary] -->
23
- ## Summary
24
-
25
- Compass API: Compass Labs DeFi API
26
- <!-- End Summary [summary] -->
27
-
28
- <!-- Start Table of Contents [toc] -->
29
- ## Table of Contents
30
- <!-- $toc-max-depth=2 -->
31
- * [compass_api_sdk](https://github.com/CompassLabs/mono/blob/master/#compassapisdk)
32
- * [SDK Installation](https://github.com/CompassLabs/mono/blob/master/#sdk-installation)
33
- * [IDE Support](https://github.com/CompassLabs/mono/blob/master/#ide-support)
34
- * [SDK Example Usage](https://github.com/CompassLabs/mono/blob/master/#sdk-example-usage)
35
- * [Authentication](https://github.com/CompassLabs/mono/blob/master/#authentication)
36
- * [Available Resources and Operations](https://github.com/CompassLabs/mono/blob/master/#available-resources-and-operations)
37
- * [Retries](https://github.com/CompassLabs/mono/blob/master/#retries)
38
- * [Error Handling](https://github.com/CompassLabs/mono/blob/master/#error-handling)
39
- * [Server Selection](https://github.com/CompassLabs/mono/blob/master/#server-selection)
40
- * [Custom HTTP Client](https://github.com/CompassLabs/mono/blob/master/#custom-http-client)
41
- * [Resource Management](https://github.com/CompassLabs/mono/blob/master/#resource-management)
42
- * [Debugging](https://github.com/CompassLabs/mono/blob/master/#debugging)
43
- * [Development](https://github.com/CompassLabs/mono/blob/master/#development)
44
- * [Maturity](https://github.com/CompassLabs/mono/blob/master/#maturity)
45
- * [Contributions](https://github.com/CompassLabs/mono/blob/master/#contributions)
46
-
47
- <!-- End Table of Contents [toc] -->
48
-
49
- <!-- Start SDK Installation [installation] -->
50
- ## SDK Installation
51
-
52
- > [!NOTE]
53
- > **Python version upgrade policy**
54
- >
55
- > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
56
-
57
- The SDK can be installed with either *pip* or *poetry* package managers.
58
-
59
- ### PIP
60
-
61
- *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
62
-
63
- ```bash
64
- pip install compass_api_sdk
65
- ```
66
-
67
- ### Poetry
68
-
69
- *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
70
-
71
- ```bash
72
- poetry add compass_api_sdk
73
- ```
74
-
75
- ### Shell and script usage with `uv`
76
-
77
- You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
78
-
79
- ```shell
80
- uvx --from compass_api_sdk python
81
- ```
82
-
83
- It's also possible to write a standalone Python script without needing to set up a whole project like so:
84
-
85
- ```python
86
- #!/usr/bin/env -S uv run --script
87
- # /// script
88
- # requires-python = ">=3.9"
89
- # dependencies = [
90
- # "compass_api_sdk",
91
- # ]
92
- # ///
93
-
94
- from compass_api_sdk import CompassAPI
95
-
96
- sdk = CompassAPI(
97
- # SDK arguments
98
- )
99
-
100
- # Rest of script here...
101
- ```
102
-
103
- Once that is saved to a file, you can run it with `uv run script.py` where
104
- `script.py` can be replaced with the actual file name.
105
- <!-- End SDK Installation [installation] -->
106
-
107
- <!-- Start IDE Support [idesupport] -->
108
- ## IDE Support
109
-
110
- ### PyCharm
111
-
112
- Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
113
-
114
- - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
115
- <!-- End IDE Support [idesupport] -->
116
-
117
- <!-- Start SDK Example Usage [usage] -->
118
- ## SDK Example Usage
119
-
120
- ### Example
121
-
122
- ```python
123
- # Synchronous Example
124
- from compass_api_sdk import CompassAPI, models
125
-
126
-
127
- with CompassAPI(
128
- api_key_auth="<YOUR_API_KEY_HERE>",
129
- ) as compass_api:
130
-
131
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
132
-
133
- # Handle response
134
- print(res)
135
- ```
136
-
137
- </br>
138
-
139
- The same SDK client can also be used to make asychronous requests by importing asyncio.
140
- ```python
141
- # Asynchronous Example
142
- import asyncio
143
- from compass_api_sdk import CompassAPI, models
144
-
145
- async def main():
146
-
147
- async with CompassAPI(
148
- api_key_auth="<YOUR_API_KEY_HERE>",
149
- ) as compass_api:
150
-
151
- res = await compass_api.aave_v3.rate_async(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
152
-
153
- # Handle response
154
- print(res)
155
-
156
- asyncio.run(main())
157
- ```
158
- <!-- End SDK Example Usage [usage] -->
159
-
160
- <!-- Start Authentication [security] -->
161
- ## Authentication
162
-
163
- ### Per-Client Security Schemes
164
-
165
- This SDK supports the following security scheme globally:
166
-
167
- | Name | Type | Scheme |
168
- | -------------- | ------ | ------- |
169
- | `api_key_auth` | apiKey | API key |
170
-
171
- To authenticate with the API the `api_key_auth` parameter must be set when initializing the SDK client instance. For example:
172
- ```python
173
- from compass_api_sdk import CompassAPI, models
174
-
175
-
176
- with CompassAPI(
177
- api_key_auth="<YOUR_API_KEY_HERE>",
178
- ) as compass_api:
179
-
180
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
181
-
182
- # Handle response
183
- print(res)
184
-
185
- ```
186
- <!-- End Authentication [security] -->
187
-
188
- <!-- Start Available Resources and Operations [operations] -->
189
- ## Available Resources and Operations
190
-
191
- <details open>
192
- <summary>Available methods</summary>
193
-
194
- ### [aave_v3](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md)
195
-
196
- * [rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#rate) - Interest Rates
197
- * [avg_rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#avg_rate) - Interest Rates: Time Average
198
- * [std_rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#std_rate) - Interest Rates: Standard Deviation
199
- * [reserve_overview](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#reserve_overview) - Reserve Overview
200
- * [token_price](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#token_price) - Token Prices
201
- * [liquidity_change](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#liquidity_change) - Liquidity Index
202
- * [user_position_summary](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#user_position_summary) - Positions - Total
203
- * [user_position_per_token](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#user_position_per_token) - Positions - per Token
204
- * [historical_transactions](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#historical_transactions) - Historical Transactions
205
- * [supply](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#supply) - Supply/Lend
206
- * [borrow](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#borrow) - Borrow
207
- * [repay](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#repay) - Repay Loans
208
- * [withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#withdraw) - Unstake
209
-
210
- ### [aerodrome_slipstream](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md)
211
-
212
- * [slipstream_liquidity_provision_positions](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_positions) - List LP Positions
213
- * [slipstream_pool_price](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_pool_price) - Pool Price
214
- * [slipstream_swap_sell_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_swap_sell_exactly) - Swap - from Specified Amount
215
- * [slipstream_swap_buy_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_swap_buy_exactly) - Swap - into Specified Amount
216
- * [slipstream_liquidity_provision_mint](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_mint) - Open a New LP Position
217
- * [slipstream_liquidity_provision_increase](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_increase) - Increase an LP Position
218
- * [slipstream_liquidity_provision_withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_withdraw) - Withdraw an LP Position
219
-
220
-
221
- ### [erc_4626_vaults](https://github.com/CompassLabs/mono/blob/master/docs/sdks/erc4626vaults/README.md)
222
-
223
- * [vault](https://github.com/CompassLabs/mono/blob/master/docs/sdks/erc4626vaults/README.md#vault) - Get Vault & User Position
224
- * [deposit](https://github.com/CompassLabs/mono/blob/master/docs/sdks/erc4626vaults/README.md#deposit) - Deposit to Vault
225
- * [withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/erc4626vaults/README.md#withdraw) - Withdraw from Vault
226
-
227
- ### [morpho](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md)
228
-
229
- * [vaults](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#vaults) - Get Vaults
230
- * [vault](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#vault) - Get Vault
231
- * [vault_position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#vault_position) - Check Vault Position
232
- * [markets](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#markets) - Get Markets
233
- * [market](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#market) - Get Market
234
- * [market_position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#market_position) - Check Market Position
235
- * [user_position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#user_position) - Check User Position
236
- * [deposit](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#deposit) - Deposit to Vault
237
- * [withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#withdraw) - Withdraw from Vault
238
- * [supply_collateral](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#supply_collateral) - Supply Collateral to Market
239
- * [withdraw_collateral](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#withdraw_collateral) - Withdraw Collateral from Market
240
- * [borrow](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#borrow) - Borrow from Market
241
- * [repay](https://github.com/CompassLabs/mono/blob/master/docs/sdks/morpho/README.md#repay) - Repay to Market
242
-
243
- ### [pendle](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md)
244
-
245
- * [position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#position) - Check User's Market Position
246
- * [positions](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#positions) - List User's Market Positions
247
- * [market](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#market) - Get Market Data
248
- * [markets](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#markets) - List Market Data
249
- * [buy_pt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#buy_pt) - Buy Principal Token (PT)
250
- * [sell_pt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#sell_pt) - Sell Principal Token (PT)
251
- * [buy_yt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#buy_yt) - Buy Yield Token (YT)
252
- * [sell_yt](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#sell_yt) - Sell Yield Token (YT)
253
- * [redeem_yield](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#redeem_yield) - Redeem Claimable Yield
254
- * [add_liquidity](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#add_liquidity) - Add Liquidity
255
- * [remove_liquidity](https://github.com/CompassLabs/mono/blob/master/docs/sdks/pendle/README.md#remove_liquidity) - Remove Liquidity
256
-
257
- ### [sky](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md)
258
-
259
- * [position](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#position) - Check USDS Position
260
- * [buy](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#buy) - Buy USDS
261
- * [sell](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#sell) - Sell USDS
262
- * [deposit](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#deposit) - Deposit USDS
263
- * [withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#withdraw) - Withdraw USDS
264
-
265
- ### [smart_account](https://github.com/CompassLabs/mono/blob/master/docs/sdks/smartaccount/README.md)
266
-
267
- * [account_batched_user_operations](https://github.com/CompassLabs/mono/blob/master/docs/sdks/smartaccount/README.md#account_batched_user_operations) - Get Smart Account Batched User Operations
268
-
269
- ### [token](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md)
270
-
271
- * [address](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#address) - Token Address
272
- * [price](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#price) - Token Price
273
- * [balance](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#balance) - Token Balance
274
- * [transfer](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#transfer) - Transfer ETH or ERC20 Tokens
275
-
276
- ### [transaction_bundler](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbundler/README.md)
277
-
278
- * [bundler_authorization](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbundler/README.md#bundler_authorization) - Enable Transaction Bundling
279
- * [bundler_execute](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbundler/README.md#bundler_execute) - Construct Bundled Transaction
280
- * [bundler_aave_loop](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbundler/README.md#bundler_aave_loop) - AAVE Leverage Long/Short
281
-
282
- ### [uniswap_v3](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md)
283
-
284
- * [quote_buy_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#quote_buy_exactly) - Get Quote - to Specified Amount
285
- * [quote_sell_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#quote_sell_exactly) - Get quote - From Specified Amount
286
- * [pool_price](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#pool_price) - Pool Price
287
- * [liquidity_provision_in_range](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#liquidity_provision_in_range) - Check if LP is Active.
288
- * [liquidity_provision_positions](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#liquidity_provision_positions) - List LP
289
- * [swap_buy_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#swap_buy_exactly) - Buy exact amount
290
- * [swap_sell_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#swap_sell_exactly) - Sell exact amount
291
- * [liquidity_provision_mint](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#liquidity_provision_mint) - Open a new LP position
292
- * [liquidity_provision_increase](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#liquidity_provision_increase) - Increase an LP position
293
- * [liquidity_provision_withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#liquidity_provision_withdraw) - Withdraw an LP position
294
-
295
- ### [universal](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md)
296
-
297
- * [portfolio](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#portfolio) - List User Portfolio
298
- * [visualize_portfolio](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#visualize_portfolio) - Visualize User Portfolio
299
- * [supported_tokens](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#supported_tokens) - List Supported Tokens
300
- * [allowance](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#allowance) - Get Allowance
301
- * [ens](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#ens) - Resolve ENS
302
- * [wrap_eth](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#wrap_eth) - Wrap ETH
303
- * [unwrap_weth](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#unwrap_weth) - Unwrap WETH
304
- * [allowance_set](https://github.com/CompassLabs/mono/blob/master/docs/sdks/universal/README.md#allowance_set) - Set Allowance
305
-
306
- </details>
307
- <!-- End Available Resources and Operations [operations] -->
308
-
309
- <!-- Start Retries [retries] -->
310
- ## Retries
311
-
312
- Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
313
-
314
- To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
315
- ```python
316
- from compass_api_sdk import CompassAPI, models
317
- from compass_api_sdk.utils import BackoffStrategy, RetryConfig
318
-
319
-
320
- with CompassAPI(
321
- api_key_auth="<YOUR_API_KEY_HERE>",
322
- ) as compass_api:
323
-
324
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC,
325
- RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
326
-
327
- # Handle response
328
- print(res)
329
-
330
- ```
331
-
332
- If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
333
- ```python
334
- from compass_api_sdk import CompassAPI, models
335
- from compass_api_sdk.utils import BackoffStrategy, RetryConfig
336
-
337
-
338
- with CompassAPI(
339
- retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
340
- api_key_auth="<YOUR_API_KEY_HERE>",
341
- ) as compass_api:
342
-
343
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
344
-
345
- # Handle response
346
- print(res)
347
-
348
- ```
349
- <!-- End Retries [retries] -->
350
-
351
- <!-- Start Error Handling [errors] -->
352
- ## Error Handling
353
-
354
- Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
355
-
356
- By default, an API error will raise a errors.APIError exception, which has the following properties:
357
-
358
- | Property | Type | Description |
359
- |-----------------|------------------|-----------------------|
360
- | `.status_code` | *int* | The HTTP status code |
361
- | `.message` | *str* | The error message |
362
- | `.raw_response` | *httpx.Response* | The raw HTTP response |
363
- | `.body` | *str* | The response content |
364
-
365
- When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `rate_async` method may raise the following exceptions:
366
-
367
- | Error Type | Status Code | Content Type |
368
- | -------------------------- | ----------- | ---------------- |
369
- | errors.HTTPValidationError | 422 | application/json |
370
- | errors.APIError | 4XX, 5XX | \*/\* |
371
-
372
- ### Example
373
-
374
- ```python
375
- from compass_api_sdk import CompassAPI, errors, models
376
-
377
-
378
- with CompassAPI(
379
- api_key_auth="<YOUR_API_KEY_HERE>",
380
- ) as compass_api:
381
- res = None
382
- try:
383
-
384
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
385
-
386
- # Handle response
387
- print(res)
388
-
389
- except errors.HTTPValidationError as e:
390
- # handle e.data: errors.HTTPValidationErrorData
391
- raise(e)
392
- except errors.APIError as e:
393
- # handle exception
394
- raise(e)
395
- ```
396
- <!-- End Error Handling [errors] -->
397
-
398
- <!-- Start Server Selection [server] -->
399
- ## Server Selection
400
-
401
- ### Override Server URL Per-Client
402
-
403
- The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
404
- ```python
405
- from compass_api_sdk import CompassAPI, models
406
-
407
-
408
- with CompassAPI(
409
- server_url="https://api.compasslabs.ai",
410
- api_key_auth="<YOUR_API_KEY_HERE>",
411
- ) as compass_api:
412
-
413
- res = compass_api.aave_v3.rate(chain=models.AaveRateChain.ARBITRUM_MAINNET, token=models.AaveRateToken.USDC)
414
-
415
- # Handle response
416
- print(res)
417
-
418
- ```
419
- <!-- End Server Selection [server] -->
420
-
421
- <!-- Start Custom HTTP Client [http-client] -->
422
- ## Custom HTTP Client
423
-
424
- The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
425
- Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
426
- This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
427
-
428
- For example, you could specify a header for every request that this sdk makes as follows:
429
- ```python
430
- from compass_api_sdk import CompassAPI
431
- import httpx
432
-
433
- http_client = httpx.Client(headers={"x-custom-header": "someValue"})
434
- s = CompassAPI(client=http_client)
435
- ```
436
-
437
- or you could wrap the client with your own custom logic:
438
- ```python
439
- from compass_api_sdk import CompassAPI
440
- from compass_api_sdk.httpclient import AsyncHttpClient
441
- import httpx
442
-
443
- class CustomClient(AsyncHttpClient):
444
- client: AsyncHttpClient
445
-
446
- def __init__(self, client: AsyncHttpClient):
447
- self.client = client
448
-
449
- async def send(
450
- self,
451
- request: httpx.Request,
452
- *,
453
- stream: bool = False,
454
- auth: Union[
455
- httpx._types.AuthTypes, httpx._client.UseClientDefault, None
456
- ] = httpx.USE_CLIENT_DEFAULT,
457
- follow_redirects: Union[
458
- bool, httpx._client.UseClientDefault
459
- ] = httpx.USE_CLIENT_DEFAULT,
460
- ) -> httpx.Response:
461
- request.headers["Client-Level-Header"] = "added by client"
462
-
463
- return await self.client.send(
464
- request, stream=stream, auth=auth, follow_redirects=follow_redirects
465
- )
466
-
467
- def build_request(
468
- self,
469
- method: str,
470
- url: httpx._types.URLTypes,
471
- *,
472
- content: Optional[httpx._types.RequestContent] = None,
473
- data: Optional[httpx._types.RequestData] = None,
474
- files: Optional[httpx._types.RequestFiles] = None,
475
- json: Optional[Any] = None,
476
- params: Optional[httpx._types.QueryParamTypes] = None,
477
- headers: Optional[httpx._types.HeaderTypes] = None,
478
- cookies: Optional[httpx._types.CookieTypes] = None,
479
- timeout: Union[
480
- httpx._types.TimeoutTypes, httpx._client.UseClientDefault
481
- ] = httpx.USE_CLIENT_DEFAULT,
482
- extensions: Optional[httpx._types.RequestExtensions] = None,
483
- ) -> httpx.Request:
484
- return self.client.build_request(
485
- method,
486
- url,
487
- content=content,
488
- data=data,
489
- files=files,
490
- json=json,
491
- params=params,
492
- headers=headers,
493
- cookies=cookies,
494
- timeout=timeout,
495
- extensions=extensions,
496
- )
497
-
498
- s = CompassAPI(async_client=CustomClient(httpx.AsyncClient()))
499
- ```
500
- <!-- End Custom HTTP Client [http-client] -->
501
-
502
- <!-- Start Resource Management [resource-management] -->
503
- ## Resource Management
504
-
505
- The `CompassAPI` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
506
-
507
- [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
508
-
509
- ```python
510
- from compass_api_sdk import CompassAPI
511
- def main():
512
-
513
- with CompassAPI(
514
- api_key_auth="<YOUR_API_KEY_HERE>",
515
- ) as compass_api:
516
- # Rest of application here...
517
-
518
-
519
- # Or when using async:
520
- async def amain():
521
-
522
- async with CompassAPI(
523
- api_key_auth="<YOUR_API_KEY_HERE>",
524
- ) as compass_api:
525
- # Rest of application here...
526
- ```
527
- <!-- End Resource Management [resource-management] -->
528
-
529
- <!-- Start Debugging [debug] -->
530
- ## Debugging
531
-
532
- You can setup your SDK to emit debug logs for SDK requests and responses.
533
-
534
- You can pass your own logger class directly into your SDK.
535
- ```python
536
- from compass_api_sdk import CompassAPI
537
- import logging
538
-
539
- logging.basicConfig(level=logging.DEBUG)
540
- s = CompassAPI(debug_logger=logging.getLogger("compass_api_sdk"))
541
- ```
542
- <!-- End Debugging [debug] -->
543
-
544
- # Development
545
-
546
- ## Maturity
547
-
548
- This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
549
- to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
550
- looking for the latest version.
551
-
552
- ## Contributions
553
-
554
- While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
555
- We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
556
-
557
- <!-- Placeholder for Future Speakeasy SDK Sections -->
558
-