compass_api_sdk 0.3.1__py3-none-any.whl → 0.3.3__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-0.3.1.dist-info → compass_api_sdk-0.3.3.dist-info}/METADATA +10 -9
- {compass_api_sdk-0.3.1.dist-info → compass_api_sdk-0.3.3.dist-info}/RECORD +24 -11
- compassapisdk/_version.py +3 -3
- compassapisdk/aave_v3.py +206 -0
- compassapisdk/models/__init__.py +110 -4
- compassapisdk/models/aave_avg_rateop.py +96 -0
- compassapisdk/models/aaveavgrateresponse.py +40 -0
- compassapisdk/models/morphoborrowparams.py +78 -0
- compassapisdk/models/morphodepositparams.py +75 -0
- compassapisdk/models/morphorepayparams.py +68 -0
- compassapisdk/models/morphosetvaultallowanceparams.py +33 -0
- compassapisdk/models/morphosupplycollateralparams.py +80 -0
- compassapisdk/models/morphowithdrawcollateralparams.py +80 -0
- compassapisdk/models/morphowithdrawparams.py +63 -0
- compassapisdk/models/multicallaction.py +54 -12
- compassapisdk/models/multicallactiontype.py +11 -0
- compassapisdk/models/skybuyparams.py +39 -0
- compassapisdk/models/skybuyrequest.py +3 -3
- compassapisdk/models/skydepositparams.py +68 -0
- compassapisdk/models/skysellparams.py +39 -0
- compassapisdk/models/skysellrequest.py +3 -3
- compassapisdk/models/skywithdrawparams.py +58 -0
- compassapisdk/sky.py +4 -4
- {compass_api_sdk-0.3.1.dist-info → compass_api_sdk-0.3.3.dist-info}/WHEEL +0 -0
|
@@ -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
|
-
|
|
93
|
+
MorphoSetVaultAllowanceParamsTypedDict,
|
|
74
94
|
UniswapWithdrawLiquidityProvisionParamsTypedDict,
|
|
75
|
-
|
|
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
|
-
|
|
107
|
+
MorphoSupplyCollateralParamsTypedDict,
|
|
108
|
+
MorphoRepayParamsTypedDict,
|
|
80
109
|
AaveRepayParamsTypedDict,
|
|
110
|
+
MorphoBorrowParamsTypedDict,
|
|
111
|
+
MorphoWithdrawCollateralParamsTypedDict,
|
|
81
112
|
AaveBorrowParamsTypedDict,
|
|
82
|
-
AerodromeSlipstreamBuyExactlyParamsTypedDict,
|
|
83
113
|
AerodromeSlipstreamSellExactlyParamsTypedDict,
|
|
84
|
-
|
|
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
|
-
|
|
130
|
+
MorphoSetVaultAllowanceParams,
|
|
100
131
|
UniswapWithdrawLiquidityProvisionParams,
|
|
101
|
-
|
|
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
|
-
|
|
144
|
+
MorphoSupplyCollateralParams,
|
|
145
|
+
MorphoRepayParams,
|
|
106
146
|
AaveRepayParams,
|
|
147
|
+
MorphoBorrowParams,
|
|
148
|
+
MorphoWithdrawCollateralParams,
|
|
107
149
|
AaveBorrowParams,
|
|
108
|
-
AerodromeSlipstreamBuyExactlyParams,
|
|
109
150
|
AerodromeSlipstreamSellExactlyParams,
|
|
110
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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
|
|
@@ -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 SkySellParamsTokenOut(str, Enum):
|
|
11
|
+
r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
|
|
12
|
+
|
|
13
|
+
DAI = "DAI"
|
|
14
|
+
USDC = "USDC"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
SkySellParamsAmountTypedDict = TypeAliasType(
|
|
18
|
+
"SkySellParamsAmountTypedDict", Union[float, str]
|
|
19
|
+
)
|
|
20
|
+
r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
SkySellParamsAmount = TypeAliasType("SkySellParamsAmount", Union[float, str])
|
|
24
|
+
r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class SkySellParamsTypedDict(TypedDict):
|
|
28
|
+
token_out: SkySellParamsTokenOut
|
|
29
|
+
r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
|
|
30
|
+
amount: SkySellParamsAmountTypedDict
|
|
31
|
+
r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SkySellParams(BaseModel):
|
|
35
|
+
token_out: SkySellParamsTokenOut
|
|
36
|
+
r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
|
|
37
|
+
|
|
38
|
+
amount: SkySellParamsAmount
|
|
39
|
+
r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
|
|
@@ -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
|
|
13
|
+
class SkySellRequestTokenOut(str, Enum):
|
|
14
14
|
r"""The token you would like to swap 1:1 with 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 sell 1:1 for 'token_out'."""
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class SkySellRequestTypedDict(TypedDict):
|
|
31
|
-
token_out:
|
|
31
|
+
token_out: SkySellRequestTokenOut
|
|
32
32
|
r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
|
|
33
33
|
amount: SkySellRequestAmountTypedDict
|
|
34
34
|
r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
|
|
@@ -38,7 +38,7 @@ class SkySellRequestTypedDict(TypedDict):
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
class SkySellRequest(BaseModel):
|
|
41
|
-
token_out:
|
|
41
|
+
token_out: SkySellRequestTokenOut
|
|
42
42
|
r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
|
|
43
43
|
|
|
44
44
|
amount: SkySellRequestAmount
|
|
@@ -0,0 +1,58 @@
|
|
|
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 SkyWithdrawParamsTypedDict(TypedDict):
|
|
17
|
+
amount: Any
|
|
18
|
+
r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
|
|
19
|
+
receiver: NotRequired[Nullable[str]]
|
|
20
|
+
r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SkyWithdrawParams(BaseModel):
|
|
24
|
+
amount: Any
|
|
25
|
+
r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
|
|
26
|
+
|
|
27
|
+
receiver: OptionalNullable[str] = UNSET
|
|
28
|
+
r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
|
|
29
|
+
|
|
30
|
+
@model_serializer(mode="wrap")
|
|
31
|
+
def serialize_model(self, handler):
|
|
32
|
+
optional_fields = ["receiver"]
|
|
33
|
+
nullable_fields = ["receiver"]
|
|
34
|
+
null_default_fields = []
|
|
35
|
+
|
|
36
|
+
serialized = handler(self)
|
|
37
|
+
|
|
38
|
+
m = {}
|
|
39
|
+
|
|
40
|
+
for n, f in type(self).model_fields.items():
|
|
41
|
+
k = f.alias or n
|
|
42
|
+
val = serialized.get(k)
|
|
43
|
+
serialized.pop(k, None)
|
|
44
|
+
|
|
45
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
46
|
+
is_set = (
|
|
47
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
48
|
+
or k in null_default_fields
|
|
49
|
+
) # pylint: disable=no-member
|
|
50
|
+
|
|
51
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
52
|
+
m[k] = val
|
|
53
|
+
elif val != UNSET_SENTINEL and (
|
|
54
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
55
|
+
):
|
|
56
|
+
m[k] = val
|
|
57
|
+
|
|
58
|
+
return m
|
compassapisdk/sky.py
CHANGED
|
@@ -205,7 +205,7 @@ class Sky(BaseSDK):
|
|
|
205
205
|
def buy(
|
|
206
206
|
self,
|
|
207
207
|
*,
|
|
208
|
-
token_in: models.
|
|
208
|
+
token_in: models.SkyBuyRequestTokenIn,
|
|
209
209
|
amount: Union[models.SkyBuyRequestAmount, models.SkyBuyRequestAmountTypedDict],
|
|
210
210
|
sender: str,
|
|
211
211
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -317,7 +317,7 @@ class Sky(BaseSDK):
|
|
|
317
317
|
async def buy_async(
|
|
318
318
|
self,
|
|
319
319
|
*,
|
|
320
|
-
token_in: models.
|
|
320
|
+
token_in: models.SkyBuyRequestTokenIn,
|
|
321
321
|
amount: Union[models.SkyBuyRequestAmount, models.SkyBuyRequestAmountTypedDict],
|
|
322
322
|
sender: str,
|
|
323
323
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -429,7 +429,7 @@ class Sky(BaseSDK):
|
|
|
429
429
|
def sell(
|
|
430
430
|
self,
|
|
431
431
|
*,
|
|
432
|
-
token_out: models.
|
|
432
|
+
token_out: models.SkySellRequestTokenOut,
|
|
433
433
|
amount: Union[
|
|
434
434
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
435
435
|
],
|
|
@@ -543,7 +543,7 @@ class Sky(BaseSDK):
|
|
|
543
543
|
async def sell_async(
|
|
544
544
|
self,
|
|
545
545
|
*,
|
|
546
|
-
token_out: models.
|
|
546
|
+
token_out: models.SkySellRequestTokenOut,
|
|
547
547
|
amount: Union[
|
|
548
548
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
549
549
|
],
|
|
File without changes
|