compass_api_sdk 0.9.41__py3-none-any.whl → 0.9.43__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 (28) hide show
  1. compass_api_sdk/_version.py +3 -3
  2. compass_api_sdk/aave_v3.py +53 -64
  3. compass_api_sdk/aerodrome_slipstream.py +29 -28
  4. compass_api_sdk/erc_4626_vaults.py +13 -12
  5. compass_api_sdk/models/__init__.py +40 -24
  6. compass_api_sdk/models/compass_api_backend_models_pendle_read_response_market_userposition.py +82 -0
  7. compass_api_sdk/models/{userposition.py → compass_api_backend_models_vaults_read_response_vault_userposition.py} +2 -2
  8. compass_api_sdk/models/pendle_marketop.py +10 -2
  9. compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
  10. compass_api_sdk/models/uniswapbuyexactlyparams.py +32 -24
  11. compass_api_sdk/models/uniswapbuyexactlyrequest.py +32 -24
  12. compass_api_sdk/models/vaultgetvaultresponse.py +10 -3
  13. compass_api_sdk/morpho.py +49 -60
  14. compass_api_sdk/pendle.py +71 -268
  15. compass_api_sdk/sky.py +21 -24
  16. compass_api_sdk/smart_account.py +5 -4
  17. compass_api_sdk/token_sdk.py +17 -16
  18. compass_api_sdk/transaction_bundler.py +13 -12
  19. compass_api_sdk/uniswap_v3.py +61 -60
  20. compass_api_sdk/universal.py +33 -32
  21. compass_api_sdk/utils/__init__.py +0 -3
  22. compass_api_sdk/utils/serializers.py +1 -18
  23. compass_api_sdk/utils/unmarshal_json_response.py +24 -0
  24. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/METADATA +2 -3
  25. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/RECORD +26 -26
  26. compass_api_sdk/models/pendle_positionop.py +0 -87
  27. compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
  28. {compass_api_sdk-0.9.41.dist-info → compass_api_sdk-0.9.43.dist-info}/WHEEL +0 -0
@@ -322,6 +322,10 @@ if TYPE_CHECKING:
322
322
  CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultState,
323
323
  CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultStateTypedDict,
324
324
  )
325
+ from .compass_api_backend_models_pendle_read_response_market_userposition import (
326
+ CompassAPIBackendModelsPendleReadResponseMarketUserPosition,
327
+ CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict,
328
+ )
325
329
  from .compass_api_backend_models_pendle_read_response_positions_tokenbalance import (
326
330
  CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance,
327
331
  CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict,
@@ -330,6 +334,10 @@ if TYPE_CHECKING:
330
334
  CompassAPIBackendModelsVaultsReadResponseVaultAsset,
331
335
  CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict,
332
336
  )
337
+ from .compass_api_backend_models_vaults_read_response_vault_userposition import (
338
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPosition,
339
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict,
340
+ )
333
341
  from .details import Details, DetailsTypedDict
334
342
  from .ensnameinforesponse import EnsNameInfoResponse, EnsNameInfoResponseTypedDict
335
343
  from .erc20data import Erc20Data, Erc20DataTypedDict
@@ -514,11 +522,6 @@ if TYPE_CHECKING:
514
522
  PendleMarketsRequest,
515
523
  PendleMarketsRequestTypedDict,
516
524
  )
517
- from .pendle_positionop import (
518
- PendlePositionChain,
519
- PendlePositionRequest,
520
- PendlePositionRequestTypedDict,
521
- )
522
525
  from .pendle_positionsop import (
523
526
  PendlePositionsChain,
524
527
  PendlePositionsRequest,
@@ -577,10 +580,6 @@ if TYPE_CHECKING:
577
580
  PendleGetQuoteResponse,
578
581
  PendleGetQuoteResponseTypedDict,
579
582
  )
