compass_api_sdk 0.1.14__py3-none-any.whl → 0.2.1__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 +214 -0
- compass_api_sdk/models/__init__.py +62 -25
- compass_api_sdk/models/aave_reserve_overviewop.py +97 -0
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +45 -11
- compass_api_sdk/models/aavelooprequest.py +87 -0
- compass_api_sdk/models/aavereserveoverviewresponse.py +25 -0
- compass_api_sdk/models/borrow.py +46 -12
- compass_api_sdk/models/liquidationcall.py +45 -18
- compass_api_sdk/models/morpho_market_positionop.py +5 -9
- compass_api_sdk/models/morpho_marketsop.py +5 -9
- compass_api_sdk/models/morpho_vault_positionop.py +5 -9
- compass_api_sdk/models/morpho_vaultsop.py +19 -17
- compass_api_sdk/models/morphoborrowrequest.py +8 -5
- compass_api_sdk/models/morphodepositrequest.py +8 -5
- compass_api_sdk/models/morphorepayrequest.py +8 -5
- compass_api_sdk/models/morphosetvaultallowancerequest.py +8 -5
- compass_api_sdk/models/morphosupplycollateralrequest.py +8 -5
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +8 -5
- compass_api_sdk/models/morphowithdrawrequest.py +8 -5
- compass_api_sdk/models/redeemunderlying.py +31 -4
- compass_api_sdk/models/repay.py +35 -4
- compass_api_sdk/models/reserve.py +67 -6
- compass_api_sdk/models/supply.py +37 -4
- compass_api_sdk/models/swapborrowrate.py +37 -8
- compass_api_sdk/models/uniswapbuyexactlyparams.py +6 -6
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +6 -6
- compass_api_sdk/models/usageascollateral.py +36 -4
- compass_api_sdk/morpho.py +63 -47
- compass_api_sdk/transaction_batching.py +284 -0
- compass_api_sdk/uniswap_v3.py +10 -10
- {compass_api_sdk-0.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/METADATA +12 -11
- {compass_api_sdk-0.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/RECORD +34 -35
- compass_api_sdk/models/aavehistoricaltransactionbase.py +0 -113
- compass_api_sdk/models/action.py +0 -14
- compass_api_sdk/models/collateralreserve.py +0 -16
- compass_api_sdk/models/principalreserve.py +0 -16
- {compass_api_sdk-0.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoSupplyCollateralRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""Amount of the token to supply to the market as collateral."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoSupplyCollateralRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoSupplyCollateralRequestTypedDict(TypedDict):
|
|
30
35
|
amount: MorphoSupplyCollateralRequestAmountTypedDict
|
|
31
36
|
r"""Amount of the token to supply to the market as collateral."""
|
|
32
37
|
unique_market_key: str
|
|
33
38
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoSupplyCollateralRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -48,8 +52,7 @@ class MorphoSupplyCollateralRequest(BaseModel):
|
|
|
48
52
|
unique_market_key: str
|
|
49
53
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
54
|
|
|
51
|
-
chain:
|
|
52
|
-
r"""The chain to use."""
|
|
55
|
+
chain: MorphoSupplyCollateralRequestChain
|
|
53
56
|
|
|
54
57
|
sender: str
|
|
55
58
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoWithdrawCollateralRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""Amount of the token to supply to the market as collateral."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoWithdrawCollateralRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoWithdrawCollateralRequestTypedDict(TypedDict):
|
|
30
35
|
amount: MorphoWithdrawCollateralRequestAmountTypedDict
|
|
31
36
|
r"""Amount of the token to supply to the market as collateral."""
|
|
32
37
|
unique_market_key: str
|
|
33
38
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoWithdrawCollateralRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -48,8 +52,7 @@ class MorphoWithdrawCollateralRequest(BaseModel):
|
|
|
48
52
|
unique_market_key: str
|
|
49
53
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
54
|
|
|
51
|
-
chain:
|
|
52
|
-
r"""The chain to use."""
|
|
55
|
+
chain: MorphoWithdrawCollateralRequestChain
|
|
53
56
|
|
|
54
57
|
sender: str
|
|
55
58
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,18 +8,23 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Any
|
|
14
14
|
from typing_extensions import NotRequired, TypedDict
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
class MorphoWithdrawRequestChain(str, Enum):
|
|
18
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
19
|
+
BASE_MAINNET = "base:mainnet"
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
class MorphoWithdrawRequestTypedDict(TypedDict):
|
|
18
23
|
vault_address: str
|
|
19
24
|
r"""The vault address you are withdrawing from."""
|
|
20
25
|
amount: Any
|
|
21
26
|
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
22
|
-
chain:
|
|
23
|
-
r"""The chain to use."""
|
|
27
|
+
chain: MorphoWithdrawRequestChain
|
|
24
28
|
sender: str
|
|
25
29
|
r"""The address of the transaction sender."""
|
|
26
30
|
receiver: NotRequired[Nullable[str]]
|
|
@@ -34,8 +38,7 @@ class MorphoWithdrawRequest(BaseModel):
|
|
|
34
38
|
amount: Any
|
|
35
39
|
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
36
40
|
|
|
37
|
-
chain:
|
|
38
|
-
r"""The chain to use."""
|
|
41
|
+
chain: MorphoWithdrawRequestChain
|
|
39
42
|
|
|
40
43
|
sender: str
|
|
41
44
|
r"""The address of the transaction sender."""
|
|
@@ -8,14 +8,41 @@ from typing_extensions import Annotated, TypedDict
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class RedeemUnderlyingTypedDict(TypedDict):
|
|
11
|
-
|
|
11
|
+
id: str
|
|
12
|
+
r"""The id of a historical transaction on aave"""
|
|
13
|
+
timestamp: int
|
|
14
|
+
r"""Timestamp in unix time"""
|
|
15
|
+
tx_hash: str
|
|
16
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
17
|
+
amount: float
|
|
18
|
+
r"""Quantity of token"""
|
|
12
19
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
20
|
+
asset_price_usd: float
|
|
21
|
+
r"""Price of token in USD"""
|
|
22
|
+
action: str
|
|
23
|
+
r"""The type of transaction"""
|
|
24
|
+
block: int
|
|
14
25
|
|
|
15
26
|
|
|
16
27
|
class RedeemUnderlying(BaseModel):
|
|
17
|
-
|
|
28
|
+
id: str
|
|
29
|
+
r"""The id of a historical transaction on aave"""
|
|
30
|
+
|
|
31
|
+
timestamp: int
|
|
32
|
+
r"""Timestamp in unix time"""
|
|
33
|
+
|
|
34
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
35
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
36
|
+
|
|
37
|
+
amount: float
|
|
38
|
+
r"""Quantity of token"""
|
|
18
39
|
|
|
19
40
|
reserve: Reserve
|
|
20
41
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
42
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
43
|
+
r"""Price of token in USD"""
|
|
44
|
+
|
|
45
|
+
action: str
|
|
46
|
+
r"""The type of transaction"""
|
|
47
|
+
|
|
48
|
+
block: int
|
compass_api_sdk/models/repay.py
CHANGED
|
@@ -3,19 +3,50 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class RepayTypedDict(TypedDict):
|
|
11
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
amount: float
|
|
21
|
+
r"""Quantity of token"""
|
|
12
22
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
23
|
+
asset_price_usd: float
|
|
24
|
+
block: int
|
|
25
|
+
action: Literal["Repay"]
|
|
26
|
+
r"""The type of transaction"""
|
|
14
27
|
|
|
15
28
|
|
|
16
29
|
class Repay(BaseModel):
|
|
17
|
-
|
|
30
|
+
id: str
|
|
31
|
+
r"""The id of a historical transaction on aave"""
|
|
32
|
+
|
|
33
|
+
timestamp: int
|
|
34
|
+
r"""Timestamp in unix time"""
|
|
35
|
+
|
|
36
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
37
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
38
|
+
|
|
39
|
+
amount: float
|
|
40
|
+
r"""Quantity of token"""
|
|
18
41
|
|
|
19
42
|
reserve: Reserve
|
|
20
43
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
44
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
45
|
+
|
|
46
|
+
block: int
|
|
47
|
+
|
|
48
|
+
ACTION: Annotated[
|
|
49
|
+
Annotated[Literal["Repay"], AfterValidator(validate_const("Repay"))],
|
|
50
|
+
pydantic.Field(alias="action"),
|
|
51
|
+
] = "Repay"
|
|
52
|
+
r"""The type of transaction"""
|
|
@@ -1,16 +1,77 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from
|
|
5
|
-
from
|
|
4
|
+
from .token_enum import TokenEnum
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
12
|
+
import pydantic
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
6
15
|
|
|
7
16
|
|
|
8
17
|
class ReserveTypedDict(TypedDict):
|
|
9
|
-
symbol:
|
|
10
|
-
|
|
18
|
+
symbol: TokenEnum
|
|
19
|
+
r"""A class representing the token.
|
|
20
|
+
|
|
21
|
+
This class is used to represent the token in the system. Notice individual
|
|
22
|
+
endpoints' documentation where per chain tokens are presented.
|
|
23
|
+
"""
|
|
24
|
+
name: str
|
|
25
|
+
r"""Name of Token"""
|
|
26
|
+
underlying_asset: str
|
|
27
|
+
r"""Checksum address of Token."""
|
|
28
|
+
decimals: NotRequired[Nullable[int]]
|
|
29
|
+
r"""Number of decimals of token."""
|
|
11
30
|
|
|
12
31
|
|
|
13
32
|
class Reserve(BaseModel):
|
|
14
|
-
symbol:
|
|
33
|
+
symbol: 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
|
+
"""
|
|
39
|
+
|
|
40
|
+
name: str
|
|
41
|
+
r"""Name of Token"""
|
|
42
|
+
|
|
43
|
+
underlying_asset: Annotated[str, pydantic.Field(alias="underlyingAsset")]
|
|
44
|
+
r"""Checksum address of Token."""
|
|
45
|
+
|
|
46
|
+
decimals: OptionalNullable[int] = UNSET
|
|
47
|
+
r"""Number of decimals of token."""
|
|
48
|
+
|
|
49
|
+
@model_serializer(mode="wrap")
|
|
50
|
+
def serialize_model(self, handler):
|
|
51
|
+
optional_fields = ["decimals"]
|
|
52
|
+
nullable_fields = ["decimals"]
|
|
53
|
+
null_default_fields = []
|
|
54
|
+
|
|
55
|
+
serialized = handler(self)
|
|
56
|
+
|
|
57
|
+
m = {}
|
|
58
|
+
|
|
59
|
+
for n, f in type(self).model_fields.items():
|
|
60
|
+
k = f.alias or n
|
|
61
|
+
val = serialized.get(k)
|
|
62
|
+
serialized.pop(k, None)
|
|
63
|
+
|
|
64
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
65
|
+
is_set = (
|
|
66
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
67
|
+
or k in null_default_fields
|
|
68
|
+
) # pylint: disable=no-member
|
|
69
|
+
|
|
70
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
71
|
+
m[k] = val
|
|
72
|
+
elif val != UNSET_SENTINEL and (
|
|
73
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
74
|
+
):
|
|
75
|
+
m[k] = val
|
|
15
76
|
|
|
16
|
-
|
|
77
|
+
return m
|
compass_api_sdk/models/supply.py
CHANGED
|
@@ -3,19 +3,52 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class SupplyTypedDict(TypedDict):
|
|
11
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
amount: float
|
|
21
|
+
r"""Quantity of token"""
|
|
12
22
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
23
|
+
asset_price_usd: float
|
|
24
|
+
r"""Price of token in USD"""
|
|
25
|
+
block: int
|
|
26
|
+
action: Literal["Supply"]
|
|
27
|
+
r"""The type of transaction"""
|
|
14
28
|
|
|
15
29
|
|
|
16
30
|
class Supply(BaseModel):
|
|
17
|
-
|
|
31
|
+
id: str
|
|
32
|
+
r"""The id of a historical transaction on aave"""
|
|
33
|
+
|
|
34
|
+
timestamp: int
|
|
35
|
+
r"""Timestamp in unix time"""
|
|
36
|
+
|
|
37
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
38
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
39
|
+
|
|
40
|
+
amount: float
|
|
41
|
+
r"""Quantity of token"""
|
|
18
42
|
|
|
19
43
|
reserve: Reserve
|
|
20
44
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
45
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
46
|
+
r"""Price of token in USD"""
|
|
47
|
+
|
|
48
|
+
block: int
|
|
49
|
+
|
|
50
|
+
ACTION: Annotated[
|
|
51
|
+
Annotated[Literal["Supply"], AfterValidator(validate_const("Supply"))],
|
|
52
|
+
pydantic.Field(alias="action"),
|
|
53
|
+
] = "Supply"
|
|
54
|
+
r"""The type of transaction"""
|
|
@@ -3,25 +3,54 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class SwapBorrowRateTypedDict(TypedDict):
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
borrow_rate_mode_from: int
|
|
21
|
+
borrow_rate_mode_to: int
|
|
22
|
+
variable_borrow_rate: int
|
|
23
|
+
stable_borrow_rate: int
|
|
15
24
|
reserve: ReserveTypedDict
|
|
25
|
+
block: int
|
|
26
|
+
action: Literal["SwapBorrowRate"]
|
|
16
27
|
|
|
17
28
|
|
|
18
29
|
class SwapBorrowRate(BaseModel):
|
|
19
|
-
|
|
30
|
+
id: str
|
|
31
|
+
r"""The id of a historical transaction on aave"""
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
timestamp: int
|
|
34
|
+
r"""Timestamp in unix time"""
|
|
22
35
|
|
|
23
|
-
|
|
36
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
37
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
24
38
|
|
|
25
|
-
|
|
39
|
+
borrow_rate_mode_from: Annotated[int, pydantic.Field(alias="borrowRateModeFrom")]
|
|
40
|
+
|
|
41
|
+
borrow_rate_mode_to: Annotated[int, pydantic.Field(alias="borrowRateModeTo")]
|
|
42
|
+
|
|
43
|
+
variable_borrow_rate: Annotated[int, pydantic.Field(alias="variableBorrowRate")]
|
|
44
|
+
|
|
45
|
+
stable_borrow_rate: Annotated[int, pydantic.Field(alias="stableBorrowRate")]
|
|
26
46
|
|
|
27
47
|
reserve: Reserve
|
|
48
|
+
|
|
49
|
+
block: int
|
|
50
|
+
|
|
51
|
+
ACTION: Annotated[
|
|
52
|
+
Annotated[
|
|
53
|
+
Literal["SwapBorrowRate"], AfterValidator(validate_const("SwapBorrowRate"))
|
|
54
|
+
],
|
|
55
|
+
pydantic.Field(alias="action"),
|
|
56
|
+
] = "SwapBorrowRate"
|
|
@@ -8,14 +8,14 @@ from typing import Optional, Union
|
|
|
8
8
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
"
|
|
11
|
+
UniswapBuyExactlyParamsAmountTypedDict = TypeAliasType(
|
|
12
|
+
"UniswapBuyExactlyParamsAmountTypedDict", Union[float, str]
|
|
13
13
|
)
|
|
14
14
|
r"""The amount of the token to swap to"""
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
"
|
|
17
|
+
UniswapBuyExactlyParamsAmount = TypeAliasType(
|
|
18
|
+
"UniswapBuyExactlyParamsAmount", Union[float, str]
|
|
19
19
|
)
|
|
20
20
|
r"""The amount of the token to swap to"""
|
|
21
21
|
|
|
@@ -38,7 +38,7 @@ class UniswapBuyExactlyParamsTypedDict(TypedDict):
|
|
|
38
38
|
|
|
39
39
|
Uniswap supports 4 different fee levels.
|
|
40
40
|
"""
|
|
41
|
-
|
|
41
|
+
amount: UniswapBuyExactlyParamsAmountTypedDict
|
|
42
42
|
r"""The amount of the token to swap to"""
|
|
43
43
|
max_slippage_percent: float
|
|
44
44
|
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
@@ -67,7 +67,7 @@ class UniswapBuyExactlyParams(BaseModel):
|
|
|
67
67
|
Uniswap supports 4 different fee levels.
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
amount: UniswapBuyExactlyParamsAmount
|
|
71
71
|
r"""The amount of the token to swap to"""
|
|
72
72
|
|
|
73
73
|
max_slippage_percent: float
|
|
@@ -9,14 +9,14 @@ from typing import Optional, Union
|
|
|
9
9
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
"
|
|
12
|
+
UniswapBuyExactlyRequestAmountTypedDict = TypeAliasType(
|
|
13
|
+
"UniswapBuyExactlyRequestAmountTypedDict", Union[float, str]
|
|
14
14
|
)
|
|
15
15
|
r"""The amount of the token to swap to"""
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
"
|
|
18
|
+
UniswapBuyExactlyRequestAmount = TypeAliasType(
|
|
19
|
+
"UniswapBuyExactlyRequestAmount", Union[float, str]
|
|
20
20
|
)
|
|
21
21
|
r"""The amount of the token to swap to"""
|
|
22
22
|
|
|
@@ -41,7 +41,7 @@ class UniswapBuyExactlyRequestTypedDict(TypedDict):
|
|
|
41
41
|
|
|
42
42
|
Uniswap supports 4 different fee levels.
|
|
43
43
|
"""
|
|
44
|
-
|
|
44
|
+
amount: UniswapBuyExactlyRequestAmountTypedDict
|
|
45
45
|
r"""The amount of the token to swap to"""
|
|
46
46
|
max_slippage_percent: float
|
|
47
47
|
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
@@ -76,7 +76,7 @@ class UniswapBuyExactlyRequest(BaseModel):
|
|
|
76
76
|
Uniswap supports 4 different fee levels.
|
|
77
77
|
"""
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
amount: UniswapBuyExactlyRequestAmount
|
|
80
80
|
r"""The amount of the token to swap to"""
|
|
81
81
|
|
|
82
82
|
max_slippage_percent: float
|
|
@@ -3,19 +3,51 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class UsageAsCollateralTypedDict(TypedDict):
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
from_state: bool
|
|
21
|
+
to_state: bool
|
|
13
22
|
reserve: ReserveTypedDict
|
|
23
|
+
block: int
|
|
24
|
+
action: Literal["UsageAsCollateral"]
|
|
25
|
+
r"""The type of transaction"""
|
|
14
26
|
|
|
15
27
|
|
|
16
28
|
class UsageAsCollateral(BaseModel):
|
|
17
|
-
|
|
29
|
+
id: str
|
|
30
|
+
r"""The id of a historical transaction on aave"""
|
|
18
31
|
|
|
19
|
-
|
|
32
|
+
timestamp: int
|
|
33
|
+
r"""Timestamp in unix time"""
|
|
34
|
+
|
|
35
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
36
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
37
|
+
|
|
38
|
+
from_state: Annotated[bool, pydantic.Field(alias="fromState")]
|
|
39
|
+
|
|
40
|
+
to_state: Annotated[bool, pydantic.Field(alias="toState")]
|
|
20
41
|
|
|
21
42
|
reserve: Reserve
|
|
43
|
+
|
|
44
|
+
block: int
|
|
45
|
+
|
|
46
|
+
ACTION: Annotated[
|
|
47
|
+
Annotated[
|
|
48
|
+
Literal["UsageAsCollateral"],
|
|
49
|
+
AfterValidator(validate_const("UsageAsCollateral")),
|
|
50
|
+
],
|
|
51
|
+
pydantic.Field(alias="action"),
|
|
52
|
+
] = "UsageAsCollateral"
|
|
53
|
+
r"""The type of transaction"""
|