compass_api_sdk 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of compass_api_sdk might be problematic. Click here for more details.

@@ -0,0 +1,75 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Union
13
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
14
+
15
+
16
+ MorphoDepositParamsAmountTypedDict = TypeAliasType(
17
+ "MorphoDepositParamsAmountTypedDict", Union[float, str]
18
+ )
19
+ r"""The amount of tokens to deposit into the vault."""
20
+
21
+
22
+ MorphoDepositParamsAmount = TypeAliasType(
23
+ "MorphoDepositParamsAmount", Union[float, str]
24
+ )
25
+ r"""The amount of tokens to deposit into the vault."""
26
+
27
+
28
+ class MorphoDepositParamsTypedDict(TypedDict):
29
+ vault_address: str
30
+ r"""The vault address you are depositing to."""
31
+ amount: MorphoDepositParamsAmountTypedDict
32
+ r"""The amount of tokens to deposit into the vault."""
33
+ receiver: NotRequired[Nullable[str]]
34
+ r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
35
+
36
+
37
+ class MorphoDepositParams(BaseModel):
38
+ vault_address: str
39
+ r"""The vault address you are depositing to."""
40
+
41
+ amount: MorphoDepositParamsAmount
42
+ r"""The amount of tokens to deposit into the vault."""
43
+
44
+ receiver: OptionalNullable[str] = UNSET
45
+ r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
46
+
47
+ @model_serializer(mode="wrap")
48
+ def serialize_model(self, handler):
49
+ optional_fields = ["receiver"]
50
+ nullable_fields = ["receiver"]
51
+ null_default_fields = []
52
+
53
+ serialized = handler(self)
54
+
55
+ m = {}
56
+
57
+ for n, f in type(self).model_fields.items():
58
+ k = f.alias or n
59
+ val = serialized.get(k)
60
+ serialized.pop(k, None)
61
+
62
+ optional_nullable = k in optional_fields and k in nullable_fields
63
+ is_set = (
64
+ self.__pydantic_fields_set__.intersection({n})
65
+ or k in null_default_fields
66
+ ) # pylint: disable=no-member
67
+
68
+ if val is not None and val != UNSET_SENTINEL:
69
+ m[k] = val
70
+ elif val != UNSET_SENTINEL and (
71
+ not k in optional_fields or (optional_nullable and is_set)
72
+ ):
73
+ m[k] = val
74
+
75
+ return m
@@ -0,0 +1,68 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Any
13
+ from typing_extensions import NotRequired, TypedDict
14
+
15
+
16
+ class MorphoRepayParamsTypedDict(TypedDict):
17
+ amount: Any
18
+ r"""Amount of the token to repay to the market. If set to 'ALL', all debt plus interest will be paid back if the user has a sufficient token balance in their wallet."""
19
+ unique_market_key: str
20
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
21
+ on_behalf_of: NotRequired[Nullable[str]]
22
+ r"""The address on behalf of whom the repayment is made. Defaults to sender."""
23
+ callback_data: NotRequired[Nullable[bytes]]
24
+ r"""An optional field for callback byte data that will be triggered upon successful repaying of debt."""
25
+
26
+
27
+ class MorphoRepayParams(BaseModel):
28
+ amount: Any
29
+ r"""Amount of the token to repay to the market. If set to 'ALL', all debt plus interest will be paid back if the user has a sufficient token balance in their wallet."""
30
+
31
+ unique_market_key: str
32
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
33
+
34
+ on_behalf_of: OptionalNullable[str] = UNSET
35
+ r"""The address on behalf of whom the repayment is made. Defaults to sender."""
36
+
37
+ callback_data: OptionalNullable[bytes] = UNSET
38
+ r"""An optional field for callback byte data that will be triggered upon successful repaying of debt."""
39
+
40
+ @model_serializer(mode="wrap")
41
+ def serialize_model(self, handler):
42
+ optional_fields = ["on_behalf_of", "callback_data"]
43
+ nullable_fields = ["on_behalf_of", "callback_data"]
44
+ null_default_fields = []
45
+
46
+ serialized = handler(self)
47
+
48
+ m = {}
49
+
50
+ for n, f in type(self).model_fields.items():
51
+ k = f.alias or n
52
+ val = serialized.get(k)
53
+ serialized.pop(k, None)
54
+
55
+ optional_nullable = k in optional_fields and k in nullable_fields
56
+ is_set = (
57
+ self.__pydantic_fields_set__.intersection({n})
58
+ or k in null_default_fields
59
+ ) # pylint: disable=no-member
60
+
61
+ if val is not None and val != UNSET_SENTINEL:
62
+ m[k] = val
63
+ elif val != UNSET_SENTINEL and (
64
+ not k in optional_fields or (optional_nullable and is_set)
65
+ ):
66
+ m[k] = val
67
+
68
+ return m
@@ -0,0 +1,33 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from typing import Union
6
+ from typing_extensions import TypeAliasType, TypedDict
7
+
8
+
9
+ MorphoSetVaultAllowanceParamsAmountTypedDict = TypeAliasType(
10
+ "MorphoSetVaultAllowanceParamsAmountTypedDict", Union[float, str]
11
+ )
12
+ r"""The amount of tokens to increase the allowance by."""
13
+
14
+
15
+ MorphoSetVaultAllowanceParamsAmount = TypeAliasType(
16
+ "MorphoSetVaultAllowanceParamsAmount", Union[float, str]
17
+ )
18
+ r"""The amount of tokens to increase the allowance by."""
19
+
20
+
21
+ class MorphoSetVaultAllowanceParamsTypedDict(TypedDict):
22
+ vault_address: str
23
+ r"""The vault address you are increasing the allowance for."""
24
+ amount: MorphoSetVaultAllowanceParamsAmountTypedDict
25
+ r"""The amount of tokens to increase the allowance by."""
26
+
27
+
28
+ class MorphoSetVaultAllowanceParams(BaseModel):
29
+ vault_address: str
30
+ r"""The vault address you are increasing the allowance for."""
31
+
32
+ amount: MorphoSetVaultAllowanceParamsAmount
33
+ r"""The amount of tokens to increase the allowance by."""
@@ -0,0 +1,80 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Union
13
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
14
+
15
+
16
+ MorphoSupplyCollateralParamsAmountTypedDict = TypeAliasType(
17
+ "MorphoSupplyCollateralParamsAmountTypedDict", Union[float, str]
18
+ )
19
+ r"""Amount of the token to supply to the market as collateral."""
20
+
21
+
22
+ MorphoSupplyCollateralParamsAmount = TypeAliasType(
23
+ "MorphoSupplyCollateralParamsAmount", Union[float, str]
24
+ )
25
+ r"""Amount of the token to supply to the market as collateral."""
26
+
27
+
28
+ class MorphoSupplyCollateralParamsTypedDict(TypedDict):
29
+ amount: MorphoSupplyCollateralParamsAmountTypedDict
30
+ r"""Amount of the token to supply to the market as collateral."""
31
+ unique_market_key: str
32
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
33
+ on_behalf_of: NotRequired[Nullable[str]]
34
+ r"""The address on behalf of whom the supplied collateral is made. Defaults to sender."""
35
+ callback_data: NotRequired[Nullable[bytes]]
36
+ r"""An optional field for callback byte data that will be triggered upon successful supplying of collateral."""
37
+
38
+
39
+ class MorphoSupplyCollateralParams(BaseModel):
40
+ amount: MorphoSupplyCollateralParamsAmount
41
+ r"""Amount of the token to supply to the market as collateral."""
42
+
43
+ unique_market_key: str
44
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
45
+
46
+ on_behalf_of: OptionalNullable[str] = UNSET
47
+ r"""The address on behalf of whom the supplied collateral is made. Defaults to sender."""
48
+
49
+ callback_data: OptionalNullable[bytes] = UNSET
50
+ r"""An optional field for callback byte data that will be triggered upon successful supplying of collateral."""
51
+
52
+ @model_serializer(mode="wrap")
53
+ def serialize_model(self, handler):
54
+ optional_fields = ["on_behalf_of", "callback_data"]
55
+ nullable_fields = ["on_behalf_of", "callback_data"]
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
@@ -0,0 +1,80 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Union
13
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
14
+
15
+
16
+ MorphoWithdrawCollateralParamsAmountTypedDict = TypeAliasType(
17
+ "MorphoWithdrawCollateralParamsAmountTypedDict", Union[float, str]
18
+ )
19
+ r"""Amount of the token to supply to the market as collateral."""
20
+
21
+
22
+ MorphoWithdrawCollateralParamsAmount = TypeAliasType(
23
+ "MorphoWithdrawCollateralParamsAmount", Union[float, str]
24
+ )
25
+ r"""Amount of the token to supply to the market as collateral."""
26
+
27
+
28
+ class MorphoWithdrawCollateralParamsTypedDict(TypedDict):
29
+ amount: MorphoWithdrawCollateralParamsAmountTypedDict
30
+ r"""Amount of the token to supply to the market as collateral."""
31
+ unique_market_key: str
32
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
33
+ on_behalf_of: NotRequired[Nullable[str]]
34
+ r"""The address on behalf of whom the withdraw is made. Defaults to sender."""
35
+ receiver: NotRequired[Nullable[str]]
36
+ r"""The address where the withdrawn collateral will be received. Defaults to sender."""
37
+
38
+
39
+ class MorphoWithdrawCollateralParams(BaseModel):
40
+ amount: MorphoWithdrawCollateralParamsAmount
41
+ r"""Amount of the token to supply to the market as collateral."""
42
+
43
+ unique_market_key: str
44
+ r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
45
+
46
+ on_behalf_of: OptionalNullable[str] = UNSET
47
+ r"""The address on behalf of whom the withdraw is made. Defaults to sender."""
48
+
49
+ receiver: OptionalNullable[str] = UNSET
50
+ r"""The address where the withdrawn collateral will be received. Defaults to sender."""
51
+
52
+ @model_serializer(mode="wrap")
53
+ def serialize_model(self, handler):
54
+ optional_fields = ["on_behalf_of", "receiver"]
55
+ nullable_fields = ["on_behalf_of", "receiver"]
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
@@ -0,0 +1,63 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Any
13
+ from typing_extensions import NotRequired, TypedDict
14
+
15
+
16
+ class MorphoWithdrawParamsTypedDict(TypedDict):
17
+ vault_address: str
18
+ r"""The vault address you are withdrawing from."""
19
+ amount: Any
20
+ r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
21
+ receiver: NotRequired[Nullable[str]]
22
+ r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
23
+
24
+
25
+ class MorphoWithdrawParams(BaseModel):
26
+ vault_address: str
27
+ r"""The vault address you are withdrawing from."""
28
+
29
+ amount: Any
30
+ r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
31
+
32
+ receiver: OptionalNullable[str] = UNSET
33
+ r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
34
+
35
+ @model_serializer(mode="wrap")
36
+ def serialize_model(self, handler):
37
+ optional_fields = ["receiver"]
38
+ nullable_fields = ["receiver"]
39
+ null_default_fields = []
40
+
41
+ serialized = handler(self)
42
+
43
+ m = {}
44
+
45
+ for n, f in type(self).model_fields.items():
46
+ k = f.alias or n
47
+ val = serialized.get(k)
48
+ serialized.pop(k, None)
49
+
50
+ optional_nullable = k in optional_fields and k in nullable_fields
51
+ is_set = (
52
+ self.__pydantic_fields_set__.intersection({n})
53
+ or k in null_default_fields
54
+ ) # pylint: disable=no-member
55
+
56
+ if val is not None and val != UNSET_SENTINEL:
57
+ m[k] = val
58
+ elif val != UNSET_SENTINEL and (
59
+ not k in optional_fields or (optional_nullable and is_set)
60
+ ):
61
+ m[k] = val
62
+
63
+ return m
@@ -33,7 +33,27 @@ from .increaseallowanceparams import (
33
33
  IncreaseAllowanceParams,
34
34
  IncreaseAllowanceParamsTypedDict,
35
35
  )
