compass_api_sdk 0.9.40__py3-none-any.whl → 0.9.42__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/_version.py +3 -3
- compass_api_sdk/aave_v3.py +53 -64
- compass_api_sdk/aerodrome_slipstream.py +29 -28
- compass_api_sdk/erc_4626_vaults.py +13 -12
- compass_api_sdk/models/__init__.py +16 -24
- compass_api_sdk/models/compass_api_backend_models_pendle_read_response_market_userposition.py +82 -0
- compass_api_sdk/models/{userposition.py → compass_api_backend_models_vaults_read_response_vault_userposition.py} +2 -2
- compass_api_sdk/models/pendle_marketop.py +10 -2
- compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
- compass_api_sdk/models/vaultgetvaultresponse.py +19 -6
- compass_api_sdk/morpho.py +49 -60
- compass_api_sdk/pendle.py +71 -268
- compass_api_sdk/sky.py +21 -24
- compass_api_sdk/smart_account.py +5 -4
- compass_api_sdk/token_sdk.py +17 -16
- compass_api_sdk/transaction_bundler.py +13 -12
- compass_api_sdk/uniswap_v3.py +41 -52
- compass_api_sdk/universal.py +33 -32
- compass_api_sdk/utils/__init__.py +0 -3
- compass_api_sdk/utils/serializers.py +1 -18
- compass_api_sdk/utils/unmarshal_json_response.py +24 -0
- {compass_api_sdk-0.9.40.dist-info → compass_api_sdk-0.9.42.dist-info}/METADATA +2 -3
- {compass_api_sdk-0.9.40.dist-info → compass_api_sdk-0.9.42.dist-info}/RECORD +24 -24
- compass_api_sdk/models/pendle_positionop.py +0 -87
- compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
- {compass_api_sdk-0.9.40.dist-info → compass_api_sdk-0.9.42.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,
|
|
@@ -941,7 +940,6 @@ if TYPE_CHECKING:
|
|
|
941
940
|
UserOperationResponse,
|
|
942
941
|
UserOperationResponseTypedDict,
|
|
943
942
|
)
|
|
944
|
-
from .userposition import UserPosition, UserPositionTypedDict
|
|
945
943
|
from .userstate import UserState, UserStateTypedDict
|
|
946
944
|
from .validationerror import (
|
|
947
945
|
Loc,
|
|
@@ -1198,10 +1196,14 @@ __all__ = [
|
|
|
1198
1196
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsAssetTypedDict",
|
|
1199
1197
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultState",
|
|
1200
1198
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultStateTypedDict",
|
|
1199
|
+
"CompassAPIBackendModelsPendleReadResponseMarketUserPosition",
|
|
1200
|
+
"CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict",
|
|
1201
1201
|
"CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance",
|
|
1202
1202
|
"CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict",
|
|
1203
1203
|
"CompassAPIBackendModelsVaultsReadResponseVaultAsset",
|
|
1204
1204
|
"CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict",
|
|
1205
|
+
"CompassAPIBackendModelsVaultsReadResponseVaultUserPosition",
|
|
1206
|
+
"CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict",
|
|
1205
1207
|
"Details",
|
|
1206
1208
|
"DetailsTypedDict",
|
|
1207
1209
|
"EnsNameInfoResponse",
|
|
@@ -1368,8 +1370,6 @@ __all__ = [
|
|
|
1368
1370
|
"PendleGetMarketResponseTypedDict",
|
|
1369
1371
|
"PendleGetQuoteResponse",
|
|
1370
1372
|
"PendleGetQuoteResponseTypedDict",
|
|
1371
|
-
"PendleGetUserPositionResponse",
|
|
1372
|
-
"PendleGetUserPositionResponseTypedDict",
|
|
1373
1373
|
"PendleListMarketsResponse",
|
|
1374
1374
|
"PendleListMarketsResponseTypedDict",
|
|
1375
1375
|
"PendleListUserPositionsResponse",
|
|
@@ -1382,9 +1382,6 @@ __all__ = [
|
|
|
1382
1382
|
"PendleMarketsChain",
|
|
1383
1383
|
"PendleMarketsRequest",
|
|
1384
1384
|
"PendleMarketsRequestTypedDict",
|
|
1385
|
-
"PendlePositionChain",
|
|
1386
|
-
"PendlePositionRequest",
|
|
1387
|
-
"PendlePositionRequestTypedDict",
|
|
1388
1385
|
"PendlePositionsChain",
|
|
1389
1386
|
"PendlePositionsRequest",
|
|
1390
1387
|
"PendlePositionsRequestTypedDict",
|
|
@@ -1661,8 +1658,6 @@ __all__ = [
|
|
|
1661
1658
|
"UserOperationResponse",
|
|
1662
1659
|
"UserOperationResponseTypedDict",
|
|
1663
1660
|
"UserOperationTypedDict",
|
|
1664
|
-
"UserPosition",
|
|
1665
|
-
"UserPositionTypedDict",
|
|
1666
1661
|
"UserState",
|
|
1667
1662
|
"UserStateTypedDict",
|
|
1668
1663
|
"ValidationError",
|
|
@@ -1917,10 +1912,14 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1917
1912
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsAssetTypedDict": ".compass_api_backend_models_morpho_read_response_get_vaults_asset",
|
|
1918
1913
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultState": ".compass_api_backend_models_morpho_read_response_get_vaults_vaultstate",
|
|
1919
1914
|
"CompassAPIBackendModelsMorphoReadResponseGetVaultsVaultStateTypedDict": ".compass_api_backend_models_morpho_read_response_get_vaults_vaultstate",
|
|
1915
|
+
"CompassAPIBackendModelsPendleReadResponseMarketUserPosition": ".compass_api_backend_models_pendle_read_response_market_userposition",
|
|
1916
|
+
"CompassAPIBackendModelsPendleReadResponseMarketUserPositionTypedDict": ".compass_api_backend_models_pendle_read_response_market_userposition",
|
|
1920
1917
|
"CompassAPIBackendModelsPendleReadResponsePositionsTokenBalance": ".compass_api_backend_models_pendle_read_response_positions_tokenbalance",
|
|
1921
1918
|
"CompassAPIBackendModelsPendleReadResponsePositionsTokenBalanceTypedDict": ".compass_api_backend_models_pendle_read_response_positions_tokenbalance",
|
|
1922
1919
|
"CompassAPIBackendModelsVaultsReadResponseVaultAsset": ".compass_api_backend_models_vaults_read_response_vault_asset",
|
|
1923
1920
|
"CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict": ".compass_api_backend_models_vaults_read_response_vault_asset",
|
|
1921
|
+
"CompassAPIBackendModelsVaultsReadResponseVaultUserPosition": ".compass_api_backend_models_vaults_read_response_vault_userposition",
|
|
1922
|
+
"CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict": ".compass_api_backend_models_vaults_read_response_vault_userposition",
|
|
1924
1923
|
"Details": ".details",
|
|
1925
1924
|
"DetailsTypedDict": ".details",
|
|
1926
1925
|
"EnsNameInfoResponse": ".ensnameinforesponse",
|
|
@@ -2055,9 +2054,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2055
2054
|
"PendleMarketsChain": ".pendle_marketsop",
|
|
2056
2055
|
"PendleMarketsRequest": ".pendle_marketsop",
|
|
2057
2056
|
"PendleMarketsRequestTypedDict": ".pendle_marketsop",
|
|
2058
|
-
"PendlePositionChain": ".pendle_positionop",
|
|
2059
|
-
"PendlePositionRequest": ".pendle_positionop",
|
|
2060
|
-
"PendlePositionRequestTypedDict": ".pendle_positionop",
|
|
2061
2057
|
"PendlePositionsChain": ".pendle_positionsop",
|
|
2062
2058
|
"PendlePositionsRequest": ".pendle_positionsop",
|
|
2063
2059
|
"PendlePositionsRequestTypedDict": ".pendle_positionsop",
|
|
@@ -2096,8 +2092,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2096
2092
|
"PendleGetMarketResponseTypedDict": ".pendlegetmarketresponse",
|
|
2097
2093
|
"PendleGetQuoteResponse": ".pendlegetquoteresponse",
|
|
2098
2094
|
"PendleGetQuoteResponseTypedDict": ".pendlegetquoteresponse",
|
|
2099
|
-
"PendleGetUserPositionResponse": ".pendlegetuserpositionresponse",
|
|
2100
|
-
"PendleGetUserPositionResponseTypedDict": ".pendlegetuserpositionresponse",
|
|
2101
2095
|
"PendleListMarketsResponse": ".pendlelistmarketsresponse",
|
|
2102
2096
|
"PendleListMarketsResponseTypedDict": ".pendlelistmarketsresponse",
|
|
2103
2097
|
"PendleListUserPositionsResponse": ".pendlelistuserpositionsresponse",
|
|
@@ -2370,8 +2364,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2370
2364
|
"UserOperationTypedDict": ".useroperation",
|
|
2371
2365
|
"UserOperationResponse": ".useroperationresponse",
|
|
2372
2366
|
"UserOperationResponseTypedDict": ".useroperationresponse",
|
|
2373
|
-
"UserPosition": ".userposition",
|
|
2374
|
-
"UserPositionTypedDict": ".userposition",
|
|
2375
2367
|
"UserState": ".userstate",
|
|
2376
2368
|
"UserStateTypedDict": ".userstate",
|
|
2377
2369
|
"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
|
|
8
|
+
class CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict(TypedDict):
|
|
9
9
|
shares: int
|
|
10
10
|
token_amount: str
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class
|
|
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
|
|
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
|
|
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
|
|
@@ -6,10 +6,19 @@ from .compass_api_backend_models_vaults_read_response_vault_asset import (
|
|
|
6
6
|
CompassAPIBackendModelsVaultsReadResponseVaultAsset,
|
|
7
7
|
CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict,
|
|
8
8
|
)
|
|
9
|
-
from .
|
|
10
|
-
|
|
9
|
+
from .compass_api_backend_models_vaults_read_response_vault_userposition import (
|
|
10
|
+
CompassAPIBackendModelsVaultsReadResponseVaultUserPosition,
|
|
11
|
+
CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict,
|
|
12
|
+
)
|
|
13
|
+
from compass_api_sdk.types import (
|
|
14
|
+
BaseModel,
|
|
15
|
+
Nullable,
|
|
16
|
+
OptionalNullable,
|
|
17
|
+
UNSET,
|
|
18
|
+
UNSET_SENTINEL,
|
|
19
|
+
)
|
|
11
20
|
from pydantic import model_serializer
|
|
12
|
-
from typing_extensions import TypedDict
|
|
21
|
+
from typing_extensions import NotRequired, TypedDict
|
|
13
22
|
|
|
14
23
|
|
|
15
24
|
class VaultGetVaultResponseTypedDict(TypedDict):
|
|
@@ -27,7 +36,9 @@ class VaultGetVaultResponseTypedDict(TypedDict):
|
|
|
27
36
|
r"""The price of one vault share in terms of the underlying asset."""
|
|
28
37
|
asset: CompassAPIBackendModelsVaultsReadResponseVaultAssetTypedDict
|
|
29
38
|
apy: ApyTypedDict
|
|
30
|
-
user_position:
|
|
39
|
+
user_position: NotRequired[
|
|
40
|
+
Nullable[CompassAPIBackendModelsVaultsReadResponseVaultUserPositionTypedDict]
|
|
41
|
+
]
|
|
31
42
|
r"""The user's position in the vault."""
|
|
32
43
|
|
|
33
44
|
|
|
@@ -54,12 +65,14 @@ class VaultGetVaultResponse(BaseModel):
|
|
|
54
65
|
|
|
55
66
|
apy: Apy
|
|
56
67
|
|
|
57
|
-
user_position:
|
|
68
|
+
user_position: OptionalNullable[
|
|
69
|
+
CompassAPIBackendModelsVaultsReadResponseVaultUserPosition
|
|
70
|
+
] = UNSET
|
|
58
71
|
r"""The user's position in the vault."""
|
|
59
72
|
|
|
60
73
|
@model_serializer(mode="wrap")
|
|
61
74
|
def serialize_model(self, handler):
|
|
62
|
-
optional_fields = []
|
|
75
|
+
optional_fields = ["user_position"]
|
|
63
76
|
nullable_fields = ["user_position"]
|
|
64
77
|
null_default_fields = []
|
|
65
78
|
|