580
- from .pendlegetuserpositionresponse import (
581
- PendleGetUserPositionResponse,
582
- PendleGetUserPositionResponseTypedDict,
583
- )
584
583
  from .pendlelistmarketsresponse import (
585
584
  PendleListMarketsResponse,
586
585
  PendleListMarketsResponseTypedDict,
@@ -809,12 +808,20 @@ if TYPE_CHECKING:
809
808
  UniswapBuyExactlyParams,
810
809
  UniswapBuyExactlyParamsAmount,
811
810
  UniswapBuyExactlyParamsAmountTypedDict,
811
+ UniswapBuyExactlyParamsTokenIn,
812
+ UniswapBuyExactlyParamsTokenInTypedDict,
813
+ UniswapBuyExactlyParamsTokenOut,
814
+ UniswapBuyExactlyParamsTokenOutTypedDict,
812
815
  UniswapBuyExactlyParamsTypedDict,
813
816
  )
814
817
  from .uniswapbuyexactlyrequest import (
815
818
  UniswapBuyExactlyRequest,
816
819
  UniswapBuyExactlyRequestAmount,
817
820
  UniswapBuyExactlyRequestAmountTypedDict,
821
+ UniswapBuyExactlyRequestTokenIn,
822
+ UniswapBuyExactlyRequestTokenInTypedDict,
823
+ UniswapBuyExactlyRequestTokenOut,
824
+ UniswapBuyExactlyRequestTokenOutTypedDict,
818
825
  UniswapBuyExactlyRequestTypedDict,
819
826
  )
820
827
  from .uniswapbuyquoteinforesponse import (
@@ -941,7 +948,6 @@ if TYPE_CHECKING:
941
948
  UserOperationResponse,
942
949
  UserOperationResponseTypedDict,
943
950
  )
944
- from .userposition import UserPosition, UserPositionTypedDict
945
951
  from .userstate import UserState, UserStateTypedDict
