compass_api_sdk 0.6.0__py3-none-any.whl → 0.6.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.
- compass_api_sdk/_version.py +2 -2
- compass_api_sdk/aave_v3.py +38 -104
- compass_api_sdk/aerodrome_slipstream.py +8 -28
- compass_api_sdk/models/__init__.py +107 -230
- compass_api_sdk/models/aave_avg_rateop.py +44 -16
- compass_api_sdk/models/aave_historical_transactionsop.py +45 -20
- compass_api_sdk/models/aave_liquidity_changeop.py +44 -18
- compass_api_sdk/models/aave_rateop.py +44 -16
- compass_api_sdk/models/aave_reserve_overviewop.py +44 -18
- compass_api_sdk/models/aave_std_rateop.py +44 -16
- compass_api_sdk/models/aave_token_priceop.py +44 -18
- compass_api_sdk/models/aave_user_position_per_tokenop.py +44 -20
- compass_api_sdk/models/aave_user_position_summaryop.py +44 -20
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +45 -20
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +45 -20
- compass_api_sdk/models/{tokenbalance.py → compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_pendle_read_response_positions_tokenbalance.py +18 -0
- compass_api_sdk/models/details.py +39 -0
- compass_api_sdk/models/generic_allowanceop.py +45 -18
- compass_api_sdk/models/generic_ensop.py +45 -16
- compass_api_sdk/models/generic_portfolioop.py +45 -18
- compass_api_sdk/models/generic_supported_tokensop.py +44 -20
- compass_api_sdk/models/generic_visualize_portfolioop.py +45 -20
- compass_api_sdk/models/increaseallowanceparams.py +20 -16
- compass_api_sdk/models/increaseallowancerequest.py +20 -16
- compass_api_sdk/models/lpbalance.py +20 -0
- compass_api_sdk/models/morpho_market_positionop.py +44 -18
- compass_api_sdk/models/morpho_marketop.py +44 -18
- compass_api_sdk/models/morpho_marketsop.py +7 -18
- compass_api_sdk/models/morpho_user_positionop.py +44 -18
- compass_api_sdk/models/morpho_vault_positionop.py +44 -18
- compass_api_sdk/models/morpho_vaultop.py +44 -16
- compass_api_sdk/models/morpho_vaultsop.py +7 -18
- compass_api_sdk/models/movement10percent.py +23 -0
- compass_api_sdk/models/multicallactiontype.py +0 -1
- compass_api_sdk/models/multicallauthorizationrequest.py +1 -15
- compass_api_sdk/models/openposition.py +28 -0
- compass_api_sdk/models/pendle_marketop.py +45 -19
- compass_api_sdk/models/pendle_marketsop.py +73 -0
- compass_api_sdk/models/pendle_positionop.py +45 -19
- compass_api_sdk/models/pendle_positionsop.py +80 -0
- compass_api_sdk/models/pendlelistmarketsresponse.py +17 -0
- compass_api_sdk/models/pendlelistuserpositionsresponse.py +17 -0
- compass_api_sdk/models/pendlemarket.py +46 -0
- compass_api_sdk/models/portfolio.py +10 -3
- compass_api_sdk/models/position.py +41 -0
- compass_api_sdk/models/sky_positionop.py +45 -16
- compass_api_sdk/models/syposition.py +17 -0
- compass_api_sdk/models/token_addressop.py +44 -18
- compass_api_sdk/models/token_balanceop.py +44 -17
- compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +44 -20
- compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +45 -20
- compass_api_sdk/models/uniswap_pool_priceop.py +44 -18
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +44 -19
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +44 -19
- compass_api_sdk/models/useroperation.py +20 -26
- compass_api_sdk/models/yieldrange.py +16 -0
- compass_api_sdk/morpho.py +28 -72
- compass_api_sdk/pendle.py +423 -21
- compass_api_sdk/sky.py +4 -8
- compass_api_sdk/token_sdk.py +8 -16
- compass_api_sdk/transaction_batching.py +0 -6
- compass_api_sdk/uniswap_v3.py +20 -64
- compass_api_sdk/universal.py +34 -60
- {compass_api_sdk-0.6.0.dist-info → compass_api_sdk-0.6.2.dist-info}/METADATA +5 -3
- {compass_api_sdk-0.6.0.dist-info → compass_api_sdk-0.6.2.dist-info}/RECORD +67 -56
- compass_api_sdk/models/contractname.py +0 -41
- compass_api_sdk/models/increaseallowanceanyparams.py +0 -58
- {compass_api_sdk-0.6.0.dist-info → compass_api_sdk-0.6.2.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 compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
11
|
+
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
12
|
+
from enum import Enum
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PendlePositionsChain(str, Enum):
|
|
18
|
+
r"""The chain to use."""
|
|
19
|
+
|
|
20
|
+
BASE_MAINNET = "base:mainnet"
|
|
21
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
22
|
+
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PendlePositionsRequestTypedDict(TypedDict):
|
|
26
|
+
chain: PendlePositionsChain
|
|
27
|
+
r"""The chain to use."""
|
|
28
|
+
block: NotRequired[Nullable[int]]
|
|
29
|
+
r"""Optional block number (defaults to latest)."""
|
|
30
|
+
user_address: str
|
|
31
|
+
r"""The user address of the desired position."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class PendlePositionsRequest(BaseModel):
|
|
35
|
+
chain: Annotated[
|
|
36
|
+
PendlePositionsChain,
|
|
37
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
38
|
+
] = PendlePositionsChain.ETHEREUM_MAINNET
|
|
39
|
+
r"""The chain to use."""
|
|
40
|
+
|
|
41
|
+
block: Annotated[
|
|
42
|
+
OptionalNullable[int],
|
|
43
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
44
|
+
] = UNSET
|
|
45
|
+
r"""Optional block number (defaults to latest)."""
|
|
46
|
+
|
|
47
|
+
user_address: Annotated[
|
|
48
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
49
|
+
] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
|
|
50
|
+
r"""The user address of the desired position."""
|
|
51
|
+
|
|
52
|
+
@model_serializer(mode="wrap")
|
|
53
|
+
def serialize_model(self, handler):
|
|
54
|
+
optional_fields = ["block"]
|
|
55
|
+
nullable_fields = ["block"]
|
|
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,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .pendlemarket import PendleMarket, PendleMarketTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import List
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PendleListMarketsResponseTypedDict(TypedDict):
|
|
11
|
+
markets: List[PendleMarketTypedDict]
|
|
12
|
+
r"""A list of active markets on the inputted chain."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PendleListMarketsResponse(BaseModel):
|
|
16
|
+
markets: List[PendleMarket]
|
|
17
|
+
r"""A list of active markets on the inputted chain."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .position import Position, PositionTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import List
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PendleListUserPositionsResponseTypedDict(TypedDict):
|
|
11
|
+
positions: List[PositionTypedDict]
|
|
12
|
+
r"""A list of the user's positions on the given chain."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PendleListUserPositionsResponse(BaseModel):
|
|
16
|
+
positions: List[Position]
|
|
17
|
+
r"""A list of the user's positions on the given chain."""
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .details import Details, DetailsTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
import pydantic
|
|
8
|
+
from typing_extensions import Annotated, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PendleMarketTypedDict(TypedDict):
|
|
12
|
+
name: str
|
|
13
|
+
address: str
|
|
14
|
+
expiry: datetime
|
|
15
|
+
pt: str
|
|
16
|
+
yt: str
|
|
17
|
+
sy: str
|
|
18
|
+
underlying_asset: str
|
|
19
|
+
details: DetailsTypedDict
|
|
20
|
+
is_new: bool
|
|
21
|
+
is_prime: bool
|
|
22
|
+
timestamp: datetime
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PendleMarket(BaseModel):
|
|
26
|
+
name: str
|
|
27
|
+
|
|
28
|
+
address: str
|
|
29
|
+
|
|
30
|
+
expiry: datetime
|
|
31
|
+
|
|
32
|
+
pt: str
|
|
33
|
+
|
|
34
|
+
yt: str
|
|
35
|
+
|
|
36
|
+
sy: str
|
|
37
|
+
|
|
38
|
+
underlying_asset: Annotated[str, pydantic.Field(alias="underlyingAsset")]
|
|
39
|
+
|
|
40
|
+
details: Details
|
|
41
|
+
|
|
42
|
+
is_new: Annotated[bool, pydantic.Field(alias="isNew")]
|
|
43
|
+
|
|
44
|
+
is_prime: Annotated[bool, pydantic.Field(alias="isPrime")]
|
|
45
|
+
|
|
46
|
+
timestamp: datetime
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .
|
|
4
|
+
from .compass_api_backend_models_generic_read_response_portfolio_tokenbalance import (
|
|
5
|
+
CompassAPIBackendModelsGenericReadResponsePortfolioTokenBalance,
|
|
6
|
+
CompassAPIBackendModelsGenericReadResponsePortfolioTokenBalanceTypedDict,
|
|
7
|
+
)
|
|
5
8
|
from compass_api_sdk.types import BaseModel
|
|
6
9
|
from typing import List
|
|
7
10
|
from typing_extensions import TypedDict
|
|
@@ -10,7 +13,9 @@ from typing_extensions import TypedDict
|
|
|
10
13
|
class PortfolioTypedDict(TypedDict):
|
|
11
14
|
total_value_in_usd: str
|
|
12
15
|
r"""Total value of the portfolio in USD"""
|
|
13
|
-
token_balances: List[
|
|
16
|
+
token_balances: List[
|
|
17
|
+
CompassAPIBackendModelsGenericReadResponsePortfolioTokenBalanceTypedDict
|
|
18
|
+
]
|
|
14
19
|
r"""List of token balances in the portfolio"""
|
|
15
20
|
|
|
16
21
|
|
|
@@ -18,5 +23,7 @@ class Portfolio(BaseModel):
|
|
|
18
23
|
total_value_in_usd: str
|
|
19
24
|
r"""Total value of the portfolio in USD"""
|
|
20
25
|
|
|
21
|
-
token_balances: List[
|
|
26
|
+
token_balances: List[
|
|
27
|
+
CompassAPIBackendModelsGenericReadResponsePortfolioTokenBalance
|
|
28
|
+
]
|
|
22
29
|
r"""List of token balances in the portfolio"""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .openposition import OpenPosition, OpenPositionTypedDict
|
|
5
|
+
from .syposition import SyPosition, SyPositionTypedDict
|
|
6
|
+
from compass_api_sdk.types import BaseModel
|
|
7
|
+
from datetime import datetime
|
|
8
|
+
import pydantic
|
|
9
|
+
from typing import List
|
|
10
|
+
from typing_extensions import Annotated, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PositionTypedDict(TypedDict):
|
|
14
|
+
chain_id: int
|
|
15
|
+
total_open: int
|
|
16
|
+
total_closed: int
|
|
17
|
+
total_sy: int
|
|
18
|
+
open_positions: List[OpenPositionTypedDict]
|
|
19
|
+
closed_positions: List[OpenPositionTypedDict]
|
|
20
|
+
sy_positions: List[SyPositionTypedDict]
|
|
21
|
+
updated_at: datetime
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Position(BaseModel):
|
|
25
|
+
chain_id: Annotated[int, pydantic.Field(alias="chainId")]
|
|
26
|
+
|
|
27
|
+
total_open: Annotated[int, pydantic.Field(alias="totalOpen")]
|
|
28
|
+
|
|
29
|
+
total_closed: Annotated[int, pydantic.Field(alias="totalClosed")]
|
|
30
|
+
|
|
31
|
+
total_sy: Annotated[int, pydantic.Field(alias="totalSy")]
|
|
32
|
+
|
|
33
|
+
open_positions: Annotated[List[OpenPosition], pydantic.Field(alias="openPositions")]
|
|
34
|
+
|
|
35
|
+
closed_positions: Annotated[
|
|
36
|
+
List[OpenPosition], pydantic.Field(alias="closedPositions")
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
sy_positions: Annotated[List[SyPosition], pydantic.Field(alias="syPositions")]
|
|
40
|
+
|
|
41
|
+
updated_at: Annotated[datetime, pydantic.Field(alias="updatedAt")]
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from compass_api_sdk.types import
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata, validate_const
|
|
6
12
|
import pydantic
|
|
13
|
+
from pydantic import model_serializer
|
|
7
14
|
from pydantic.functional_validators import AfterValidator
|
|
8
|
-
from typing import Literal, Optional
|
|
9
|
-
from typing_extensions import Annotated, NotRequired,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SkyPositionBlockTypedDict = TypeAliasType("SkyPositionBlockTypedDict", Union[int, str])
|
|
13
|
-
r"""The block number you want to get this data at."""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
SkyPositionBlock = TypeAliasType("SkyPositionBlock", Union[int, str])
|
|
17
|
-
r"""The block number you want to get this data at."""
|
|
15
|
+
from typing import Literal, Optional
|
|
16
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
class SkyPositionRequestTypedDict(TypedDict):
|
|
21
20
|
chain: Literal["ethereum:mainnet"]
|
|
22
|
-
block: NotRequired[
|
|
23
|
-
r"""
|
|
21
|
+
block: NotRequired[Nullable[int]]
|
|
22
|
+
r"""Optional block number (defaults to latest)."""
|
|
24
23
|
user_address: str
|
|
25
24
|
r"""The user address of the desired position."""
|
|
26
25
|
|
|
@@ -36,12 +35,42 @@ class SkyPositionRequest(BaseModel):
|
|
|
36
35
|
] = "ethereum:mainnet"
|
|
37
36
|
|
|
38
37
|
block: Annotated[
|
|
39
|
-
|
|
38
|
+
OptionalNullable[int],
|
|
40
39
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
41
|
-
] =
|
|
42
|
-
r"""
|
|
40
|
+
] = UNSET
|
|
41
|
+
r"""Optional block number (defaults to latest)."""
|
|
43
42
|
|
|
44
43
|
user_address: Annotated[
|
|
45
44
|
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
46
45
|
] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
|
|
47
46
|
r"""The user address of the desired position."""
|
|
47
|
+
|
|
48
|
+
@model_serializer(mode="wrap")
|
|
49
|
+
def serialize_model(self, handler):
|
|
50
|
+
optional_fields = ["chain", "block"]
|
|
51
|
+
nullable_fields = ["block"]
|
|
52
|
+
null_default_fields = []
|
|
53
|
+
|
|
54
|
+
serialized = handler(self)
|
|
55
|
+
|
|
56
|
+
m = {}
|
|
57
|
+
|
|
58
|
+
for n, f in type(self).model_fields.items():
|
|
59
|
+
k = f.alias or n
|
|
60
|
+
val = serialized.get(k)
|
|
61
|
+
serialized.pop(k, None)
|
|
62
|
+
|
|
63
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
64
|
+
is_set = (
|
|
65
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
66
|
+
or k in null_default_fields
|
|
67
|
+
) # pylint: disable=no-member
|
|
68
|
+
|
|
69
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
70
|
+
m[k] = val
|
|
71
|
+
elif val != UNSET_SENTINEL and (
|
|
72
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
73
|
+
):
|
|
74
|
+
m[k] = val
|
|
75
|
+
|
|
76
|
+
return m
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import BaseModel
|
|
5
|
+
import pydantic
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SyPositionTypedDict(TypedDict):
|
|
10
|
+
sy_id: str
|
|
11
|
+
balance: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SyPosition(BaseModel):
|
|
15
|
+
sy_id: Annotated[str, pydantic.Field(alias="syId")]
|
|
16
|
+
|
|
17
|
+
balance: str
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from compass_api_sdk.types import
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
8
|
-
from typing_extensions import Annotated, NotRequired,
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
15
|
|
|
10
16
|
|
|
11
17
|
class TokenAddressChain(str, Enum):
|
|
@@ -16,16 +22,6 @@ class TokenAddressChain(str, Enum):
|
|
|
16
22
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
23
|
|
|
18
24
|
|
|
19
|
-
TokenAddressBlockTypedDict = TypeAliasType(
|
|
20
|
-
"TokenAddressBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
TokenAddressBlock = TypeAliasType("TokenAddressBlock", Union[int, str])
|
|
26
|
-
r"""The block number you want to get this data at."""
|
|
27
|
-
|
|
28
|
-
|
|
29
25
|
class TokenAddressToken(str, Enum):
|
|
30
26
|
r"""A class representing the token.
|
|
31
27
|
|
|
@@ -82,8 +78,8 @@ class TokenAddressToken(str, Enum):
|
|
|
82
78
|
class TokenAddressRequestTypedDict(TypedDict):
|
|
83
79
|
chain: TokenAddressChain
|
|
84
80
|
r"""The chain to use."""
|
|
85
|
-
block: NotRequired[
|
|
86
|
-
r"""
|
|
81
|
+
block: NotRequired[Nullable[int]]
|
|
82
|
+
r"""Optional block number (defaults to latest)."""
|
|
87
83
|
token: TokenAddressToken
|
|
88
84
|
r"""The token symbol to get the address for.."""
|
|
89
85
|
|
|
@@ -96,13 +92,43 @@ class TokenAddressRequest(BaseModel):
|
|
|
96
92
|
r"""The chain to use."""
|
|
97
93
|
|
|
98
94
|
block: Annotated[
|
|
99
|
-
|
|
95
|
+
OptionalNullable[int],
|
|
100
96
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
101
|
-
] =
|
|
102
|
-
r"""
|
|
97
|
+
] = UNSET
|
|
98
|
+
r"""Optional block number (defaults to latest)."""
|
|
103
99
|
|
|
104
100
|
token: Annotated[
|
|
105
101
|
TokenAddressToken,
|
|
106
102
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
107
103
|
] = TokenAddressToken.WETH
|
|
108
104
|
r"""The token symbol to get the address for.."""
|
|
105
|
+
|
|
106
|
+
@model_serializer(mode="wrap")
|
|
107
|
+
def serialize_model(self, handler):
|
|
108
|
+
optional_fields = ["block"]
|
|
109
|
+
nullable_fields = ["block"]
|
|
110
|
+
null_default_fields = []
|
|
111
|
+
|
|
112
|
+
serialized = handler(self)
|
|
113
|
+
|
|
114
|
+
m = {}
|
|
115
|
+
|
|
116
|
+
for n, f in type(self).model_fields.items():
|
|
117
|
+
k = f.alias or n
|
|
118
|
+
val = serialized.get(k)
|
|
119
|
+
serialized.pop(k, None)
|
|
120
|
+
|
|
121
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
122
|
+
is_set = (
|
|
123
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
124
|
+
or k in null_default_fields
|
|
125
|
+
) # pylint: disable=no-member
|
|
126
|
+
|
|
127
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
128
|
+
m[k] = val
|
|
129
|
+
elif val != UNSET_SENTINEL and (
|
|
130
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
131
|
+
):
|
|
132
|
+
m[k] = val
|
|
133
|
+
|
|
134
|
+
return m
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .token_enum import TokenEnum
|
|
5
|
-
from compass_api_sdk.types import
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
6
12
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
7
13
|
from enum import Enum
|
|
8
|
-
from
|
|
14
|
+
from pydantic import model_serializer
|
|
15
|
+
from typing import Union
|
|
9
16
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
10
17
|
|
|
11
18
|
|
|
@@ -17,16 +24,6 @@ class TokenBalanceChain(str, Enum):
|
|
|
17
24
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
18
25
|
|
|
19
26
|
|
|
20
|
-
TokenBalanceBlockTypedDict = TypeAliasType(
|
|
21
|
-
"TokenBalanceBlockTypedDict", Union[int, str]
|
|
22
|
-
)
|
|
23
|
-
r"""The block number you want to get this data at."""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
TokenBalanceBlock = TypeAliasType("TokenBalanceBlock", Union[int, str])
|
|
27
|
-
r"""The block number you want to get this data at."""
|
|
28
|
-
|
|
29
|
-
|
|
30
27
|
TokenBalanceTokenTypedDict = TypeAliasType(
|
|
31
28
|
"TokenBalanceTokenTypedDict", Union[TokenEnum, str]
|
|
32
29
|
)
|
|
@@ -42,8 +39,8 @@ class TokenBalanceRequestTypedDict(TypedDict):
|
|
|
42
39
|
r"""The symbol of the token for which the balance is checked.."""
|
|
43
40
|
chain: TokenBalanceChain
|
|
44
41
|
r"""The chain to use."""
|
|
45
|
-
block: NotRequired[
|
|
46
|
-
r"""
|
|
42
|
+
block: NotRequired[Nullable[int]]
|
|
43
|
+
r"""Optional block number (defaults to latest)."""
|
|
47
44
|
user: str
|
|
48
45
|
r"""The user to get the ERC20 balance of."""
|
|
49
46
|
|
|
@@ -62,12 +59,42 @@ class TokenBalanceRequest(BaseModel):
|
|
|
62
59
|
r"""The chain to use."""
|
|
63
60
|
|
|
64
61
|
block: Annotated[
|
|
65
|
-
|
|
62
|
+
OptionalNullable[int],
|
|
66
63
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
67
|
-
] =
|
|
68
|
-
r"""
|
|
64
|
+
] = UNSET
|
|
65
|
+
r"""Optional block number (defaults to latest)."""
|
|
69
66
|
|
|
70
67
|
user: Annotated[
|
|
71
68
|
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
72
69
|
] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
|
|
73
70
|
r"""The user to get the ERC20 balance of."""
|
|
71
|
+
|
|
72
|
+
@model_serializer(mode="wrap")
|
|
73
|
+
def serialize_model(self, handler):
|
|
74
|
+
optional_fields = ["block"]
|
|
75
|
+
nullable_fields = ["block"]
|
|
76
|
+
null_default_fields = []
|
|
77
|
+
|
|
78
|
+
serialized = handler(self)
|
|
79
|
+
|
|
80
|
+
m = {}
|
|
81
|
+
|
|
82
|
+
for n, f in type(self).model_fields.items():
|
|
83
|
+
k = f.alias or n
|
|
84
|
+
val = serialized.get(k)
|
|
85
|
+
serialized.pop(k, None)
|
|
86
|
+
|
|
87
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
88
|
+
is_set = (
|
|
89
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
90
|
+
or k in null_default_fields
|
|
91
|
+
) # pylint: disable=no-member
|
|
92
|
+
|
|
93
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
94
|
+
m[k] = val
|
|
95
|
+
elif val != UNSET_SENTINEL and (
|
|
96
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
97
|
+
):
|
|
98
|
+
m[k] = val
|
|
99
|
+
|
|
100
|
+
return m
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from compass_api_sdk.types import
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
8
|
-
from typing_extensions import Annotated, NotRequired,
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
15
|
|
|
10
16
|
|
|
11
17
|
class UniswapLiquidityProvisionInRangeChain(str, Enum):
|
|
@@ -16,23 +22,11 @@ class UniswapLiquidityProvisionInRangeChain(str, Enum):
|
|
|
16
22
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
23
|
|
|
18
24
|
|
|
19
|
-
UniswapLiquidityProvisionInRangeBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapLiquidityProvisionInRangeBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapLiquidityProvisionInRangeBlock = TypeAliasType(
|
|
26
|
-
"UniswapLiquidityProvisionInRangeBlock", Union[int, str]
|
|
27
|
-
)
|
|
28
|
-
r"""The block number you want to get this data at."""
|
|
29
|
-
|
|
30
|
-
|
|
31
25
|
class UniswapLiquidityProvisionInRangeRequestTypedDict(TypedDict):
|
|
32
26
|
chain: UniswapLiquidityProvisionInRangeChain
|
|
33
27
|
r"""The chain to use."""
|
|
34
|
-
block: NotRequired[
|
|
35
|
-
r"""
|
|
28
|
+
block: NotRequired[Nullable[int]]
|
|
29
|
+
r"""Optional block number (defaults to latest)."""
|
|
36
30
|
token_id: int
|
|
37
31
|
r"""Token ID of the NFT representing the liquidity provisioned position."""
|
|
38
32
|
|
|
@@ -45,12 +39,42 @@ class UniswapLiquidityProvisionInRangeRequest(BaseModel):
|
|
|
45
39
|
r"""The chain to use."""
|
|
46
40
|
|
|
47
41
|
block: Annotated[
|
|
48
|
-
|
|
42
|
+
OptionalNullable[int],
|
|
49
43
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
50
|
-
] =
|
|
51
|
-
r"""
|
|
44
|
+
] = UNSET
|
|
45
|
+
r"""Optional block number (defaults to latest)."""
|
|
52
46
|
|
|
53
47
|
token_id: Annotated[
|
|
54
48
|
int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
55
49
|
] = 4318185
|
|
56
50
|
r"""Token ID of the NFT representing the liquidity provisioned position."""
|
|
51
|
+
|
|
52
|
+
@model_serializer(mode="wrap")
|
|
53
|
+
def serialize_model(self, handler):
|
|
54
|
+
optional_fields = ["block"]
|
|
55
|
+
nullable_fields = ["block"]
|
|
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
|