36
+ from .morphoborrowparams import MorphoBorrowParams, MorphoBorrowParamsTypedDict
37
+ from .morphodepositparams import MorphoDepositParams, MorphoDepositParamsTypedDict
38
+ from .morphorepayparams import MorphoRepayParams, MorphoRepayParamsTypedDict
39
+ from .morphosetvaultallowanceparams import (
40
+ MorphoSetVaultAllowanceParams,
41
+ MorphoSetVaultAllowanceParamsTypedDict,
42
+ )
43
+ from .morphosupplycollateralparams import (
44
+ MorphoSupplyCollateralParams,
45
+ MorphoSupplyCollateralParamsTypedDict,
46
+ )
47
+ from .morphowithdrawcollateralparams import (
48
+ MorphoWithdrawCollateralParams,
49
+ MorphoWithdrawCollateralParamsTypedDict,
50
+ )
51
+ from .morphowithdrawparams import MorphoWithdrawParams, MorphoWithdrawParamsTypedDict
36
52
  from .multicallactiontype import MulticallActionType
53
+ from .skybuyparams import SkyBuyParams, SkyBuyParamsTypedDict
54
+ from .skydepositparams import SkyDepositParams, SkyDepositParamsTypedDict
55
+ from .skysellparams import SkySellParams, SkySellParamsTypedDict
56
+ from .skywithdrawparams import SkyWithdrawParams, SkyWithdrawParamsTypedDict
37
57
  from .tokentransfererc20params import (
38
58
  TokenTransferErc20Params,
39
59
  TokenTransferErc20ParamsTypedDict,
@@ -70,23 +90,34 @@ BodyTypedDict = TypeAliasType(
70
90
  Union[
71
91
  WrapEthParamsTypedDict,
72
92
  UnwrapWethParamsTypedDict,
73
- AerodromeSlipstreamWithdrawLiquidityProvisionParamsTypedDict,
93
+ MorphoSetVaultAllowanceParamsTypedDict,
74
94
  UniswapWithdrawLiquidityProvisionParamsTypedDict,
75
- TokenTransferErc20ParamsTypedDict,
95
+ AerodromeSlipstreamWithdrawLiquidityProvisionParamsTypedDict,
96
+ SkyWithdrawParamsTypedDict,
97
+ SkyDepositParamsTypedDict,
98
+ SkySellParamsTypedDict,
99
+ SkyBuyParamsTypedDict,
100
+ IncreaseAllowanceParamsTypedDict,
76
101
  IncreaseAllowanceAnyParamsTypedDict,
102
+ MorphoWithdrawParamsTypedDict,
103
+ MorphoDepositParamsTypedDict,
104
+ TokenTransferErc20ParamsTypedDict,
77
105
  AaveSupplyParamsTypedDict,
78
106
  AaveWithdrawParamsTypedDict,
79
- IncreaseAllowanceParamsTypedDict,
107
+ MorphoSupplyCollateralParamsTypedDict,
108
+ MorphoRepayParamsTypedDict,
80
109
  AaveRepayParamsTypedDict,
110
+ MorphoBorrowParamsTypedDict,
111
+ MorphoWithdrawCollateralParamsTypedDict,
81
112
  AaveBorrowParamsTypedDict,
82
- AerodromeSlipstreamBuyExactlyParamsTypedDict,
83
113
  AerodromeSlipstreamSellExactlyParamsTypedDict,
84
- AerodromeSlipstreamIncreaseLiquidityProvisionParamsTypedDict,
114
+ AerodromeSlipstreamBuyExactlyParamsTypedDict,
85
115
  UniswapIncreaseLiquidityProvisionParamsTypedDict,
116
+ AerodromeSlipstreamIncreaseLiquidityProvisionParamsTypedDict,
86
117
  UniswapBuyExactlyParamsTypedDict,
87
118
  UniswapSellExactlyParamsTypedDict,
88
- UniswapMintLiquidityProvisionParamsTypedDict,
89
119
  AerodromeSlipstreamMintLiquidityProvisionParamsTypedDict,
120
+ UniswapMintLiquidityProvisionParamsTypedDict,
90
121
  ],
91
122
  )
92
123
 
@@ -96,23 +127,34 @@ Body = TypeAliasType(
96
127
  Union[
97
128
  WrapEthParams,
98
129
  UnwrapWethParams,
99
- AerodromeSlipstreamWithdrawLiquidityProvisionParams,
130
+ MorphoSetVaultAllowanceParams,
100
131
  UniswapWithdrawLiquidityProvisionParams,
101
- TokenTransferErc20Params,
132
+ AerodromeSlipstreamWithdrawLiquidityProvisionParams,
133
+ SkyWithdrawParams,
134
+ SkyDepositParams,
135
+ SkySellParams,
136
+ SkyBuyParams,
137
+ IncreaseAllowanceParams,
102
138
  IncreaseAllowanceAnyParams,
139
+ MorphoWithdrawParams,
140
+ MorphoDepositParams,
141
+ TokenTransferErc20Params,
103
142
  AaveSupplyParams,
104
143
  AaveWithdrawParams,
105
- IncreaseAllowanceParams,
144
+ MorphoSupplyCollateralParams,
145
+ MorphoRepayParams,
106
146
  AaveRepayParams,
147
+ MorphoBorrowParams,
148
+ MorphoWithdrawCollateralParams,
107
149
  AaveBorrowParams,
108
- AerodromeSlipstreamBuyExactlyParams,
109
150
  AerodromeSlipstreamSellExactlyParams,
110
- AerodromeSlipstreamIncreaseLiquidityProvisionParams,
151
+ AerodromeSlipstreamBuyExactlyParams,
111
152
  UniswapIncreaseLiquidityProvisionParams,
153
+ AerodromeSlipstreamIncreaseLiquidityProvisionParams,
112
154
  UniswapBuyExactlyParams,
113
155
  UniswapSellExactlyParams,
114
- UniswapMintLiquidityProvisionParams,
115
156
  AerodromeSlipstreamMintLiquidityProvisionParams,
157
+ UniswapMintLiquidityProvisionParams,
116
158
  ],
117
159
  )
118
160
 
@@ -16,6 +16,17 @@ class MulticallActionType(str, Enum):
16
16
  AERODROME_SLIPSTREAM_WITHDRAW_LIQUIDITY = "AERODROME_SLIPSTREAM_WITHDRAW_LIQUIDITY"
17
17
  ALLOWANCE_INCREASE = "ALLOWANCE_INCREASE"
18
18
  ALLOWANCE_INCREASE_ANY = "ALLOWANCE_INCREASE_ANY"
19
+ MORPHO_BORROW = "MORPHO_BORROW"
20
+ MORPHO_DEPOSIT = "MORPHO_DEPOSIT"
21
+ MORPHO_REPAY = "MORPHO_REPAY"
22
+ MORPHO_SET_VAULT_ALLOWANCE = "MORPHO_SET_VAULT_ALLOWANCE"
23
+ MORPHO_SUPPLY_COLLATERAL = "MORPHO_SUPPLY_COLLATERAL"
24
+ MORPHO_WITHDRAW = "MORPHO_WITHDRAW"
25
+ MORPHO_WITHDRAW_COLLATERAL = "MORPHO_WITHDRAW_COLLATERAL"
26
+ SKY_BUY = "SKY_BUY"
27
+ SKY_DEPOSIT = "SKY_DEPOSIT"
28
+ SKY_SELL = "SKY_SELL"
29
+ SKY_WITHDRAW = "SKY_WITHDRAW"
19
30
  TRANSFER_ERC20 = "TRANSFER_ERC20"
20
31
  UNISWAP_ADD_LIQUIDITY = "UNISWAP_ADD_LIQUIDITY"
21
32
  UNISWAP_BUY_EXACTLY = "UNISWAP_BUY_EXACTLY"
@@ -0,0 +1,39 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from enum import Enum
6
+ from typing import Union
7
+ from typing_extensions import TypeAliasType, TypedDict
8
+
9
+
10
+ class SkyBuyParamsTokenIn(str, Enum):
11
+ r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
12
+
13
+ DAI = "DAI"
14
+ USDC = "USDC"
15
+
16
+
17
+ SkyBuyParamsAmountTypedDict = TypeAliasType(
18
+ "SkyBuyParamsAmountTypedDict", Union[float, str]
19
+ )
20
+ r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
21
+
22
+
23
+ SkyBuyParamsAmount = TypeAliasType("SkyBuyParamsAmount", Union[float, str])
24
+ r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
25
+
26
+
27
+ class SkyBuyParamsTypedDict(TypedDict):
28
+ token_in: SkyBuyParamsTokenIn
29
+ r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
30
+ amount: SkyBuyParamsAmountTypedDict
31
+ r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
32
+
33
+
34
+ class SkyBuyParams(BaseModel):
35
+ token_in: SkyBuyParamsTokenIn
36
+ r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
37
+
38
+ amount: SkyBuyParamsAmount
39
+ r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
@@ -10,7 +10,7 @@ from typing import Literal, Optional, Union
10
10
  from typing_extensions import Annotated, TypeAliasType, TypedDict
11
11
 
12
12
 
13
- class TokenIn(str, Enum):
13
+ class SkyBuyRequestTokenIn(str, Enum):
14
14
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
15
15
 
16
16
  DAI = "DAI"
@@ -28,7 +28,7 @@ r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
28
28
 
29
29
 
30
30
  class SkyBuyRequestTypedDict(TypedDict):
31
- token_in: TokenIn
31
+ token_in: SkyBuyRequestTokenIn
32
32
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
33
33
  amount: SkyBuyRequestAmountTypedDict
34
34
  r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
@@ -38,7 +38,7 @@ class SkyBuyRequestTypedDict(TypedDict):
38
38
 
39
39
 
40
40
  class SkyBuyRequest(BaseModel):
41
- token_in: TokenIn
41
+ token_in: SkyBuyRequestTokenIn
42
42
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
43
43
 
44
44
  amount: SkyBuyRequestAmount
@@ -0,0 +1,68 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ )
11
+ from pydantic import model_serializer
12
+ from typing import Union
13
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
14
+
15
+
16
+ SkyDepositParamsAmountTypedDict = TypeAliasType(
17
+ "SkyDepositParamsAmountTypedDict", Union[float, str]
18
+ )
19
+ r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
20
+
21
+
22
+ SkyDepositParamsAmount = TypeAliasType("SkyDepositParamsAmount", Union[float, str])
23
+ r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
24
+
25
+
26
+ class SkyDepositParamsTypedDict(TypedDict):
27
+ amount: SkyDepositParamsAmountTypedDict
28
+ r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
29
+ receiver: NotRequired[Nullable[str]]
30
+ r"""The address which will receive the sUSDS. Defaults to the sender."""
31
+
32
+
33
+ class SkyDepositParams(BaseModel):
34
+ amount: SkyDepositParamsAmount
35
+ r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
36
+
37
+ receiver: OptionalNullable[str] = UNSET
38
+ r"""The address which will receive the sUSDS. Defaults to the sender."""
39
+
40
+ @model_serializer(mode="wrap")
41
+ def serialize_model(self, handler):
42
+ optional_fields = ["receiver"]
43
+ nullable_fields = ["receiver"]
44
+ null_default_fields = []
45
+
46
+ serialized = handler(self)
47
+
48
+ m = {}
49
+
50
+ for n, f in type(self).model_fields.items():
51
+ k = f.alias or n
52
+ val = serialized.get(k)
53
+ serialized.pop(k, None)
54
+
55
+ optional_nullable = k in optional_fields and k in nullable_fields
56
+ is_set = (
57
+ self.__pydantic_fields_set__.intersection({n})
58
+ or k in null_default_fields
59
+ ) # pylint: disable=no-member
60
+
61
+ if val is not None and val != UNSET_SENTINEL:
62
+ m[k] = val
63
+ elif val != UNSET_SENTINEL and (
64
+ not k in optional_fields or (optional_nullable and is_set)
65
+ ):
66
+ m[k] = val
67
+
68
+ return m