compass_api_sdk 2.0.21rc1__py3-none-any.whl → 2.2.1rc3__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.
Files changed (36) hide show
  1. compass_api_sdk/_version.py +2 -2
  2. compass_api_sdk/earn.py +360 -114
  3. compass_api_sdk/gas_sponsorship.py +38 -26
  4. compass_api_sdk/models/__init__.py +65 -9
  5. compass_api_sdk/models/aaveposition.py +80 -25
  6. compass_api_sdk/models/approvetransferrequest.py +2 -2
  7. compass_api_sdk/models/batchedsafeoperationsresponse_input.py +4 -4
  8. compass_api_sdk/models/batchedsafeoperationsresponse_output.py +4 -4
  9. compass_api_sdk/models/compass_api_backend_v2_models_earn_read_response_positions_vaultposition.py +72 -18
  10. compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712domain.py +6 -6
  11. compass_api_sdk/models/depositevent.py +61 -0
  12. compass_api_sdk/models/earnmanageparams.py +8 -6
  13. compass_api_sdk/models/earnmanagerequest.py +6 -4
  14. compass_api_sdk/models/earnpositionsresponse.py +31 -22
  15. compass_api_sdk/models/fee.py +8 -7
  16. compass_api_sdk/models/pendledepositevent.py +49 -0
  17. compass_api_sdk/models/pendlemarketinfo.py +138 -0
  18. compass_api_sdk/models/pendlemarketsresponse.py +30 -0
  19. compass_api_sdk/models/pendleptposition.py +111 -0
  20. compass_api_sdk/models/pendleptvenue.py +78 -0
  21. compass_api_sdk/models/pendlewithdrawalevent.py +54 -0
  22. compass_api_sdk/models/positionpnl.py +52 -0
  23. compass_api_sdk/models/safetxmessage.py +6 -6
  24. compass_api_sdk/models/sponsorgasrequest.py +2 -2
  25. compass_api_sdk/models/v2_earn_pendle_marketsop.py +105 -0
  26. compass_api_sdk/models/v2_earn_positionsop.py +5 -30
  27. compass_api_sdk/models/v2_earn_vaultsop.py +3 -3
  28. compass_api_sdk/models/withdrawalevent.py +61 -0
  29. compass_api_sdk/types/basemodel.py +41 -3
  30. compass_api_sdk/utils/__init__.py +0 -3
  31. compass_api_sdk/utils/enums.py +60 -0
  32. compass_api_sdk/utils/requestbodies.py +3 -3
  33. compass_api_sdk/utils/serializers.py +0 -20
  34. {compass_api_sdk-2.0.21rc1.dist-info → compass_api_sdk-2.2.1rc3.dist-info}/METADATA +3 -2
  35. {compass_api_sdk-2.0.21rc1.dist-info → compass_api_sdk-2.2.1rc3.dist-info}/RECORD +36 -26
  36. {compass_api_sdk-2.0.21rc1.dist-info → compass_api_sdk-2.2.1rc3.dist-info}/WHEEL +0 -0
@@ -26,13 +26,19 @@ class GasSponsorship(BaseSDK):
26
26
  ) -> models.SponsorGasResponse:
27
27
  r"""Prepare gas-sponsored transaction
28
28
 
29
- Prepare a gas-sponsored transaction to be signed and submitted by `sender`.
29
+ Prepare a gas-sponsored transaction from signed EIP-712 typed data.
30
30
 
31
- The `owner` submits their off-chain signature of EIP-712 typed data along with the data itself.
31
+ Submit the `owner`'s off-chain signature along with the EIP-712 typed data that was signed. Returns an unsigned transaction for the `sender` to sign and broadcast.
32
32
 
33
- The `sender` will sign and submit the transaction returned from this endpoint, effectively sponsoring the gas for the transaction on behalf of the `owner`.
33
+ **How gas sponsorship works:**
34
+ 1. Call an endpoint with `gas_sponsorship=true` (e.g., [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), [/earn/manage](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position)) to get EIP-712 typed data
35
+ 2. Owner signs the typed data off-chain
36
+ 3. Submit signature + typed data to this endpoint
37
+ 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
34
38
 
35
- :param owner: The owner of the smart account's address.
39
+ **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), the owner must first set up a Permit2 allowance using [/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) (once per token).
40
+
41
+ :param owner: The wallet address that owns the Earn Account.
36
42
  :param chain: The chain to use.
37
43
  :param eip_712: The EIP-712 typed data that was signed.
38
44
  :param signature: The EIP-712 signed typed data signature.
@@ -135,13 +141,19 @@ class GasSponsorship(BaseSDK):
135
141
  ) -> models.SponsorGasResponse:
136
142
  r"""Prepare gas-sponsored transaction
