compass_api_sdk 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of compass_api_sdk might be problematic. Click here for more details.
- {compass_api_sdk-0.1.0.dist-info → compass_api_sdk-0.1.2.dist-info}/METADATA +40 -39
- compass_api_sdk-0.1.2.dist-info/RECORD +165 -0
- {compass_api_sdk → compassapisdk}/_hooks/sdkhooks.py +1 -1
- {compass_api_sdk → compassapisdk}/_hooks/types.py +1 -1
- {compass_api_sdk → compassapisdk}/_version.py +2 -2
- {compass_api_sdk → compassapisdk}/aave_v3.py +9 -9
- {compass_api_sdk → compassapisdk}/aerodrome_slipstream.py +3 -3
- {compass_api_sdk → compassapisdk}/basesdk.py +3 -3
- {compass_api_sdk → compassapisdk}/errors/httpvalidationerror.py +3 -3
- {compass_api_sdk → compassapisdk}/models/__init__.py +431 -47
- {compass_api_sdk → compassapisdk}/models/aave_liquidity_changeop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/aave_token_priceop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/aave_user_position_per_tokenop.py +5 -7
- {compass_api_sdk → compassapisdk}/models/aave_user_position_summaryop.py +5 -7
- compassapisdk/models/aaveborrowparams.py +94 -0
- {compass_api_sdk → compassapisdk}/models/aaveborrowrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aaveliquiditychangeresponse.py +1 -1
- compassapisdk/models/aaverepayparams.py +94 -0
- {compass_api_sdk → compassapisdk}/models/aaverepayrequest.py +1 -1
- compassapisdk/models/aavesupplyparams.py +82 -0
- {compass_api_sdk → compassapisdk}/models/aavesupplyrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aavetokenpriceresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aaveuserpositionpertokenresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aaveuserpositionsummaryresponse.py +1 -1
- compassapisdk/models/aavewithdrawparams.py +45 -0
- {compass_api_sdk → compassapisdk}/models/aavewithdrawrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aerodrome_slipstream_liquidity_provision_positionsop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/aerodrome_slipstream_pool_priceop.py +2 -2
- compassapisdk/models/aerodromeaddliquidityethparams.py +153 -0
- compassapisdk/models/aerodromeaddliquidityparams.py +160 -0
- {compass_api_sdk → compassapisdk}/models/aerodromelppositionsresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aerodromeposition.py +1 -1
- compassapisdk/models/aerodromeremoveliquidityethrequest.py +139 -0
- compassapisdk/models/aerodromeremoveliquidityrequest.py +152 -0
- compassapisdk/models/aerodromeslipstreambuyexactlyparams.py +81 -0
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreambuyexactlyrequest.py +1 -1
- compassapisdk/models/aerodromeslipstreamincreaseliquidityprovisionparams.py +110 -0
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +1 -1
- compassapisdk/models/aerodromeslipstreammintliquidityprovisionparams.py +175 -0
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreammintliquidityprovisionrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreampoolpriceresponse.py +1 -1
- compassapisdk/models/aerodromeslipstreamsellexactlyparams.py +85 -0
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreamsellexactlyrequest.py +1 -1
- compassapisdk/models/aerodromeslipstreamwithdrawliquidityprovisionparams.py +51 -0
- {compass_api_sdk → compassapisdk}/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +1 -1
- compassapisdk/models/aerodromeswapethfortokenparams.py +110 -0
- compassapisdk/models/aerodromeswaptokenforethparams.py +110 -0
- compassapisdk/models/aerodromeswaptokensparams.py +135 -0
- {compass_api_sdk → compassapisdk}/models/allowanceinforesponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/chaininfo.py +1 -1
- {compass_api_sdk → compassapisdk}/models/compass_api_backend_models_morpho_read_response_get_markets_asset.py +1 -1
- {compass_api_sdk → compassapisdk}/models/compass_api_backend_models_morpho_read_response_get_vaults_asset.py +1 -1
- compassapisdk/models/contractname.py +34 -0
- {compass_api_sdk → compassapisdk}/models/ensnameinforesponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/generic_allowanceop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/generic_ensop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/generic_portfolioop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/generic_supported_tokensop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/generic_visualize_portfolioop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/image.py +1 -1
- compassapisdk/models/increaseallowanceanyparams.py +62 -0
- compassapisdk/models/increaseallowanceparams.py +66 -0
- {compass_api_sdk → compassapisdk}/models/increaseallowancerequest.py +4 -4
- {compass_api_sdk → compassapisdk}/models/marketstate.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morpho_market_positionop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/morpho_marketsop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/morpho_vault_positionop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/morpho_vaultsop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/morphoborrowrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphocheckmarketpositionresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphocheckvaultpositionresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphodepositrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphogetmarketsresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphogetvaultsresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphomarket.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphorepayrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphosetvaultallowancerequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphosupplycollateralrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphovault.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphowithdrawcollateralrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/morphowithdrawrequest.py +1 -1
- compassapisdk/models/multicallaction.py +170 -0
- compassapisdk/models/multicallactiontype.py +33 -0
- compassapisdk/models/multicallauthorizationrequest.py +35 -0
- compassapisdk/models/multicallauthorizationresponse.py +31 -0
- compassapisdk/models/multicallexecuterequest.py +36 -0
- {compass_api_sdk → compassapisdk}/models/portfolio.py +1 -1
- {compass_api_sdk → compassapisdk}/models/security.py +2 -2
- compassapisdk/models/signedauthorization.py +42 -0
- {compass_api_sdk → compassapisdk}/models/token_addressop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/token_balanceop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/token_priceop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/tokenaddressresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/tokenbalance.py +1 -1
- {compass_api_sdk → compassapisdk}/models/tokenbalanceresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/tokeninfo.py +1 -1
- {compass_api_sdk → compassapisdk}/models/tokenpriceresponse.py +1 -1
- compass_api_sdk/models/transfererc20request.py → compassapisdk/models/tokentransfererc20params.py +11 -22
- {compass_api_sdk → compassapisdk}/models/tokentransferrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswap_liquidity_provision_in_rangeop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/uniswap_liquidity_provision_positionsop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/uniswap_pool_priceop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/uniswap_quote_buy_exactlyop.py +2 -2
- {compass_api_sdk → compassapisdk}/models/uniswap_quote_sell_exactlyop.py +2 -2
- compassapisdk/models/uniswapbuyexactlyparams.py +89 -0
- {compass_api_sdk → compassapisdk}/models/uniswapbuyexactlyrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswapbuyquoteinforesponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswapcheckinrangeresponse.py +1 -1
- compassapisdk/models/uniswapincreaseliquidityprovisionparams.py +84 -0
- {compass_api_sdk → compassapisdk}/models/uniswapincreaseliquidityprovisionrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswaplppositionsinforesponse.py +1 -1
- compassapisdk/models/uniswapmintliquidityprovisionparams.py +170 -0
- {compass_api_sdk → compassapisdk}/models/uniswapmintliquidityprovisionrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswappoolpriceresponse.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswappositionssolidityresponse.py +1 -1
- compassapisdk/models/uniswapsellexactlyparams.py +93 -0
- {compass_api_sdk → compassapisdk}/models/uniswapsellexactlyrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/uniswapsellquoteinforesponse.py +1 -1
- compassapisdk/models/uniswapwithdrawliquidityprovisionparams.py +50 -0
- {compass_api_sdk → compassapisdk}/models/uniswapwithdrawliquidityprovisionrequest.py +1 -1
- compassapisdk/models/unsignedmulticalltransaction.py +67 -0
- {compass_api_sdk → compassapisdk}/models/unsignedtransaction.py +1 -1
- compassapisdk/models/unwrapwethparams.py +30 -0
- {compass_api_sdk → compassapisdk}/models/unwrapwethrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/models/validationerror.py +1 -1
- {compass_api_sdk → compassapisdk}/models/vaultstate.py +1 -1
- {compass_api_sdk → compassapisdk}/models/weeklyapys.py +1 -1
- compassapisdk/models/wrapethparams.py +30 -0
- {compass_api_sdk → compassapisdk}/models/wrapethrequest.py +1 -1
- {compass_api_sdk → compassapisdk}/morpho.py +3 -3
- {compass_api_sdk → compassapisdk}/sdk.py +12 -9
- {compass_api_sdk → compassapisdk}/sdkconfiguration.py +2 -2
- {compass_api_sdk → compassapisdk}/token_sdk.py +3 -3
- compassapisdk/transaction_batching.py +473 -0
- {compass_api_sdk → compassapisdk}/uniswap_v3.py +3 -3
- {compass_api_sdk → compassapisdk}/universal.py +144 -1012
- compass_api_sdk/_hooks/registration.py +0 -13
- compass_api_sdk/models/balanceinforesponse.py +0 -43
- compass_api_sdk/models/generic_balanceop.py +0 -104
- compass_api_sdk/models/generic_price_usdop.py +0 -97
- compass_api_sdk/models/priceresponse.py +0 -15
- compass_api_sdk/models/transferethrequest.py +0 -46
- compass_api_sdk-0.1.0.dist-info/RECORD +0 -137
- {compass_api_sdk-0.1.0.dist-info → compass_api_sdk-0.1.2.dist-info}/WHEEL +0 -0
- {compass_api_sdk → compassapisdk}/__init__.py +0 -0
- {compass_api_sdk → compassapisdk}/_hooks/__init__.py +0 -0
- {compass_api_sdk → compassapisdk}/errors/__init__.py +0 -0
- {compass_api_sdk → compassapisdk}/errors/apierror.py +0 -0
- {compass_api_sdk → compassapisdk}/httpclient.py +0 -0
- {compass_api_sdk → compassapisdk}/models/chain.py +0 -0
- {compass_api_sdk → compassapisdk}/models/feeenum.py +0 -0
- {compass_api_sdk → compassapisdk}/models/interestratemode.py +0 -0
- {compass_api_sdk → compassapisdk}/models/token_enum.py +0 -0
- {compass_api_sdk → compassapisdk}/py.typed +0 -0
- {compass_api_sdk → compassapisdk}/types/__init__.py +0 -0
- {compass_api_sdk → compassapisdk}/types/basemodel.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/__init__.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/annotations.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/datetimes.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/enums.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/eventstreaming.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/forms.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/headers.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/logger.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/metadata.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/queryparams.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/requestbodies.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/retries.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/security.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/serializers.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/url.py +0 -0
- {compass_api_sdk → compassapisdk}/utils/values.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compassapisdk.types import BaseModel
|
|
5
|
+
from typing import Union
|
|
6
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
UnwrapWethParamsAmountTypedDict = TypeAliasType(
|
|
10
|
+
"UnwrapWethParamsAmountTypedDict", Union[float, str]
|
|
11
|
+
)
|
|
12
|
+
r"""The amount of WETH to unwrap."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
UnwrapWethParamsAmount = TypeAliasType("UnwrapWethParamsAmount", Union[float, str])
|
|
16
|
+
r"""The amount of WETH to unwrap."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UnwrapWethParamsTypedDict(TypedDict):
|
|
20
|
+
r"""Parameters model for unwrapping WETH back to native ETH."""
|
|
21
|
+
|
|
22
|
+
amount: UnwrapWethParamsAmountTypedDict
|
|
23
|
+
r"""The amount of WETH to unwrap."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class UnwrapWethParams(BaseModel):
|
|
27
|
+
r"""Parameters model for unwrapping WETH back to native ETH."""
|
|
28
|
+
|
|
29
|
+
amount: UnwrapWethParamsAmount
|
|
30
|
+
r"""The amount of WETH to unwrap."""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from
|
|
4
|
+
from compassapisdk.types import BaseModel
|
|
5
5
|
from typing import List, Union
|
|
6
6
|
from typing_extensions import TypeAliasType, TypedDict
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from
|
|
4
|
+
from compassapisdk.types import BaseModel
|
|
5
5
|
import pydantic
|
|
6
6
|
from typing_extensions import Annotated, TypedDict
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from
|
|
4
|
+
from compassapisdk.types import BaseModel
|
|
5
5
|
import pydantic
|
|
6
6
|
from typing_extensions import Annotated, TypedDict
|
|
7
7
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compassapisdk.types import BaseModel
|
|
5
|
+
from typing import Union
|
|
6
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
WrapEthParamsAmountTypedDict = TypeAliasType(
|
|
10
|
+
"WrapEthParamsAmountTypedDict", Union[float, str]
|
|
11
|
+
)
|
|
12
|
+
r"""The amount of ETH to wrap."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
WrapEthParamsAmount = TypeAliasType("WrapEthParamsAmount", Union[float, str])
|
|
16
|
+
r"""The amount of ETH to wrap."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WrapEthParamsTypedDict(TypedDict):
|
|
20
|
+
r"""Parameters model for wrapping ETH into WETH."""
|
|
21
|
+
|
|
22
|
+
amount: WrapEthParamsAmountTypedDict
|
|
23
|
+
r"""The amount of ETH to wrap."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class WrapEthParams(BaseModel):
|
|
27
|
+
r"""Parameters model for wrapping ETH into WETH."""
|
|
28
|
+
|
|
29
|
+
amount: WrapEthParamsAmount
|
|
30
|
+
r"""The amount of ETH to wrap."""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from compassapisdk import errors, models, utils
|
|
5
|
+
from compassapisdk._hooks import HookContext
|
|
6
|
+
from compassapisdk.types import Nullable, OptionalNullable, UNSET
|
|
7
7
|
from typing import Any, Mapping, Optional, Union
|
|
8
8
|
|
|
9
9
|
|
|
@@ -5,15 +5,16 @@ from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients
|
|
|
5
5
|
from .sdkconfiguration import SDKConfiguration
|
|
6
6
|
from .utils.logger import Logger, get_default_logger
|
|
7
7
|
from .utils.retries import RetryConfig
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
8
|
+
from compassapisdk import models, utils
|
|
9
|
+
from compassapisdk._hooks import SDKHooks
|
|
10
|
+
from compassapisdk.aave_v3 import AaveV3
|
|
11
|
+
from compassapisdk.aerodrome_slipstream import AerodromeSlipstream
|
|
12
|
+
from compassapisdk.morpho import Morpho
|
|
13
|
+
from compassapisdk.token_sdk import TokenSDK
|
|
14
|
+
from compassapisdk.transaction_batching import TransactionBatching
|
|
15
|
+
from compassapisdk.types import OptionalNullable, UNSET
|
|
16
|
+
from compassapisdk.uniswap_v3 import UniswapV3
|
|
17
|
+
from compassapisdk.universal import Universal
|
|
17
18
|
import httpx
|
|
18
19
|
from typing import Any, Callable, Dict, Optional, Union, cast
|
|
19
20
|
import weakref
|
|
@@ -28,6 +29,7 @@ class CompassAPISDK(BaseSDK):
|
|
|
28
29
|
token: TokenSDK
|
|
29
30
|
uniswap_v3: UniswapV3
|
|
30
31
|
universal: Universal
|
|
32
|
+
transaction_batching: TransactionBatching
|
|
31
33
|
|
|
32
34
|
def __init__(
|
|
33
35
|
self,
|
|
@@ -131,6 +133,7 @@ class CompassAPISDK(BaseSDK):
|
|
|
131
133
|
self.token = TokenSDK(self.sdk_configuration)
|
|
132
134
|
self.uniswap_v3 = UniswapV3(self.sdk_configuration)
|
|
133
135
|
self.universal = Universal(self.sdk_configuration)
|
|
136
|
+
self.transaction_batching = TransactionBatching(self.sdk_configuration)
|
|
134
137
|
|
|
135
138
|
def __enter__(self):
|
|
136
139
|
return self
|
|
@@ -9,8 +9,8 @@ from ._version import (
|
|
|
9
9
|
)
|
|
10
10
|
from .httpclient import AsyncHttpClient, HttpClient
|
|
11
11
|
from .utils import Logger, RetryConfig, remove_suffix
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from compassapisdk import models
|
|
13
|
+
from compassapisdk.types import OptionalNullable, UNSET
|
|
14
14
|
from dataclasses import dataclass
|
|
15
15
|
from pydantic import Field
|
|
16
16
|
from typing import Callable, Dict, Optional, Tuple, Union
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from compassapisdk import errors, models, utils
|
|
5
|
+
from compassapisdk._hooks import HookContext
|
|
6
|
+
from compassapisdk.types import OptionalNullable, UNSET
|
|
7
7
|
from typing import Any, Mapping, Optional, Union
|
|
8
8
|
|
|
9
9
|
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from compassapisdk import errors, models, utils
|
|
5
|
+
from compassapisdk._hooks import HookContext
|
|
6
|
+
from compassapisdk.types import OptionalNullable, UNSET
|
|
7
|
+
from typing import Any, List, Mapping, Optional, Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TransactionBatching(BaseSDK):
|
|
11
|
+
def authorization(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
chain: models.Chain,
|
|
15
|
+
sender: str,
|
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
|
+
server_url: Optional[str] = None,
|
|
18
|
+
timeout_ms: Optional[int] = None,
|
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
+
) -> models.MulticallAuthorizationResponse:
|
|
21
|
+
r"""Get EIP-7702 Authorization
|
|
22
|
+
|
|
23
|
+
Get authorization data for EIP-7702 batching operations.
|
|
24
|
+
|
|
25
|
+
This authorization is required to prevent replay attacks and ensure transaction
|
|
26
|
+
ordering when batching multiple actions into a single transaction. The authorization
|
|
27
|
+
includes a nonce and chain ID to guarantee transaction uniqueness and proper network
|
|
28
|
+
targeting.
|
|
29
|
+
|
|
30
|
+
:param chain: The chain to use.
|
|
31
|
+
:param sender: The Ethereum address to use for authorization
|
|
32
|
+
:param retries: Override the default retry configuration for this method
|
|
33
|
+
:param server_url: Override the default server URL for this method
|
|
34
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
35
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
36
|
+
"""
|
|
37
|
+
base_url = None
|
|
38
|
+
url_variables = None
|
|
39
|
+
if timeout_ms is None:
|
|
40
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
41
|
+
|
|
42
|
+
if server_url is not None:
|
|
43
|
+
base_url = server_url
|
|
44
|
+
else:
|
|
45
|
+
base_url = self._get_url(base_url, url_variables)
|
|
46
|
+
|
|
47
|
+
request = models.MulticallAuthorizationRequest(
|
|
48
|
+
chain=chain,
|
|
49
|
+
sender=sender,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
req = self._build_request(
|
|
53
|
+
method="POST",
|
|
54
|
+
path="/v0/multicall/authorization",
|
|
55
|
+
base_url=base_url,
|
|
56
|
+
url_variables=url_variables,
|
|
57
|
+
request=request,
|
|
58
|
+
request_body_required=True,
|
|
59
|
+
request_has_path_params=False,
|
|
60
|
+
request_has_query_params=True,
|
|
61
|
+
user_agent_header="user-agent",
|
|
62
|
+
accept_header_value="application/json",
|
|
63
|
+
http_headers=http_headers,
|
|
64
|
+
security=self.sdk_configuration.security,
|
|
65
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
66
|
+
request, False, False, "json", models.MulticallAuthorizationRequest
|
|
67
|
+
),
|
|
68
|
+
timeout_ms=timeout_ms,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
if retries == UNSET:
|
|
72
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
73
|
+
retries = self.sdk_configuration.retry_config
|
|
74
|
+
|
|
75
|
+
retry_config = None
|
|
76
|
+
if isinstance(retries, utils.RetryConfig):
|
|
77
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
78
|
+
|
|
79
|
+
http_res = self.do_request(
|
|
80
|
+
hook_ctx=HookContext(
|
|
81
|
+
base_url=base_url or "",
|
|
82
|
+
operation_id="multicall_authorization",
|
|
83
|
+
oauth2_scopes=[],
|
|
84
|
+
security_source=self.sdk_configuration.security,
|
|
85
|
+
),
|
|
86
|
+
request=req,
|
|
87
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
88
|
+
retry_config=retry_config,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response_data: Any = None
|
|
92
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
93
|
+
return utils.unmarshal_json(
|
|
94
|
+
http_res.text, models.MulticallAuthorizationResponse
|
|
95
|
+
)
|
|
96
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
97
|
+
response_data = utils.unmarshal_json(
|
|
98
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
99
|
+
)
|
|
100
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
101
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
102
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
103
|
+
raise errors.APIError(
|
|
104
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
105
|
+
)
|
|
106
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
107
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
108
|
+
raise errors.APIError(
|
|
109
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
content_type = http_res.headers.get("Content-Type")
|
|
113
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
114
|
+
raise errors.APIError(
|
|
115
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
116
|
+
http_res.status_code,
|
|
117
|
+
http_res_text,
|
|
118
|
+
http_res,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
async def authorization_async(
|
|
122
|
+
self,
|
|
123
|
+
*,
|
|
124
|
+
chain: models.Chain,
|
|
125
|
+
sender: str,
|
|
126
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
127
|
+
server_url: Optional[str] = None,
|
|
128
|
+
timeout_ms: Optional[int] = None,
|
|
129
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
130
|
+
) -> models.MulticallAuthorizationResponse:
|
|
131
|
+
r"""Get EIP-7702 Authorization
|
|
132
|
+
|
|
133
|
+
Get authorization data for EIP-7702 batching operations.
|
|
134
|
+
|
|
135
|
+
This authorization is required to prevent replay attacks and ensure transaction
|
|
136
|
+
ordering when batching multiple actions into a single transaction. The authorization
|
|
137
|
+
includes a nonce and chain ID to guarantee transaction uniqueness and proper network
|
|
138
|
+
targeting.
|
|
139
|
+
|
|
140
|
+
:param chain: The chain to use.
|
|
141
|
+
:param sender: The Ethereum address to use for authorization
|
|
142
|
+
:param retries: Override the default retry configuration for this method
|
|
143
|
+
:param server_url: Override the default server URL for this method
|
|
144
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
145
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
146
|
+
"""
|
|
147
|
+
base_url = None
|
|
148
|
+
url_variables = None
|
|
149
|
+
if timeout_ms is None:
|
|
150
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
151
|
+
|
|
152
|
+
if server_url is not None:
|
|
153
|
+
base_url = server_url
|
|
154
|
+
else:
|
|
155
|
+
base_url = self._get_url(base_url, url_variables)
|
|
156
|
+
|
|
157
|
+
request = models.MulticallAuthorizationRequest(
|
|
158
|
+
chain=chain,
|
|
159
|
+
sender=sender,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
req = self._build_request_async(
|
|
163
|
+
method="POST",
|
|
164
|
+
path="/v0/multicall/authorization",
|
|
165
|
+
base_url=base_url,
|
|
166
|
+
url_variables=url_variables,
|
|
167
|
+
request=request,
|
|
168
|
+
request_body_required=True,
|
|
169
|
+
request_has_path_params=False,
|
|
170
|
+
request_has_query_params=True,
|
|
171
|
+
user_agent_header="user-agent",
|
|
172
|
+
accept_header_value="application/json",
|
|
173
|
+
http_headers=http_headers,
|
|
174
|
+
security=self.sdk_configuration.security,
|
|
175
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
176
|
+
request, False, False, "json", models.MulticallAuthorizationRequest
|
|
177
|
+
),
|
|
178
|
+
timeout_ms=timeout_ms,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if retries == UNSET:
|
|
182
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
183
|
+
retries = self.sdk_configuration.retry_config
|
|
184
|
+
|
|
185
|
+
retry_config = None
|
|
186
|
+
if isinstance(retries, utils.RetryConfig):
|
|
187
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
188
|
+
|
|
189
|
+
http_res = await self.do_request_async(
|
|
190
|
+
hook_ctx=HookContext(
|
|
191
|
+
base_url=base_url or "",
|
|
192
|
+
operation_id="multicall_authorization",
|
|
193
|
+
oauth2_scopes=[],
|
|
194
|
+
security_source=self.sdk_configuration.security,
|
|
195
|
+
),
|
|
196
|
+
request=req,
|
|
197
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
198
|
+
retry_config=retry_config,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
response_data: Any = None
|
|
202
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
203
|
+
return utils.unmarshal_json(
|
|
204
|
+
http_res.text, models.MulticallAuthorizationResponse
|
|
205
|
+
)
|
|
206
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
207
|
+
response_data = utils.unmarshal_json(
|
|
208
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
209
|
+
)
|
|
210
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
211
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
212
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
213
|
+
raise errors.APIError(
|
|
214
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
215
|
+
)
|
|
216
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
217
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
218
|
+
raise errors.APIError(
|
|
219
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
content_type = http_res.headers.get("Content-Type")
|
|
223
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
224
|
+
raise errors.APIError(
|
|
225
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
226
|
+
http_res.status_code,
|
|
227
|
+
http_res_text,
|
|
228
|
+
http_res,
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
def execute(
|
|
232
|
+
self,
|
|
233
|
+
*,
|
|
234
|
+
chain: models.Chain,
|
|
235
|
+
sender: str,
|
|
236
|
+
signed_authorization: Union[
|
|
237
|
+
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
238
|
+
],
|
|
239
|
+
actions: Union[
|
|
240
|
+
List[models.MulticallAction], List[models.MulticallActionTypedDict]
|
|
241
|
+
],
|
|
242
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
243
|
+
server_url: Optional[str] = None,
|
|
244
|
+
timeout_ms: Optional[int] = None,
|
|
245
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
246
|
+
) -> models.UnsignedMulticallTransaction:
|
|
247
|
+
r"""Execute Tx Batching
|
|
248
|
+
|
|
249
|
+
Execute a batch of transactions in a single multicall using EIP-7702.
|
|
250
|
+
|
|
251
|
+
This endpoint allows bundling multiple contract calls into a single atomic
|
|
252
|
+
transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
253
|
+
together. The transaction must be authorized using the /authorization endpoint to
|
|
254
|
+
prevent replay attacks.
|
|
255
|
+
|
|
256
|
+
:param chain: The chain to use.
|
|
257
|
+
:param sender: The address of the transaction sender.
|
|
258
|
+
:param signed_authorization:
|
|
259
|
+
:param actions: List of possible actions for multicall
|
|
260
|
+
:param retries: Override the default retry configuration for this method
|
|
261
|
+
:param server_url: Override the default server URL for this method
|
|
262
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
263
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
264
|
+
"""
|
|
265
|
+
base_url = None
|
|
266
|
+
url_variables = None
|
|
267
|
+
if timeout_ms is None:
|
|
268
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
269
|
+
|
|
270
|
+
if server_url is not None:
|
|
271
|
+
base_url = server_url
|
|
272
|
+
else:
|
|
273
|
+
base_url = self._get_url(base_url, url_variables)
|
|
274
|
+
|
|
275
|
+
request = models.MulticallExecuteRequest(
|
|
276
|
+
chain=chain,
|
|
277
|
+
sender=sender,
|
|
278
|
+
signed_authorization=utils.get_pydantic_model(
|
|
279
|
+
signed_authorization, models.SignedAuthorization
|
|
280
|
+
),
|
|
281
|
+
actions=utils.get_pydantic_model(actions, List[models.MulticallAction]),
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
req = self._build_request(
|
|
285
|
+
method="POST",
|
|
286
|
+
path="/v0/multicall/execute",
|
|
287
|
+
base_url=base_url,
|
|
288
|
+
url_variables=url_variables,
|
|
289
|
+
request=request,
|
|
290
|
+
request_body_required=True,
|
|
291
|
+
request_has_path_params=False,
|
|
292
|
+
request_has_query_params=True,
|
|
293
|
+
user_agent_header="user-agent",
|
|
294
|
+
accept_header_value="application/json",
|
|
295
|
+
http_headers=http_headers,
|
|
296
|
+
security=self.sdk_configuration.security,
|
|
297
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
298
|
+
request, False, False, "json", models.MulticallExecuteRequest
|
|
299
|
+
),
|
|
300
|
+
timeout_ms=timeout_ms,
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
if retries == UNSET:
|
|
304
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
305
|
+
retries = self.sdk_configuration.retry_config
|
|
306
|
+
|
|
307
|
+
retry_config = None
|
|
308
|
+
if isinstance(retries, utils.RetryConfig):
|
|
309
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
310
|
+
|
|
311
|
+
http_res = self.do_request(
|
|
312
|
+
hook_ctx=HookContext(
|
|
313
|
+
base_url=base_url or "",
|
|
314
|
+
operation_id="multicall_execute",
|
|
315
|
+
oauth2_scopes=[],
|
|
316
|
+
security_source=self.sdk_configuration.security,
|
|
317
|
+
),
|
|
318
|
+
request=req,
|
|
319
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
320
|
+
retry_config=retry_config,
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
response_data: Any = None
|
|
324
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
325
|
+
return utils.unmarshal_json(
|
|
326
|
+
http_res.text, models.UnsignedMulticallTransaction
|
|
327
|
+
)
|
|
328
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
329
|
+
response_data = utils.unmarshal_json(
|
|
330
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
331
|
+
)
|
|
332
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
333
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
334
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
335
|
+
raise errors.APIError(
|
|
336
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
337
|
+
)
|
|
338
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
339
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
340
|
+
raise errors.APIError(
|
|
341
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
342
|
+
)
|
|
343
|
+
|
|
344
|
+
content_type = http_res.headers.get("Content-Type")
|
|
345
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
346
|
+
raise errors.APIError(
|
|
347
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
348
|
+
http_res.status_code,
|
|
349
|
+
http_res_text,
|
|
350
|
+
http_res,
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
async def execute_async(
|
|
354
|
+
self,
|
|
355
|
+
*,
|
|
356
|
+
chain: models.Chain,
|
|
357
|
+
sender: str,
|
|
358
|
+
signed_authorization: Union[
|
|
359
|
+
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
360
|
+
],
|
|
361
|
+
actions: Union[
|
|
362
|
+
List[models.MulticallAction], List[models.MulticallActionTypedDict]
|
|
363
|
+
],
|
|
364
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
365
|
+
server_url: Optional[str] = None,
|
|
366
|
+
timeout_ms: Optional[int] = None,
|
|
367
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
368
|
+
) -> models.UnsignedMulticallTransaction:
|
|
369
|
+
r"""Execute Tx Batching
|
|
370
|
+
|
|
371
|
+
Execute a batch of transactions in a single multicall using EIP-7702.
|
|
372
|
+
|
|
373
|
+
This endpoint allows bundling multiple contract calls into a single atomic
|
|
374
|
+
transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
375
|
+
together. The transaction must be authorized using the /authorization endpoint to
|
|
376
|
+
prevent replay attacks.
|
|
377
|
+
|
|
378
|
+
:param chain: The chain to use.
|
|
379
|
+
:param sender: The address of the transaction sender.
|
|
380
|
+
:param signed_authorization:
|
|
381
|
+
:param actions: List of possible actions for multicall
|
|
382
|
+
:param retries: Override the default retry configuration for this method
|
|
383
|
+
:param server_url: Override the default server URL for this method
|
|
384
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
385
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
386
|
+
"""
|
|
387
|
+
base_url = None
|
|
388
|
+
url_variables = None
|
|
389
|
+
if timeout_ms is None:
|
|
390
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
391
|
+
|
|
392
|
+
if server_url is not None:
|
|
393
|
+
base_url = server_url
|
|
394
|
+
else:
|
|
395
|
+
base_url = self._get_url(base_url, url_variables)
|
|
396
|
+
|
|
397
|
+
request = models.MulticallExecuteRequest(
|
|
398
|
+
chain=chain,
|
|
399
|
+
sender=sender,
|
|
400
|
+
signed_authorization=utils.get_pydantic_model(
|
|
401
|
+
signed_authorization, models.SignedAuthorization
|
|
402
|
+
),
|
|
403
|
+
actions=utils.get_pydantic_model(actions, List[models.MulticallAction]),
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
req = self._build_request_async(
|
|
407
|
+
method="POST",
|
|
408
|
+
path="/v0/multicall/execute",
|
|
409
|
+
base_url=base_url,
|
|
410
|
+
url_variables=url_variables,
|
|
411
|
+
request=request,
|
|
412
|
+
request_body_required=True,
|
|
413
|
+
request_has_path_params=False,
|
|
414
|
+
request_has_query_params=True,
|
|
415
|
+
user_agent_header="user-agent",
|
|
416
|
+
accept_header_value="application/json",
|
|
417
|
+
http_headers=http_headers,
|
|
418
|
+
security=self.sdk_configuration.security,
|
|
419
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
420
|
+
request, False, False, "json", models.MulticallExecuteRequest
|
|
421
|
+
),
|
|
422
|
+
timeout_ms=timeout_ms,
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
if retries == UNSET:
|
|
426
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
427
|
+
retries = self.sdk_configuration.retry_config
|
|
428
|
+
|
|
429
|
+
retry_config = None
|
|
430
|
+
if isinstance(retries, utils.RetryConfig):
|
|
431
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
432
|
+
|
|
433
|
+
http_res = await self.do_request_async(
|
|
434
|
+
hook_ctx=HookContext(
|
|
435
|
+
base_url=base_url or "",
|
|
436
|
+
operation_id="multicall_execute",
|
|
437
|
+
oauth2_scopes=[],
|
|
438
|
+
security_source=self.sdk_configuration.security,
|
|
439
|
+
),
|
|
440
|
+
request=req,
|
|
441
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
442
|
+
retry_config=retry_config,
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
response_data: Any = None
|
|
446
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
447
|
+
return utils.unmarshal_json(
|
|
448
|
+
http_res.text, models.UnsignedMulticallTransaction
|
|
449
|
+
)
|
|
450
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
451
|
+
response_data = utils.unmarshal_json(
|
|
452
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
453
|
+
)
|
|
454
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
455
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
456
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
457
|
+
raise errors.APIError(
|
|
458
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
459
|
+
)
|
|
460
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
461
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
462
|
+
raise errors.APIError(
|
|
463
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
content_type = http_res.headers.get("Content-Type")
|
|
467
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
468
|
+
raise errors.APIError(
|
|
469
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
470
|
+
http_res.status_code,
|
|
471
|
+
http_res_text,
|
|
472
|
+
http_res,
|
|
473
|
+
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from compassapisdk import errors, models, utils
|
|
5
|
+
from compassapisdk._hooks import HookContext
|
|
6
|
+
from compassapisdk.types import OptionalNullable, UNSET
|
|
7
7
|
from typing import Any, Mapping, Optional, Union
|
|
8
8
|
|
|
9
9
|
|