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
@@ -0,0 +1,1192 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from compass_api_sdk import errors, models, utils
5
+ from compass_api_sdk._hooks import HookContext
6
+ from compass_api_sdk.types import OptionalNullable, UNSET
7
+ from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
8
+ from typing import Any, Mapping, Optional, Union
9
+
10
+
11
+ class Token(BaseSDK):
12
+ def token_price(
13
+ self,
14
+ *,
15
+ chain: models.V1TokenPriceChain,
16
+ token: str,
17
+ block: OptionalNullable[int] = UNSET,
18
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
+ server_url: Optional[str] = None,
20
+ timeout_ms: Optional[int] = None,
21
+ http_headers: Optional[Mapping[str, str]] = None,
22
+ ) -> models.TokenPriceResponse:
23
+ r"""Token Price
24
+
25
+ Retrieves the price of a token in USD.
26
+
27
+ :param chain:
28
+ :param token: The symbol or address of the token for which to get the price..
29
+ :param block: Optional block number (defaults to latest).
30
+ :param retries: Override the default retry configuration for this method
31
+ :param server_url: Override the default server URL for this method
32
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
33
+ :param http_headers: Additional headers to set or replace on requests.
34
+ """
35
+ base_url = None
36
+ url_variables = None
37
+ if timeout_ms is None:
38
+ timeout_ms = self.sdk_configuration.timeout_ms
39
+
40
+ if server_url is not None:
41
+ base_url = server_url
42
+ else:
43
+ base_url = self._get_url(base_url, url_variables)
44
+
45
+ request = models.V1TokenPriceRequest(
46
+ chain=chain,
47
+ block=block,
48
+ token=token,
49
+ )
50
+
51
+ req = self._build_request(
52
+ method="GET",
53
+ path="/v1/token/price",
54
+ base_url=base_url,
55
+ url_variables=url_variables,
56
+ request=request,
57
+ request_body_required=False,
58
+ request_has_path_params=False,
59
+ request_has_query_params=True,
60
+ user_agent_header="user-agent",
61
+ accept_header_value="application/json",
62
+ http_headers=http_headers,
63
+ security=self.sdk_configuration.security,
64
+ allow_empty_value=None,
65
+ timeout_ms=timeout_ms,
66
+ )
67
+
68
+ if retries == UNSET:
69
+ if self.sdk_configuration.retry_config is not UNSET:
70
+ retries = self.sdk_configuration.retry_config
71
+
72
+ retry_config = None
73
+ if isinstance(retries, utils.RetryConfig):
74
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
75
+
76
+ http_res = self.do_request(
77
+ hook_ctx=HookContext(
78
+ config=self.sdk_configuration,
79
+ base_url=base_url or "",
80
+ operation_id="v1_token_price",
81
+ oauth2_scopes=None,
82
+ security_source=self.sdk_configuration.security,
83
+ ),
84
+ request=req,
85
+ error_status_codes=["422", "4XX", "5XX"],
86
+ retry_config=retry_config,
87
+ )
88
+
89
+ response_data: Any = None
90
+ if utils.match_response(http_res, "200", "application/json"):
91
+ return unmarshal_json_response(models.TokenPriceResponse, http_res)
92
+ if utils.match_response(http_res, "422", "application/json"):
93
+ response_data = unmarshal_json_response(
94
+ errors.HTTPValidationErrorData, http_res
95
+ )
96
+ raise errors.HTTPValidationError(response_data, http_res)
97
+ if utils.match_response(http_res, "4XX", "*"):
98
+ http_res_text = utils.stream_to_text(http_res)
99
+ raise errors.APIError("API error occurred", http_res, http_res_text)
100
+ if utils.match_response(http_res, "5XX", "*"):
101
+ http_res_text = utils.stream_to_text(http_res)
102
+ raise errors.APIError("API error occurred", http_res, http_res_text)
103
+
104
+ raise errors.APIError("Unexpected response received", http_res)
105
+
106
+ async def token_price_async(
107
+ self,
108
+ *,
109
+ chain: models.V1TokenPriceChain,
110
+ token: str,
111
+ block: OptionalNullable[int] = UNSET,
112
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
113
+ server_url: Optional[str] = None,
114
+ timeout_ms: Optional[int] = None,
115
+ http_headers: Optional[Mapping[str, str]] = None,
116
+ ) -> models.TokenPriceResponse:
117
+ r"""Token Price
118
+
119
+ Retrieves the price of a token in USD.
120
+
121
+ :param chain:
122
+ :param token: The symbol or address of the token for which to get the price..
123
+ :param block: Optional block number (defaults to latest).
124
+ :param retries: Override the default retry configuration for this method
125
+ :param server_url: Override the default server URL for this method
126
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
127
+ :param http_headers: Additional headers to set or replace on requests.
128
+ """
129
+ base_url = None
130
+ url_variables = None
131
+ if timeout_ms is None:
132
+ timeout_ms = self.sdk_configuration.timeout_ms
133
+
134
+ if server_url is not None:
135
+ base_url = server_url
136
+ else:
137
+ base_url = self._get_url(base_url, url_variables)
138
+
139
+ request = models.V1TokenPriceRequest(
140
+ chain=chain,
141
+ block=block,
142
+ token=token,
143
+ )
144
+
145
+ req = self._build_request_async(
146
+ method="GET",
147
+ path="/v1/token/price",
148
+ base_url=base_url,
149
+ url_variables=url_variables,
150
+ request=request,
151
+ request_body_required=False,
152
+ request_has_path_params=False,
153
+ request_has_query_params=True,
154
+ user_agent_header="user-agent",
155
+ accept_header_value="application/json",
156
+ http_headers=http_headers,
157
+ security=self.sdk_configuration.security,
158
+ allow_empty_value=None,
159
+ timeout_ms=timeout_ms,
160
+ )
161
+
162
+ if retries == UNSET:
163
+ if self.sdk_configuration.retry_config is not UNSET:
164
+ retries = self.sdk_configuration.retry_config
165
+
166
+ retry_config = None
167
+ if isinstance(retries, utils.RetryConfig):
168
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
169
+
170
+ http_res = await self.do_request_async(
171
+ hook_ctx=HookContext(
172
+ config=self.sdk_configuration,
173
+ base_url=base_url or "",
174
+ operation_id="v1_token_price",
175
+ oauth2_scopes=None,
176
+ security_source=self.sdk_configuration.security,
177
+ ),
178
+ request=req,
179
+ error_status_codes=["422", "4XX", "5XX"],
180
+ retry_config=retry_config,
181
+ )
182
+
183
+ response_data: Any = None
184
+ if utils.match_response(http_res, "200", "application/json"):
185
+ return unmarshal_json_response(models.TokenPriceResponse, http_res)
186
+ if utils.match_response(http_res, "422", "application/json"):
187
+ response_data = unmarshal_json_response(
188
+ errors.HTTPValidationErrorData, http_res
189
+ )
190
+ raise errors.HTTPValidationError(response_data, http_res)
191
+ if utils.match_response(http_res, "4XX", "*"):
192
+ http_res_text = await utils.stream_to_text_async(http_res)
193
+ raise errors.APIError("API error occurred", http_res, http_res_text)
194
+ if utils.match_response(http_res, "5XX", "*"):
195
+ http_res_text = await utils.stream_to_text_async(http_res)
196
+ raise errors.APIError("API error occurred", http_res, http_res_text)
197
+
198
+ raise errors.APIError("Unexpected response received", http_res)
199
+
200
+ def token_balance(
201
+ self,
202
+ *,
203
+ chain: models.V1TokenBalanceChain,
204
+ user: str,
205
+ token: str,
206
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
207
+ server_url: Optional[str] = None,
208
+ timeout_ms: Optional[int] = None,
209
+ http_headers: Optional[Mapping[str, str]] = None,
210
+ ) -> models.TokenBalanceResponse:
211
+ r"""Token Balance
212
+
213
+ Returns the balance of a specific ERC20 token for a given user address.
214
+
215
+ :param chain:
216
+ :param user: The user to get the token balance of.
217
+ :param token: The symbol or address of the token for which the balance is checked.
218
+ :param retries: Override the default retry configuration for this method
219
+ :param server_url: Override the default server URL for this method
220
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
221
+ :param http_headers: Additional headers to set or replace on requests.
222
+ """
223
+ base_url = None
224
+ url_variables = None
225
+ if timeout_ms is None:
226
+ timeout_ms = self.sdk_configuration.timeout_ms
227
+
228
+ if server_url is not None:
229
+ base_url = server_url
230
+ else:
231
+ base_url = self._get_url(base_url, url_variables)
232
+
233
+ request = models.V1TokenBalanceRequest(
234
+ chain=chain,
235
+ user=user,
236
+ token=token,
237
+ )
238
+
239
+ req = self._build_request(
240
+ method="GET",
241
+ path="/v1/token/balance",
242
+ base_url=base_url,
243
+ url_variables=url_variables,
244
+ request=request,
245
+ request_body_required=False,
246
+ request_has_path_params=False,
247
+ request_has_query_params=True,
248
+ user_agent_header="user-agent",
249
+ accept_header_value="application/json",
250
+ http_headers=http_headers,
251
+ security=self.sdk_configuration.security,
252
+ allow_empty_value=None,
253
+ timeout_ms=timeout_ms,
254
+ )
255
+
256
+ if retries == UNSET:
257
+ if self.sdk_configuration.retry_config is not UNSET:
258
+ retries = self.sdk_configuration.retry_config
259
+
260
+ retry_config = None
261
+ if isinstance(retries, utils.RetryConfig):
262
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
263
+
264
+ http_res = self.do_request(
265
+ hook_ctx=HookContext(
266
+ config=self.sdk_configuration,
267
+ base_url=base_url or "",
268
+ operation_id="v1_token_balance",
269
+ oauth2_scopes=None,
270
+ security_source=self.sdk_configuration.security,
271
+ ),
272
+ request=req,
273
+ error_status_codes=["422", "4XX", "5XX"],
274
+ retry_config=retry_config,
275
+ )
276
+
277
+ response_data: Any = None
278
+ if utils.match_response(http_res, "200", "application/json"):
279
+ return unmarshal_json_response(models.TokenBalanceResponse, http_res)
280
+ if utils.match_response(http_res, "422", "application/json"):
281
+ response_data = unmarshal_json_response(
282
+ errors.HTTPValidationErrorData, http_res
283
+ )
284
+ raise errors.HTTPValidationError(response_data, http_res)
285
+ if utils.match_response(http_res, "4XX", "*"):
286
+ http_res_text = utils.stream_to_text(http_res)
287
+ raise errors.APIError("API error occurred", http_res, http_res_text)
288
+ if utils.match_response(http_res, "5XX", "*"):
289
+ http_res_text = utils.stream_to_text(http_res)
290
+ raise errors.APIError("API error occurred", http_res, http_res_text)
291
+
292
+ raise errors.APIError("Unexpected response received", http_res)
293
+
294
+ async def token_balance_async(
295
+ self,
296
+ *,
297
+ chain: models.V1TokenBalanceChain,
298
+ user: str,
299
+ token: str,
300
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
301
+ server_url: Optional[str] = None,
302
+ timeout_ms: Optional[int] = None,
303
+ http_headers: Optional[Mapping[str, str]] = None,
304
+ ) -> models.TokenBalanceResponse:
305
+ r"""Token Balance
306
+
307
+ Returns the balance of a specific ERC20 token for a given user address.
308
+
309
+ :param chain:
310
+ :param user: The user to get the token balance of.
311
+ :param token: The symbol or address of the token for which the balance is checked.
312
+ :param retries: Override the default retry configuration for this method
313
+ :param server_url: Override the default server URL for this method
314
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
315
+ :param http_headers: Additional headers to set or replace on requests.
316
+ """
317
+ base_url = None
318
+ url_variables = None
319
+ if timeout_ms is None:
320
+ timeout_ms = self.sdk_configuration.timeout_ms
321
+
322
+ if server_url is not None:
323
+ base_url = server_url
324
+ else:
325
+ base_url = self._get_url(base_url, url_variables)
326
+
327
+ request = models.V1TokenBalanceRequest(
328
+ chain=chain,
329
+ user=user,
330
+ token=token,
331
+ )
332
+
333
+ req = self._build_request_async(
334
+ method="GET",
335
+ path="/v1/token/balance",
336
+ base_url=base_url,
337
+ url_variables=url_variables,
338
+ request=request,
339
+ request_body_required=False,
340
+ request_has_path_params=False,
341
+ request_has_query_params=True,
342
+ user_agent_header="user-agent",
343
+ accept_header_value="application/json",
344
+ http_headers=http_headers,
345
+ security=self.sdk_configuration.security,
346
+ allow_empty_value=None,
347
+ timeout_ms=timeout_ms,
348
+ )
349
+
350
+ if retries == UNSET:
351
+ if self.sdk_configuration.retry_config is not UNSET:
352
+ retries = self.sdk_configuration.retry_config
353
+
354
+ retry_config = None
355
+ if isinstance(retries, utils.RetryConfig):
356
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
357
+
358
+ http_res = await self.do_request_async(
359
+ hook_ctx=HookContext(
360
+ config=self.sdk_configuration,
361
+ base_url=base_url or "",
362
+ operation_id="v1_token_balance",
363
+ oauth2_scopes=None,
364
+ security_source=self.sdk_configuration.security,
365
+ ),
366
+ request=req,
367
+ error_status_codes=["422", "4XX", "5XX"],
368
+ retry_config=retry_config,
369
+ )
370
+
371
+ response_data: Any = None
372
+ if utils.match_response(http_res, "200", "application/json"):
373
+ return unmarshal_json_response(models.TokenBalanceResponse, http_res)
374
+ if utils.match_response(http_res, "422", "application/json"):
375
+ response_data = unmarshal_json_response(
376
+ errors.HTTPValidationErrorData, http_res
377
+ )
378
+ raise errors.HTTPValidationError(response_data, http_res)
379
+ if utils.match_response(http_res, "4XX", "*"):
380
+ http_res_text = await utils.stream_to_text_async(http_res)
381
+ raise errors.APIError("API error occurred", http_res, http_res_text)
382
+ if utils.match_response(http_res, "5XX", "*"):
383
+ http_res_text = await utils.stream_to_text_async(http_res)
384
+ raise errors.APIError("API error occurred", http_res, http_res_text)
385
+
386
+ raise errors.APIError("Unexpected response received", http_res)
387
+
388
+ def token_list(
389
+ self,
390
+ *,
391
+ chain: models.V1TokenListChain,
392
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
393
+ server_url: Optional[str] = None,
394
+ timeout_ms: Optional[int] = None,
395
+ http_headers: Optional[Mapping[str, str]] = None,
396
+ ) -> models.TokenListResponse:
397
+ r"""List known tokens
398
+
399
+ Returns a list of known tokens.
400
+
401
+ :param chain:
402
+ :param retries: Override the default retry configuration for this method
403
+ :param server_url: Override the default server URL for this method
404
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
405
+ :param http_headers: Additional headers to set or replace on requests.
406
+ """
407
+ base_url = None
408
+ url_variables = None
409
+ if timeout_ms is None:
410
+ timeout_ms = self.sdk_configuration.timeout_ms
411
+
412
+ if server_url is not None:
413
+ base_url = server_url
414
+ else:
415
+ base_url = self._get_url(base_url, url_variables)
416
+
417
+ request = models.V1TokenListRequest(
418
+ chain=chain,
419
+ )
420
+
421
+ req = self._build_request(
422
+ method="GET",
423
+ path="/v1/token/list",
424
+ base_url=base_url,
425
+ url_variables=url_variables,
426
+ request=request,
427
+ request_body_required=False,
428
+ request_has_path_params=False,
429
+ request_has_query_params=True,
430
+ user_agent_header="user-agent",
431
+ accept_header_value="application/json",
432
+ http_headers=http_headers,
433
+ security=self.sdk_configuration.security,
434
+ allow_empty_value=None,
435
+ timeout_ms=timeout_ms,
436
+ )
437
+
438
+ if retries == UNSET:
439
+ if self.sdk_configuration.retry_config is not UNSET:
440
+ retries = self.sdk_configuration.retry_config
441
+
442
+ retry_config = None
443
+ if isinstance(retries, utils.RetryConfig):
444
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
445
+
446
+ http_res = self.do_request(
447
+ hook_ctx=HookContext(
448
+ config=self.sdk_configuration,
449
+ base_url=base_url or "",
450
+ operation_id="v1_token_list",
451
+ oauth2_scopes=None,
452
+ security_source=self.sdk_configuration.security,
453
+ ),
454
+ request=req,
455
+ error_status_codes=["422", "4XX", "5XX"],
456
+ retry_config=retry_config,
457
+ )
458
+
459
+ response_data: Any = None
460
+ if utils.match_response(http_res, "200", "application/json"):
461
+ return unmarshal_json_response(models.TokenListResponse, http_res)
462
+ if utils.match_response(http_res, "422", "application/json"):
463
+ response_data = unmarshal_json_response(
464
+ errors.HTTPValidationErrorData, http_res
465
+ )
466
+ raise errors.HTTPValidationError(response_data, http_res)
467
+ if utils.match_response(http_res, "4XX", "*"):
468
+ http_res_text = utils.stream_to_text(http_res)
469
+ raise errors.APIError("API error occurred", http_res, http_res_text)
470
+ if utils.match_response(http_res, "5XX", "*"):
471
+ http_res_text = utils.stream_to_text(http_res)
472
+ raise errors.APIError("API error occurred", http_res, http_res_text)
473
+
474
+ raise errors.APIError("Unexpected response received", http_res)
475
+
476
+ async def token_list_async(
477
+ self,
478
+ *,
479
+ chain: models.V1TokenListChain,
480
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
481
+ server_url: Optional[str] = None,
482
+ timeout_ms: Optional[int] = None,
483
+ http_headers: Optional[Mapping[str, str]] = None,
484
+ ) -> models.TokenListResponse:
485
+ r"""List known tokens
486
+
487
+ Returns a list of known tokens.
488
+
489
+ :param chain:
490
+ :param retries: Override the default retry configuration for this method
491
+ :param server_url: Override the default server URL for this method
492
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
493
+ :param http_headers: Additional headers to set or replace on requests.
494
+ """
495
+ base_url = None
496
+ url_variables = None
497
+ if timeout_ms is None:
498
+ timeout_ms = self.sdk_configuration.timeout_ms
499
+
500
+ if server_url is not None:
501
+ base_url = server_url
502
+ else:
503
+ base_url = self._get_url(base_url, url_variables)
504
+
505
+ request = models.V1TokenListRequest(
506
+ chain=chain,
507
+ )
508
+
509
+ req = self._build_request_async(
510
+ method="GET",
511
+ path="/v1/token/list",
512
+ base_url=base_url,
513
+ url_variables=url_variables,
514
+ request=request,
515
+ request_body_required=False,
516
+ request_has_path_params=False,
517
+ request_has_query_params=True,
518
+ user_agent_header="user-agent",
519
+ accept_header_value="application/json",
520
+ http_headers=http_headers,
521
+ security=self.sdk_configuration.security,
522
+ allow_empty_value=None,
523
+ timeout_ms=timeout_ms,
524
+ )
525
+
526
+ if retries == UNSET:
527
+ if self.sdk_configuration.retry_config is not UNSET:
528
+ retries = self.sdk_configuration.retry_config
529
+
530
+ retry_config = None
531
+ if isinstance(retries, utils.RetryConfig):
532
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
533
+
534
+ http_res = await self.do_request_async(
535
+ hook_ctx=HookContext(
536
+ config=self.sdk_configuration,
537
+ base_url=base_url or "",
538
+ operation_id="v1_token_list",
539
+ oauth2_scopes=None,
540
+ security_source=self.sdk_configuration.security,
541
+ ),
542
+ request=req,
543
+ error_status_codes=["422", "4XX", "5XX"],
544
+ retry_config=retry_config,
545
+ )
546
+
547
+ response_data: Any = None
548
+ if utils.match_response(http_res, "200", "application/json"):
549
+ return unmarshal_json_response(models.TokenListResponse, http_res)
550
+ if utils.match_response(http_res, "422", "application/json"):
551
+ response_data = unmarshal_json_response(
552
+ errors.HTTPValidationErrorData, http_res
553
+ )
554
+ raise errors.HTTPValidationError(response_data, http_res)
555
+ if utils.match_response(http_res, "4XX", "*"):
556
+ http_res_text = await utils.stream_to_text_async(http_res)
557
+ raise errors.APIError("API error occurred", http_res, http_res_text)
558
+ if utils.match_response(http_res, "5XX", "*"):
559
+ http_res_text = await utils.stream_to_text_async(http_res)
560
+ raise errors.APIError("API error occurred", http_res, http_res_text)
561
+
562
+ raise errors.APIError("Unexpected response received", http_res)
563
+
564
+ def token_transfer(
565
+ self,
566
+ *,
567
+ to: str,
568
+ token: str,
569
+ amount: Union[
570
+ models.TokenTransferRequestAmount,
571
+ models.TokenTransferRequestAmountTypedDict,
572
+ ],
573
+ chain: models.TokenTransferRequestChain,
574
+ sender: str,
575
+ estimate_gas: Optional[bool] = None,
576
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
577
+ server_url: Optional[str] = None,
578
+ timeout_ms: Optional[int] = None,
579
+ http_headers: Optional[Mapping[str, str]] = None,
580
+ ) -> models.TransactionResponse:
581
+ r"""Transfer Tokens
582
+
583
+ Sends native ETH or ERC20 tokens from the sender's address to another address.
584
+
585
+ :param to: The recipient of the tokens.
586
+ :param token: The symbol or address of the token to transfer.
587
+ :param amount: Amount of token to transfer
588
+ :param chain:
589
+ :param sender: The address of the transaction sender.
590
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
591
+ :param retries: Override the default retry configuration for this method
592
+ :param server_url: Override the default server URL for this method
593
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
594
+ :param http_headers: Additional headers to set or replace on requests.
595
+ """
596
+ base_url = None
597
+ url_variables = None
598
+ if timeout_ms is None:
599
+ timeout_ms = self.sdk_configuration.timeout_ms
600
+
601
+ if server_url is not None:
602
+ base_url = server_url
603
+ else:
604
+ base_url = self._get_url(base_url, url_variables)
605
+
606
+ request = models.TokenTransferRequest(
607
+ to=to,
608
+ token=token,
609
+ amount=amount,
610
+ chain=chain,
611
+ sender=sender,
612
+ estimate_gas=estimate_gas,
613
+ )
614
+
615
+ req = self._build_request(
616
+ method="POST",
617
+ path="/v1/token/transfer",
618
+ base_url=base_url,
619
+ url_variables=url_variables,
620
+ request=request,
621
+ request_body_required=True,
622
+ request_has_path_params=False,
623
+ request_has_query_params=True,
624
+ user_agent_header="user-agent",
625
+ accept_header_value="application/json",
626
+ http_headers=http_headers,
627
+ security=self.sdk_configuration.security,
628
+ get_serialized_body=lambda: utils.serialize_request_body(
629
+ request, False, False, "json", models.TokenTransferRequest
630
+ ),
631
+ allow_empty_value=None,
632
+ timeout_ms=timeout_ms,
633
+ )
634
+
635
+ if retries == UNSET:
636
+ if self.sdk_configuration.retry_config is not UNSET:
637
+ retries = self.sdk_configuration.retry_config
638
+
639
+ retry_config = None
640
+ if isinstance(retries, utils.RetryConfig):
641
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
642
+
643
+ http_res = self.do_request(
644
+ hook_ctx=HookContext(
645
+ config=self.sdk_configuration,
646
+ base_url=base_url or "",
647
+ operation_id="v1_token_transfer",
648
+ oauth2_scopes=None,
649
+ security_source=self.sdk_configuration.security,
650
+ ),
651
+ request=req,
652
+ error_status_codes=["422", "4XX", "5XX"],
653
+ retry_config=retry_config,
654
+ )
655
+
656
+ response_data: Any = None
657
+ if utils.match_response(http_res, "200", "application/json"):
658
+ return unmarshal_json_response(models.TransactionResponse, http_res)
659
+ if utils.match_response(http_res, "422", "application/json"):
660
+ response_data = unmarshal_json_response(
661
+ errors.HTTPValidationErrorData, http_res
662
+ )
663
+ raise errors.HTTPValidationError(response_data, http_res)
664
+ if utils.match_response(http_res, "4XX", "*"):
665
+ http_res_text = utils.stream_to_text(http_res)
666
+ raise errors.APIError("API error occurred", http_res, http_res_text)
667
+ if utils.match_response(http_res, "5XX", "*"):
668
+ http_res_text = utils.stream_to_text(http_res)
669
+ raise errors.APIError("API error occurred", http_res, http_res_text)
670
+
671
+ raise errors.APIError("Unexpected response received", http_res)
672
+
673
+ async def token_transfer_async(
674
+ self,
675
+ *,
676
+ to: str,
677
+ token: str,
678
+ amount: Union[
679
+ models.TokenTransferRequestAmount,
680
+ models.TokenTransferRequestAmountTypedDict,
681
+ ],
682
+ chain: models.TokenTransferRequestChain,
683
+ sender: str,
684
+ estimate_gas: Optional[bool] = None,
685
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
686
+ server_url: Optional[str] = None,
687
+ timeout_ms: Optional[int] = None,
688
+ http_headers: Optional[Mapping[str, str]] = None,
689
+ ) -> models.TransactionResponse:
690
+ r"""Transfer Tokens
691
+
692
+ Sends native ETH or ERC20 tokens from the sender's address to another address.
693
+
694
+ :param to: The recipient of the tokens.
695
+ :param token: The symbol or address of the token to transfer.
696
+ :param amount: Amount of token to transfer
697
+ :param chain:
698
+ :param sender: The address of the transaction sender.
699
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
700
+ :param retries: Override the default retry configuration for this method
701
+ :param server_url: Override the default server URL for this method
702
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
703
+ :param http_headers: Additional headers to set or replace on requests.
704
+ """
705
+ base_url = None
706
+ url_variables = None
707
+ if timeout_ms is None:
708
+ timeout_ms = self.sdk_configuration.timeout_ms
709
+
710
+ if server_url is not None:
711
+ base_url = server_url
712
+ else:
713
+ base_url = self._get_url(base_url, url_variables)
714
+
715
+ request = models.TokenTransferRequest(
716
+ to=to,
717
+ token=token,
718
+ amount=amount,
719
+ chain=chain,
720
+ sender=sender,
721
+ estimate_gas=estimate_gas,
722
+ )
723
+
724
+ req = self._build_request_async(
725
+ method="POST",
726
+ path="/v1/token/transfer",
727
+ base_url=base_url,
728
+ url_variables=url_variables,
729
+ request=request,
730
+ request_body_required=True,
731
+ request_has_path_params=False,
732
+ request_has_query_params=True,
733
+ user_agent_header="user-agent",
734
+ accept_header_value="application/json",
735
+ http_headers=http_headers,
736
+ security=self.sdk_configuration.security,
737
+ get_serialized_body=lambda: utils.serialize_request_body(
738
+ request, False, False, "json", models.TokenTransferRequest
739
+ ),
740
+ allow_empty_value=None,
741
+ timeout_ms=timeout_ms,
742
+ )
743
+
744
+ if retries == UNSET:
745
+ if self.sdk_configuration.retry_config is not UNSET:
746
+ retries = self.sdk_configuration.retry_config
747
+
748
+ retry_config = None
749
+ if isinstance(retries, utils.RetryConfig):
750
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
751
+
752
+ http_res = await self.do_request_async(
753
+ hook_ctx=HookContext(
754
+ config=self.sdk_configuration,
755
+ base_url=base_url or "",
756
+ operation_id="v1_token_transfer",
757
+ oauth2_scopes=None,
758
+ security_source=self.sdk_configuration.security,
759
+ ),
760
+ request=req,
761
+ error_status_codes=["422", "4XX", "5XX"],
762
+ retry_config=retry_config,
763
+ )
764
+
765
+ response_data: Any = None
766
+ if utils.match_response(http_res, "200", "application/json"):
767
+ return unmarshal_json_response(models.TransactionResponse, http_res)
768
+ if utils.match_response(http_res, "422", "application/json"):
769
+ response_data = unmarshal_json_response(
770
+ errors.HTTPValidationErrorData, http_res
771
+ )
772
+ raise errors.HTTPValidationError(response_data, http_res)
773
+ if utils.match_response(http_res, "4XX", "*"):
774
+ http_res_text = await utils.stream_to_text_async(http_res)
775
+ raise errors.APIError("API error occurred", http_res, http_res_text)
776
+ if utils.match_response(http_res, "5XX", "*"):
777
+ http_res_text = await utils.stream_to_text_async(http_res)
778
+ raise errors.APIError("API error occurred", http_res, http_res_text)
779
+
780
+ raise errors.APIError("Unexpected response received", http_res)
781
+
782
+ def token_wrap_eth(
783
+ self,
784
+ *,
785
+ amount: Union[
786
+ models.WrapEthRequestAmount, models.WrapEthRequestAmountTypedDict
787
+ ],
788
+ chain: models.WrapEthRequestChain,
789
+ sender: str,
790
+ estimate_gas: Optional[bool] = None,
791
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
792
+ server_url: Optional[str] = None,
793
+ timeout_ms: Optional[int] = None,
794
+ http_headers: Optional[Mapping[str, str]] = None,
795
+ ) -> models.TransactionResponse:
796
+ r"""Wrap ETH
797
+
798
+ Wrapping ETH creates an ERC20 compliant form of ETH that is typically needed for
799
+ it to be traded on DeFi protocols.
800
+
801
+ :param amount: The amount of ETH to wrap.
802
+ :param chain:
803
+ :param sender: The address of the transaction sender.
804
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
805
+ :param retries: Override the default retry configuration for this method
806
+ :param server_url: Override the default server URL for this method
807
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
808
+ :param http_headers: Additional headers to set or replace on requests.
809
+ """
810
+ base_url = None
811
+ url_variables = None
812
+ if timeout_ms is None:
813
+ timeout_ms = self.sdk_configuration.timeout_ms
814
+
815
+ if server_url is not None:
816
+ base_url = server_url
817
+ else:
818
+ base_url = self._get_url(base_url, url_variables)
819
+
820
+ request = models.WrapEthRequest(
821
+ amount=amount,
822
+ chain=chain,
823
+ sender=sender,
824
+ estimate_gas=estimate_gas,
825
+ )
826
+
827
+ req = self._build_request(
828
+ method="POST",
829
+ path="/v1/token/wrap_eth",
830
+ base_url=base_url,
831
+ url_variables=url_variables,
832
+ request=request,
833
+ request_body_required=True,
834
+ request_has_path_params=False,
835
+ request_has_query_params=True,
836
+ user_agent_header="user-agent",
837
+ accept_header_value="application/json",
838
+ http_headers=http_headers,
839
+ security=self.sdk_configuration.security,
840
+ get_serialized_body=lambda: utils.serialize_request_body(
841
+ request, False, False, "json", models.WrapEthRequest
842
+ ),
843
+ allow_empty_value=None,
844
+ timeout_ms=timeout_ms,
845
+ )
846
+
847
+ if retries == UNSET:
848
+ if self.sdk_configuration.retry_config is not UNSET:
849
+ retries = self.sdk_configuration.retry_config
850
+
851
+ retry_config = None
852
+ if isinstance(retries, utils.RetryConfig):
853
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
854
+
855
+ http_res = self.do_request(
856
+ hook_ctx=HookContext(
857
+ config=self.sdk_configuration,
858
+ base_url=base_url or "",
859
+ operation_id="v1_token_wrap_eth",
860
+ oauth2_scopes=None,
861
+ security_source=self.sdk_configuration.security,
862
+ ),
863
+ request=req,
864
+ error_status_codes=["422", "4XX", "5XX"],
865
+ retry_config=retry_config,
866
+ )
867
+
868
+ response_data: Any = None
869
+ if utils.match_response(http_res, "200", "application/json"):
870
+ return unmarshal_json_response(models.TransactionResponse, http_res)
871
+ if utils.match_response(http_res, "422", "application/json"):
872
+ response_data = unmarshal_json_response(
873
+ errors.HTTPValidationErrorData, http_res
874
+ )
875
+ raise errors.HTTPValidationError(response_data, http_res)
876
+ if utils.match_response(http_res, "4XX", "*"):
877
+ http_res_text = utils.stream_to_text(http_res)
878
+ raise errors.APIError("API error occurred", http_res, http_res_text)
879
+ if utils.match_response(http_res, "5XX", "*"):
880
+ http_res_text = utils.stream_to_text(http_res)
881
+ raise errors.APIError("API error occurred", http_res, http_res_text)
882
+
883
+ raise errors.APIError("Unexpected response received", http_res)
884
+
885
+ async def token_wrap_eth_async(
886
+ self,
887
+ *,
888
+ amount: Union[
889
+ models.WrapEthRequestAmount, models.WrapEthRequestAmountTypedDict
890
+ ],
891
+ chain: models.WrapEthRequestChain,
892
+ sender: str,
893
+ estimate_gas: Optional[bool] = None,
894
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
895
+ server_url: Optional[str] = None,
896
+ timeout_ms: Optional[int] = None,
897
+ http_headers: Optional[Mapping[str, str]] = None,
898
+ ) -> models.TransactionResponse:
899
+ r"""Wrap ETH
900
+
901
+ Wrapping ETH creates an ERC20 compliant form of ETH that is typically needed for
902
+ it to be traded on DeFi protocols.
903
+
904
+ :param amount: The amount of ETH to wrap.
905
+ :param chain:
906
+ :param sender: The address of the transaction sender.
907
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
908
+ :param retries: Override the default retry configuration for this method
909
+ :param server_url: Override the default server URL for this method
910
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
911
+ :param http_headers: Additional headers to set or replace on requests.
912
+ """
913
+ base_url = None
914
+ url_variables = None
915
+ if timeout_ms is None:
916
+ timeout_ms = self.sdk_configuration.timeout_ms
917
+
918
+ if server_url is not None:
919
+ base_url = server_url
920
+ else:
921
+ base_url = self._get_url(base_url, url_variables)
922
+
923
+ request = models.WrapEthRequest(
924
+ amount=amount,
925
+ chain=chain,
926
+ sender=sender,
927
+ estimate_gas=estimate_gas,
928
+ )
929
+
930
+ req = self._build_request_async(
931
+ method="POST",
932
+ path="/v1/token/wrap_eth",
933
+ base_url=base_url,
934
+ url_variables=url_variables,
935
+ request=request,
936
+ request_body_required=True,
937
+ request_has_path_params=False,
938
+ request_has_query_params=True,
939
+ user_agent_header="user-agent",
940
+ accept_header_value="application/json",
941
+ http_headers=http_headers,
942
+ security=self.sdk_configuration.security,
943
+ get_serialized_body=lambda: utils.serialize_request_body(
944
+ request, False, False, "json", models.WrapEthRequest
945
+ ),
946
+ allow_empty_value=None,
947
+ timeout_ms=timeout_ms,
948
+ )
949
+
950
+ if retries == UNSET:
951
+ if self.sdk_configuration.retry_config is not UNSET:
952
+ retries = self.sdk_configuration.retry_config
953
+
954
+ retry_config = None
955
+ if isinstance(retries, utils.RetryConfig):
956
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
957
+
958
+ http_res = await self.do_request_async(
959
+ hook_ctx=HookContext(
960
+ config=self.sdk_configuration,
961
+ base_url=base_url or "",
962
+ operation_id="v1_token_wrap_eth",
963
+ oauth2_scopes=None,
964
+ security_source=self.sdk_configuration.security,
965
+ ),
966
+ request=req,
967
+ error_status_codes=["422", "4XX", "5XX"],
968
+ retry_config=retry_config,
969
+ )
970
+
971
+ response_data: Any = None
972
+ if utils.match_response(http_res, "200", "application/json"):
973
+ return unmarshal_json_response(models.TransactionResponse, http_res)
974
+ if utils.match_response(http_res, "422", "application/json"):
975
+ response_data = unmarshal_json_response(
976
+ errors.HTTPValidationErrorData, http_res
977
+ )
978
+ raise errors.HTTPValidationError(response_data, http_res)
979
+ if utils.match_response(http_res, "4XX", "*"):
980
+ http_res_text = await utils.stream_to_text_async(http_res)
981
+ raise errors.APIError("API error occurred", http_res, http_res_text)
982
+ if utils.match_response(http_res, "5XX", "*"):
983
+ http_res_text = await utils.stream_to_text_async(http_res)
984
+ raise errors.APIError("API error occurred", http_res, http_res_text)
985
+
986
+ raise errors.APIError("Unexpected response received", http_res)
987
+
988
+ def token_unwrap_weth(
989
+ self,
990
+ *,
991
+ amount: Union[
992
+ models.UnwrapWethRequestAmount, models.UnwrapWethRequestAmountTypedDict
993
+ ],
994
+ chain: models.UnwrapWethRequestChain,
995
+ sender: str,
996
+ estimate_gas: Optional[bool] = None,
997
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
998
+ server_url: Optional[str] = None,
999
+ timeout_ms: Optional[int] = None,
1000
+ http_headers: Optional[Mapping[str, str]] = None,
1001
+ ) -> models.TransactionResponse:
1002
+ r"""Unwrap WETH
1003
+
1004
+ Unwrapping WETH converts the ERC-20 compliant form of ETH back to native ETH that
1005
+ can be used for gas and other native purposes.
1006
+
1007
+ :param amount: The amount of WETH to unwrap.
1008
+ :param chain:
1009
+ :param sender: The address of the transaction sender.
1010
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
1011
+ :param retries: Override the default retry configuration for this method
1012
+ :param server_url: Override the default server URL for this method
1013
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1014
+ :param http_headers: Additional headers to set or replace on requests.
1015
+ """
1016
+ base_url = None
1017
+ url_variables = None
1018
+ if timeout_ms is None:
1019
+ timeout_ms = self.sdk_configuration.timeout_ms
1020
+
1021
+ if server_url is not None:
1022
+ base_url = server_url
1023
+ else:
1024
+ base_url = self._get_url(base_url, url_variables)
1025
+
1026
+ request = models.UnwrapWethRequest(
1027
+ amount=amount,
1028
+ chain=chain,
1029
+ sender=sender,
1030
+ estimate_gas=estimate_gas,
1031
+ )
1032
+
1033
+ req = self._build_request(
1034
+ method="POST",
1035
+ path="/v1/token/unwrap_weth",
1036
+ base_url=base_url,
1037
+ url_variables=url_variables,
1038
+ request=request,
1039
+ request_body_required=True,
1040
+ request_has_path_params=False,
1041
+ request_has_query_params=True,
1042
+ user_agent_header="user-agent",
1043
+ accept_header_value="application/json",
1044
+ http_headers=http_headers,
1045
+ security=self.sdk_configuration.security,
1046
+ get_serialized_body=lambda: utils.serialize_request_body(
1047
+ request, False, False, "json", models.UnwrapWethRequest
1048
+ ),
1049
+ allow_empty_value=None,
1050
+ timeout_ms=timeout_ms,
1051
+ )
1052
+
1053
+ if retries == UNSET:
1054
+ if self.sdk_configuration.retry_config is not UNSET:
1055
+ retries = self.sdk_configuration.retry_config
1056
+
1057
+ retry_config = None
1058
+ if isinstance(retries, utils.RetryConfig):
1059
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1060
+
1061
+ http_res = self.do_request(
1062
+ hook_ctx=HookContext(
1063
+ config=self.sdk_configuration,
1064
+ base_url=base_url or "",
1065
+ operation_id="v1_token_unwrap_weth",
1066
+ oauth2_scopes=None,
1067
+ security_source=self.sdk_configuration.security,
1068
+ ),
1069
+ request=req,
1070
+ error_status_codes=["422", "4XX", "5XX"],
1071
+ retry_config=retry_config,
1072
+ )
1073
+
1074
+ response_data: Any = None
1075
+ if utils.match_response(http_res, "200", "application/json"):
1076
+ return unmarshal_json_response(models.TransactionResponse, http_res)
1077
+ if utils.match_response(http_res, "422", "application/json"):
1078
+ response_data = unmarshal_json_response(
1079
+ errors.HTTPValidationErrorData, http_res
1080
+ )
1081
+ raise errors.HTTPValidationError(response_data, http_res)
1082
+ if utils.match_response(http_res, "4XX", "*"):
1083
+ http_res_text = utils.stream_to_text(http_res)
1084
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1085
+ if utils.match_response(http_res, "5XX", "*"):
1086
+ http_res_text = utils.stream_to_text(http_res)
1087
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1088
+
1089
+ raise errors.APIError("Unexpected response received", http_res)
1090
+
1091
+ async def token_unwrap_weth_async(
1092
+ self,
1093
+ *,
1094
+ amount: Union[
1095
+ models.UnwrapWethRequestAmount, models.UnwrapWethRequestAmountTypedDict
1096
+ ],
1097
+ chain: models.UnwrapWethRequestChain,
1098
+ sender: str,
1099
+ estimate_gas: Optional[bool] = None,
1100
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1101
+ server_url: Optional[str] = None,
1102
+ timeout_ms: Optional[int] = None,
1103
+ http_headers: Optional[Mapping[str, str]] = None,
1104
+ ) -> models.TransactionResponse:
1105
+ r"""Unwrap WETH
1106
+
1107
+ Unwrapping WETH converts the ERC-20 compliant form of ETH back to native ETH that
1108
+ can be used for gas and other native purposes.
1109
+
1110
+ :param amount: The amount of WETH to unwrap.
1111
+ :param chain:
1112
+ :param sender: The address of the transaction sender.
1113
+ :param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
1114
+ :param retries: Override the default retry configuration for this method
1115
+ :param server_url: Override the default server URL for this method
1116
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1117
+ :param http_headers: Additional headers to set or replace on requests.
1118
+ """
1119
+ base_url = None
1120
+ url_variables = None
1121
+ if timeout_ms is None:
1122
+ timeout_ms = self.sdk_configuration.timeout_ms
1123
+
1124
+ if server_url is not None:
1125
+ base_url = server_url
1126
+ else:
1127
+ base_url = self._get_url(base_url, url_variables)
1128
+
1129
+ request = models.UnwrapWethRequest(
1130
+ amount=amount,
1131
+ chain=chain,
1132
+ sender=sender,
1133
+ estimate_gas=estimate_gas,
1134
+ )
1135
+
1136
+ req = self._build_request_async(
1137
+ method="POST",
1138
+ path="/v1/token/unwrap_weth",
1139
+ base_url=base_url,
1140
+ url_variables=url_variables,
1141
+ request=request,
1142
+ request_body_required=True,
1143
+ request_has_path_params=False,
1144
+ request_has_query_params=True,
1145
+ user_agent_header="user-agent",
1146
+ accept_header_value="application/json",
1147
+ http_headers=http_headers,
1148
+ security=self.sdk_configuration.security,
1149
+ get_serialized_body=lambda: utils.serialize_request_body(
1150
+ request, False, False, "json", models.UnwrapWethRequest
1151
+ ),
1152
+ allow_empty_value=None,
1153
+ timeout_ms=timeout_ms,
1154
+ )
1155
+
1156
+ if retries == UNSET:
1157
+ if self.sdk_configuration.retry_config is not UNSET:
1158
+ retries = self.sdk_configuration.retry_config
1159
+
1160
+ retry_config = None
1161
+ if isinstance(retries, utils.RetryConfig):
1162
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1163
+
1164
+ http_res = await self.do_request_async(
1165
+ hook_ctx=HookContext(
1166
+ config=self.sdk_configuration,
1167
+ base_url=base_url or "",
1168
+ operation_id="v1_token_unwrap_weth",
1169
+ oauth2_scopes=None,
1170
+ security_source=self.sdk_configuration.security,
1171
+ ),
1172
+ request=req,
1173
+ error_status_codes=["422", "4XX", "5XX"],
1174
+ retry_config=retry_config,
1175
+ )
1176
+
1177
+ response_data: Any = None
1178
+ if utils.match_response(http_res, "200", "application/json"):
1179
+ return unmarshal_json_response(models.TransactionResponse, http_res)
1180
+ if utils.match_response(http_res, "422", "application/json"):
1181
+ response_data = unmarshal_json_response(
1182
+ errors.HTTPValidationErrorData, http_res
1183
+ )
1184
+ raise errors.HTTPValidationError(response_data, http_res)
1185
+ if utils.match_response(http_res, "4XX", "*"):
1186
+ http_res_text = await utils.stream_to_text_async(http_res)
1187
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1188
+ if utils.match_response(http_res, "5XX", "*"):
1189
+ http_res_text = await utils.stream_to_text_async(http_res)
1190
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1191
+
1192
+ raise errors.APIError("Unexpected response received", http_res)