946
952
  from .validationerror import (
947
953
  Loc,
@@ -1198,10 +1204,14 @@ __all__ = [
1198
1204
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsAssetTypedDict",
1199
1205
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultState",
1200
1206
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultStateTypedDict",
1207
+ "CompassAPIBackendModelsPendleReadResponseMarketUserPosition",
1208
+ "CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict",
1201
1209
  "CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance",
1202
1210
  "CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict",
1203
1211
  "CompassAPIBackendModelsVaultsReadResponseVaultAsset",
1204
1212
  "CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict",
1213
+ "CompassAPIBackendModelsVaultsReadResponseVaultUserPosition",
1214
+ "CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict",
1205
1215
  "Details",
1206
1216
  "DetailsTypedDict",
1207
1217
  "EnsNameInfoResponse",
@@ -1368,8 +1378,6 @@ __all__ = [
1368
1378
  "PendleGetMarketResponseTypedDict",
1369
1379
  "PendleGetQuoteResponse",
1370
1380
  "PendleGetQuoteResponseTypedDict",
1371
- "PendleGetUserPositionResponse",
1372
- "PendleGetUserPositionResponseTypedDict",
1373
1381
  "PendleListMarketsResponse",
1374
1382
  "PendleListMarketsResponseTypedDict",
1375
1383
  "PendleListUserPositionsResponse",
@@ -1382,9 +1390,6 @@ __all__ = [
1382
1390
  "PendleMarketsChain",
1383
1391
  "PendleMarketsRequest",
1384
1392
  "PendleMarketsRequestTypedDict",
1385
- "PendlePositionChain",
1386
- "PendlePositionRequest",
1387
- "PendlePositionRequestTypedDict",
1388
1393
  "PendlePositionsChain",
1389
1394
  "PendlePositionsRequest",
1390
1395
  "PendlePositionsRequestTypedDict",
@@ -1542,10 +1547,18 @@ __all__ = [
1542
1547
  "UniswapBuyExactlyParams",
1543
1548
  "UniswapBuyExactlyParamsAmount",
1544
1549
  "UniswapBuyExactlyParamsAmountTypedDict",
1550
+ "UniswapBuyExactlyParamsTokenIn",
1551
+ "UniswapBuyExactlyParamsTokenInTypedDict",
1552
+ "UniswapBuyExactlyParamsTokenOut",
1553
+ "UniswapBuyExactlyParamsTokenOutTypedDict",
1545
1554
  "UniswapBuyExactlyParamsTypedDict",
1546
1555
  "UniswapBuyExactlyRequest",
1547
1556
  "UniswapBuyExactlyRequestAmount",
1548
1557
  "UniswapBuyExactlyRequestAmountTypedDict",
1558
+ "UniswapBuyExactlyRequestTokenIn",
1559
+ "UniswapBuyExactlyRequestTokenInTypedDict",
1560
+ "UniswapBuyExactlyRequestTokenOut",
1561
+ "UniswapBuyExactlyRequestTokenOutTypedDict",
1549
1562
  "UniswapBuyExactlyRequestTypedDict",
1550
1563
  "UniswapBuyQuoteInfoResponse",
1551
1564
  "UniswapBuyQuoteInfoResponseTypedDict",
@@ -1661,8 +1674,6 @@ __all__ = [
1661
1674
  "UserOperationResponse",
1662
1675
  "UserOperationResponseTypedDict",
1663
1676
  "UserOperationTypedDict",
1664
- "UserPosition",
1665
- "UserPositionTypedDict",
1666
1677
  "UserState",
1667
1678
  "UserStateTypedDict",
1668
1679
  "ValidationError",
@@ -1917,10 +1928,14 @@ _dynamic_imports: dict[str, str] = {
1917
1928
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsAssetTypedDict": ".compass_api_backend_models_morpho_read_response_get_vaults_asset",
1918
1929
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultState": ".compass_api_backend_models_morpho_read_response_get_vaults_vaultstate",
1919
1930
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultStateTypedDict": ".compass_api_backend_models_morpho_read_response_get_vaults_vaultstate",
1931
+ "CompassAPIBackendModelsPendleReadResponseMarketUserPosition": ".compass_api_backend_models_pendle_read_response_market_userposition",
1932
+ "CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict": ".compass_api_backend_models_pendle_read_response_market_userposition",
1920
1933
  "CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance": ".compass_api_backend_models_pendle_read_response_positions_tokenbalance",
1921
1934
  "CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict": ".compass_api_backend_models_pendle_read_response_positions_tokenbalance",
1922
1935
  "CompassAPIBackendModelsVaultsReadResponseVaultAsset": ".compass_api_backend_models_vaults_read_response_vault_asset",
1923
1936
  "CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict": ".compass_api_backend_models_vaults_read_response_vault_asset",
1937
+ "CompassAPIBackendModelsVaultsReadResponseVaultUserPosition": ".compass_api_backend_models_vaults_read_response_vault_userposition",
1938
+ "CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict": ".compass_api_backend_models_vaults_read_response_vault_userposition",
1924
1939
  "Details": ".details",
1925
1940
  "DetailsTypedDict": ".details",
1926
1941
  "EnsNameInfoResponse": ".ensnameinforesponse",
@@ -2055,9 +2070,6 @@ _dynamic_imports: dict[str, str] = {
2055
2070
  "PendleMarketsChain": ".pendle_marketsop",
2056
2071
  "PendleMarketsRequest": ".pendle_marketsop",
2057
2072
  "PendleMarketsRequestTypedDict": ".pendle_marketsop",
2058
- "PendlePositionChain": ".pendle_positionop",
2059
- "PendlePositionRequest": ".pendle_positionop",
2060
- "PendlePositionRequestTypedDict": ".pendle_positionop",
2061
2073
  "PendlePositionsChain": ".pendle_positionsop",
2062
2074
  "PendlePositionsRequest": ".pendle_positionsop",
2063
2075
  "PendlePositionsRequestTypedDict": ".pendle_positionsop",
@@ -2096,8 +2108,6 @@ _dynamic_imports: dict[str, str] = {
2096
2108
  "PendleGetMarketResponseTypedDict": ".pendlegetmarketresponse",
2097
2109
  "PendleGetQuoteResponse": ".pendlegetquoteresponse",
2098
2110
  "PendleGetQuoteResponseTypedDict": ".pendlegetquoteresponse",
2099
- "PendleGetUserPositionResponse": ".pendlegetuserpositionresponse",
2100
- "PendleGetUserPositionResponseTypedDict": ".pendlegetuserpositionresponse",
2101
2111
  "PendleListMarketsResponse": ".pendlelistmarketsresponse",
2102
2112
  "PendleListMarketsResponseTypedDict": ".pendlelistmarketsresponse",
2103
2113
  "PendleListUserPositionsResponse": ".pendlelistuserpositionsresponse",
@@ -2277,10 +2287,18 @@ _dynamic_imports: dict[str, str] = {
2277
2287
  "UniswapBuyExactlyParams": ".uniswapbuyexactlyparams",
2278
2288
  "UniswapBuyExactlyParamsAmount": ".uniswapbuyexactlyparams",
2279
2289
  "UniswapBuyExactlyParamsAmountTypedDict": ".uniswapbuyexactlyparams",
2290
+ "UniswapBuyExactlyParamsTokenIn": ".uniswapbuyexactlyparams",
2291
+ "UniswapBuyExactlyParamsTokenInTypedDict": ".uniswapbuyexactlyparams",
2292
+ "UniswapBuyExactlyParamsTokenOut": ".uniswapbuyexactlyparams",
2293
+ "UniswapBuyExactlyParamsTokenOutTypedDict": ".uniswapbuyexactlyparams",
2280
2294
  "UniswapBuyExactlyParamsTypedDict": ".uniswapbuyexactlyparams",
2281
2295
  "UniswapBuyExactlyRequest": ".uniswapbuyexactlyrequest",
2282
2296
  "UniswapBuyExactlyRequestAmount": ".uniswapbuyexactlyrequest",
2283
2297
  "UniswapBuyExactlyRequestAmountTypedDict": ".uniswapbuyexactlyrequest",
2298
+ "UniswapBuyExactlyRequestTokenIn": ".uniswapbuyexactlyrequest",
2299
+ "UniswapBuyExactlyRequestTokenInTypedDict": ".uniswapbuyexactlyrequest",
2300
+ "UniswapBuyExactlyRequestTokenOut": ".uniswapbuyexactlyrequest",
2301
+ "UniswapBuyExactlyRequestTokenOutTypedDict": ".uniswapbuyexactlyrequest",
2284
2302
  "UniswapBuyExactlyRequestTypedDict": ".uniswapbuyexactlyrequest",
2285
2303
  "UniswapBuyQuoteInfoResponse": ".uniswapbuyquoteinforesponse",
2286
2304
  "UniswapBuyQuoteInfoResponseTypedDict": ".uniswapbuyquoteinforesponse",
@@ -2370,8 +2388,6 @@ _dynamic_imports: dict[str, str] = {
2370
2388
  "UserOperationTypedDict": ".useroperation",
2371
2389
  "UserOperationResponse": ".useroperationresponse",
2372
2390
  "UserOperationResponseTypedDict": ".useroperationresponse",
2373
- "UserPosition": ".userposition",
2374
- "UserPositionTypedDict": ".userposition",
2375
2391
  "UserState": ".userstate",
2376
2392
  "UserStateTypedDict": ".userstate",
2377
2393
  "Loc": ".validationerror",
@@ -0,0 +1,82 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compass_api_sdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing_extensions import NotRequired, TypedDict
13
+
14
+
15
+ class CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict(TypedDict):
16
+ claimable_yield: str
17
+ r"""The amount of yield that can be claimed in the underlying token."""
18
+ sy_balance: str
19
+ r"""The amount of SY tokens the user currently holds."""
20
+ pt_balance: str
21
+ r"""The amount of PT tokens the user currently holds."""
22
+ yt_balance: str
23
+ r"""The amount of YT tokens the user currently holds."""
24
+ lp_balance: str
25
+ r"""The amount of LP tokens the user currently holds."""
26
+ underlying_token_balance: str
27
+ r"""The amount of underlying tokens the user currently holds."""
28
+ accounting_asset_balance: NotRequired[Nullable[str]]
29
+ r"""The amount of accounting assets the user currently holds."""
30
+
31
+
32
+ class CompassAPIBackendModelsPendleReadResponseMarketUserPosition(BaseModel):
33
+ claimable_yield: str
34
+ r"""The amount of yield that can be claimed in the underlying token."""
35
+
36
+ sy_balance: str
37
+ r"""The amount of SY tokens the user currently holds."""
38
+
39
+ pt_balance: str
40
+ r"""The amount of PT tokens the user currently holds."""
41
+
42
+ yt_balance: str
43
+ r"""The amount of YT tokens the user currently holds."""
44
+
45
+ lp_balance: str
46
+ r"""The amount of LP tokens the user currently holds."""
47
+
48
+ underlying_token_balance: str
49
+ r"""The amount of underlying tokens the user currently holds."""
50
+
51
+ accounting_asset_balance: OptionalNullable[str] = UNSET
52
+ r"""The amount of accounting assets the user currently holds."""
53
+
54
+ @model_serializer(mode="wrap")
55
+ def serialize_model(self, handler):
56
+ optional_fields = ["accounting_asset_balance"]
57
+ nullable_fields = ["accounting_asset_balance"]
58
+ null_default_fields = []
59
+
60
+ serialized = handler(self)
61
+
62
+ m = {}
63
+
64
+ for n, f in type(self).model_fields.items():
65
+ k = f.alias or n
66
+ val = serialized.get(k)
67
+ serialized.pop(k, None)
68
+
69
+ optional_nullable = k in optional_fields and k in nullable_fields
70
+ is_set = (
71
+ self.__pydantic_fields_set__.intersection({n})
72
+ or k in null_default_fields
73
+ ) # pylint: disable=no-member
74
+
75
+ if val is not None and val != UNSET_SENTINEL:
76
+ m[k] = val
77
+ elif val != UNSET_SENTINEL and (
78
+ not k in optional_fields or (optional_nullable and is_set)
79
+ ):
80
+ m[k] = val
81
+
82
+ return m
@@ -5,12 +5,12 @@ from compass_api_sdk.types import BaseModel
5
5
  from typing_extensions import TypedDict
6
6
 
7
7
 
8
- class UserPositionTypedDict(TypedDict):
8
+ class CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict(TypedDict):
9
9
  shares: int
10
10
  token_amount: str
11
11
 
12
12
 
13
- class UserPosition(BaseModel):
13
+ class CompassAPIBackendModelsVaultsReadResponseVaultUserPosition(BaseModel):
14
14
  shares: int
15
15
 
16
16
  token_amount: str
@@ -29,6 +29,8 @@ class PendleMarketRequestTypedDict(TypedDict):
29
29
  r"""Optional block number (defaults to latest)."""
30
30
  market_address: str
31
31
  r"""The market address of the desired position."""
32
+ user_address: NotRequired[Nullable[str]]
33
+ r"""The user address of the desired market position. Only include if you would like the user position included in the response. Defaults to `None`."""
32
34
 
33
35
 
34
36
  class PendleMarketRequest(BaseModel):
@@ -49,10 +51,16 @@ class PendleMarketRequest(BaseModel):
49
51
  ] = "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538"
50
52
  r"""The market address of the desired position."""
51
53
 
54
+ user_address: Annotated[
55
+ OptionalNullable[str],
56
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
57
+ ] = UNSET
58
+ r"""The user address of the desired market position. Only include if you would like the user position included in the response. Defaults to `None`."""
59
+
52
60
  @model_serializer(mode="wrap")
53
61
  def serialize_model(self, handler):
54
- optional_fields = ["block"]
55
- nullable_fields = ["block"]
62
+ optional_fields = ["block", "user_address"]
63
+ nullable_fields = ["block", "user_address"]
56
64
  null_default_fields = []
57
65
 
58
66
  serialized = handler(self)
@@ -1,10 +1,21 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .compass_api_backend_models_pendle_read_response_market_userposition import (
5
+ CompassAPIBackendModelsPendleReadResponseMarketUserPosition,
6
+ CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict,
7
+ )
4
8
  from .markettokens import MarketTokens, MarketTokensTypedDict
5
- from compass_api_sdk.types import BaseModel
9
+ from compass_api_sdk.types import (
10
+ BaseModel,
11
+ Nullable,
12
+ OptionalNullable,
13
+ UNSET,
14
+ UNSET_SENTINEL,
15
+ )
6
16
  from datetime import datetime
7
- from typing_extensions import TypedDict
17
+ from pydantic import model_serializer
18
+ from typing_extensions import NotRequired, TypedDict
8
19
 
9
20
 
10
21
  class PendleGetMarketResponseTypedDict(TypedDict):
@@ -15,6 +26,10 @@ class PendleGetMarketResponseTypedDict(TypedDict):
15
26
  maturity_date: datetime
16
27
  r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
17
28
  tokens: MarketTokensTypedDict
29
+ user_position: NotRequired[
30
+ Nullable[CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict]
31
+ ]
32
+ r"""The user's position in the market."""
18
33
 
19
34
 
20
35
  class PendleGetMarketResponse(BaseModel):
@@ -28,3 +43,38 @@ class PendleGetMarketResponse(BaseModel):
28
43
  r"""The maturity date of the market. ISO 8601 format. UTC timezone."""
29
44
 
30
45
  tokens: MarketTokens
46
+
47
+ user_position: OptionalNullable[
48
+ CompassAPIBackendModelsPendleReadResponseMarketUserPosition
49
+ ] = UNSET
50
+ r"""The user's position in the market."""
51
+
52
+ @model_serializer(mode="wrap")
53
+ def serialize_model(self, handler):
54
+ optional_fields = ["user_position"]
55
+ nullable_fields = ["user_position"]
56
+ null_default_fields = []
57
+
58
+ serialized = handler(self)
59
+
60
+ m = {}
61
+
62
+ for n, f in type(self).model_fields.items():
63
+ k = f.alias or n
64
+ val = serialized.get(k)
65
+ serialized.pop(k, None)
66
+
67
+ optional_nullable = k in optional_fields and k in nullable_fields
68
+ is_set = (
69
+ self.__pydantic_fields_set__.intersection({n})
70
+ or k in null_default_fields
71
+ ) # pylint: disable=no-member
72
+
73
+ if val is not None and val != UNSET_SENTINEL:
74
+ m[k] = val
75
+ elif val != UNSET_SENTINEL and (
76
+ not k in optional_fields or (optional_nullable and is_set)
77
+ ):
78
+ m[k] = val
79
+
80
+ return m
@@ -11,6 +11,30 @@ from typing import Literal, Optional, Union
11
11
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
12
12
 
13
13
 
14
+ UniswapBuyExactlyParamsTokenInTypedDict = TypeAliasType(
15
+ "UniswapBuyExactlyParamsTokenInTypedDict", Union[TokenEnum, str]
16
+ )
17
+ r"""The symbol of the token to swap from."""
18
+
19
+
20
+ UniswapBuyExactlyParamsTokenIn = TypeAliasType(
21
+ "UniswapBuyExactlyParamsTokenIn", Union[TokenEnum, str]
22
+ )
23
+ r"""The symbol of the token to swap from."""
24
+
25
+
26
+ UniswapBuyExactlyParamsTokenOutTypedDict = TypeAliasType(
27
+ "UniswapBuyExactlyParamsTokenOutTypedDict", Union[TokenEnum, str]
28
+ )
29
+ r"""The symbol of the token to swap to."""
30
+
31
+
32
+ UniswapBuyExactlyParamsTokenOut = TypeAliasType(
33
+ "UniswapBuyExactlyParamsTokenOut", Union[TokenEnum, str]
34
+ )
35
+ r"""The symbol of the token to swap to."""
36
+
37
+
14
38
  UniswapBuyExactlyParamsAmountTypedDict = TypeAliasType(
15
39
  "UniswapBuyExactlyParamsAmountTypedDict", Union[float, str]
16
40
  )
@@ -24,18 +48,10 @@ r"""The amount of the token to swap to"""
24
48
 
25
49
 
26
50
  class UniswapBuyExactlyParamsTypedDict(TypedDict):
27
- token_in: TokenEnum
28
- r"""A class representing the token.
29
-
30
- This class is used to represent the token in the system. Notice individual
31
- endpoints' documentation where per chain tokens are presented.
32
- """
33
- token_out: TokenEnum
34
- r"""A class representing the token.
35
-
36
- This class is used to represent the token in the system. Notice individual
37
- endpoints' documentation where per chain tokens are presented.
38
- """
51
+ token_in: UniswapBuyExactlyParamsTokenInTypedDict
52
+ r"""The symbol of the token to swap from."""
53
+ token_out: UniswapBuyExactlyParamsTokenOutTypedDict
54
+ r"""The symbol of the token to swap to."""
39
55
  fee: FeeEnum
40
56
  r"""The transaction fee of a Uniswap pool in bips.
41
57
 
@@ -51,19 +67,11 @@ class UniswapBuyExactlyParamsTypedDict(TypedDict):
51
67
 
52
68
 
53
69
  class UniswapBuyExactlyParams(BaseModel):
54
- token_in: TokenEnum
55
- r"""A class representing the token.
56
-
57
- This class is used to represent the token in the system. Notice individual
58
- endpoints' documentation where per chain tokens are presented.
59
- """
70
+ token_in: UniswapBuyExactlyParamsTokenIn
71
+ r"""The symbol of the token to swap from."""
60
72
 
61
- token_out: TokenEnum
62
- r"""A class representing the token.
63
-
64
- This class is used to represent the token in the system. Notice individual
65
- endpoints' documentation where per chain tokens are presented.
66
- """
73
+ token_out: UniswapBuyExactlyParamsTokenOut
74
+ r"""The symbol of the token to swap to."""
67
75
 
68
76
  fee: FeeEnum
69
77
  r"""The transaction fee of a Uniswap pool in bips.
@@ -12,6 +12,30 @@ from typing import Literal, Optional, Union
12
12
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
13
13
 
14
14
 
15
+ UniswapBuyExactlyRequestTokenInTypedDict = TypeAliasType(
16
+ "UniswapBuyExactlyRequestTokenInTypedDict", Union[TokenEnum, str]
17
+ )
18
+ r"""The symbol of the token to swap from."""
19
+
20
+
21
+ UniswapBuyExactlyRequestTokenIn = TypeAliasType(
22
+ "UniswapBuyExactlyRequestTokenIn", Union[TokenEnum, str]
23
+ )
24
+ r"""The symbol of the token to swap from."""
25
+
26
+
27
+ UniswapBuyExactlyRequestTokenOutTypedDict = TypeAliasType(
28
+ "UniswapBuyExactlyRequestTokenOutTypedDict", Union[TokenEnum, str]
29
+ )
30
+ r"""The symbol of the token to swap to."""
31
+
32
+
33
+ UniswapBuyExactlyRequestTokenOut = TypeAliasType(
34
+ "UniswapBuyExactlyRequestTokenOut", Union[TokenEnum, str]
35
+ )
36
+ r"""The symbol of the token to swap to."""
37
+
38
+
15
39
  UniswapBuyExactlyRequestAmountTypedDict = TypeAliasType(
16
40
  "UniswapBuyExactlyRequestAmountTypedDict", Union[float, str]
17
41
  )
@@ -27,18 +51,10 @@ r"""The amount of the token to swap to"""
27
51
  class UniswapBuyExactlyRequestTypedDict(TypedDict):
28
52
  r"""Request model for buying an exact amount of tokens."""
29
53
 
30
- token_in: TokenEnum
31
- r"""A class representing the token.
32
-
33
- This class is used to represent the token in the system. Notice individual
34
- endpoints' documentation where per chain tokens are presented.
35
- """
36
- token_out: TokenEnum
37
- r"""A class representing the token.
38
-
39
- This class is used to represent the token in the system. Notice individual
40
- endpoints' documentation where per chain tokens are presented.
41
- """
54
+ token_in: UniswapBuyExactlyRequestTokenInTypedDict
55
+ r"""The symbol of the token to swap from."""
56
+ token_out: UniswapBuyExactlyRequestTokenOutTypedDict
57
+ r"""The symbol of the token to swap to."""
42
58
  fee: FeeEnum
43
59
  r"""The transaction fee of a Uniswap pool in bips.
44
60
 
@@ -60,19 +76,11 @@ class UniswapBuyExactlyRequestTypedDict(TypedDict):
60
76
  class UniswapBuyExactlyRequest(BaseModel):
61
77
  r"""Request model for buying an exact amount of tokens."""
62
78
 
63
- token_in: TokenEnum
64
- r"""A class representing the token.
65
-
66
- This class is used to represent the token in the system. Notice individual
67
- endpoints' documentation where per chain tokens are presented.
68
- """
79
+ token_in: UniswapBuyExactlyRequestTokenIn
80
+ r"""The symbol of the token to swap from."""
69
81
 
70
- token_out: TokenEnum
71
- r"""A class representing the token.
72
-
73
- This class is used to represent the token in the system. Notice individual
74
- endpoints' documentation where per chain tokens are presented.
75
- """
82
+ token_out: UniswapBuyExactlyRequestTokenOut
83
+ r"""The symbol of the token to swap to."""
76
84
 
77
85
  fee: FeeEnum
78
86
  r"""The transaction fee of a Uniswap pool in bips.
@@ -6,7 +6,10 @@ from .compass_api_backend_models_vaults_read_response_vault_asset import (
6
6
  CompassAPIBackendModelsVaultsReadResponseVaultAsset,
7
7
  CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict,
8
8
  )
9
- from .userposition import UserPosition, UserPositionTypedDict
9
+ from .compass_api_backend_models_vaults_read_response_vault_userposition import (
10
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPosition,
11
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict,
12
+ )
10
13
  from compass_api_sdk.types import (
11
14
  BaseModel,
12
15
  Nullable,
@@ -33,7 +36,9 @@ class VaultGetVaultResponseTypedDict(TypedDict):
33
36
  r"""The price of one vault share in terms of the underlying asset."""
34
37
  asset: CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict
35
38
  apy: ApyTypedDict
36
- user_position: NotRequired[Nullable[UserPositionTypedDict]]
39
+ user_position: NotRequired[
40
+ Nullable[CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict]
41
+ ]
37
42
  r"""The user's position in the vault."""
38
43
 
39
44
 
@@ -60,7 +65,9 @@ class VaultGetVaultResponse(BaseModel):
60
65
 
61
66
  apy: Apy
62
67
 
63
- user_position: OptionalNullable[UserPosition] = UNSET
68
+ user_position: OptionalNullable[
69
+ CompassAPIBackendModelsVaultsReadResponseVaultUserPosition
70
+ ] = UNSET
64
71
  r"""The user's position in the vault."""
65
72
 
66
73
  @model_serializer(mode="wrap")