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

Files changed (133) hide show
  1. compass_api_sdk/_version.py +3 -3
  2. compass_api_sdk/aave_v3.py +198 -198
  3. compass_api_sdk/aerodrome_slipstream.py +108 -108
  4. compass_api_sdk/erc_4626_vaults.py +44 -44
  5. compass_api_sdk/errors/__init__.py +3 -2
  6. compass_api_sdk/models/__init__.py +900 -746
  7. compass_api_sdk/models/aaveborrowrequest.py +9 -5
  8. compass_api_sdk/models/aavehistoricaltransactionsresponse.py +5 -5
  9. compass_api_sdk/models/aavelooprequest.py +59 -11
  10. compass_api_sdk/models/aaverepayrequest.py +9 -5
  11. compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
  12. compass_api_sdk/models/aavesupplyrequest.py +9 -5
  13. compass_api_sdk/models/aavewithdrawrequest.py +9 -5
  14. compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +7 -5
  15. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +7 -5
  16. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +7 -5
  17. compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +7 -5
  18. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +7 -5
  19. compass_api_sdk/models/batcheduseroperationsrequest.py +9 -5
  20. compass_api_sdk/models/chain.py +3 -3
  21. compass_api_sdk/models/details.py +44 -7
  22. compass_api_sdk/models/morphoborrowrequest.py +3 -2
  23. compass_api_sdk/models/morphodepositrequest.py +3 -2
  24. compass_api_sdk/models/morphorepayrequest.py +3 -2
  25. compass_api_sdk/models/morphosupplycollateralrequest.py +3 -2
  26. compass_api_sdk/models/morphowithdrawcollateralrequest.py +3 -2
  27. compass_api_sdk/models/morphowithdrawrequest.py +3 -2
  28. compass_api_sdk/models/movement10percent.py +65 -10
  29. compass_api_sdk/models/multicallauthorizationrequest.py +9 -5
  30. compass_api_sdk/models/multicallexecuterequest.py +53 -10
  31. compass_api_sdk/models/odosswaprequest.py +9 -5
  32. compass_api_sdk/models/pendlemanageliquidityparams.py +81 -0
  33. compass_api_sdk/models/pendlemanageliquidityrequest.py +95 -0
  34. compass_api_sdk/models/pendleredeemyieldrequest.py +9 -5
  35. compass_api_sdk/models/pendletradeptparams.py +81 -0
  36. compass_api_sdk/models/pendletradeptrequest.py +95 -0
  37. compass_api_sdk/models/pendletradeytparams.py +81 -0
  38. compass_api_sdk/models/pendletradeytrequest.py +95 -0
  39. compass_api_sdk/models/pendletxresponse.py +45 -0
  40. compass_api_sdk/models/setallowancerequest.py +8 -5
  41. compass_api_sdk/models/skybuyrequest.py +7 -9
  42. compass_api_sdk/models/skydepositrequest.py +7 -8
  43. compass_api_sdk/models/skysellrequest.py +7 -9
  44. compass_api_sdk/models/skywithdrawrequest.py +7 -8
  45. compass_api_sdk/models/token_enum.py +17 -0
  46. compass_api_sdk/models/tokentransferparams.py +67 -0
  47. compass_api_sdk/models/tokentransferrequest.py +9 -5
  48. compass_api_sdk/models/transactionresponse.py +40 -0
  49. compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -24
  50. compass_api_sdk/models/uniswapbuyexactlyrequest.py +28 -29
  51. compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +45 -0
  52. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +9 -5
  53. compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +9 -5
  54. compass_api_sdk/models/uniswapsellexactlyparams.py +43 -40
  55. compass_api_sdk/models/uniswapsellexactlyrequest.py +52 -45
  56. compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +45 -0
  57. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +9 -5
  58. compass_api_sdk/models/unwrapwethrequest.py +9 -5
  59. compass_api_sdk/models/useroperation.py +34 -40
  60. compass_api_sdk/models/{aave_aave_supported_tokensop.py → v1_aave_aave_supported_tokensop.py} +9 -13
  61. compass_api_sdk/models/{aave_avg_rateop.py → v1_aave_avg_rateop.py} +32 -19
  62. compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +9 -13
  63. compass_api_sdk/models/{aave_liquidity_changeop.py → v1_aave_liquidity_changeop.py} +30 -17
  64. compass_api_sdk/models/{aave_rateop.py → v1_aave_rateop.py} +32 -19
  65. compass_api_sdk/models/{aave_reserve_overviewop.py → v1_aave_reserve_overviewop.py} +32 -19
  66. compass_api_sdk/models/{aave_std_rateop.py → v1_aave_std_rateop.py} +32 -19
  67. compass_api_sdk/models/{aave_token_priceop.py → v1_aave_token_priceop.py} +32 -19
  68. compass_api_sdk/models/{aave_user_position_per_tokenop.py → v1_aave_user_position_per_tokenop.py} +32 -19
  69. compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +9 -13
  70. compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_aerodrome_slipstream_liquidity_provision_positionsop.py} +7 -13
  71. compass_api_sdk/models/{aerodrome_slipstream_pool_priceop.py → v1_aerodrome_slipstream_pool_priceop.py} +53 -25
  72. compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +24 -25
  73. compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +7 -13
  74. compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +9 -13
  75. compass_api_sdk/models/{generic_supported_chainsop.py → v1_generic_supported_chainsop.py} +2 -2
  76. compass_api_sdk/models/v1_generic_supported_tokensop.py +24 -0
  77. compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +9 -8
  78. compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +9 -8
  79. compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +9 -8
  80. compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +9 -8
  81. compass_api_sdk/models/{morpho_vaultop.py → v1_morpho_vaultop.py} +9 -13
  82. compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +9 -8
  83. compass_api_sdk/models/{pendle_marketop.py → v1_pendle_marketop.py} +9 -13
  84. compass_api_sdk/models/v1_pendle_marketsop.py +24 -0
  85. compass_api_sdk/models/{pendle_positionsop.py → v1_pendle_positionsop.py} +10 -14
  86. compass_api_sdk/models/{sky_positionop.py → v1_sky_positionop.py} +14 -15
  87. compass_api_sdk/models/{token_addressop.py → v1_token_addressop.py} +30 -17
  88. compass_api_sdk/models/{token_balanceop.py → v1_token_balanceop.py} +14 -18
  89. compass_api_sdk/models/{token_priceop.py → v1_token_priceop.py} +14 -18
  90. compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +24 -0
  91. compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +9 -13
  92. compass_api_sdk/models/{aerodrome_slipstream_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +9 -13
  93. compass_api_sdk/models/{uniswap_pool_priceop.py → v1_uniswap_pool_priceop.py} +59 -29
  94. compass_api_sdk/models/{uniswap_quote_buy_exactlyop.py → v1_uniswap_quote_buy_exactlyop.py} +65 -35
  95. compass_api_sdk/models/{uniswap_quote_sell_exactlyop.py → v1_uniswap_quote_sell_exactlyop.py} +65 -35
  96. compass_api_sdk/models/{vaults_vaultop.py → v1_vaults_vaultop.py} +9 -13
  97. compass_api_sdk/models/vaultdepositparams.py +85 -0
  98. compass_api_sdk/models/vaultdepositrequest.py +9 -5
  99. compass_api_sdk/models/vaultwithdrawparams.py +75 -0
  100. compass_api_sdk/models/vaultwithdrawrequest.py +9 -5
  101. compass_api_sdk/models/wrapethrequest.py +9 -5
  102. compass_api_sdk/morpho.py +140 -140
  103. compass_api_sdk/pendle.py +254 -1066
  104. compass_api_sdk/sky.py +98 -56
  105. compass_api_sdk/smart_account.py +10 -10
  106. compass_api_sdk/swap.py +16 -16
  107. compass_api_sdk/token_sdk.py +56 -56
  108. compass_api_sdk/transaction_bundler.py +64 -62
  109. compass_api_sdk/uniswap_v3.py +222 -214
  110. compass_api_sdk/universal.py +104 -292
  111. compass_api_sdk/utils/__init__.py +3 -2
  112. {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/METADATA +83 -88
  113. {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/RECORD +114 -117
  114. compass_api_sdk/models/generic_supported_tokensop.py +0 -28
  115. compass_api_sdk/models/generic_visualize_portfolioop.py +0 -37
  116. compass_api_sdk/models/image.py +0 -15
  117. compass_api_sdk/models/pendle_marketsop.py +0 -28
  118. compass_api_sdk/models/pendle_quoteop.py +0 -128
  119. compass_api_sdk/models/pendleaddliquidityparams.py +0 -50
  120. compass_api_sdk/models/pendleaddliquidityrequest.py +0 -61
  121. compass_api_sdk/models/pendlebuyptparams.py +0 -48
  122. compass_api_sdk/models/pendlebuyptrequest.py +0 -59
  123. compass_api_sdk/models/pendlebuyytparams.py +0 -48
  124. compass_api_sdk/models/pendlebuyytrequest.py +0 -59
  125. compass_api_sdk/models/pendlegetquoteresponse.py +0 -15
  126. compass_api_sdk/models/pendleremoveliquidityparams.py +0 -50
  127. compass_api_sdk/models/pendleremoveliquidityrequest.py +0 -61
  128. compass_api_sdk/models/pendlesellptparams.py +0 -48
  129. compass_api_sdk/models/pendlesellptrequest.py +0 -61
  130. compass_api_sdk/models/pendlesellytparams.py +0 -48
  131. compass_api_sdk/models/pendlesellytrequest.py +0 -61
  132. compass_api_sdk/models/txresponse.py +0 -27
  133. {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-1.0.0.dist-info}/WHEEL +0 -0
@@ -1,7 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .interestratemode import InterestRateMode
6
5
  from .token_enum import TokenEnum
7
6
  from compass_api_sdk.types import (
@@ -12,6 +11,7 @@ from compass_api_sdk.types import (
12
11
  UNSET_SENTINEL,
13
12
  )
14
13
  from compass_api_sdk.utils import validate_const
14
+ from enum import Enum
15
15
  import pydantic
16
16
  from pydantic import model_serializer
17
17
  from pydantic.functional_validators import AfterValidator
@@ -29,6 +29,12 @@ AaveBorrowRequestAmount = TypeAliasType("AaveBorrowRequestAmount", Union[float,
29
29
  r"""The amount of the asset to borrow"""
30
30
 
31
31
 
32
+ class AaveBorrowRequestChain(str, Enum):
33
+ ARBITRUM = "arbitrum"
34
+ BASE = "base"
35
+ ETHEREUM = "ethereum"
36
+
37
+
32
38
  class AaveBorrowRequestTypedDict(TypedDict):
33
39
  token: TokenEnum
34
40
  r"""A class representing the token.
@@ -43,8 +49,7 @@ class AaveBorrowRequestTypedDict(TypedDict):
43
49
 
44
50
  A stable (but typically higher rate), or a variable rate.
45
51
  """
46
- chain: Chain
47
- r"""The chain to use."""
52
+ chain: AaveBorrowRequestChain
48
53
  sender: str
49
54
  r"""The address of the transaction sender."""
50
55
  action_type: Literal["AAVE_BORROW"]
@@ -69,8 +74,7 @@ class AaveBorrowRequest(BaseModel):
69
74
  A stable (but typically higher rate), or a variable rate.
70
75
  """
71
76
 
72
- chain: Chain
73
- r"""The chain to use."""
77
+ chain: AaveBorrowRequestChain
74
78
 
75
79
  sender: str
76
80
  r"""The address of the transaction sender."""
@@ -15,8 +15,8 @@ from typing import List, Union
15
15
  from typing_extensions import Annotated, TypeAliasType, TypedDict
16
16
 
17
17
 
18
- TransactionTypedDict = TypeAliasType(
19
- "TransactionTypedDict",
18
+ AaveHistoricalTransactionsResponseTransactionTypedDict = TypeAliasType(
19
+ "AaveHistoricalTransactionsResponseTransactionTypedDict",
20
20
  Union[
21
21
  RedeemUnderlyingTypedDict,
22
22
  RepayTypedDict,
@@ -29,7 +29,7 @@ TransactionTypedDict = TypeAliasType(
29
29
  )
30
30
 
31
31
 
32
- Transaction = Annotated[
32
+ AaveHistoricalTransactionsResponseTransaction = Annotated[
33
33
  Union[
34
34
  Annotated[Borrow, Tag("Borrow")],
35
35
  Annotated[LiquidationCall, Tag("LiquidationCall")],
@@ -50,7 +50,7 @@ class AaveHistoricalTransactionsResponseTypedDict(TypedDict):
50
50
  r"""Specifies how many transactions to skip before returning results, letting you choose the starting point for the data you want to receive."""
51
51
  limit: int
52
52
  r"""Sets the maximum number of transactions to include in the response, helping control the size of the returned dataset."""
53
- transactions: List[TransactionTypedDict]
53
+ transactions: List[AaveHistoricalTransactionsResponseTransactionTypedDict]
54
54
 
55
55
 
56
56
  class AaveHistoricalTransactionsResponse(BaseModel):
@@ -62,4 +62,4 @@ class AaveHistoricalTransactionsResponse(BaseModel):
62
62
  limit: int
63
63
  r"""Sets the maximum number of transactions to include in the response, helping control the size of the returned dataset."""
64
64
 
65
- transactions: List[Transaction]
65
+ transactions: List[AaveHistoricalTransactionsResponseTransaction]
@@ -1,12 +1,25 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
6
5
  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
6
+ from compass_api_sdk.types import (
7
+ BaseModel,
8
+ Nullable,
9
+ OptionalNullable,
10
+ UNSET,
11
+ UNSET_SENTINEL,
12
+ )
13
+ from enum import Enum
14
+ from pydantic import model_serializer
15
+ from typing import Optional, Union
16
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
17
+
18
+
19
+ class AaveLoopRequestChain(str, Enum):
20
+ ARBITRUM = "arbitrum"
21
+ BASE = "base"
22
+ ETHEREUM = "ethereum"
10
23
 
11
24
 
12
25
  InitialCollateralAmountTypedDict = TypeAliasType(
@@ -48,11 +61,9 @@ r"""Loan To Value percentage of the loop"""
48
61
  class AaveLoopRequestTypedDict(TypedDict):
49
62
  r"""Request model for executing an Aave loop strategy."""
50
63
 
51
- chain: Chain
52
- r"""The chain to use."""
64
+ chain: AaveLoopRequestChain
53
65
  sender: str
54
66
  r"""The address of the transaction sender."""
55
- signed_authorization: SignedAuthorizationTypedDict
56
67
  collateral_token: TokenEnum
57
68
  r"""A class representing the token.
58
69
 
@@ -73,19 +84,20 @@ class AaveLoopRequestTypedDict(TypedDict):
73
84
  r"""Maximum allowed slippage for token swaps in percentage"""
74
85
  loan_to_value: LoanToValueTypedDict
75
86
  r"""Loan To Value percentage of the loop"""
87
+ signed_authorization: NotRequired[Nullable[SignedAuthorizationTypedDict]]
88
+ r"""EIP-7702 authorization. Required when `is_account_abstraction` is False."""
89
+ is_account_abstraction: NotRequired[bool]
90
+ r"""Whether to use account abstraction for the transaction."""
76
91
 
77
92
 
78
93
  class AaveLoopRequest(BaseModel):
79
94
  r"""Request model for executing an Aave loop strategy."""
80
95
 
81
- chain: Chain
82
- r"""The chain to use."""
96
+ chain: AaveLoopRequestChain
83
97
 
84
98
  sender: str
85
99
  r"""The address of the transaction sender."""
86
100
 
87
- signed_authorization: SignedAuthorization
88
-
89
101
  collateral_token: TokenEnum
90
102
  r"""A class representing the token.
91
103
 
@@ -111,3 +123,39 @@ class AaveLoopRequest(BaseModel):
111
123
 
112
124
  loan_to_value: LoanToValue
113
125
  r"""Loan To Value percentage of the loop"""
126
+
127
+ signed_authorization: OptionalNullable[SignedAuthorization] = UNSET
128
+ r"""EIP-7702 authorization. Required when `is_account_abstraction` is False."""
129
+
130
+ is_account_abstraction: Optional[bool] = False
131
+ r"""Whether to use account abstraction for the transaction."""
132
+
133
+ @model_serializer(mode="wrap")
134
+ def serialize_model(self, handler):
135
+ optional_fields = ["signed_authorization", "is_account_abstraction"]
136
+ nullable_fields = ["signed_authorization"]
137
+ null_default_fields = []
138
+
139
+ serialized = handler(self)
140
+
141
+ m = {}
142
+
143
+ for n, f in type(self).model_fields.items():
144
+ k = f.alias or n
145
+ val = serialized.get(k)
146
+ serialized.pop(k, None)
147
+
148
+ optional_nullable = k in optional_fields and k in nullable_fields
149
+ is_set = (
150
+ self.__pydantic_fields_set__.intersection({n})
151
+ or k in null_default_fields
152
+ ) # pylint: disable=no-member
153
+
154
+ if val is not None and val != UNSET_SENTINEL:
155
+ m[k] = val
156
+ elif val != UNSET_SENTINEL and (
157
+ not k in optional_fields or (optional_nullable and is_set)
158
+ ):
159
+ m[k] = val
160
+
161
+ return m
@@ -1,7 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .interestratemode import InterestRateMode
6
5
  from .token_enum import TokenEnum
7
6
  from compass_api_sdk.types import (
@@ -12,6 +11,7 @@ from compass_api_sdk.types import (
12
11
  UNSET_SENTINEL,
13
12
  )
14
13
  from compass_api_sdk.utils import validate_const
14
+ from enum import Enum
15
15
  import pydantic
16
16
  from pydantic import model_serializer
17
17
  from pydantic.functional_validators import AfterValidator
@@ -29,6 +29,12 @@ AaveRepayRequestAmount = TypeAliasType("AaveRepayRequestAmount", Union[float, st
29
29
  r"""The amount of the asset to repay"""
30
30
 
31
31
 
32
+ class AaveRepayRequestChain(str, Enum):
33
+ ARBITRUM = "arbitrum"
34
+ BASE = "base"
35
+ ETHEREUM = "ethereum"
36
+
37
+
32
38
  class AaveRepayRequestTypedDict(TypedDict):
33
39
  token: TokenEnum
34
40
  r"""A class representing the token.
@@ -43,8 +49,7 @@ class AaveRepayRequestTypedDict(TypedDict):
43
49
 
44
50
  A stable (but typically higher rate), or a variable rate.
45
51
  """
46
- chain: Chain
47
- r"""The chain to use."""
52
+ chain: AaveRepayRequestChain
48
53
  sender: str
49
54
  r"""The address of the transaction sender."""
50
55
  action_type: Literal["AAVE_REPAY"]
@@ -69,8 +74,7 @@ class AaveRepayRequest(BaseModel):
69
74
  A stable (but typically higher rate), or a variable rate.
70
75
  """
71
76
 
72
- chain: Chain
73
- r"""The chain to use."""
77
+ chain: AaveRepayRequestChain
74
78
 
75
79
  sender: str
76
80
  r"""The address of the transaction sender."""
@@ -1,7 +1,8 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from compass_api_sdk.types import BaseModel
4
+ from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
5
+ from pydantic import model_serializer
5
6
  from typing_extensions import TypedDict
6
7
 
7
8
 
@@ -10,7 +11,7 @@ class AaveReserveOverviewResponseTypedDict(TypedDict):
10
11
  r"""Total tokens supplied in an Aave Reserve in USD. E.G. How much WBTC has been supplied on Aave in USD."""
11
12
  total_borrowed: float
12
13
  r"""Total tokens borrowed in an Aave Reserve converted to USD. E.G. How much WBTC has been supplied on Aave (in USD)."""
13
- utilization_ratio: float
14
+ utilization_ratio: Nullable[float]
14
15
  r"""Total borrowed divided by total supplied in an Aave Reserve. E.G. How much WBTC has been borrowed on Aaave divided by the amount supplied"""
15
16
 
16
17
 
@@ -21,5 +22,35 @@ class AaveReserveOverviewResponse(BaseModel):
21
22
  total_borrowed: float
22
23
  r"""Total tokens borrowed in an Aave Reserve converted to USD. E.G. How much WBTC has been supplied on Aave (in USD)."""
23
24
 
24
- utilization_ratio: float
25
+ utilization_ratio: Nullable[float]
25
26
  r"""Total borrowed divided by total supplied in an Aave Reserve. E.G. How much WBTC has been borrowed on Aaave divided by the amount supplied"""
27
+
28
+ @model_serializer(mode="wrap")
29
+ def serialize_model(self, handler):
30
+ optional_fields = []
31
+ nullable_fields = ["utilization_ratio"]
32
+ null_default_fields = []
33
+
34
+ serialized = handler(self)
35
+
36
+ m = {}
37
+
38
+ for n, f in type(self).model_fields.items():
39
+ k = f.alias or n
40
+ val = serialized.get(k)
41
+ serialized.pop(k, None)
42
+
43
+ optional_nullable = k in optional_fields and k in nullable_fields
44
+ is_set = (
45
+ self.__pydantic_fields_set__.intersection({n})
46
+ or k in null_default_fields
47
+ ) # pylint: disable=no-member
48
+
49
+ if val is not None and val != UNSET_SENTINEL:
50
+ m[k] = val
51
+ elif val != UNSET_SENTINEL and (
52
+ not k in optional_fields or (optional_nullable and is_set)
53
+ ):
54
+ m[k] = val
55
+
56
+ return m
@@ -1,7 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .token_enum import TokenEnum
6
5
  from compass_api_sdk.types import (
7
6
  BaseModel,
@@ -11,6 +10,7 @@ from compass_api_sdk.types import (
11
10
  UNSET_SENTINEL,
12
11
  )
13
12
  from compass_api_sdk.utils import validate_const
13
+ from enum import Enum
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
16
  from pydantic.functional_validators import AfterValidator
@@ -28,6 +28,12 @@ AaveSupplyRequestAmount = TypeAliasType("AaveSupplyRequestAmount", Union[float,
28
28
  r"""The amount of the asset to supply"""
29
29
 
30
30
 
31
+ class AaveSupplyRequestChain(str, Enum):
32
+ ARBITRUM = "arbitrum"
33
+ BASE = "base"
34
+ ETHEREUM = "ethereum"
35
+
36
+
31
37
  class AaveSupplyRequestTypedDict(TypedDict):
32
38
  token: TokenEnum
33
39
  r"""A class representing the token.
@@ -37,8 +43,7 @@ class AaveSupplyRequestTypedDict(TypedDict):
37
43
  """
38
44
  amount: AaveSupplyRequestAmountTypedDict
39
45
  r"""The amount of the asset to supply"""
40
- chain: Chain
41
- r"""The chain to use."""
46
+ chain: AaveSupplyRequestChain
42
47
  sender: str
43
48
  r"""The address of the transaction sender."""
44
49
  action_type: Literal["AAVE_SUPPLY"]
@@ -57,8 +62,7 @@ class AaveSupplyRequest(BaseModel):
57
62
  amount: AaveSupplyRequestAmount
58
63
  r"""The amount of the asset to supply"""
59
64
 
60
- chain: Chain
61
- r"""The chain to use."""
65
+ chain: AaveSupplyRequestChain
62
66
 
63
67
  sender: str
64
68
  r"""The address of the transaction sender."""
@@ -1,10 +1,10 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .token_enum import TokenEnum
6
5
  from compass_api_sdk.types import BaseModel
7
6
  from compass_api_sdk.utils import validate_const
7
+ from enum import Enum
8
8
  import pydantic
9
9
  from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional, Union
@@ -23,6 +23,12 @@ AaveWithdrawRequestAmount = TypeAliasType(
23
23
  r"""The amount of the asset to withdraw"""
24
24
 
25
25
 
26
+ class AaveWithdrawRequestChain(str, Enum):
27
+ ARBITRUM = "arbitrum"
28
+ BASE = "base"
29
+ ETHEREUM = "ethereum"
30
+
31
+
26
32
  class AaveWithdrawRequestTypedDict(TypedDict):
27
33
  token: TokenEnum
28
34
  r"""A class representing the token.
@@ -34,8 +40,7 @@ class AaveWithdrawRequestTypedDict(TypedDict):
34
40
  r"""The amount of the asset to withdraw"""
35
41
  recipient: str
36
42
  r"""The address of the recipient of the withdrawn funds."""
37
- chain: Chain
38
- r"""The chain to use."""
43
+ chain: AaveWithdrawRequestChain
39
44
  sender: str
40
45
  r"""The address of the transaction sender."""
41
46
  action_type: Literal["AAVE_WITHDRAW"]
@@ -55,8 +60,7 @@ class AaveWithdrawRequest(BaseModel):
55
60
  recipient: str
56
61
  r"""The address of the recipient of the withdrawn funds."""
57
62
 
58
- chain: Chain
59
- r"""The chain to use."""
63
+ chain: AaveWithdrawRequestChain
60
64
 
61
65
  sender: str
62
66
  r"""The address of the transaction sender."""
@@ -1,10 +1,10 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .token_enum import TokenEnum
6
5
  from compass_api_sdk.types import BaseModel
7
6
  from compass_api_sdk.utils import validate_const
7
+ from enum import Enum
8
8
  import pydantic
9
9
  from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional, Union
@@ -35,6 +35,10 @@ AerodromeSlipstreamBuyExactlyRequestAmountInMaximum = TypeAliasType(
35
35
  r"""The maximum amount of the token to swap from"""
36
36
 
37
37
 
38
+ class AerodromeSlipstreamBuyExactlyRequestChain(str, Enum):
39
+ BASE = "base"
40
+
41
+
38
42
  class AerodromeSlipstreamBuyExactlyRequestTypedDict(TypedDict):
39
43
  r"""Request model for buying exactly an amount of tokens."""
40
44
 
@@ -56,8 +60,7 @@ class AerodromeSlipstreamBuyExactlyRequestTypedDict(TypedDict):
56
60
  r"""The amount of the token to swap to"""
57
61
  amount_in_maximum: AerodromeSlipstreamBuyExactlyRequestAmountInMaximumTypedDict
58
62
  r"""The maximum amount of the token to swap from"""
59
- chain: Chain
60
- r"""The chain to use."""
63
+ chain: AerodromeSlipstreamBuyExactlyRequestChain
61
64
  sender: str
62
65
  r"""The address of the transaction sender."""
63
66
  action_type: Literal["AERODROME_SLIPSTREAM_BUY_EXACTLY"]
@@ -89,8 +92,7 @@ class AerodromeSlipstreamBuyExactlyRequest(BaseModel):
89
92
  amount_in_maximum: AerodromeSlipstreamBuyExactlyRequestAmountInMaximum
90
93
  r"""The maximum amount of the token to swap from"""
91
94
 
92
- chain: Chain
93
- r"""The chain to use."""
95
+ chain: AerodromeSlipstreamBuyExactlyRequestChain
94
96
 
95
97
  sender: str
96
98
  r"""The address of the transaction sender."""
@@ -1,9 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from compass_api_sdk.types import BaseModel
6
5
  from compass_api_sdk.utils import validate_const
6
+ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
@@ -68,6 +68,10 @@ AerodromeSlipstreamIncreaseLiquidityProvisionRequestAmount1Min = TypeAliasType(
68
68
  r"""The minimum amount of the second token to deposit"""
69
69
 
70
70
 
71
+ class AerodromeSlipstreamIncreaseLiquidityProvisionRequestChain(str, Enum):
72
+ BASE = "base"
73
+
74
+
71
75
  class AerodromeSlipstreamIncreaseLiquidityProvisionRequestTypedDict(TypedDict):
72
76
  token_id: int
73
77
  r"""Token ID of the NFT representing the liquidity provisioned position."""
@@ -83,8 +87,7 @@ class AerodromeSlipstreamIncreaseLiquidityProvisionRequestTypedDict(TypedDict):
83
87
  r"""The minimum amount of the first token to deposit"""
84
88
  amount1_min: AerodromeSlipstreamIncreaseLiquidityProvisionRequestAmount1MinTypedDict
85
89
  r"""The minimum amount of the second token to deposit"""
86
- chain: Chain
87
- r"""The chain to use."""
90
+ chain: AerodromeSlipstreamIncreaseLiquidityProvisionRequestChain
88
91
  sender: str
89
92
  r"""The address of the transaction sender."""
90
93
  action_type: Literal["AERODROME_SLIPSTREAM_INCREASE_LIQUIDITY_PROVISION"]
@@ -106,8 +109,7 @@ class AerodromeSlipstreamIncreaseLiquidityProvisionRequest(BaseModel):
106
109
  amount1_min: AerodromeSlipstreamIncreaseLiquidityProvisionRequestAmount1Min
107
110
  r"""The minimum amount of the second token to deposit"""
108
111
 
109
- chain: Chain
110
- r"""The chain to use."""
112
+ chain: AerodromeSlipstreamIncreaseLiquidityProvisionRequestChain
111
113
 
112
114
  sender: str
113
115
  r"""The address of the transaction sender."""
@@ -1,7 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .token_enum import TokenEnum
6
5
  from compass_api_sdk.types import (
7
6
  BaseModel,
@@ -11,6 +10,7 @@ from compass_api_sdk.types import (
11
10
  UNSET_SENTINEL,
12
11
  )
13
12
  from compass_api_sdk.utils import validate_const
13
+ from enum import Enum
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
16
  from pydantic.functional_validators import AfterValidator
@@ -70,6 +70,10 @@ AerodromeSlipstreamMintLiquidityProvisionRequestAmount1Min = TypeAliasType(
70
70
  r"""The minimum amount of the second token to deposit"""
71
71
 
72
72
 
73
+ class AerodromeSlipstreamMintLiquidityProvisionRequestChain(str, Enum):
74
+ BASE = "base"
75
+
76
+
73
77
  class AerodromeSlipstreamMintLiquidityProvisionRequestTypedDict(TypedDict):
74
78
  r"""Request model for minting a new liquidity position."""
75
79
 
@@ -103,8 +107,7 @@ class AerodromeSlipstreamMintLiquidityProvisionRequestTypedDict(TypedDict):
103
107
  r"""The minimum amount of the first token to deposit"""
104
108
  amount1_min: AerodromeSlipstreamMintLiquidityProvisionRequestAmount1MinTypedDict
105
109
  r"""The minimum amount of the second token to deposit"""
106
- chain: Chain
107
- r"""The chain to use."""
110
+ chain: AerodromeSlipstreamMintLiquidityProvisionRequestChain
108
111
  sender: str
109
112
  r"""The address of the transaction sender."""
110
113
  action_type: Literal["AERODROME_SLIPSTREAM_MINT_LIQUIDITY_PROVISION"]
@@ -150,8 +153,7 @@ class AerodromeSlipstreamMintLiquidityProvisionRequest(BaseModel):
150
153
  amount1_min: AerodromeSlipstreamMintLiquidityProvisionRequestAmount1Min
151
154
  r"""The minimum amount of the second token to deposit"""
152
155
 
153
- chain: Chain
154
- r"""The chain to use."""
156
+ chain: AerodromeSlipstreamMintLiquidityProvisionRequestChain
155
157
 
156
158
  sender: str
157
159
  r"""The address of the transaction sender."""
@@ -1,10 +1,10 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .token_enum import TokenEnum
6
5
  from compass_api_sdk.types import BaseModel
7
6
  from compass_api_sdk.utils import validate_const
7
+ from enum import Enum
8
8
  import pydantic
9
9
  from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional, Union
@@ -35,6 +35,10 @@ AerodromeSlipstreamSellExactlyRequestAmountOutMinimum = TypeAliasType(
35
35
  r"""The minimum amount of the token to swap to, defaults to 0"""
36
36
 
37
37
 
38
+ class AerodromeSlipstreamSellExactlyRequestChain(str, Enum):
39
+ BASE = "base"
40
+
41
+
38
42
  class AerodromeSlipstreamSellExactlyRequestTypedDict(TypedDict):
39
43
  r"""Request model for selling exactly an amount of tokens."""
40
44
 
@@ -54,8 +58,7 @@ class AerodromeSlipstreamSellExactlyRequestTypedDict(TypedDict):
54
58
  r"""The tick spacing of the pool"""
55
59
  amount_in: AerodromeSlipstreamSellExactlyRequestAmountInTypedDict
56
60
  r"""The amount of the token to swap from"""
57
- chain: Chain
58
- r"""The chain to use."""
61
+ chain: AerodromeSlipstreamSellExactlyRequestChain
59
62
  sender: str
60
63
  r"""The address of the transaction sender."""
61
64
  action_type: Literal["AERODROME_SLIPSTREAM_SELL_EXACTLY"]
@@ -88,8 +91,7 @@ class AerodromeSlipstreamSellExactlyRequest(BaseModel):
88
91
  amount_in: AerodromeSlipstreamSellExactlyRequestAmountIn
89
92
  r"""The amount of the token to swap from"""
90
93
 
91
- chain: Chain
92
- r"""The chain to use."""
94
+ chain: AerodromeSlipstreamSellExactlyRequestChain
93
95
 
94
96
  sender: str
95
97
  r"""The address of the transaction sender."""
@@ -1,9 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from compass_api_sdk.types import BaseModel
6
5
  from compass_api_sdk.utils import validate_const
6
+ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
@@ -26,13 +26,16 @@ AerodromeSlipstreamWithdrawLiquidityProvisionRequestPercentageForWithdrawal = (
26
26
  r"""How much liquidity to take out in percentage."""
27
27
 
28
28
 
29
+ class AerodromeSlipstreamWithdrawLiquidityProvisionRequestChain(str, Enum):
30
+ BASE = "base"
31
+
32
+
29
33
  class AerodromeSlipstreamWithdrawLiquidityProvisionRequestTypedDict(TypedDict):
30
34
  token_id: int
31
35
  r"""Token ID of the NFT representing the liquidity provisioned position."""
32
36
  percentage_for_withdrawal: AerodromeSlipstreamWithdrawLiquidityProvisionRequestPercentageForWithdrawalTypedDict
33
37
  r"""How much liquidity to take out in percentage."""
34
- chain: Chain
35
- r"""The chain to use."""
38
+ chain: AerodromeSlipstreamWithdrawLiquidityProvisionRequestChain
36
39
  sender: str
37
40
  r"""The address of the transaction sender."""
38
41
  action_type: Literal["AERODROME_SLIPSTREAM_WITHDRAW_LIQUIDITY_PROVISION"]
@@ -47,8 +50,7 @@ class AerodromeSlipstreamWithdrawLiquidityProvisionRequest(BaseModel):
47
50
  )
48
51
  r"""How much liquidity to take out in percentage."""
49
52
 
50
- chain: Chain
51
- r"""The chain to use."""
53
+ chain: AerodromeSlipstreamWithdrawLiquidityProvisionRequestChain
52
54
 
53
55
  sender: str
54
56
  r"""The address of the transaction sender."""
@@ -1,18 +1,23 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .chain import Chain
5
4
  from .useroperation import UserOperation, UserOperationTypedDict
6
5
  from compass_api_sdk.types import BaseModel
6
+ from enum import Enum
7
7
  from typing import List
8
8
  from typing_extensions import TypedDict
9
9
 
10
10
 
11
+ class BatchedUserOperationsRequestChain(str, Enum):
12
+ ARBITRUM = "arbitrum"
13
+ BASE = "base"
14
+ ETHEREUM = "ethereum"
15
+
16
+
11
17
  class BatchedUserOperationsRequestTypedDict(TypedDict):
12
18
  r"""Request model for batching user operations."""
13
19
 
14
- chain: Chain
15
- r"""The chain to use."""
20
+ chain: BatchedUserOperationsRequestChain
16
21
  sender: str
17
22
  r"""The address of the transaction sender."""
18
23
  operations: List[UserOperationTypedDict]
@@ -22,8 +27,7 @@ class BatchedUserOperationsRequestTypedDict(TypedDict):
22
27
  class BatchedUserOperationsRequest(BaseModel):
23
28
  r"""Request model for batching user operations."""
24
29
 
25
- chain: Chain
26
- r"""The chain to use."""
30
+ chain: BatchedUserOperationsRequestChain
27
31
 
28
32
  sender: str
29
33
  r"""The address of the transaction sender."""
@@ -7,6 +7,6 @@ from enum import Enum
7
7
  class Chain(str, Enum):
8
8
  r"""The chain to use."""
9
9
 
10
- BASE_MAINNET = "base:mainnet"
11
- ETHEREUM_MAINNET = "ethereum:mainnet"
12
- ARBITRUM_MAINNET = "arbitrum:mainnet"
10
+ BASE = "base"
11
+ ETHEREUM = "ethereum"
12
+ ARBITRUM = "arbitrum"