137
143
 
138
- Prepare a gas-sponsored transaction to be signed and submitted by `sender`.
144
+ Prepare a gas-sponsored transaction from signed EIP-712 typed data.
145
+
146
+ Submit the `owner`'s off-chain signature along with the EIP-712 typed data that was signed. Returns an unsigned transaction for the `sender` to sign and broadcast.
139
147
 
140
- The `owner` submits their off-chain signature of EIP-712 typed data along with the data itself.
148
+ **How gas sponsorship works:**
149
+ 1. Call an endpoint with `gas_sponsorship=true` (e.g., [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), [/earn/manage](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position)) to get EIP-712 typed data
150
+ 2. Owner signs the typed data off-chain
151
+ 3. Submit signature + typed data to this endpoint
152
+ 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
141
153
 
142
- The `sender` will sign and submit the transaction returned from this endpoint, effectively sponsoring the gas for the transaction on behalf of the `owner`.
154
+ **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), the owner must first set up a Permit2 allowance using [/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) (once per token).
143
155
 
144
- :param owner: The owner of the smart account's address.
156
+ :param owner: The wallet address that owns the Earn Account.
145
157
  :param chain: The chain to use.
146
158
  :param eip_712: The EIP-712 typed data that was signed.
147
159
  :param signature: The EIP-712 signed typed data signature.
@@ -241,18 +253,18 @@ class GasSponsorship(BaseSDK):
241
253
  ) -> models.ApproveTransferResponse:
242
254
  r"""Approve token transfer
243
255
 
244
- Prepare a one-time permit2 approval transaction for a given token.
256
+ Set up a one-time Permit2 allowance for gas-sponsored token transfers.
245
257
 
246
- This is only required if the `owner` would like to transfer tokens from their wallet to their Earn Account with gas-sponsorship.
258
+ Only required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
247
259
 
248
- This approval transaction itself can be submitted with gas-sponsorship.
249
- In this case, EIP-712 typed data will be returned and should be signed by the `owner` off-chain.
250
- This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
251
- Gas-sponsored approvals can only be achieved by ERC-20 tokens that support permit (EIP-2612).
252
- Some tokens, like USDT and WETH, do not allow for this behavior.
253
- In the case of non-permit tokens, the one-time approval transaction can be submitted in the conventional manner where the `owner` must sign, submit and pay gas for the transaction.
260
+ **With gas sponsorship (`gas_sponsorship=true`):**
261
+ - Returns EIP-712 typed data for the owner to sign off-chain
262
+ - Submit signature + typed data to [/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
263
+ - Only works for tokens that support EIP-2612 permit (e.g., USDC)
254
264
 
255
- :param owner: The owner of the smart account's address.
265
+ Some tokens, like USDT and WETH, do not support EIP-2612 permit. For these tokens, set `gas_sponsorship=false` to receive an unsigned transaction that the owner must sign, submit, and pay gas for.
266
+
267
+ :param owner: The wallet address that owns the Earn Account.
256
268
  :param chain: The chain to use.
257
269
  :param token: The token you would like to transfer with gas sponsorship.
258
270
  :param gas_sponsorship: Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
@@ -350,18 +362,18 @@ class GasSponsorship(BaseSDK):
350
362
  ) -> models.ApproveTransferResponse:
351
363
  r"""Approve token transfer
352
364
 
353
- Prepare a one-time permit2 approval transaction for a given token.
365
+ Set up a one-time Permit2 allowance for gas-sponsored token transfers.
366
+
367
+ Only required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
354
368
 
