compass_api_sdk 0.9.13__py3-none-any.whl → 0.9.14__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.

@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "compass_api_sdk"
6
- __version__: str = "0.9.13"
6
+ __version__: str = "0.9.14"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
- __gen_version__: str = "2.623.2"
9
- __user_agent__: str = "speakeasy-sdk/python 0.9.13 2.623.2 0.0.1 compass_api_sdk"
8
+ __gen_version__: str = "2.628.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.9.14 2.628.0 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -79,6 +79,18 @@ if TYPE_CHECKING:
79
79
  AaveLiquidityChangeResponse,
80
80
  AaveLiquidityChangeResponseTypedDict,
81
81
  )
82
+ from .aavelooprequest import (
83
+ AaveLoopRequest,
84
+ AaveLoopRequestTypedDict,
85
+ InitialCollateralAmount,
86
+ InitialCollateralAmountTypedDict,
87
+ LoanToValue,
88
+ LoanToValueTypedDict,
89
+ MaxSlippagePercent,
90
+ MaxSlippagePercentTypedDict,
91
+ Multiplier,
92
+ MultiplierTypedDict,
93
+ )
82
94
  from .aaverateresponse import AaveRateResponse, AaveRateResponseTypedDict
83
95
  from .aaverepayparams import (
84
96
  AaveRepayParams,
@@ -525,6 +537,18 @@ if TYPE_CHECKING:
525
537
  MorphoWithdrawRequestTypedDict,
526
538
  )
527
539
  from .movement10percent import Movement10Percent, Movement10PercentTypedDict
540
+ from .multicallauthorizationrequest import (
541
+ MulticallAuthorizationRequest,
542
+ MulticallAuthorizationRequestTypedDict,
543
+ )
544
+ from .multicallauthorizationresponse import (
545
+ MulticallAuthorizationResponse,
546
+ MulticallAuthorizationResponseTypedDict,
547
+ )
548
+ from .multicallexecuterequest import (
549
+ MulticallExecuteRequest,
550
+ MulticallExecuteRequestTypedDict,
551
+ )
528
552
  from .openposition import OpenPosition, OpenPositionTypedDict
