compass_api_sdk 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of compass_api_sdk might be problematic. Click here for more details.

Files changed (138) hide show
  1. compass_api_sdk-0.0.1/PKG-INFO +534 -0
  2. compass_api_sdk-0.0.1/README.md +517 -0
  3. compass_api_sdk-0.0.1/py.typed +1 -0
  4. compass_api_sdk-0.0.1/pyproject.toml +52 -0
  5. compass_api_sdk-0.0.1/src/compass_api_sdk/__init__.py +17 -0
  6. compass_api_sdk-0.0.1/src/compass_api_sdk/_hooks/__init__.py +5 -0
  7. compass_api_sdk-0.0.1/src/compass_api_sdk/_hooks/registration.py +13 -0
  8. compass_api_sdk-0.0.1/src/compass_api_sdk/_hooks/sdkhooks.py +76 -0
  9. compass_api_sdk-0.0.1/src/compass_api_sdk/_hooks/types.py +106 -0
  10. compass_api_sdk-0.0.1/src/compass_api_sdk/_version.py +15 -0
  11. compass_api_sdk-0.0.1/src/compass_api_sdk/aave_v3.py +1903 -0
  12. compass_api_sdk-0.0.1/src/compass_api_sdk/aerodrome_slipstream.py +1875 -0
  13. compass_api_sdk-0.0.1/src/compass_api_sdk/basesdk.py +362 -0
  14. compass_api_sdk-0.0.1/src/compass_api_sdk/errors/__init__.py +7 -0
  15. compass_api_sdk-0.0.1/src/compass_api_sdk/errors/apierror.py +22 -0
  16. compass_api_sdk-0.0.1/src/compass_api_sdk/errors/httpvalidationerror.py +21 -0
  17. compass_api_sdk-0.0.1/src/compass_api_sdk/httpclient.py +136 -0
  18. compass_api_sdk-0.0.1/src/compass_api_sdk/models/__init__.py +777 -0
  19. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aave_liquidity_changeop.py +108 -0
  20. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aave_token_priceop.py +98 -0
  21. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aave_user_position_per_tokenop.py +104 -0
  22. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aave_user_position_summaryop.py +35 -0
  23. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aaveborrowrequest.py +105 -0
  24. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aaveliquiditychangeresponse.py +26 -0
  25. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aaverepayrequest.py +105 -0
  26. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aavesupplyrequest.py +93 -0
  27. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aavetokenpriceresponse.py +15 -0
  28. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aaveuserpositionpertokenresponse.py +73 -0
  29. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aaveuserpositionsummaryresponse.py +50 -0
  30. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aavewithdrawrequest.py +58 -0
  31. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +35 -0
  32. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +173 -0
  33. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromelppositionsresponse.py +21 -0
  34. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeposition.py +70 -0
  35. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +92 -0
  36. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +109 -0
  37. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +186 -0
  38. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +57 -0
  39. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +96 -0
  40. compass_api_sdk-0.0.1/src/compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +50 -0
  41. compass_api_sdk-0.0.1/src/compass_api_sdk/models/allowanceinforesponse.py +48 -0
  42. compass_api_sdk-0.0.1/src/compass_api_sdk/models/balanceinforesponse.py +43 -0
  43. compass_api_sdk-0.0.1/src/compass_api_sdk/models/chain.py +12 -0
  44. compass_api_sdk-0.0.1/src/compass_api_sdk/models/chaininfo.py +53 -0
  45. compass_api_sdk-0.0.1/src/compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_asset.py +22 -0
  46. compass_api_sdk-0.0.1/src/compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_asset.py +23 -0
  47. compass_api_sdk-0.0.1/src/compass_api_sdk/models/ensnameinforesponse.py +24 -0
  48. compass_api_sdk-0.0.1/src/compass_api_sdk/models/feeenum.py +16 -0
  49. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_allowanceop.py +121 -0
  50. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_balanceop.py +104 -0
  51. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_ensop.py +35 -0
  52. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_portfolioop.py +35 -0
  53. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_price_usdop.py +98 -0
  54. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_supported_tokensop.py +29 -0
  55. compass_api_sdk-0.0.1/src/compass_api_sdk/models/generic_visualize_portfolioop.py +35 -0
  56. compass_api_sdk-0.0.1/src/compass_api_sdk/models/image.py +15 -0
  57. compass_api_sdk-0.0.1/src/compass_api_sdk/models/increaseallowancerequest.py +77 -0
  58. compass_api_sdk-0.0.1/src/compass_api_sdk/models/interestratemode.py +14 -0
  59. compass_api_sdk-0.0.1/src/compass_api_sdk/models/marketstate.py +35 -0
  60. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morpho_market_positionop.py +39 -0
  61. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morpho_marketsop.py +78 -0
  62. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morpho_vault_positionop.py +39 -0
  63. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morpho_vaultsop.py +72 -0
  64. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphoborrowrequest.py +91 -0
  65. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphocheckmarketpositionresponse.py +23 -0
  66. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphocheckvaultpositionresponse.py +20 -0
  67. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphodepositrequest.py +86 -0
  68. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphogetmarketsresponse.py +17 -0
  69. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphogetvaultsresponse.py +17 -0
  70. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphomarket.py +80 -0
  71. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphorepayrequest.py +79 -0
  72. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphosetvaultallowancerequest.py +44 -0
  73. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphosupplycollateralrequest.py +91 -0
  74. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphovault.py +47 -0
  75. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphowithdrawcollateralrequest.py +91 -0
  76. compass_api_sdk-0.0.1/src/compass_api_sdk/models/morphowithdrawrequest.py +74 -0
  77. compass_api_sdk-0.0.1/src/compass_api_sdk/models/portfolio.py +22 -0
  78. compass_api_sdk-0.0.1/src/compass_api_sdk/models/priceresponse.py +15 -0
  79. compass_api_sdk-0.0.1/src/compass_api_sdk/models/security.py +24 -0
  80. compass_api_sdk-0.0.1/src/compass_api_sdk/models/token_addressop.py +98 -0
  81. compass_api_sdk-0.0.1/src/compass_api_sdk/models/token_balanceop.py +49 -0
  82. compass_api_sdk-0.0.1/src/compass_api_sdk/models/token_enum.py +57 -0
  83. compass_api_sdk-0.0.1/src/compass_api_sdk/models/token_priceop.py +97 -0
  84. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokenaddressresponse.py +15 -0
  85. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokenbalance.py +49 -0
  86. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokenbalanceresponse.py +44 -0
  87. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokeninfo.py +17 -0
  88. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokenpriceresponse.py +15 -0
  89. compass_api_sdk-0.0.1/src/compass_api_sdk/models/tokentransferrequest.py +66 -0
  90. compass_api_sdk-0.0.1/src/compass_api_sdk/models/transfererc20request.py +62 -0
  91. compass_api_sdk-0.0.1/src/compass_api_sdk/models/transferethrequest.py +46 -0
  92. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +34 -0
  93. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +35 -0
  94. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswap_pool_priceop.py +193 -0
  95. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +209 -0
  96. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +209 -0
  97. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapbuyexactlyrequest.py +104 -0
  98. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapbuyquoteinforesponse.py +20 -0
  99. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapcheckinrangeresponse.py +15 -0
  100. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +99 -0
  101. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswaplppositionsinforesponse.py +24 -0
  102. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +185 -0
  103. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswappoolpriceresponse.py +47 -0
  104. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswappositionssolidityresponse.py +46 -0
  105. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapsellexactlyrequest.py +104 -0
  106. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapsellquoteinforesponse.py +20 -0
  107. compass_api_sdk-0.0.1/src/compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +51 -0
  108. compass_api_sdk-0.0.1/src/compass_api_sdk/models/unsignedtransaction.py +58 -0
  109. compass_api_sdk-0.0.1/src/compass_api_sdk/models/unwrapwethrequest.py +41 -0
  110. compass_api_sdk-0.0.1/src/compass_api_sdk/models/validationerror.py +26 -0
  111. compass_api_sdk-0.0.1/src/compass_api_sdk/models/vaultstate.py +32 -0
  112. compass_api_sdk-0.0.1/src/compass_api_sdk/models/weeklyapys.py +23 -0
  113. compass_api_sdk-0.0.1/src/compass_api_sdk/models/wrapethrequest.py +41 -0
  114. compass_api_sdk-0.0.1/src/compass_api_sdk/morpho.py +2577 -0
  115. compass_api_sdk-0.0.1/src/compass_api_sdk/py.typed +1 -0
  116. compass_api_sdk-0.0.1/src/compass_api_sdk/sdk.py +155 -0
  117. compass_api_sdk-0.0.1/src/compass_api_sdk/sdkconfiguration.py +56 -0
  118. compass_api_sdk-0.0.1/src/compass_api_sdk/token_sdk.py +861 -0
  119. compass_api_sdk-0.0.1/src/compass_api_sdk/types/__init__.py +21 -0
  120. compass_api_sdk-0.0.1/src/compass_api_sdk/types/basemodel.py +39 -0
  121. compass_api_sdk-0.0.1/src/compass_api_sdk/uniswap_v3.py +2551 -0
  122. compass_api_sdk-0.0.1/src/compass_api_sdk/universal.py +2625 -0
  123. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/__init__.py +100 -0
  124. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/annotations.py +55 -0
  125. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/datetimes.py +23 -0
  126. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/enums.py +74 -0
  127. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/eventstreaming.py +238 -0
  128. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/forms.py +202 -0
  129. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/headers.py +136 -0
  130. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/logger.py +22 -0
  131. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/metadata.py +118 -0
  132. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/queryparams.py +205 -0
  133. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/requestbodies.py +66 -0
  134. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/retries.py +217 -0
  135. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/security.py +174 -0
  136. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/serializers.py +248 -0
  137. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/url.py +155 -0
  138. compass_api_sdk-0.0.1/src/compass_api_sdk/utils/values.py +137 -0