355
- This is only required if the `owner` would like to transfer tokens from their wallet to their Earn Account with gas-sponsorship.
369
+ **With gas sponsorship (`gas_sponsorship=true`):**
370
+ - Returns EIP-712 typed data for the owner to sign off-chain
371
+ - Submit signature + typed data to [/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
372
+ - Only works for tokens that support EIP-2612 permit (e.g., USDC)
356
373
 
357
- This approval transaction itself can be submitted with gas-sponsorship.
358
- In this case, EIP-712 typed data will be returned and should be signed by the `owner` off-chain.
359
- This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
360
- Gas-sponsored approvals can only be achieved by ERC-20 tokens that support permit (EIP-2612).
361
- Some tokens, like USDT and WETH, do not allow for this behavior.
362
- In the case of non-permit tokens, the one-time approval transaction can be submitted in the conventional manner where the `owner` must sign, submit and pay gas for the transaction.
374
+ Some tokens, like USDT and WETH, do not support EIP-2612 permit. For these tokens, set `gas_sponsorship=false` to receive an unsigned transaction that the owner must sign, submit, and pay gas for.
363
375
 
364
- :param owner: The owner of the smart account's address.
376
+ :param owner: The wallet address that owns the Earn Account.
365
377
  :param chain: The chain to use.
366
378
  :param token: The token you would like to transfer with gas sponsorship.
367
379
  :param gas_sponsorship: Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
@@ -377,6 +377,7 @@ if TYPE_CHECKING:
377
377
  CreateAccountResponse,
378
378
  CreateAccountResponseTypedDict,
379
379
  )
380
+ from .depositevent import DepositEvent, DepositEventTypedDict
380
381
  from .depositforburnrequest import (
381
382
  DepositForBurnRequest,
382
383
  DepositForBurnRequestAmount,
@@ -410,8 +411,6 @@ if TYPE_CHECKING:
410
411
  from .earnpositionsresponse import (
411
412
  EarnPositionsResponse,
412
413
  EarnPositionsResponseTypedDict,
413
- UserPosition,
414
- UserPositionTypedDict,
415
414
  )
416
415
  from .earnswapparams import (
417
416
  EarnSwapParams,
@@ -642,6 +641,7 @@ if TYPE_CHECKING:
642
641
  )
643
642
  from .openposition import OpenPosition, OpenPositionTypedDict
644
643
  from .operationtype import OperationType
644
+ from .pendledepositevent import PendleDepositEvent, PendleDepositEventTypedDict
645
645
  from .pendlegetmarketresponse import (
646
646
  PendleGetMarketResponse,
647
647
  PendleGetMarketResponseTypedDict,
@@ -670,6 +670,13 @@ if TYPE_CHECKING:
670
670
  PendleManageLiquidityRequestTypedDict,
671
671
  )
672
672
  from .pendlemarket import PendleMarket, PendleMarketTypedDict
673
+ from .pendlemarketinfo import PendleMarketInfo, PendleMarketInfoTypedDict
674
+ from .pendlemarketsresponse import (
675
+ PendleMarketsResponse,
676
+ PendleMarketsResponseTypedDict,
677
+ )
678
+ from .pendleptposition import PendlePTPosition, PendlePTPositionTypedDict
679
+ from .pendleptvenue import PendlePTVenue, PendlePTVenueTypedDict
673
680
  from .pendleredeemyieldparams import (
674
681
  PendleRedeemYieldParams,
675
682
  PendleRedeemYieldParamsTypedDict,
@@ -715,6 +722,10 @@ if TYPE_CHECKING:
715
722
  PendleTxResponseTransactionTypedDict,
716
723
  PendleTxResponseTypedDict,
717
724
  )
725
+ from .pendlewithdrawalevent import (
726
+ PendleWithdrawalEvent,
727
+ PendleWithdrawalEventTypedDict,
728
+ )
718
729
  from .permit2typeddata_input import (
719
730
  Permit2TypedDataInput,
720
731
  Permit2TypedDataInputTypedDict,
@@ -739,6 +750,7 @@ if TYPE_CHECKING:
739
750
  )
740
751
  from .portfolio import Portfolio, PortfolioTypedDict
741
752
  from .position import Position, PositionTypedDict
753
+ from .positionpnl import PositionPnL, PositionPnLTypedDict
742
754
  from .protocol import Protocol
743
755
  from .repay import Repay, RepayTypedDict
744
756
  from .reserve import Reserve, ReserveTypedDict
@@ -1236,13 +1248,18 @@ if TYPE_CHECKING:
1236
1248
  V2EarnAaveMarketsRequest,
1237
1249
  V2EarnAaveMarketsRequestTypedDict,
1238
1250
  )