529
553
  from .pendle_marketop import (
530
554
  PendleMarketChain,
@@ -978,6 +1002,8 @@ __all__ = [
978
1002
  "AaveLiquidityChangeResponse",
979
1003
  "AaveLiquidityChangeResponseTypedDict",
980
1004
  "AaveLiquidityChangeToken",
1005
+ "AaveLoopRequest",
1006
+ "AaveLoopRequestTypedDict",
981
1007
  "AaveRateChain",
982
1008
  "AaveRateRequest",
983
1009
  "AaveRateRequestTypedDict",
@@ -1209,11 +1235,15 @@ __all__ = [
1209
1235
  "IncreaseAllowanceRequestToken",
1210
1236
  "IncreaseAllowanceRequestTokenTypedDict",
1211
1237
  "IncreaseAllowanceRequestTypedDict",
1238
+ "InitialCollateralAmount",
1239
+ "InitialCollateralAmountTypedDict",
1212
1240
  "InterestRateMode",
1213
1241
  "LiquidationCall",
1214
1242
  "LiquidationCallTypedDict",
1215
1243
  "Liquidity",
1216
1244
  "LiquidityTypedDict",
1245
+ "LoanToValue",
1246
+ "LoanToValueTypedDict",
1217
1247
  "Loc",
1218
1248
  "LocTypedDict",
1219
1249
  "LpBalance",
@@ -1222,6 +1252,8 @@ __all__ = [
1222
1252
  "MarketPosition",
1223
1253
  "MarketPositionTypedDict",
1224
1254
  "MarketTypedDict",
1255
+ "MaxSlippagePercent",
1256
+ "MaxSlippagePercentTypedDict",
1225
1257
  "Metadata",
1226
1258
  "MetadataTypedDict",
1227
1259
  "MorphoBorrowParams",
@@ -1320,6 +1352,14 @@ __all__ = [
1320
1352
  "MorphoWithdrawRequestTypedDict",
1321
1353
  "Movement10Percent",
1322
1354
  "Movement10PercentTypedDict",
1355
+ "MulticallAuthorizationRequest",
1356
+ "MulticallAuthorizationRequestTypedDict",
1357
+ "MulticallAuthorizationResponse",
1358
+ "MulticallAuthorizationResponseTypedDict",
1359
+ "MulticallExecuteRequest",
1360
+ "MulticallExecuteRequestTypedDict",
1361
+ "Multiplier",
1362
+ "MultiplierTypedDict",
1323
1363
  "OpenPosition",
1324
1364
  "OpenPositionTypedDict",
1325
1365
  "PendleAddLiquidityParams",
@@ -1689,6 +1729,16 @@ _dynamic_imports: dict[str, str] = {
1689
1729
  "TransactionTypedDict": ".aavehistoricaltransactionsresponse",
1690
1730
  "AaveLiquidityChangeResponse": ".aaveliquiditychangeresponse",
1691
1731
  "AaveLiquidityChangeResponseTypedDict": ".aaveliquiditychangeresponse",
1732
+ "AaveLoopRequest": ".aavelooprequest",
1733
+ "AaveLoopRequestTypedDict": ".aavelooprequest",
1734
+ "InitialCollateralAmount": ".aavelooprequest",
1735
+ "InitialCollateralAmountTypedDict": ".aavelooprequest",
1736
+ "LoanToValue": ".aavelooprequest",
1737
+ "LoanToValueTypedDict": ".aavelooprequest",
1738
+ "MaxSlippagePercent": ".aavelooprequest",
1739
+ "MaxSlippagePercentTypedDict": ".aavelooprequest",
1740
+ "Multiplier": ".aavelooprequest",
1741
+ "MultiplierTypedDict": ".aavelooprequest",
1692
1742
  "AaveRateResponse": ".aaverateresponse",
1693
1743
  "AaveRateResponseTypedDict": ".aaverateresponse",
1694
1744
  "AaveRepayParams": ".aaverepayparams",
@@ -2004,6 +2054,12 @@ _dynamic_imports: dict[str, str] = {
2004
2054
  "MorphoWithdrawRequestTypedDict": ".morphowithdrawrequest",
2005
2055
  "Movement10Percent": ".movement10percent",
2006
2056
  "Movement10PercentTypedDict": ".movement10percent",
2057
+ "MulticallAuthorizationRequest": ".multicallauthorizationrequest",
2058
+ "MulticallAuthorizationRequestTypedDict": ".multicallauthorizationrequest",
2059
+ "MulticallAuthorizationResponse": ".multicallauthorizationresponse",
2060
+ "MulticallAuthorizationResponseTypedDict": ".multicallauthorizationresponse",
2061
+ "MulticallExecuteRequest": ".multicallexecuterequest",
2062
+ "MulticallExecuteRequestTypedDict": ".multicallexecuterequest",
2007
2063
  "OpenPosition": ".openposition",
2008
2064
  "OpenPositionTypedDict": ".openposition",
2009
2065
  "PendleMarketChain": ".pendle_marketop",
@@ -0,0 +1,113 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chain import Chain
5
+ from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
6
+ from .token_enum import TokenEnum
7
+ from compass_api_sdk.types import BaseModel
8
+ from typing import Union
9
+ from typing_extensions import TypeAliasType, TypedDict
10
+
11
+
12
+ InitialCollateralAmountTypedDict = TypeAliasType(
13
+ "InitialCollateralAmountTypedDict", Union[float, str]
14
+ )
15
+ r"""Amount of collateral token to supply to Aave"""
16
+
17
+
18
+ InitialCollateralAmount = TypeAliasType("InitialCollateralAmount", Union[float, str])
19
+ r"""Amount of collateral token to supply to Aave"""
20
+
21
+
22
+ MultiplierTypedDict = TypeAliasType("MultiplierTypedDict", Union[float, str])
23
+ r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
24
+
25
+
26
+ Multiplier = TypeAliasType("Multiplier", Union[float, str])
27
+ r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
28
+
29
+
30
+ MaxSlippagePercentTypedDict = TypeAliasType(
31
+ "MaxSlippagePercentTypedDict", Union[float, str]
32
+ )
33
+ r"""Maximum allowed slippage for token swaps in percentage"""
34
+
35
+
36
+ MaxSlippagePercent = TypeAliasType("MaxSlippagePercent", Union[float, str])
37
+ r"""Maximum allowed slippage for token swaps in percentage"""
38
+
39
+
40
+ LoanToValueTypedDict = TypeAliasType("LoanToValueTypedDict", Union[float, str])
41
+ r"""Loan To Value percentage of the loop"""
42
+
43
+
44
+ LoanToValue = TypeAliasType("LoanToValue", Union[float, str])
45
+ r"""Loan To Value percentage of the loop"""
46
+
47
+
48
+ class AaveLoopRequestTypedDict(TypedDict):
49
+ r"""Request model for executing an Aave loop strategy."""
50
+
51
+ chain: Chain
52
+ r"""The chain to use."""
53
+ sender: str
54
+ r"""The address of the transaction sender."""
55
+ signed_authorization: SignedAuthorizationTypedDict
56
+ collateral_token: TokenEnum
57
+ r"""A class representing the token.
58
+
59
+ This class is used to represent the token in the system. Notice individual
60
+ endpoints' documentation where per chain tokens are presented.
61
+ """
62
+ borrow_token: TokenEnum
63
+ r"""A class representing the token.
64
+
65
+ This class is used to represent the token in the system. Notice individual
66
+ endpoints' documentation where per chain tokens are presented.
67
+ """
68
+ initial_collateral_amount: InitialCollateralAmountTypedDict
69
+ r"""Amount of collateral token to supply to Aave"""
70
+ multiplier: MultiplierTypedDict
71
+ r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
72
+ max_slippage_percent: MaxSlippagePercentTypedDict
73
+ r"""Maximum allowed slippage for token swaps in percentage"""
74
+ loan_to_value: LoanToValueTypedDict
75
+ r"""Loan To Value percentage of the loop"""
76
+
77
+
78
+ class AaveLoopRequest(BaseModel):
79
+ r"""Request model for executing an Aave loop strategy."""
80
+
81
+ chain: Chain
82
+ r"""The chain to use."""
83
+
84
+ sender: str
85
+ r"""The address of the transaction sender."""
86
+
87
+ signed_authorization: SignedAuthorization
88
+
89
+ collateral_token: TokenEnum
90
+ r"""A class representing the token.
91
+
92
+ This class is used to represent the token in the system. Notice individual
93
+ endpoints' documentation where per chain tokens are presented.
94
+ """
95
+
96
+ borrow_token: TokenEnum
97
+ r"""A class representing the token.
98
+
99
+ This class is used to represent the token in the system. Notice individual
100
+ endpoints' documentation where per chain tokens are presented.
101
+ """
102
+
103
+ initial_collateral_amount: InitialCollateralAmount
104
+ r"""Amount of collateral token to supply to Aave"""
105
+
106
+ multiplier: Multiplier
107
+ r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
108
+
109
+ max_slippage_percent: MaxSlippagePercent
110
+ r"""Maximum allowed slippage for token swaps in percentage"""
111
+
112
+ loan_to_value: LoanToValue
113
+ r"""Loan To Value percentage of the loop"""
@@ -15,41 +15,61 @@ from typing_extensions import Annotated, NotRequired, TypedDict
15
15
 
16
16
  class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketStateTypedDict(TypedDict):
17
17
  utilization: str
18
- collateral_assets: str
19
18
  borrow_assets: str
20
- borrow_assets_usd: str
21
19
  liquidity_assets: str
22
- liquidity_assets_usd: str
23
20
  total_liquidity: str
24
- total_liquidity_usd: str
21
+ collateral_assets: NotRequired[Nullable[str]]
25
22
  collateral_assets_usd: NotRequired[Nullable[str]]
23
+ borrow_assets_usd: NotRequired[Nullable[str]]
24
+ liquidity_assets_usd: NotRequired[Nullable[str]]
25
+ total_liquidity_usd: NotRequired[Nullable[str]]
26
26
 
27
27
 
28
28
  class CompassAPIBackendModelsMorphoReadResponseGetMarketMarketState(BaseModel):
29
29
  utilization: str
30
30
 
31
- collateral_assets: Annotated[str, pydantic.Field(alias="collateralAssets")]
32
-
33
31
  borrow_assets: Annotated[str, pydantic.Field(alias="borrowAssets")]
34
32
 
35
- borrow_assets_usd: Annotated[str, pydantic.Field(alias="borrowAssetsUsd")]
36
-
37
33
  liquidity_assets: Annotated[str, pydantic.Field(alias="liquidityAssets")]
38
34
 
39
- liquidity_assets_usd: Annotated[str, pydantic.Field(alias="liquidityAssetsUsd")]
40
-
41
35
  total_liquidity: Annotated[str, pydantic.Field(alias="totalLiquidity")]
42
36
 
43
- total_liquidity_usd: Annotated[str, pydantic.Field(alias="totalLiquidityUsd")]
37
+ collateral_assets: Annotated[
38
+ OptionalNullable[str], pydantic.Field(alias="collateralAssets")
39
+ ] = UNSET
44
40
 
45
41
  collateral_assets_usd: Annotated[
46
42
  OptionalNullable[str], pydantic.Field(alias="collateralAssetsUsd")
47
43
  ] = UNSET
48
44
 
45
+ borrow_assets_usd: Annotated[
46
+ OptionalNullable[str], pydantic.Field(alias="borrowAssetsUsd")
47
+ ] = UNSET
48
+
49
+ liquidity_assets_usd: Annotated[
50
+ OptionalNullable[str], pydantic.Field(alias="liquidityAssetsUsd")
51
+ ] = UNSET
52
+
53
+ total_liquidity_usd: Annotated[
54
+ OptionalNullable[str], pydantic.Field(alias="totalLiquidityUsd")
55
+ ] = UNSET
56
+
49
57
  @model_serializer(mode="wrap")
50
58
  def serialize_model(self, handler):
51
- optional_fields = ["collateralAssetsUsd"]
52
- nullable_fields = ["collateralAssetsUsd"]
59
+ optional_fields = [
60
+ "collateralAssets",
61
+ "collateralAssetsUsd",
62
+ "borrowAssetsUsd",
63
+ "liquidityAssetsUsd",
64
+ "totalLiquidityUsd",
65
+ ]
66
+ nullable_fields = [
67
+ "collateralAssets",
68
+ "collateralAssetsUsd",
69
+ "borrowAssetsUsd",
70
+ "liquidityAssetsUsd",
71
+ "totalLiquidityUsd",
72
+ ]
53
73
  null_default_fields = []
54
74
 
55
75
  serialized = handler(self)
@@ -10,17 +10,11 @@ from typing_extensions import Annotated, TypedDict
10
10
 
11
11
 
12
12
  class MetadataTypedDict(TypedDict):
13
- description: Nullable[str]
14
- image: Nullable[str]
15
13
  forum_link: Nullable[str]
16
14
  curators: List[CuratorTypedDict]
17
15
 
18
16
 
19
17
  class Metadata(BaseModel):
20
- description: Nullable[str]
21
-
22
- image: Nullable[str]
23
-
24
18
  forum_link: Annotated[Nullable[str], pydantic.Field(alias="forumLink")]
25
19
 
26
20
  curators: List[Curator]
@@ -28,7 +22,7 @@ class Metadata(BaseModel):
28
22
  @model_serializer(mode="wrap")
29
23
  def serialize_model(self, handler):
30
24
  optional_fields = []
31
- nullable_fields = ["description", "image", "forumLink"]
25
+ nullable_fields = ["forumLink"]
32
26
  null_default_fields = []
33
27
 
34
28
  serialized = handler(self)
@@ -0,0 +1,39 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chain import Chain
5
+ from compass_api_sdk.types import BaseModel
6
+ from typing_extensions import TypedDict
7
+
8
+
9
+ class MulticallAuthorizationRequestTypedDict(TypedDict):
10
+ r"""Request model for getting a multicall authorization.
11
+
12
+ This model is used to authorize a sender address to perform multicall operations,
13
+ allowing it to call multiple functions on multiple contracts in a single
14
+ transaction.
15
+
16
+ Only needs to be done once per an EOA.
17
+ """
18
+
19
+ chain: Chain
20
+ r"""The chain to use."""
21
+ sender: str
22
+ r"""The Ethereum address to use for authorization"""
23
+
24
+
25
+ class MulticallAuthorizationRequest(BaseModel):
26
+ r"""Request model for getting a multicall authorization.
27
+
28
+ This model is used to authorize a sender address to perform multicall operations,
29
+ allowing it to call multiple functions on multiple contracts in a single
30
+ transaction.
31
+
32
+ Only needs to be done once per an EOA.
33
+ """
34
+
35
+ chain: Chain
36
+ r"""The chain to use."""
37
+
38
+ sender: str
39
+ r"""The Ethereum address to use for authorization"""
@@ -0,0 +1,30 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import BaseModel
5
+ import pydantic
6
+ from typing_extensions import Annotated, TypedDict
7
+
8
+
9
+ class MulticallAuthorizationResponseTypedDict(TypedDict):
10
+ r"""Response model for multicall authorization."""
11
+
12
+ nonce: int
13
+ r"""A unique nonce value for this authorization"""
14
+ address: str
15
+ r"""The Ethereum address authorized for multicall"""
16
+ chain_id: int
17
+ r"""The chain ID for the blockchain network"""
18
+
19
+
20
+ class MulticallAuthorizationResponse(BaseModel):
21
+ r"""Response model for multicall authorization."""
22
+
23
+ nonce: int
24
+ r"""A unique nonce value for this authorization"""
25
+
26
+ address: str
27
+ r"""The Ethereum address authorized for multicall"""
28
+
29
+ chain_id: Annotated[int, pydantic.Field(alias="chainId")]
30
+ r"""The chain ID for the blockchain network"""
@@ -0,0 +1,36 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chain import Chain
5
+ from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
6
+ from .useroperation import UserOperation, UserOperationTypedDict
7
+ from compass_api_sdk.types import BaseModel
8
+ from typing import List
9
+ from typing_extensions import TypedDict
10
+
11
+
12
+ class MulticallExecuteRequestTypedDict(TypedDict):
13
+ r"""Request model for executing a multicall."""
14
+
15
+ chain: Chain
16
+ r"""The chain to use."""
17
+ sender: str
18
+ r"""The address of the transaction sender."""
19
+ signed_authorization: SignedAuthorizationTypedDict
20
+ actions: List[UserOperationTypedDict]
21
+ r"""List of possible actions for multicall"""
22
+
23
+
24
+ class MulticallExecuteRequest(BaseModel):
25
+ r"""Request model for executing a multicall."""
26
+
27
+ chain: Chain
28
+ r"""The chain to use."""
29
+
30
+ sender: str
31
+ r"""The address of the transaction sender."""
32
+
33
+ signed_authorization: SignedAuthorization
34
+
35
+ actions: List[UserOperation]
36
+ r"""List of possible actions for multicall"""
compass_api_sdk/sdk.py CHANGED
@@ -21,6 +21,7 @@ if TYPE_CHECKING:
21
21
  from compass_api_sdk.sky import Sky
22
22
  from compass_api_sdk.smart_account import SmartAccount
23
23
  from compass_api_sdk.token_sdk import TokenSDK
24
+ from compass_api_sdk.transaction_batching import TransactionBatching
24
25
  from compass_api_sdk.uniswap_v3 import UniswapV3
25
26
  from compass_api_sdk.universal import Universal
26
27
 
@@ -36,6 +37,7 @@ class CompassAPI(BaseSDK):
36
37
  uniswap_v3: "UniswapV3"
37
38
  universal: "Universal"
38
39
  pendle: "Pendle"
40
+ transaction_batching: "TransactionBatching"
39
41
  smart_account: "SmartAccount"
40
42
  _sub_sdk_map = {
41
43
  "aave_v3": ("compass_api_sdk.aave_v3", "AaveV3"),
@@ -49,6 +51,10 @@ class CompassAPI(BaseSDK):
49
51
  "uniswap_v3": ("compass_api_sdk.uniswap_v3", "UniswapV3"),
50
52
  "universal": ("compass_api_sdk.universal", "Universal"),
51
53
  "pendle": ("compass_api_sdk.pendle", "Pendle"),
54
+ "transaction_batching": (
55
+ "compass_api_sdk.transaction_batching",
56
+ "TransactionBatching",
57
+ ),
52
58
  "smart_account": ("compass_api_sdk.smart_account", "SmartAccount"),
53
59
  }
54
60