@@ -0,0 +1,534 @@
1
+ Metadata-Version: 2.3
2
+ Name: compass_api_sdk
3
+ Version: 0.0.1
4
+ Summary: Python Client SDK Generated by Speakeasy.
5
+ Author: royalnine
6
+ Requires-Python: >=3.9
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: httpx (>=0.28.1)
14
+ Requires-Dist: pydantic (>=2.11.2)
15
+ Description-Content-Type: text/markdown
16
+
17
+ # compass_api_sdk
18
+
19
+ Developer-friendly & type-safe Python SDK specifically catered to leverage *compass_api_sdk* API.
20
+
21
+ <div align="left">
22
+ <a href="https://www.speakeasy.com/?utm_source=compass-api-sdk&utm_campaign=python"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
23
+ <a href="https://opensource.org/licenses/MIT">
24
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
25
+ </a>
26
+ </div>
27
+
28
+
29
+ <br /><br />
30
+ > [!IMPORTANT]
31
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/compasslabs/api). Delete this section before > publishing to a package manager.
32
+
33
+ <!-- Start Summary [summary] -->
34
+ ## Summary
35
+
36
+ Compass API: Compass Labs DeFi API
37
+ <!-- End Summary [summary] -->
38
+
39
+ <!-- Start Table of Contents [toc] -->
40
+ ## Table of Contents
41
+ <!-- $toc-max-depth=2 -->
42
+ * [compass_api_sdk](#compassapisdk)
43
+ * [SDK Installation](#sdk-installation)
44
+ * [IDE Support](#ide-support)
45
+ * [SDK Example Usage](#sdk-example-usage)
46
+ * [Authentication](#authentication)
47
+ * [Available Resources and Operations](#available-resources-and-operations)
48
+ * [Retries](#retries)
49
+ * [Error Handling](#error-handling)
50
+ * [Server Selection](#server-selection)
51
+ * [Custom HTTP Client](#custom-http-client)
52
+ * [Resource Management](#resource-management)
53
+ * [Debugging](#debugging)
54
+ * [Development](#development)
55
+ * [Maturity](#maturity)
56
+ * [Contributions](#contributions)
57
+
58
+ <!-- End Table of Contents [toc] -->
59
+
60
+ <!-- Start SDK Installation [installation] -->
61
+ ## SDK Installation
62
+
63
+ > [!TIP]
64
+ > To finish publishing your SDK to PyPI you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
65
+
66
+
67
+ > [!NOTE]
68
+ > **Python version upgrade policy**
69
+ >
70
+ > 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.
71
+
72
+ The SDK can be installed with either *pip* or *poetry* package managers.
73
+
74
+ ### PIP
75
+
76
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
77
+
78
+ ```bash
79
+ pip install git+<UNSET>.git
80
+ ```
81
+
82
+ ### Poetry
83
+
84
+ *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.
85
+
86
+ ```bash
87
+ poetry add git+<UNSET>.git
88
+ ```
89
+
90
+ ### Shell and script usage with `uv`
91
+
92
+ 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:
93
+
94
+ ```shell
95
+ uvx --from compass_api_sdk python
96
+ ```
97
+
98
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
99
+
100
+ ```python
101
+ #!/usr/bin/env -S uv run --script
102
+ # /// script
103
+ # requires-python = ">=3.9"
104
+ # dependencies = [
105
+ # "compass_api_sdk",
106
+ # ]
107
+ # ///
108
+
109
+ from compass_api_sdk import CompassAPISDK
110
+
111
+ sdk = CompassAPISDK(
112
+ # SDK arguments
113
+ )
114
+
115
+ # Rest of script here...
116
+ ```
117
+
118
+ Once that is saved to a file, you can run it with `uv run script.py` where
119
+ `script.py` can be replaced with the actual file name.
120
+ <!-- End SDK Installation [installation] -->
121
+
122
+ <!-- Start IDE Support [idesupport] -->
123
+ ## IDE Support
124
+
125
+ ### PyCharm
126
+
127
+ 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.
128
+
129
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
130
+ <!-- End IDE Support [idesupport] -->
131
+
132
+ <!-- Start SDK Example Usage [usage] -->
133
+ ## SDK Example Usage
134
+
135
+ ### Example
136
+
137
+ ```python
138
+ # Synchronous Example
139
+ from compass_api_sdk import CompassAPISDK
140
+
141
+
142
+ with CompassAPISDK(
143
+ api_key_auth="<YOUR_API_KEY_HERE>",
144
+ ) as cas_client:
145
+
146
+ res = cas_client.aave_v3.token_price()
147
+
148
+ # Handle response
149
+ print(res)
150
+ ```
151
+
152
+ </br>
153
+
154
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
155
+ ```python
156
+ # Asynchronous Example
157
+ import asyncio
158
+ from compass_api_sdk import CompassAPISDK
159
+
160
+ async def main():
161
+
162
+ async with CompassAPISDK(
163
+ api_key_auth="<YOUR_API_KEY_HERE>",
164
+ ) as cas_client:
165
+
166
+ res = await cas_client.aave_v3.token_price_async()
167
+
168
+ # Handle response
169
+ print(res)
170
+
171
+ asyncio.run(main())
172
+ ```
173
+ <!-- End SDK Example Usage [usage] -->
174
+
175
+ <!-- Start Authentication [security] -->
176
+ ## Authentication
177
+
178
+ ### Per-Client Security Schemes
179
+
180
+ This SDK supports the following security scheme globally:
181
+
182
+ | Name | Type | Scheme |
183
+ | -------------- | ------ | ------- |
184
+ | `api_key_auth` | apiKey | API key |
185
+
186
+ To authenticate with the API the `api_key_auth` parameter must be set when initializing the SDK client instance. For example:
187
+ ```python
188
+ from compass_api_sdk import CompassAPISDK
189
+
190
+
191
+ with CompassAPISDK(
192
+ api_key_auth="<YOUR_API_KEY_HERE>",
193
+ ) as cas_client:
194
+
195
+ res = cas_client.aave_v3.token_price()
196
+
197
+ # Handle response
198
+ print(res)
199
+
200
+ ```
201
+ <!-- End Authentication [security] -->
202
+
203
+ <!-- Start Available Resources and Operations [operations] -->
204
+ ## Available Resources and Operations
205
+
206
+ <details open>
207
+ <summary>Available methods</summary>
208
+
209
+ ### [aave_v3](docs/sdks/aavev3/README.md)
210
+
211
+ * [token_price](docs/sdks/aavev3/README.md#token_price) - Token prices
212
+ * [liquidity_change](docs/sdks/aavev3/README.md#liquidity_change) - Liquidity index
213
+ * [user_position_summary](docs/sdks/aavev3/README.md#user_position_summary) - Positions - total
214
+ * [user_position_per_token](docs/sdks/aavev3/README.md#user_position_per_token) - Positions - per token
215
+ * [supply](docs/sdks/aavev3/README.md#supply) - Supply/Lend
216
+ * [borrow](docs/sdks/aavev3/README.md#borrow) - Borrow
217
+ * [repay](docs/sdks/aavev3/README.md#repay) - Repay loans
218
+ * [withdraw](docs/sdks/aavev3/README.md#withdraw) - Unstake
219
+
220
+ ### [aerodrome_slipstream](docs/sdks/aerodromeslipstream/README.md)
221
+
222
+ * [slipstream_liquidity_provision_positions](docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_positions) - List LP positions
223
+ * [slipstream_pool_price](docs/sdks/aerodromeslipstream/README.md#slipstream_pool_price) - Pool price
224
+ * [slipstream_swap_sell_exactly](docs/sdks/aerodromeslipstream/README.md#slipstream_swap_sell_exactly) - Swap - from specified amount
225
+ * [slipstream_swap_buy_exactly](docs/sdks/aerodromeslipstream/README.md#slipstream_swap_buy_exactly) - Swap - into specified amount
226
+ * [slipstream_liquidity_provision_mint](docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_mint) - Open a new LP position
227
+ * [slipstream_liquidity_provision_increase](docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_increase) - Increase an LP position
228
+ * [slipstream_liquidity_provision_withdraw](docs/sdks/aerodromeslipstream/README.md#slipstream_liquidity_provision_withdraw) - Withdraw an LP position
229
+
230
+
231
+ ### [morpho](docs/sdks/morpho/README.md)
232
+
233
+ * [vaults](docs/sdks/morpho/README.md#vaults) - Get Vaults
234
+ * [vault_position](docs/sdks/morpho/README.md#vault_position) - Check Vault Position
235
+ * [markets](docs/sdks/morpho/README.md#markets) - Get Markets
236
+ * [market_position](docs/sdks/morpho/README.md#market_position) - Check Market Position
237
+ * [allowance](docs/sdks/morpho/README.md#allowance) - Set Allowance for Vault
238
+ * [deposit](docs/sdks/morpho/README.md#deposit) - Deposit to Vault
239
+ * [withdraw](docs/sdks/morpho/README.md#withdraw) - Withdraw from Vault
240
+ * [supply_collateral](docs/sdks/morpho/README.md#supply_collateral) - Supply Collateral to Market
241
+ * [withdraw_collateral](docs/sdks/morpho/README.md#withdraw_collateral) - Withdraw Collateral from Market
242
+ * [borrow](docs/sdks/morpho/README.md#borrow) - Borrow from Market
243
+ * [repay](docs/sdks/morpho/README.md#repay) - Repay to Market
244
+
245
+ ### [token](docs/sdks/tokensdk/README.md)
246
+
247
+ * [address](docs/sdks/tokensdk/README.md#address) - Token Address
248
+ * [price](docs/sdks/tokensdk/README.md#price) - Token Price
249
+ * [balance](docs/sdks/tokensdk/README.md#balance) - Token Balance
250
+ * [transfer](docs/sdks/tokensdk/README.md#transfer) - Transfer ETH or ERC20 Tokens
251
+
252
+ ### [uniswap_v3](docs/sdks/uniswapv3/README.md)
253
+
254
+ * [quote_buy_exactly](docs/sdks/uniswapv3/README.md#quote_buy_exactly) - Get quote - to specified amount
255
+ * [quote_sell_exactly](docs/sdks/uniswapv3/README.md#quote_sell_exactly) - Get quote - from specified amount
256
+ * [pool_price](docs/sdks/uniswapv3/README.md#pool_price) - Pool price
257
+ * [liquidity_provision_in_range](docs/sdks/uniswapv3/README.md#liquidity_provision_in_range) - Check if LP is active.
258
+ * [liquidity_provision_positions](docs/sdks/uniswapv3/README.md#liquidity_provision_positions) - List LP
259
+ * [swap_buy_exactly](docs/sdks/uniswapv3/README.md#swap_buy_exactly) - Buy exact amount
260
+ * [swap_sell_exactly](docs/sdks/uniswapv3/README.md#swap_sell_exactly) - Sell exact amount
261
+ * [liquidity_provision_increase](docs/sdks/uniswapv3/README.md#liquidity_provision_increase) - Increase an LP position
262
+ * [liquidity_provision_mint](docs/sdks/uniswapv3/README.md#liquidity_provision_mint) - Open a new LP position
263
+ * [liquidity_provision_withdraw](docs/sdks/uniswapv3/README.md#liquidity_provision_withdraw) - Withdraw an LP position
264
+
265
+ ### [universal](docs/sdks/universal/README.md)
266
+
267
+ * [portfolio](docs/sdks/universal/README.md#portfolio) - List user portfolio
268
+ * [visualize_portfolio](docs/sdks/universal/README.md#visualize_portfolio) - Visualize user portfolio
269
+ * [price_usd](docs/sdks/universal/README.md#price_usd) - Token price
270
+ * [supported_tokens](docs/sdks/universal/README.md#supported_tokens) - List supported tokens
271
+ * [balance](docs/sdks/universal/README.md#balance) - User Token Balance
272
+ * [allowance](docs/sdks/universal/README.md#allowance) - Get allowance - Protocol
273
+ * [ens](docs/sdks/universal/README.md#ens) - Resolve ENS
274
+ * [wrap_eth](docs/sdks/universal/README.md#wrap_eth) - Wrap ETH
275
+ * [unwrap_weth](docs/sdks/universal/README.md#unwrap_weth) - Unwrap WETH
276
+ * [transfer_erc20](docs/sdks/universal/README.md#transfer_erc20) - Transfer Token
277
+ * [transfer_native_token](docs/sdks/universal/README.md#transfer_native_token) - Transfer ETH
278
+ * [allowance_set](docs/sdks/universal/README.md#allowance_set) - Set Allowance - Protocol
279
+
280
+ </details>
281
+ <!-- End Available Resources and Operations [operations] -->
282
+
283
+ <!-- Start Retries [retries] -->
284
+ ## Retries
285
+
286
+ 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.
287
+
288
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
289
+ ```python
290
+ from compass_api_sdk import CompassAPISDK
291
+ from compass_api_sdk.utils import BackoffStrategy, RetryConfig
292
+
293
+
294
+ with CompassAPISDK(
295
+ api_key_auth="<YOUR_API_KEY_HERE>",
296
+ ) as cas_client:
297
+
298
+ res = cas_client.aave_v3.token_price(,
299
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
300
+
301
+ # Handle response
302
+ print(res)
303
+
304
+ ```
305
+
306
+ 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:
307
+ ```python
308
+ from compass_api_sdk import CompassAPISDK
309
+ from compass_api_sdk.utils import BackoffStrategy, RetryConfig
310
+
311
+
312
+ with CompassAPISDK(
313
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
314
+ api_key_auth="<YOUR_API_KEY_HERE>",
315
+ ) as cas_client:
316
+
317
+ res = cas_client.aave_v3.token_price()
318
+
319
+ # Handle response
320
+ print(res)
321
+
322
+ ```
323
+ <!-- End Retries [retries] -->
324
+
325
+ <!-- Start Error Handling [errors] -->
326
+ ## Error Handling
327
+
328
+ Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
329
+
330
+ By default, an API error will raise a errors.APIError exception, which has the following properties:
331
+
332
+ | Property | Type | Description |
333
+ |-----------------|------------------|-----------------------|
334
+ | `.status_code` | *int* | The HTTP status code |
335
+ | `.message` | *str* | The error message |
336
+ | `.raw_response` | *httpx.Response* | The raw HTTP response |
337
+ | `.body` | *str* | The response content |
338
+
339
+ 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 `token_price_async` method may raise the following exceptions:
340
+
341
+ | Error Type | Status Code | Content Type |
342
+ | -------------------------- | ----------- | ---------------- |
343
+ | errors.HTTPValidationError | 422 | application/json |
344
+ | errors.APIError | 4XX, 5XX | \*/\* |
345
+
346
+ ### Example
347
+
348
+ ```python
349
+ from compass_api_sdk import CompassAPISDK, errors
350
+
351
+
352
+ with CompassAPISDK(
353
+ api_key_auth="<YOUR_API_KEY_HERE>",
354
+ ) as cas_client:
355
+ res = None
356
+ try:
357
+
358
+ res = cas_client.aave_v3.token_price()
359
+
360
+ # Handle response
361
+ print(res)
362
+
363
+ except errors.HTTPValidationError as e:
364
+ # handle e.data: errors.HTTPValidationErrorData
365
+ raise(e)
366
+ except errors.APIError as e:
367
+ # handle exception
368
+ raise(e)
369
+ ```
370
+ <!-- End Error Handling [errors] -->
371
+
372
+ <!-- Start Server Selection [server] -->
373
+ ## Server Selection
374
+
375
+ ### Override Server URL Per-Client
376
+
377
+ 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:
378
+ ```python
379
+ from compass_api_sdk import CompassAPISDK
380
+
381
+
382
+ with CompassAPISDK(
383
+ server_url="https://api.compasslabs.ai",
384
+ api_key_auth="<YOUR_API_KEY_HERE>",
385
+ ) as cas_client:
386
+
387
+ res = cas_client.aave_v3.token_price()
388
+
389
+ # Handle response
390
+ print(res)
391
+
392
+ ```
393
+ <!-- End Server Selection [server] -->
394
+
395
+ <!-- Start Custom HTTP Client [http-client] -->
396
+ ## Custom HTTP Client
397
+
398
+ 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.
399
+ 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.
400
+ 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.
401
+
402
+ For example, you could specify a header for every request that this sdk makes as follows:
403
+ ```python
404
+ from compass_api_sdk import CompassAPISDK
405
+ import httpx
406
+
407
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
408
+ s = CompassAPISDK(client=http_client)
409
+ ```
410
+
411
+ or you could wrap the client with your own custom logic:
412
+ ```python
413
+ from compass_api_sdk import CompassAPISDK
414
+ from compass_api_sdk.httpclient import AsyncHttpClient
415
+ import httpx
416
+
417
+ class CustomClient(AsyncHttpClient):
418
+ client: AsyncHttpClient
419
+
420
+ def __init__(self, client: AsyncHttpClient):
421
+ self.client = client
422
+
423
+ async def send(
424
+ self,
425
+ request: httpx.Request,
426
+ *,
427
+ stream: bool = False,
428
+ auth: Union[
429
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
430
+ ] = httpx.USE_CLIENT_DEFAULT,
431
+ follow_redirects: Union[
432
+ bool, httpx._client.UseClientDefault
433
+ ] = httpx.USE_CLIENT_DEFAULT,
434
+ ) -> httpx.Response:
435
+ request.headers["Client-Level-Header"] = "added by client"
436
+
437
+ return await self.client.send(
438
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
439
+ )
440
+
441
+ def build_request(
442
+ self,
443
+ method: str,
444
+ url: httpx._types.URLTypes,
445
+ *,
446
+ content: Optional[httpx._types.RequestContent] = None,
447
+ data: Optional[httpx._types.RequestData] = None,
448
+ files: Optional[httpx._types.RequestFiles] = None,
449
+ json: Optional[Any] = None,
450
+ params: Optional[httpx._types.QueryParamTypes] = None,
451
+ headers: Optional[httpx._types.HeaderTypes] = None,
452
+ cookies: Optional[httpx._types.CookieTypes] = None,
453
+ timeout: Union[
454
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
455
+ ] = httpx.USE_CLIENT_DEFAULT,
456
+ extensions: Optional[httpx._types.RequestExtensions] = None,
457
+ ) -> httpx.Request:
458
+ return self.client.build_request(
459
+ method,
460
+ url,
461
+ content=content,
462
+ data=data,
463
+ files=files,
464
+ json=json,
465
+ params=params,
466
+ headers=headers,
467
+ cookies=cookies,
468
+ timeout=timeout,
469
+ extensions=extensions,
470
+ )
471
+
472
+ s = CompassAPISDK(async_client=CustomClient(httpx.AsyncClient()))
473
+ ```
474
+ <!-- End Custom HTTP Client [http-client] -->
475
+
476
+ <!-- Start Resource Management [resource-management] -->
477
+ ## Resource Management
478
+
479
+ The `CompassAPISDK` 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.
480
+
481
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
482
+
483
+ ```python
484
+ from compass_api_sdk import CompassAPISDK
485
+ def main():
486
+
487
+ with CompassAPISDK(
488
+ api_key_auth="<YOUR_API_KEY_HERE>",
489
+ ) as cas_client:
490
+ # Rest of application here...
491
+
492
+
493
+ # Or when using async:
494
+ async def amain():
495
+
496
+ async with CompassAPISDK(
497
+ api_key_auth="<YOUR_API_KEY_HERE>",
498
+ ) as cas_client:
499
+ # Rest of application here...
500
+ ```
501
+ <!-- End Resource Management [resource-management] -->
502
+
503
+ <!-- Start Debugging [debug] -->
504
+ ## Debugging
505
+
506
+ You can setup your SDK to emit debug logs for SDK requests and responses.
507
+
508
+ You can pass your own logger class directly into your SDK.
509
+ ```python
510
+ from compass_api_sdk import CompassAPISDK
511
+ import logging
512
+
513
+ logging.basicConfig(level=logging.DEBUG)
514
+ s = CompassAPISDK(debug_logger=logging.getLogger("compass_api_sdk"))
515
+ ```
516
+ <!-- End Debugging [debug] -->
517
+
518
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
519
+
520
+ # Development
521
+
522
+ ## Maturity
523
+
524
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
525
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
526
+ looking for the latest version.
527
+
528
+ ## Contributions
529
+
530
+ 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.
531
+ 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.
532
+
533
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=compass-api-sdk&utm_campaign=python)
534
+