1251
+ from .v2_earn_pendle_marketsop import (
1252
+ V2EarnPendleMarketsDirection,
1253
+ V2EarnPendleMarketsRequest,
1254
+ V2EarnPendleMarketsRequestTypedDict,
1255
+ )
1239
1256
  from .v2_earn_positionsop import (
1240
1257
  V2EarnPositionsChain,
1241
1258
  V2EarnPositionsRequest,
1242
1259
  V2EarnPositionsRequestTypedDict,
1243
1260
  )
1244
1261
  from .v2_earn_vaultsop import (
1245
- Direction,
1262
+ V2EarnVaultsDirection,
1246
1263
  V2EarnVaultsRequest,
1247
1264
  V2EarnVaultsRequestTypedDict,
1248
1265
  )
@@ -1293,6 +1310,7 @@ if TYPE_CHECKING:
1293
1310
  WildcatGetMarketResponseTypedDict,
1294
1311
  )
1295
1312
  from .withdraw import Withdraw, WithdrawTypedDict
1313
+ from .withdrawalevent import WithdrawalEvent, WithdrawalEventTypedDict
1296
1314
  from .wrapethparams import (
1297
1315
  WrapEthParams,
1298
1316
  WrapEthParamsAmount,
@@ -1549,6 +1567,8 @@ __all__ = [
1549
1567
  "CreateAccountResponse",
1550
1568
  "CreateAccountResponseTypedDict",
1551
1569
  "Denomination",
1570
+ "DepositEvent",
1571
+ "DepositEventTypedDict",
1552
1572
  "DepositForBurnRequest",
1553
1573
  "DepositForBurnRequestAmount",
1554
1574
  "DepositForBurnRequestAmountTypedDict",
@@ -1561,7 +1581,6 @@ __all__ = [
1561
1581
  "DestinationChain",
1562
1582
  "Details",
1563
1583
  "DetailsTypedDict",
1564
- "Direction",
1565
1584
  "EarnManageParams",
1566
1585
  "EarnManageParamsAction",
1567
1586
  "EarnManageParamsTypedDict",
@@ -1760,6 +1779,8 @@ __all__ = [
1760
1779
  "OpenPosition",
1761
1780
  "OpenPositionTypedDict",
1762
1781
  "OperationType",
1782
+ "PendleDepositEvent",
1783
+ "PendleDepositEventTypedDict",
1763
1784
  "PendleGetMarketResponse",
1764
1785
  "PendleGetMarketResponseTypedDict",
1765
1786
  "PendleListMarketsResponse",
@@ -1778,7 +1799,15 @@ __all__ = [
1778
1799
  "PendleManageLiquidityRequestChain",
1779
1800
  "PendleManageLiquidityRequestTypedDict",
1780
1801
  "PendleMarket",
1802
+ "PendleMarketInfo",
1803
+ "PendleMarketInfoTypedDict",
1781
1804
  "PendleMarketTypedDict",
1805
+ "PendleMarketsResponse",
1806
+ "PendleMarketsResponseTypedDict",
1807
+ "PendlePTPosition",
1808
+ "PendlePTPositionTypedDict",
1809
+ "PendlePTVenue",
1810
+ "PendlePTVenueTypedDict",
1782
1811
  "PendleRedeemYieldParams",
1783
1812
  "PendleRedeemYieldParamsTypedDict",
1784
1813
  "PendleRedeemYieldRequest",
@@ -1810,6 +1839,8 @@ __all__ = [
1810
1839
  "PendleTxResponseTransaction",
1811
1840
  "PendleTxResponseTransactionTypedDict",
1812
1841
  "PendleTxResponseTypedDict",
1842
+ "PendleWithdrawalEvent",
1843
+ "PendleWithdrawalEventTypedDict",
1813
1844
  "Permit2TypedDataInput",
1814
1845
  "Permit2TypedDataInputTypedDict",
1815
1846
  "Permit2TypedDataOutput",
@@ -1827,6 +1858,8 @@ __all__ = [
1827
1858
  "Portfolio",
1828
1859
  "PortfolioTypedDict",
1829
1860
  "Position",
1861
+ "PositionPnL",
1862
+ "PositionPnLTypedDict",
1830
1863
  "PositionTypedDict",
1831
1864
  "Protocol",
1832
1865
  "R",
@@ -2057,8 +2090,6 @@ __all__ = [
2057
2090
  "UserOperationResponse",
2058
2091
  "UserOperationResponseTypedDict",
2059
2092
  "UserOperationTypedDict",
2060
- "UserPosition",
2061
- "UserPositionTypedDict",
2062
2093
  "UserState",
2063
2094
  "UserStateTypedDict",
2064
2095
  "V1AaveAaveSupportedTokensChain",
@@ -2189,9 +2220,13 @@ __all__ = [
2189
2220
  "V2CctpMintResponseTypedDict",
2190
2221
  "V2EarnAaveMarketsRequest",
2191
2222
  "V2EarnAaveMarketsRequestTypedDict",
2223
+ "V2EarnPendleMarketsDirection",
2224
+ "V2EarnPendleMarketsRequest",
2225
+ "V2EarnPendleMarketsRequestTypedDict",
2192
2226
  "V2EarnPositionsChain",
2193
2227
  "V2EarnPositionsRequest",
2194
2228
  "V2EarnPositionsRequestTypedDict",
2229
+ "V2EarnVaultsDirection",
2195
2230
  "V2EarnVaultsRequest",
2196
2231
  "V2EarnVaultsRequestTypedDict",
2197
2232
  "V2UserOperation",
@@ -2230,6 +2265,8 @@ __all__ = [
2230
2265
  "WildcatGetMarketResponseTypedDict",
2231
2266
  "Withdraw",
2232
2267
  "WithdrawTypedDict",
2268
+ "WithdrawalEvent",
2269
+ "WithdrawalEventTypedDict",
2233
2270
  "WrapEthParams",
2234
2271
  "WrapEthParamsAmount",
2235
2272
  "WrapEthParamsAmountTypedDict",
@@ -2491,6 +2528,8 @@ _dynamic_imports: dict[str, str] = {
2491
2528
  "CreateAccountRequestTypedDict": ".createaccountrequest",
2492
2529
  "CreateAccountResponse": ".createaccountresponse",
2493
2530
  "CreateAccountResponseTypedDict": ".createaccountresponse",
2531
+ "DepositEvent": ".depositevent",
2532
+ "DepositEventTypedDict": ".depositevent",
2494
2533
  "DepositForBurnRequest": ".depositforburnrequest",
2495
2534
  "DepositForBurnRequestAmount": ".depositforburnrequest",
2496
2535
  "DepositForBurnRequestAmountTypedDict": ".depositforburnrequest",
@@ -2517,8 +2556,6 @@ _dynamic_imports: dict[str, str] = {
2517
2556
  "EarnManageResponseTypedDict": ".earnmanageresponse",
2518
2557
  "EarnPositionsResponse": ".earnpositionsresponse",
2519
2558
  "EarnPositionsResponseTypedDict": ".earnpositionsresponse",
2520
- "UserPosition": ".earnpositionsresponse",
2521
- "UserPositionTypedDict": ".earnpositionsresponse",
2522
2559
  "EarnSwapParams": ".earnswapparams",
2523
2560
  "EarnSwapParamsAmountIn": ".earnswapparams",
2524
2561
  "EarnSwapParamsAmountInTypedDict": ".earnswapparams",
@@ -2694,6 +2731,8 @@ _dynamic_imports: dict[str, str] = {
2694
2731
  "OpenPosition": ".openposition",
2695
2732
  "OpenPositionTypedDict": ".openposition",
2696
2733
  "OperationType": ".operationtype",
2734
+ "PendleDepositEvent": ".pendledepositevent",
2735
+ "PendleDepositEventTypedDict": ".pendledepositevent",
2697
2736
  "PendleGetMarketResponse": ".pendlegetmarketresponse",
2698
2737
  "PendleGetMarketResponseTypedDict": ".pendlegetmarketresponse",
2699
2738
  "PendleListMarketsResponse": ".pendlelistmarketsresponse",
@@ -2713,6 +2752,14 @@ _dynamic_imports: dict[str, str] = {
2713
2752
  "PendleManageLiquidityRequestTypedDict": ".pendlemanageliquidityrequest",
2714
2753
  "PendleMarket": ".pendlemarket",
2715
2754
  "PendleMarketTypedDict": ".pendlemarket",
2755
+ "PendleMarketInfo": ".pendlemarketinfo",
2756
+ "PendleMarketInfoTypedDict": ".pendlemarketinfo",
2757
+ "PendleMarketsResponse": ".pendlemarketsresponse",
2758
+ "PendleMarketsResponseTypedDict": ".pendlemarketsresponse",
2759
+ "PendlePTPosition": ".pendleptposition",
2760
+ "PendlePTPositionTypedDict": ".pendleptposition",
2761
+ "PendlePTVenue": ".pendleptvenue",
2762
+ "PendlePTVenueTypedDict": ".pendleptvenue",
2716
2763
  "PendleRedeemYieldParams": ".pendleredeemyieldparams",
2717
2764
  "PendleRedeemYieldParamsTypedDict": ".pendleredeemyieldparams",
2718
2765
  "PendleRedeemYieldRequest": ".pendleredeemyieldrequest",
@@ -2744,6 +2791,8 @@ _dynamic_imports: dict[str, str] = {
2744
2791
  "PendleTxResponseTransaction": ".pendletxresponse",
2745
2792
  "PendleTxResponseTransactionTypedDict": ".pendletxresponse",
2746
2793
  "PendleTxResponseTypedDict": ".pendletxresponse",
2794
+ "PendleWithdrawalEvent": ".pendlewithdrawalevent",
2795
+ "PendleWithdrawalEventTypedDict": ".pendlewithdrawalevent",
2747
2796
  "Permit2TypedDataInput": ".permit2typeddata_input",
2748
2797
  "Permit2TypedDataInputTypedDict": ".permit2typeddata_input",
2749
2798
  "Permit2TypedDataOutput": ".permit2typeddata_output",
@@ -2762,6 +2811,8 @@ _dynamic_imports: dict[str, str] = {
2762
2811
  "PortfolioTypedDict": ".portfolio",
2763
2812
  "Position": ".position",
2764
2813
  "PositionTypedDict": ".position",
2814
+ "PositionPnL": ".positionpnl",
2815
+ "PositionPnLTypedDict": ".positionpnl",
2765
2816
  "Protocol": ".protocol",
2766
2817
  "Repay": ".repay",
2767
2818
  "RepayTypedDict": ".repay",
@@ -3117,10 +3168,13 @@ _dynamic_imports: dict[str, str] = {
3117
3168
  "V2CctpMintResponseTypedDict": ".v2_cctp_mintop",
3118
3169
  "V2EarnAaveMarketsRequest": ".v2_earn_aave_marketsop",
3119
3170
  "V2EarnAaveMarketsRequestTypedDict": ".v2_earn_aave_marketsop",
3171
+ "V2EarnPendleMarketsDirection": ".v2_earn_pendle_marketsop",
3172
+ "V2EarnPendleMarketsRequest": ".v2_earn_pendle_marketsop",
3173
+ "V2EarnPendleMarketsRequestTypedDict": ".v2_earn_pendle_marketsop",
3120
3174
  "V2EarnPositionsChain": ".v2_earn_positionsop",
3121
3175
  "V2EarnPositionsRequest": ".v2_earn_positionsop",
3122
3176
  "V2EarnPositionsRequestTypedDict": ".v2_earn_positionsop",
3123
- "Direction": ".v2_earn_vaultsop",
3177
+ "V2EarnVaultsDirection": ".v2_earn_vaultsop",
3124
3178
  "V2EarnVaultsRequest": ".v2_earn_vaultsop",
3125
3179
  "V2EarnVaultsRequestTypedDict": ".v2_earn_vaultsop",
3126
3180
  "V2BundleRequest": ".v2bundlerequest",
@@ -3165,6 +3219,8 @@ _dynamic_imports: dict[str, str] = {
3165
3219
  "WildcatGetMarketResponseTypedDict": ".wildcatgetmarketresponse",
3166
3220
  "Withdraw": ".withdraw",
3167
3221
  "WithdrawTypedDict": ".withdraw",
3222
+ "WithdrawalEvent": ".withdrawalevent",
3223
+ "WithdrawalEventTypedDict": ".withdrawalevent",
3168
3224
  "WrapEthParams": ".wrapethparams",
3169
3225
  "WrapEthParamsAmount": ".wrapethparams",
3170
3226
  "WrapEthParamsAmountTypedDict": ".wrapethparams",
@@ -1,36 +1,62 @@
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 BaseModel
4
+ from .depositevent import DepositEvent, DepositEventTypedDict
5
+ from .positionpnl import PositionPnL, PositionPnLTypedDict
6
+ from .withdrawalevent import WithdrawalEvent, WithdrawalEventTypedDict
7
+ from compass_api_sdk.types import (
8
+ BaseModel,
9
+ Nullable,
10
+ OptionalNullable,
11
+ UNSET,
12
+ UNSET_SENTINEL,
13
+ )
5
14
  from compass_api_sdk.utils import validate_const
6
15
  import pydantic
16
+ from pydantic import model_serializer
7
17
  from pydantic.functional_validators import AfterValidator
8
- from typing import Literal, Optional
9
- from typing_extensions import Annotated, TypedDict
18
+ from typing import List, Literal, Optional
19
+ from typing_extensions import Annotated, NotRequired, TypedDict
10
20
 
11
21
 
12
22
  class AavePositionTypedDict(TypedDict):
13
- id: str
14
- r"""Base64-encoded position identifier."""
15
- amount_in_underlying_token: str
16
- r"""The user's position value denominated in the supplied asset."""
17
- token_name: str
18
- r"""Symbol of the Aave reserve asset (e.g., USDC)."""
23
+ r"""Aave V3 lending position.
24
+
25
+ Note: Unlike the old model, this no longer has vault_address/vault_name fields
26
+ as they were nonsensical for Aave positions.
27
+ """
28
+
29
+ reserve_address: str
30
+ r"""The reserve (underlying token) address."""
31
+ reserve_symbol: str
32
+ r"""Symbol of the reserve asset (e.g., USDC)."""
33
+ balance: str
34
+ r"""The user's position value (aToken balance)."""
19
35
  type: Literal["AAVE"]
20
36
  r"""The market type discriminator."""
21
- vault_address: Literal["None"]
22
- vault_name: Literal["None"]
37
+ pnl: NotRequired[Nullable[PositionPnLTypedDict]]
38
+ r"""PnL metrics for this position."""
39
+ deposits: NotRequired[List[DepositEventTypedDict]]
40
+ r"""All deposit events for this position."""
41
+ withdrawals: NotRequired[List[WithdrawalEventTypedDict]]
42
+ r"""All withdrawal events for this position."""
23
43
 
24
44
 
25
45
  class AavePosition(BaseModel):
26
- id: str
27
- r"""Base64-encoded position identifier."""
46
+ r"""Aave V3 lending position.
47
+
48
+ Note: Unlike the old model, this no longer has vault_address/vault_name fields
49
+ as they were nonsensical for Aave positions.
50
+ """
28
51
 
29
- amount_in_underlying_token: str
30
- r"""The user's position value denominated in the supplied asset."""
52
+ reserve_address: str
53
+ r"""The reserve (underlying token) address."""
31
54
 
32
- token_name: str
33
- r"""Symbol of the Aave reserve asset (e.g., USDC)."""
55
+ reserve_symbol: str
56
+ r"""Symbol of the reserve asset (e.g., USDC)."""
57
+
58
+ balance: str
59
+ r"""The user's position value (aToken balance)."""
34
60
 
35
61
  TYPE: Annotated[
36
62
  Annotated[Literal["AAVE"], AfterValidator(validate_const("AAVE"))],
@@ -38,12 +64,41 @@ class AavePosition(BaseModel):
38
64
  ] = "AAVE"
39
65
  r"""The market type discriminator."""
40
66
 
41
- VAULT_ADDRESS: Annotated[
42
- Annotated[Optional[Literal["None"]], AfterValidator(validate_const("None"))],
43
- pydantic.Field(alias="vault_address"),
44
- ] = "None"
67
+ pnl: OptionalNullable[PositionPnL] = UNSET
68
+ r"""PnL metrics for this position."""
69
+
70
+ deposits: Optional[List[DepositEvent]] = None
71
+ r"""All deposit events for this position."""
72
+
73
+ withdrawals: Optional[List[WithdrawalEvent]] = None
74
+ r"""All withdrawal events for this position."""
75
+
76
+ @model_serializer(mode="wrap")
77
+ def serialize_model(self, handler):
78
+ optional_fields = ["pnl", "deposits", "withdrawals"]
79
+ nullable_fields = ["pnl"]
80
+ null_default_fields = []
81
+
82
+ serialized = handler(self)
83
+
84
+ m = {}
85
+
86
+ for n, f in type(self).model_fields.items():
87
+ k = f.alias or n
88
+ val = serialized.get(k)
89
+ serialized.pop(k, None)
90
+
91
+ optional_nullable = k in optional_fields and k in nullable_fields
92
+ is_set = (
93
+ self.__pydantic_fields_set__.intersection({n})
94
+ or k in null_default_fields
95
+ ) # pylint: disable=no-member
96
+
97
+ if val is not None and val != UNSET_SENTINEL:
98
+ m[k] = val
99
+ elif val != UNSET_SENTINEL and (
100
+ not k in optional_fields or (optional_nullable and is_set)
101
+ ):
102
+ m[k] = val
45
103
 
46
- VAULT_NAME: Annotated[
47
- Annotated[Optional[Literal["None"]], AfterValidator(validate_const("None"))],
48
- pydantic.Field(alias="vault_name"),
49
- ] = "None"
104
+ return m
@@ -9,7 +9,7 @@ from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
  class ApproveTransferRequestTypedDict(TypedDict):
11
11
  owner: str
12
- r"""The owner of the smart account's address."""
12
+ r"""The wallet address that owns the Earn Account."""
13
13
  chain: Chain
14
14
  r"""The chain to use."""
15
15
  token: str
@@ -20,7 +20,7 @@ class ApproveTransferRequestTypedDict(TypedDict):
20
20
 
21
21
  class ApproveTransferRequest(BaseModel):
22
22
  owner: str
23
- r"""The owner of the smart account's address."""
23
+ r"""The wallet address that owns the Earn Account."""
24
24
 
25
25
  chain: Chain
26
26
  r"""The chain to use."""
@@ -22,11 +22,11 @@ class BatchedSafeOperationsResponseInputTypedDict(TypedDict):
22
22
  r"""Response containing EIP-712 typed data for Safe transaction signing."""
23
23
 
24
24
  domain: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712DomainTypedDict
25
- r"""The EIP-712 domain separator for Safe transactions."""
25
+ r"""The EIP-712 domain separator."""
26
26
  types: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712TypesTypedDict
27
27
  r"""The type definitions for EIP-712 structured data."""
28
28
  message: SafeTxMessageTypedDict
29
- r"""The message data for a Safe transaction."""
29
+ r"""The message data for the transaction."""
30
30
  primary_type: Literal["SafeTx"]
31
31
  r"""Primary type for the structured data"""
32
32
 
@@ -37,13 +37,13 @@ class BatchedSafeOperationsResponseInput(BaseModel):
37
37
  domain: (
38
38
  CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
39
39
  )
40
- r"""The EIP-712 domain separator for Safe transactions."""
40
+ r"""The EIP-712 domain separator."""
41
41
 
42
42
  types: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types
43
43
  r"""The type definitions for EIP-712 structured data."""
44
44
 
45
45
  message: SafeTxMessage
46
- r"""The message data for a Safe transaction."""
46
+ r"""The message data for the transaction."""
47
47
 
48
48
  PRIMARY_TYPE: Annotated[
49
49
  Annotated[Literal["SafeTx"], AfterValidator(validate_const("SafeTx"))],
@@ -22,11 +22,11 @@ class BatchedSafeOperationsResponseOutputTypedDict(TypedDict):
22
22
  r"""Response containing EIP-712 typed data for Safe transaction signing."""
23
23
 
24
24
  domain: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712DomainTypedDict
25
- r"""The EIP-712 domain separator for Safe transactions."""
25
+ r"""The EIP-712 domain separator."""
26
26
  types: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712TypesTypedDict
27
27
  r"""The type definitions for EIP-712 structured data."""
28
28
  message: SafeTxMessageTypedDict
29
- r"""The message data for a Safe transaction."""
29
+ r"""The message data for the transaction."""
30
30
  primary_type: Literal["SafeTx"]
31
31
  r"""Primary type for the structured data"""
32
32
 
@@ -37,13 +37,13 @@ class BatchedSafeOperationsResponseOutput(BaseModel):
37
37
  domain: (
38
38
  CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
39
39
  )
40
- r"""The EIP-712 domain separator for Safe transactions."""
40
+ r"""The EIP-712 domain separator."""
41
41
 
42
42
  types: CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types
43
43
  r"""The type definitions for EIP-712 structured data."""
44
44
 
45
45
  message: SafeTxMessage
46
- r"""The message data for a Safe transaction."""
46
+ r"""The message data for the transaction."""
47
47
 
48
48
  PRIMARY_TYPE: Annotated[
49
49
  Annotated[Literal["SafeTx"], AfterValidator(validate_const("SafeTx"))],