compass_api_sdk 0.2.0__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.

Files changed (35) hide show
  1. compass_api_sdk/_version.py +2 -2
  2. compass_api_sdk/models/__init__.py +46 -25
  3. compass_api_sdk/models/aavehistoricaltransactionsresponse.py +45 -11
  4. compass_api_sdk/models/aavelooprequest.py +87 -0
  5. compass_api_sdk/models/borrow.py +46 -12
  6. compass_api_sdk/models/liquidationcall.py +45 -18
  7. compass_api_sdk/models/morpho_market_positionop.py +5 -9
  8. compass_api_sdk/models/morpho_marketsop.py +5 -9
  9. compass_api_sdk/models/morpho_vault_positionop.py +5 -9
  10. compass_api_sdk/models/morpho_vaultsop.py +19 -17
  11. compass_api_sdk/models/morphoborrowrequest.py +8 -5
  12. compass_api_sdk/models/morphodepositrequest.py +8 -5
  13. compass_api_sdk/models/morphorepayrequest.py +8 -5
  14. compass_api_sdk/models/morphosetvaultallowancerequest.py +8 -5
  15. compass_api_sdk/models/morphosupplycollateralrequest.py +8 -5
  16. compass_api_sdk/models/morphowithdrawcollateralrequest.py +8 -5
  17. compass_api_sdk/models/morphowithdrawrequest.py +8 -5
  18. compass_api_sdk/models/redeemunderlying.py +31 -4
  19. compass_api_sdk/models/repay.py +35 -4
  20. compass_api_sdk/models/reserve.py +67 -6
  21. compass_api_sdk/models/supply.py +37 -4
  22. compass_api_sdk/models/swapborrowrate.py +37 -8
  23. compass_api_sdk/models/uniswapbuyexactlyparams.py +6 -6
  24. compass_api_sdk/models/uniswapbuyexactlyrequest.py +6 -6
  25. compass_api_sdk/models/usageascollateral.py +36 -4
  26. compass_api_sdk/morpho.py +63 -47
  27. compass_api_sdk/transaction_batching.py +284 -0
  28. compass_api_sdk/uniswap_v3.py +10 -10
  29. {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/METADATA +2 -1
  30. {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/RECORD +31 -34
  31. compass_api_sdk/models/aavehistoricaltransactionbase.py +0 -113
  32. compass_api_sdk/models/action.py +0 -14
  33. compass_api_sdk/models/collateralreserve.py +0 -16
  34. compass_api_sdk/models/principalreserve.py +0 -16
  35. {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/WHEEL +0 -0
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "compass_api_sdk"
6
- __version__: str = "0.2.0"
6
+ __version__: str = "0.2.1"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
8
  __gen_version__: str = "2.599.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.2.0 2.599.0 0.0.1 compass_api_sdk"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.2.1 2.599.0 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -52,18 +52,22 @@ from .aaveborrowrequest import (
52
52
  AaveBorrowRequestAmountTypedDict,
53
53
  AaveBorrowRequestTypedDict,
54
54
  )
55
- from .aavehistoricaltransactionbase import (
56
- AaveHistoricalTransactionBase,
57
- AaveHistoricalTransactionBaseTypedDict,
58
- )
59
55
  from .aavehistoricaltransactionsresponse import (
60
56
  AaveHistoricalTransactionsResponse,
61
57
  AaveHistoricalTransactionsResponseTypedDict,
58
+ Transaction,
59
+ TransactionTypedDict,
62
60
  )
63
61
  from .aaveliquiditychangeresponse import (
64
62
  AaveLiquidityChangeResponse,
65
63
  AaveLiquidityChangeResponseTypedDict,
66
64
  )
65
+ from .aavelooprequest import (
66
+ AaveLoopRequest,
67
+ AaveLoopRequestTypedDict,
68
+ CollateralAmount,
69
+ CollateralAmountTypedDict,
70
+ )
67
71
  from .aaverateresponse import AaveRateResponse, AaveRateResponseTypedDict
68
72
  from .aaverepayparams import (
69
73
  AaveRepayParams,
@@ -117,7 +121,6 @@ from .aavewithdrawrequest import (
117
121
  AaveWithdrawRequestAmountTypedDict,
118
122
  AaveWithdrawRequestTypedDict,
119
123
  )
120
- from .action import Action
121
124
  from .aerodrome_slipstream_liquidity_provision_positionsop import (
122
125
  AerodromeSlipstreamLiquidityProvisionPositionsChain,
123
126
  AerodromeSlipstreamLiquidityProvisionPositionsRequest,
@@ -232,10 +235,9 @@ from .aerodromeslipstreamwithdrawliquidityprovisionrequest import (
232
235
  AerodromeSlipstreamWithdrawLiquidityProvisionRequestTypedDict,
233
236
  )
234
237
  from .allowanceinforesponse import AllowanceInfoResponse, AllowanceInfoResponseTypedDict
235
- from .borrow import Borrow, BorrowTypedDict
238
+ from .borrow import Borrow, BorrowTypedDict, Borrowratemode
236
239
  from .chain import Chain
237
240
  from .chaininfo import ChainInfo, ChainInfoTypedDict
238
- from .collateralreserve import CollateralReserve, CollateralReserveTypedDict
239
241
  from .compass_api_backend_models_morpho_read_response_get_markets_asset import (
240
242
  CompassAPIBackendModelsMorphoReadResponseGetMarketsAsset,
241
243
  CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict,
@@ -322,6 +324,7 @@ from .morphoborrowrequest import (
322
324
  MorphoBorrowRequest,
323
325
  MorphoBorrowRequestAmount,
324
326
  MorphoBorrowRequestAmountTypedDict,
327
+ MorphoBorrowRequestChain,
325
328
  MorphoBorrowRequestTypedDict,
326
329
  )
327
330
  from .morphocheckmarketpositionresponse import (
@@ -336,6 +339,7 @@ from .morphodepositrequest import (
336
339
  MorphoDepositRequest,
337
340
  MorphoDepositRequestAmount,
338
341
  MorphoDepositRequestAmountTypedDict,
342
+ MorphoDepositRequestChain,
339
343
  MorphoDepositRequestTypedDict,
340
344
  )
341
345
  from .morphogetmarketsresponse import (
@@ -347,17 +351,23 @@ from .morphogetvaultsresponse import (
347
351
  MorphoGetVaultsResponseTypedDict,
348
352
  )
349
353
  from .morphomarket import MorphoMarket, MorphoMarketTypedDict
350
- from .morphorepayrequest import MorphoRepayRequest, MorphoRepayRequestTypedDict
354
+ from .morphorepayrequest import (
355
+ MorphoRepayRequest,
356
+ MorphoRepayRequestChain,
357
+ MorphoRepayRequestTypedDict,
358
+ )
351
359
  from .morphosetvaultallowancerequest import (
352
360
  MorphoSetVaultAllowanceRequest,
353
361
  MorphoSetVaultAllowanceRequestAmount,
354
362
  MorphoSetVaultAllowanceRequestAmountTypedDict,
363
+ MorphoSetVaultAllowanceRequestChain,
355
364
  MorphoSetVaultAllowanceRequestTypedDict,
356
365
  )
357
366
  from .morphosupplycollateralrequest import (
358
367
  MorphoSupplyCollateralRequest,
359
368
  MorphoSupplyCollateralRequestAmount,
360
369
  MorphoSupplyCollateralRequestAmountTypedDict,
370
+ MorphoSupplyCollateralRequestChain,
361
371
  MorphoSupplyCollateralRequestTypedDict,
362
372
  )
363
373
  from .morphovault import MorphoVault, MorphoVaultTypedDict
@@ -365,9 +375,14 @@ from .morphowithdrawcollateralrequest import (
365
375
  MorphoWithdrawCollateralRequest,
366
376
  MorphoWithdrawCollateralRequestAmount,
367
377
  MorphoWithdrawCollateralRequestAmountTypedDict,
378
+ MorphoWithdrawCollateralRequestChain,
368
379
  MorphoWithdrawCollateralRequestTypedDict,
369
380
  )
370
- from .morphowithdrawrequest import MorphoWithdrawRequest, MorphoWithdrawRequestTypedDict
381
+ from .morphowithdrawrequest import (
382
+ MorphoWithdrawRequest,
383
+ MorphoWithdrawRequestChain,
384
+ MorphoWithdrawRequestTypedDict,
385
+ )
371
386
  from .multicallaction import (
372
387
  Body,
373
388
  BodyTypedDict,
@@ -388,7 +403,6 @@ from .multicallexecuterequest import (
388
403
  MulticallExecuteRequestTypedDict,
389
404
  )
390
405
  from .portfolio import Portfolio, PortfolioTypedDict
391
- from .principalreserve import PrincipalReserve, PrincipalReserveTypedDict
392
406
  from .redeemunderlying import RedeemUnderlying, RedeemUnderlyingTypedDict
393
407
  from .repay import Repay, RepayTypedDict
394
408
  from .reserve import Reserve, ReserveTypedDict
@@ -513,14 +527,14 @@ from .uniswap_quote_sell_exactlyop import (
513
527
  )
514
528
  from .uniswapbuyexactlyparams import (
515
529
  UniswapBuyExactlyParams,
516
- UniswapBuyExactlyParamsAmountOut,
517
- UniswapBuyExactlyParamsAmountOutTypedDict,
530
+ UniswapBuyExactlyParamsAmount,
531
+ UniswapBuyExactlyParamsAmountTypedDict,
518
532
  UniswapBuyExactlyParamsTypedDict,
519
533
  )
520
534
  from .uniswapbuyexactlyrequest import (
521
535
  UniswapBuyExactlyRequest,
522
- UniswapBuyExactlyRequestAmountOut,
523
- UniswapBuyExactlyRequestAmountOutTypedDict,
536
+ UniswapBuyExactlyRequestAmount,
537
+ UniswapBuyExactlyRequestAmountTypedDict,
524
538
  UniswapBuyExactlyRequestTypedDict,
525
539
  )
526
540
  from .uniswapbuyquoteinforesponse import (
@@ -668,8 +682,6 @@ __all__ = [
668
682
  "AaveBorrowRequestAmount",
669
683
  "AaveBorrowRequestAmountTypedDict",
670
684
  "AaveBorrowRequestTypedDict",
671
- "AaveHistoricalTransactionBase",
672
- "AaveHistoricalTransactionBaseTypedDict",
673
685
  "AaveHistoricalTransactionsChain",
674
686
  "AaveHistoricalTransactionsRequest",
675
687
  "AaveHistoricalTransactionsRequestTypedDict",
@@ -681,6 +693,8 @@ __all__ = [
681
693
  "AaveLiquidityChangeResponse",
682
694
  "AaveLiquidityChangeResponseTypedDict",
683
695
  "AaveLiquidityChangeToken",
696
+ "AaveLoopRequest",
697
+ "AaveLoopRequestTypedDict",
684
698
  "AaveRateChain",
685
699
  "AaveRateRequest",
686
700
  "AaveRateRequestTypedDict",
@@ -734,7 +748,6 @@ __all__ = [
734
748
  "AaveWithdrawRequestAmount",
735
749
  "AaveWithdrawRequestAmountTypedDict",
736
750
  "AaveWithdrawRequestTypedDict",
737
- "Action",
738
751
  "AerodromeLPPositionsResponse",
739
752
  "AerodromeLPPositionsResponseTypedDict",
740
753
  "AerodromePosition",
@@ -827,11 +840,12 @@ __all__ = [
827
840
  "BodyTypedDict",
828
841
  "Borrow",
829
842
  "BorrowTypedDict",
843
+ "Borrowratemode",
830
844
  "Chain",
831
845
  "ChainInfo",
832
846
  "ChainInfoTypedDict",
833
- "CollateralReserve",
834
- "CollateralReserveTypedDict",
847
+ "CollateralAmount",
848
+ "CollateralAmountTypedDict",
835
849
  "CompassAPIBackendModelsMorphoReadResponseGetMarketsAsset",
836
850
  "CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict",
837
851
  "CompassAPIBackendModelsMorphoReadResponseGetVaultsAsset",
@@ -883,6 +897,7 @@ __all__ = [
883
897
  "MorphoBorrowRequest",
884
898
  "MorphoBorrowRequestAmount",
885
899
  "MorphoBorrowRequestAmountTypedDict",
900
+ "MorphoBorrowRequestChain",
886
901
  "MorphoBorrowRequestTypedDict",
887
902
  "MorphoCheckMarketPositionResponse",
888
903
  "MorphoCheckMarketPositionResponseTypedDict",
@@ -891,6 +906,7 @@ __all__ = [
891
906
  "MorphoDepositRequest",
892
907
  "MorphoDepositRequestAmount",
893
908
  "MorphoDepositRequestAmountTypedDict",
909
+ "MorphoDepositRequestChain",
894
910
  "MorphoDepositRequestTypedDict",
895
911
  "MorphoGetMarketsResponse",
896
912
  "MorphoGetMarketsResponseTypedDict",
@@ -905,14 +921,17 @@ __all__ = [
905
921
  "MorphoMarketsRequest",
906
922
  "MorphoMarketsRequestTypedDict",
907
923
  "MorphoRepayRequest",
924
+ "MorphoRepayRequestChain",
908
925
  "MorphoRepayRequestTypedDict",
909
926
  "MorphoSetVaultAllowanceRequest",
910
927
  "MorphoSetVaultAllowanceRequestAmount",
911
928
  "MorphoSetVaultAllowanceRequestAmountTypedDict",
929
+ "MorphoSetVaultAllowanceRequestChain",
912
930
  "MorphoSetVaultAllowanceRequestTypedDict",
913
931
  "MorphoSupplyCollateralRequest",
914
932
  "MorphoSupplyCollateralRequestAmount",
915
933
  "MorphoSupplyCollateralRequestAmountTypedDict",
934
+ "MorphoSupplyCollateralRequestChain",
916
935
  "MorphoSupplyCollateralRequestTypedDict",
917
936
  "MorphoVault",
918
937
  "MorphoVaultPositionChain",
@@ -925,8 +944,10 @@ __all__ = [
925
944
  "MorphoWithdrawCollateralRequest",
926
945
  "MorphoWithdrawCollateralRequestAmount",
927
946
  "MorphoWithdrawCollateralRequestAmountTypedDict",
947
+ "MorphoWithdrawCollateralRequestChain",
928
948
  "MorphoWithdrawCollateralRequestTypedDict",
929
949
  "MorphoWithdrawRequest",
950
+ "MorphoWithdrawRequestChain",
930
951
  "MorphoWithdrawRequestTypedDict",
931
952
  "MulticallAction",
932
953
  "MulticallActionType",
@@ -939,8 +960,6 @@ __all__ = [
939
960
  "MulticallExecuteRequestTypedDict",
940
961
  "Portfolio",
941
962
  "PortfolioTypedDict",
942
- "PrincipalReserve",
943
- "PrincipalReserveTypedDict",
944
963
  "R",
945
964
  "RTypedDict",
946
965
  "RedeemUnderlying",
@@ -1015,13 +1034,15 @@ __all__ = [
1015
1034
  "TokenTransferRequestToken",
1016
1035
  "TokenTransferRequestTokenTypedDict",
1017
1036
  "TokenTransferRequestTypedDict",
1037
+ "Transaction",
1038
+ "TransactionTypedDict",
1018
1039
  "UniswapBuyExactlyParams",
1019
- "UniswapBuyExactlyParamsAmountOut",
1020
- "UniswapBuyExactlyParamsAmountOutTypedDict",
1040
+ "UniswapBuyExactlyParamsAmount",
1041
+ "UniswapBuyExactlyParamsAmountTypedDict",
1021
1042
  "UniswapBuyExactlyParamsTypedDict",
1022
1043
  "UniswapBuyExactlyRequest",
1023
- "UniswapBuyExactlyRequestAmountOut",
1024
- "UniswapBuyExactlyRequestAmountOutTypedDict",
1044
+ "UniswapBuyExactlyRequestAmount",
1045
+ "UniswapBuyExactlyRequestAmountTypedDict",
1025
1046
  "UniswapBuyExactlyRequestTypedDict",
1026
1047
  "UniswapBuyQuoteInfoResponse",
1027
1048
  "UniswapBuyQuoteInfoResponseTypedDict",
@@ -1,31 +1,65 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .aavehistoricaltransactionbase import (
5
- AaveHistoricalTransactionBase,
6
- AaveHistoricalTransactionBaseTypedDict,
7
- )
4
+ from .borrow import Borrow, BorrowTypedDict
5
+ from .liquidationcall import LiquidationCall, LiquidationCallTypedDict
6
+ from .redeemunderlying import RedeemUnderlying, RedeemUnderlyingTypedDict
7
+ from .repay import Repay, RepayTypedDict
8
+ from .supply import Supply, SupplyTypedDict
9
+ from .swapborrowrate import SwapBorrowRate, SwapBorrowRateTypedDict
10
+ from .usageascollateral import UsageAsCollateral, UsageAsCollateralTypedDict
8
11
  from compass_api_sdk.types import BaseModel
9
- from typing import List
10
- from typing_extensions import TypedDict
12
+ from compass_api_sdk.utils import get_discriminator
13
+ from pydantic import Discriminator, Tag
14
+ from typing import List, Union
15
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
16
+
17
+
18
+ TransactionTypedDict = TypeAliasType(
19
+ "TransactionTypedDict",
20
+ Union[
21
+ RedeemUnderlyingTypedDict,
22
+ RepayTypedDict,
23
+ SupplyTypedDict,
24
+ UsageAsCollateralTypedDict,
25
+ BorrowTypedDict,
26
+ SwapBorrowRateTypedDict,
27
+ LiquidationCallTypedDict,
28
+ ],
29
+ )
30
+
31
+
32
+ Transaction = Annotated[
33
+ Union[
34
+ Annotated[Borrow, Tag("Borrow")],
35
+ Annotated[LiquidationCall, Tag("LiquidationCall")],
36
+ Annotated[RedeemUnderlying, Tag("RedeemUnderlying")],
37
+ Annotated[Repay, Tag("Repay")],
38
+ Annotated[Supply, Tag("Supply")],
39
+ Annotated[SwapBorrowRate, Tag("SwapBorrowRate")],
40
+ Annotated[UsageAsCollateral, Tag("UsageAsCollateral")],
41
+ ],
42
+ Discriminator(lambda m: get_discriminator(m, "action", "action")),
43
+ ]
11
44
 
12
45
 
13
46
  class AaveHistoricalTransactionsResponseTypedDict(TypedDict):
14
47
  r"""Response model for getting Aave historical transactions."""
15
48
 
16
- total: int
17
49
  offset: int
50
+ r"""Specifies how many transactions to skip before returning results, letting you choose the starting point for the data you want to receive."""
18
51
  limit: int
19
- transactions: List[AaveHistoricalTransactionBaseTypedDict]
52
+ r"""Sets the maximum number of transactions to include in the response, helping control the size of the returned dataset."""
53
+ transactions: List[TransactionTypedDict]
20
54
 
21
55
 
22
56
  class AaveHistoricalTransactionsResponse(BaseModel):
23
57
  r"""Response model for getting Aave historical transactions."""
24
58
 
25
- total: int
26
-
27
59
  offset: int
60
+ r"""Specifies how many transactions to skip before returning results, letting you choose the starting point for the data you want to receive."""
28
61
 
29
62
  limit: int
63
+ r"""Sets the maximum number of transactions to include in the response, helping control the size of the returned dataset."""
30
64
 
31
- transactions: List[AaveHistoricalTransactionBase]
65
+ transactions: List[Transaction]
@@ -0,0 +1,87 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chain import Chain
5
+ from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
6
+ from .token_enum import TokenEnum
7
+ from compass_api_sdk.types import BaseModel
8
+ from typing import Union
9
+ from typing_extensions import TypeAliasType, TypedDict
10
+
11
+
12
+ CollateralAmountTypedDict = TypeAliasType(
13
+ "CollateralAmountTypedDict", Union[float, str]
14
+ )
15
+ r"""Amount of collateral token to supply to Aave"""
16
+
17
+
18
+ CollateralAmount = TypeAliasType("CollateralAmount", Union[float, str])
19
+ r"""Amount of collateral token to supply to Aave"""
20
+
21
+
22
+ class AaveLoopRequestTypedDict(TypedDict):
23
+ r"""Request model for executing an Aave loop transaction."""
24
+
25
+ chain: Chain
26
+ r"""The chain to use."""
27
+ sender: str
28
+ r"""The address of the transaction sender."""
29
+ signed_authorization: SignedAuthorizationTypedDict
30
+ collateral_token: TokenEnum
31
+ r"""A class representing the token.
32
+
33
+ This class is used to represent the token in the system. Notice individual
34
+ endpoints' documentation where per chain tokens are presented.
35
+ """
36
+ borrow_token: TokenEnum
37
+ r"""A class representing the token.
38
+
39
+ This class is used to represent the token in the system. Notice individual
40
+ endpoints' documentation where per chain tokens are presented.
41
+ """
42
+ collateral_amount: CollateralAmountTypedDict
43
+ r"""Amount of collateral token to supply to Aave"""
44
+ loop_count: int
45
+ r"""Number of times to perform the supply-borrow loop"""
46
+ max_slippage_percent: float
47
+ r"""Maximum allowed slippage for token swaps in percentage"""
48
+ loan_to_value: float
49
+ r"""Loan To Value percentage of the loop"""
50
+
51
+
52
+ class AaveLoopRequest(BaseModel):
53
+ r"""Request model for executing an Aave loop transaction."""
54
+
55
+ chain: Chain
56
+ r"""The chain to use."""
57
+
58
+ sender: str
59
+ r"""The address of the transaction sender."""
60
+
61
+ signed_authorization: SignedAuthorization
62
+
63
+ collateral_token: TokenEnum
64
+ r"""A class representing the token.
65
+
66
+ This class is used to represent the token in the system. Notice individual
67
+ endpoints' documentation where per chain tokens are presented.
68
+ """
69
+
70
+ borrow_token: TokenEnum
71
+ r"""A class representing the token.
72
+
73
+ This class is used to represent the token in the system. Notice individual
74
+ endpoints' documentation where per chain tokens are presented.
75
+ """
76
+
77
+ collateral_amount: CollateralAmount
78
+ r"""Amount of collateral token to supply to Aave"""
79
+
80
+ loop_count: int
81
+ r"""Number of times to perform the supply-borrow loop"""
82
+
83
+ max_slippage_percent: float
84
+ r"""Maximum allowed slippage for token swaps in percentage"""
85
+
86
+ loan_to_value: float
87
+ r"""Loan To Value percentage of the loop"""
@@ -3,31 +3,65 @@
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
7
+ from enum import Enum
6
8
  import pydantic
9
+ from pydantic.functional_validators import AfterValidator
10
+ from typing import Literal
7
11
  from typing_extensions import Annotated, TypedDict
8
12
 
9
13
 
14
+ class Borrowratemode(int, Enum):
15
+ r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
16
+
17
+ ONE = 1
18
+ TWO = 2
19
+
20
+
10
21
  class BorrowTypedDict(TypedDict):
11
- amount: str
12
- borrow_rate_mode: str
13
- borrow_rate: str
14
- stable_token_debt: str
15
- variable_token_debt: str
22
+ id: str
23
+ r"""The id of a historical transaction on aave"""
24
+ timestamp: int
25
+ r"""Timestamp in unix time"""
26
+ tx_hash: str
27
+ r"""Transaction hash. You can paste these into the search bar on etherscan"""
28
+ amount: float
29
+ r"""Quantity of token"""
30
+ borrow_rate_mode: Borrowratemode
31
+ r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
16
32
  reserve: ReserveTypedDict
17
- asset_price_usd: str
33
+ asset_price_usd: float
34
+ r"""Price of token in USD"""
35
+ block: int
36
+ action: Literal["Borrow"]
37
+ r"""The type of transaction"""
18
38
 
19
39
 
20
40
  class Borrow(BaseModel):
21
- amount: str
41
+ id: str
42
+ r"""The id of a historical transaction on aave"""
22
43
 
23
- borrow_rate_mode: Annotated[str, pydantic.Field(alias="borrowRateMode")]
44
+ timestamp: int
45
+ r"""Timestamp in unix time"""
24
46
 
25
- borrow_rate: Annotated[str, pydantic.Field(alias="borrowRate")]
47
+ tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
48
+ r"""Transaction hash. You can paste these into the search bar on etherscan"""
26
49
 
27
- stable_token_debt: Annotated[str, pydantic.Field(alias="stableTokenDebt")]
50
+ amount: float
51
+ r"""Quantity of token"""
28
52
 
29
- variable_token_debt: Annotated[str, pydantic.Field(alias="variableTokenDebt")]
53
+ borrow_rate_mode: Annotated[Borrowratemode, pydantic.Field(alias="borrowRateMode")]
54
+ r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
30
55
 
31
56
  reserve: Reserve
32
57
 
33
- asset_price_usd: Annotated[str, pydantic.Field(alias="assetPriceUSD")]
58
+ asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
59
+ r"""Price of token in USD"""
60
+
61
+ block: int
62
+
63
+ ACTION: Annotated[
64
+ Annotated[Literal["Borrow"], AfterValidator(validate_const("Borrow"))],
65
+ pydantic.Field(alias="action"),
66
+ ] = "Borrow"
67
+ r"""The type of transaction"""
@@ -1,37 +1,64 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .collateralreserve import CollateralReserve, CollateralReserveTypedDict
5
- from .principalreserve import PrincipalReserve, PrincipalReserveTypedDict
4
+ from .reserve import Reserve, ReserveTypedDict
6
5
  from compass_api_sdk.types import BaseModel
6
+ from compass_api_sdk.utils import validate_const
7
7
  import pydantic
8
+ from pydantic.functional_validators import AfterValidator
9
+ from typing import Literal
8
10
  from typing_extensions import Annotated, TypedDict
9
11
 
10
12
 
11
13
  class LiquidationCallTypedDict(TypedDict):
12
- collateral_amount: str
13
- collateral_reserve: CollateralReserveTypedDict
14
- principal_amount: str
15
- principal_reserve: PrincipalReserveTypedDict
16
- collateral_asset_price_usd: str
17
- borrow_asset_price_usd: str
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
+ collateral_amount: float
21
+ collateral_reserve: ReserveTypedDict
22
+ principal_amount: float
23
+ principal_reserve: ReserveTypedDict
24
+ collateral_asset_price_usd: float
25
+ borrow_asset_price_usd: float
26
+ block: int
27
+ action: Literal["LiquidationCall"]
18
28
 
19
29
 
20
30
  class LiquidationCall(BaseModel):
21
- collateral_amount: Annotated[str, pydantic.Field(alias="collateralAmount")]
31
+ id: str
32
+ r"""The id of a historical transaction on aave"""
22
33
 
23
- collateral_reserve: Annotated[
24
- CollateralReserve, pydantic.Field(alias="collateralReserve")
25
- ]
34
+ timestamp: int
35
+ r"""Timestamp in unix time"""
26
36
 
27
- principal_amount: Annotated[str, pydantic.Field(alias="principalAmount")]
37
+ tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
38
+ r"""Transaction hash. You can paste these into the search bar on etherscan"""
28
39
 
29
- principal_reserve: Annotated[
30
- PrincipalReserve, pydantic.Field(alias="principalReserve")
31
- ]
40
+ collateral_amount: Annotated[float, pydantic.Field(alias="collateralAmount")]
41
+
42
+ collateral_reserve: Annotated[Reserve, pydantic.Field(alias="collateralReserve")]
43
+
44
+ principal_amount: Annotated[float, pydantic.Field(alias="principalAmount")]
45
+
46
+ principal_reserve: Annotated[Reserve, pydantic.Field(alias="principalReserve")]
32
47
 
33
48
  collateral_asset_price_usd: Annotated[
34
- str, pydantic.Field(alias="collateralAssetPriceUSD")
49
+ float, pydantic.Field(alias="collateralAssetPriceUSD")
50
+ ]
51
+
52
+ borrow_asset_price_usd: Annotated[
53
+ float, pydantic.Field(alias="borrowAssetPriceUSD")
35
54
  ]
36
55
 
37
- borrow_asset_price_usd: Annotated[str, pydantic.Field(alias="borrowAssetPriceUSD")]
56
+ block: int
57
+
58
+ ACTION: Annotated[
59
+ Annotated[
60
+ Literal["LiquidationCall"],
61
+ AfterValidator(validate_const("LiquidationCall")),
62
+ ],
63
+ pydantic.Field(alias="action"),
64
+ ] = "LiquidationCall"
@@ -4,30 +4,26 @@ from __future__ import annotations
4
4
  from compass_api_sdk.types import BaseModel
5
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
6
6
  from enum import Enum
7
- from typing_extensions import Annotated, TypedDict
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
9
 
9
10
 
10
11
  class MorphoMarketPositionChain(str, Enum):
11
- r"""The chain to use."""
12
-
13
- BASE_MAINNET = "base:mainnet"
14
12
  ETHEREUM_MAINNET = "ethereum:mainnet"
15
- ARBITRUM_MAINNET = "arbitrum:mainnet"
13
+ BASE_MAINNET = "base:mainnet"
16
14
 
17
15
 
18
16
  class MorphoMarketPositionRequestTypedDict(TypedDict):
19
- chain: MorphoMarketPositionChain
20
- r"""The chain to use."""
17
+ chain: NotRequired[MorphoMarketPositionChain]
21
18
  user_address: str
22
19
  unique_market_key: str
23
20
 
24
21
 
25
22
  class MorphoMarketPositionRequest(BaseModel):
26
23
  chain: Annotated[
27
- MorphoMarketPositionChain,
24
+ Optional[MorphoMarketPositionChain],
28
25
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
29
26
  ] = MorphoMarketPositionChain.ETHEREUM_MAINNET
30
- r"""The chain to use."""
31
27
 
32
28
  user_address: Annotated[
33
29
  str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
@@ -11,30 +11,26 @@ from compass_api_sdk.types import (
11
11
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
12
  from enum import Enum
13
13
  from pydantic import model_serializer
14
+ from typing import Optional
14
15
  from typing_extensions import Annotated, NotRequired, TypedDict
15
16
 
16
17
 
17
18
  class MorphoMarketsChain(str, Enum):
18
- r"""The chain to use."""
19
-
20
- BASE_MAINNET = "base:mainnet"
21
19
  ETHEREUM_MAINNET = "ethereum:mainnet"
22
- ARBITRUM_MAINNET = "arbitrum:mainnet"
20
+ BASE_MAINNET = "base:mainnet"
23
21
 
24
22
 
25
23
  class MorphoMarketsRequestTypedDict(TypedDict):
26
- chain: MorphoMarketsChain
27
- r"""The chain to use."""
24
+ chain: NotRequired[MorphoMarketsChain]
28
25
  collateral_token: NotRequired[Nullable[str]]
29
26
  loan_token: NotRequired[Nullable[str]]
30
27
 
31
28
 
32
29
  class MorphoMarketsRequest(BaseModel):
33
30
  chain: Annotated[
34
- MorphoMarketsChain,
31
+ Optional[MorphoMarketsChain],
35
32
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
36
33
  ] = MorphoMarketsChain.ETHEREUM_MAINNET
37
- r"""The chain to use."""
38
34
 
39
35
  collateral_token: Annotated[
40
36
  OptionalNullable[str],
@@ -48,7 +44,7 @@ class MorphoMarketsRequest(BaseModel):
48
44
 
49
45
  @model_serializer(mode="wrap")
50
46
  def serialize_model(self, handler):
51
- optional_fields = ["collateral_token", "loan_token"]
47
+ optional_fields = ["chain", "collateral_token", "loan_token"]
52
48
  nullable_fields = ["collateral_token", "loan_token"]
53
49
  null_default_fields = []
54
50