compass_api_sdk 0.9.10__py3-none-any.whl → 0.9.12__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/models/__init__.py +0 -56
- compass_api_sdk/models/token_priceop.py +1 -1
- compass_api_sdk/sdk.py +0 -6
- compass_api_sdk/token_sdk.py +2 -2
- {compass_api_sdk-0.9.10.dist-info → compass_api_sdk-0.9.12.dist-info}/METADATA +1 -7
- {compass_api_sdk-0.9.10.dist-info → compass_api_sdk-0.9.12.dist-info}/RECORD +8 -13
- compass_api_sdk/models/aavelooprequest.py +0 -113
- compass_api_sdk/models/multicallauthorizationrequest.py +0 -39
- compass_api_sdk/models/multicallauthorizationresponse.py +0 -30
- compass_api_sdk/models/multicallexecuterequest.py +0 -36
- compass_api_sdk/transaction_batching.py +0 -765
- {compass_api_sdk-0.9.10.dist-info → compass_api_sdk-0.9.12.dist-info}/WHEEL +0 -0
compass_api_sdk/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "compass_api_sdk"
|
|
6
|
-
__version__: str = "0.9.
|
|
6
|
+
__version__: str = "0.9.12"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.1"
|
|
8
|
-
__gen_version__: str = "2.623.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.9.
|
|
8
|
+
__gen_version__: str = "2.623.2"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.9.12 2.623.2 0.0.1 compass_api_sdk"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
|
@@ -79,18 +79,6 @@ if TYPE_CHECKING:
|
|
|
79
79
|
AaveLiquidityChangeResponse,
|
|
80
80
|
AaveLiquidityChangeResponseTypedDict,
|
|
81
81
|
)
|
|
82
|
-
from .aavelooprequest import (
|
|
83
|
-
AaveLoopRequest,
|
|
84
|
-
AaveLoopRequestTypedDict,
|
|
85
|
-
InitialCollateralAmount,
|
|
86
|
-
InitialCollateralAmountTypedDict,
|
|
87
|
-
LoanToValue,
|
|
88
|
-
LoanToValueTypedDict,
|
|
89
|
-
MaxSlippagePercent,
|
|
90
|
-
MaxSlippagePercentTypedDict,
|
|
91
|
-
Multiplier,
|
|
92
|
-
MultiplierTypedDict,
|
|
93
|
-
)
|
|
94
82
|
from .aaverateresponse import AaveRateResponse, AaveRateResponseTypedDict
|
|
95
83
|
from .aaverepayparams import (
|
|
96
84
|
AaveRepayParams,
|
|
@@ -537,18 +525,6 @@ if TYPE_CHECKING:
|
|
|
537
525
|
MorphoWithdrawRequestTypedDict,
|
|
538
526
|
)
|
|
539
527
|
from .movement10percent import Movement10Percent, Movement10PercentTypedDict
|
|
540
|
-
from .multicallauthorizationrequest import (
|
|
541
|
-
MulticallAuthorizationRequest,
|
|
542
|
-
MulticallAuthorizationRequestTypedDict,
|
|
543
|
-
)
|
|
544
|
-
from .multicallauthorizationresponse import (
|
|
545
|
-
MulticallAuthorizationResponse,
|
|
546
|
-
MulticallAuthorizationResponseTypedDict,
|
|
547
|
-
)
|
|
548
|
-
from .multicallexecuterequest import (
|
|
549
|
-
MulticallExecuteRequest,
|
|
550
|
-
MulticallExecuteRequestTypedDict,
|
|
551
|
-
)
|
|
552
528
|
from .openposition import OpenPosition, OpenPositionTypedDict
|
|
553
529
|
from .pendle_marketop import (
|
|
554
530
|
PendleMarketChain,
|
|
@@ -1002,8 +978,6 @@ __all__ = [
|
|
|
1002
978
|
"AaveLiquidityChangeResponse",
|
|
1003
979
|
"AaveLiquidityChangeResponseTypedDict",
|
|
1004
980
|
"AaveLiquidityChangeToken",
|
|
1005
|
-
"AaveLoopRequest",
|
|
1006
|
-
"AaveLoopRequestTypedDict",
|
|
1007
981
|
"AaveRateChain",
|
|
1008
982
|
"AaveRateRequest",
|
|
1009
983
|
"AaveRateRequestTypedDict",
|
|
@@ -1235,15 +1209,11 @@ __all__ = [
|
|
|
1235
1209
|
"IncreaseAllowanceRequestToken",
|
|
1236
1210
|
"IncreaseAllowanceRequestTokenTypedDict",
|
|
1237
1211
|
"IncreaseAllowanceRequestTypedDict",
|
|
1238
|
-
"InitialCollateralAmount",
|
|
1239
|
-
"InitialCollateralAmountTypedDict",
|
|
1240
1212
|
"InterestRateMode",
|
|
1241
1213
|
"LiquidationCall",
|
|
1242
1214
|
"LiquidationCallTypedDict",
|
|
1243
1215
|
"Liquidity",
|
|
1244
1216
|
"LiquidityTypedDict",
|
|
1245
|
-
"LoanToValue",
|
|
1246
|
-
"LoanToValueTypedDict",
|
|
1247
1217
|
"Loc",
|
|
1248
1218
|
"LocTypedDict",
|
|
1249
1219
|
"LpBalance",
|
|
@@ -1252,8 +1222,6 @@ __all__ = [
|
|
|
1252
1222
|
"MarketPosition",
|
|
1253
1223
|
"MarketPositionTypedDict",
|
|
1254
1224
|
"MarketTypedDict",
|
|
1255
|
-
"MaxSlippagePercent",
|
|
1256
|
-
"MaxSlippagePercentTypedDict",
|
|
1257
1225
|
"Metadata",
|
|
1258
1226
|
"MetadataTypedDict",
|
|
1259
1227
|
"MorphoBorrowParams",
|
|
@@ -1352,14 +1320,6 @@ __all__ = [
|
|
|
1352
1320
|
"MorphoWithdrawRequestTypedDict",
|
|
1353
1321
|
"Movement10Percent",
|
|
1354
1322
|
"Movement10PercentTypedDict",
|
|
1355
|
-
"MulticallAuthorizationRequest",
|
|
1356
|
-
"MulticallAuthorizationRequestTypedDict",
|
|
1357
|
-
"MulticallAuthorizationResponse",
|
|
1358
|
-
"MulticallAuthorizationResponseTypedDict",
|
|
1359
|
-
"MulticallExecuteRequest",
|
|
1360
|
-
"MulticallExecuteRequestTypedDict",
|
|
1361
|
-
"Multiplier",
|
|
1362
|
-
"MultiplierTypedDict",
|
|
1363
1323
|
"OpenPosition",
|
|
1364
1324
|
"OpenPositionTypedDict",
|
|
1365
1325
|
"PendleAddLiquidityParams",
|
|
@@ -1729,16 +1689,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1729
1689
|
"TransactionTypedDict": ".aavehistoricaltransactionsresponse",
|
|
1730
1690
|
"AaveLiquidityChangeResponse": ".aaveliquiditychangeresponse",
|
|
1731
1691
|
"AaveLiquidityChangeResponseTypedDict": ".aaveliquiditychangeresponse",
|
|
1732
|
-
"AaveLoopRequest": ".aavelooprequest",
|
|
1733
|
-
"AaveLoopRequestTypedDict": ".aavelooprequest",
|
|
1734
|
-
"InitialCollateralAmount": ".aavelooprequest",
|
|
1735
|
-
"InitialCollateralAmountTypedDict": ".aavelooprequest",
|
|
1736
|
-
"LoanToValue": ".aavelooprequest",
|
|
1737
|
-
"LoanToValueTypedDict": ".aavelooprequest",
|
|
1738
|
-
"MaxSlippagePercent": ".aavelooprequest",
|
|
1739
|
-
"MaxSlippagePercentTypedDict": ".aavelooprequest",
|
|
1740
|
-
"Multiplier": ".aavelooprequest",
|
|
1741
|
-
"MultiplierTypedDict": ".aavelooprequest",
|
|
1742
1692
|
"AaveRateResponse": ".aaverateresponse",
|
|
1743
1693
|
"AaveRateResponseTypedDict": ".aaverateresponse",
|
|
1744
1694
|
"AaveRepayParams": ".aaverepayparams",
|
|
@@ -2054,12 +2004,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2054
2004
|
"MorphoWithdrawRequestTypedDict": ".morphowithdrawrequest",
|
|
2055
2005
|
"Movement10Percent": ".movement10percent",
|
|
2056
2006
|
"Movement10PercentTypedDict": ".movement10percent",
|
|
2057
|
-
"MulticallAuthorizationRequest": ".multicallauthorizationrequest",
|
|
2058
|
-
"MulticallAuthorizationRequestTypedDict": ".multicallauthorizationrequest",
|
|
2059
|
-
"MulticallAuthorizationResponse": ".multicallauthorizationresponse",
|
|
2060
|
-
"MulticallAuthorizationResponseTypedDict": ".multicallauthorizationresponse",
|
|
2061
|
-
"MulticallExecuteRequest": ".multicallexecuterequest",
|
|
2062
|
-
"MulticallExecuteRequestTypedDict": ".multicallexecuterequest",
|
|
2063
2007
|
"OpenPosition": ".openposition",
|
|
2064
2008
|
"OpenPositionTypedDict": ".openposition",
|
|
2065
2009
|
"PendleMarketChain": ".pendle_marketop",
|
|
@@ -79,7 +79,7 @@ class TokenPriceRequest(BaseModel):
|
|
|
79
79
|
chain: Annotated[
|
|
80
80
|
TokenPriceChain,
|
|
81
81
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
82
|
-
] = TokenPriceChain.
|
|
82
|
+
] = TokenPriceChain.ETHEREUM_MAINNET
|
|
83
83
|
r"""The chain to use."""
|
|
84
84
|
|
|
85
85
|
token: Annotated[
|
compass_api_sdk/sdk.py
CHANGED
|
@@ -21,7 +21,6 @@ if TYPE_CHECKING:
|
|
|
21
21
|
from compass_api_sdk.sky import Sky
|
|
22
22
|
from compass_api_sdk.smart_account import SmartAccount
|
|
23
23
|
from compass_api_sdk.token_sdk import TokenSDK
|
|
24
|
-
from compass_api_sdk.transaction_batching import TransactionBatching
|
|
25
24
|
from compass_api_sdk.uniswap_v3 import UniswapV3
|
|
26
25
|
from compass_api_sdk.universal import Universal
|
|
27
26
|
|
|
@@ -37,7 +36,6 @@ class CompassAPI(BaseSDK):
|
|
|
37
36
|
uniswap_v3: "UniswapV3"
|
|
38
37
|
universal: "Universal"
|
|
39
38
|
pendle: "Pendle"
|
|
40
|
-
transaction_batching: "TransactionBatching"
|
|
41
39
|
smart_account: "SmartAccount"
|
|
42
40
|
_sub_sdk_map = {
|
|
43
41
|
"aave_v3": ("compass_api_sdk.aave_v3", "AaveV3"),
|
|
@@ -51,10 +49,6 @@ class CompassAPI(BaseSDK):
|
|
|
51
49
|
"uniswap_v3": ("compass_api_sdk.uniswap_v3", "UniswapV3"),
|
|
52
50
|
"universal": ("compass_api_sdk.universal", "Universal"),
|
|
53
51
|
"pendle": ("compass_api_sdk.pendle", "Pendle"),
|
|
54
|
-
"transaction_batching": (
|
|
55
|
-
"compass_api_sdk.transaction_batching",
|
|
56
|
-
"TransactionBatching",
|
|
57
|
-
),
|
|
58
52
|
"smart_account": ("compass_api_sdk.smart_account", "SmartAccount"),
|
|
59
53
|
}
|
|
60
54
|
|
compass_api_sdk/token_sdk.py
CHANGED
|
@@ -213,7 +213,7 @@ class TokenSDK(BaseSDK):
|
|
|
213
213
|
def price(
|
|
214
214
|
self,
|
|
215
215
|
*,
|
|
216
|
-
chain: models.TokenPriceChain = models.TokenPriceChain.
|
|
216
|
+
chain: models.TokenPriceChain = models.TokenPriceChain.ETHEREUM_MAINNET,
|
|
217
217
|
token: models.TokenPriceToken = models.TokenPriceToken.WBTC,
|
|
218
218
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
219
219
|
server_url: Optional[str] = None,
|
|
@@ -318,7 +318,7 @@ class TokenSDK(BaseSDK):
|
|
|
318
318
|
async def price_async(
|
|
319
319
|
self,
|
|
320
320
|
*,
|
|
321
|
-
chain: models.TokenPriceChain = models.TokenPriceChain.
|
|
321
|
+
chain: models.TokenPriceChain = models.TokenPriceChain.ETHEREUM_MAINNET,
|
|
322
322
|
token: models.TokenPriceToken = models.TokenPriceToken.WBTC,
|
|
323
323
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
324
324
|
server_url: Optional[str] = None,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: compass_api_sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.12
|
|
4
4
|
Summary: Compass API SDK.
|
|
5
5
|
Author: royalnine
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -268,12 +268,6 @@ with CompassAPI(
|
|
|
268
268
|
* [balance](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#balance) - Token Balance
|
|
269
269
|
* [transfer](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#transfer) - Transfer ETH or ERC20 Tokens.
|
|
270
270
|
|
|
271
|
-
### [transaction_batching](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbatching/README.md)
|
|
272
|
-
|
|
273
|
-
* [authorization](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbatching/README.md#authorization) - Enable transaction bundling.
|
|
274
|
-
* [execute](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbatching/README.md#execute) - Construct Bundled Transaction
|
|
275
|
-
* [aave_loop](https://github.com/CompassLabs/mono/blob/master/docs/sdks/transactionbatching/README.md#aave_loop) - AAVE leverage long/short
|
|
276
|
-
|
|
277
271
|
### [uniswap_v3](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md)
|
|
278
272
|
|
|
279
273
|
* [quote_buy_exactly](https://github.com/CompassLabs/mono/blob/master/docs/sdks/uniswapv3/README.md#quote_buy_exactly) - Get quote - to specified amount
|
|
@@ -2,7 +2,7 @@ compass_api_sdk/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,4
|
|
|
2
2
|
compass_api_sdk/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
|
|
3
3
|
compass_api_sdk/_hooks/sdkhooks.py,sha256=eVxHB2Q_JG6zZx5xn74i208ij-fpTHqq2jod6fbghRQ,2503
|
|
4
4
|
compass_api_sdk/_hooks/types.py,sha256=4qXm6dEntJOC2QeOdTklcc53oFzTU3HBb1xGdZ-kBXY,3059
|
|
5
|
-
compass_api_sdk/_version.py,sha256=
|
|
5
|
+
compass_api_sdk/_version.py,sha256=XjoM7mmSLmrFQMqSUtkH8z-2KXiqB-gsba5kE02aXBA,474
|
|
6
6
|
compass_api_sdk/aave_v3.py,sha256=RmNPcYy3tmtbufL_UaZ6inLtUOnSqidAZIIyxXeKd-g,126400
|
|
7
7
|
compass_api_sdk/aerodrome_slipstream.py,sha256=zPbCz8ySxnjBGoy2DjqpN6Np5kmjE4rqKzmKZScMRbY,83443
|
|
8
8
|
compass_api_sdk/basesdk.py,sha256=xDxC-X-LHCwtVy8SPM6nckSu1NmF8uKhHUUQd3X-syo,11810
|
|
@@ -10,7 +10,7 @@ compass_api_sdk/errors/__init__.py,sha256=V3vSSmUvxXtgwHL60IBI0MzLWll8h373LvT3el
|
|
|
10
10
|
compass_api_sdk/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
|
|
11
11
|
compass_api_sdk/errors/httpvalidationerror.py,sha256=KBdpK3fYQoeMB-3m9dLKiMYimFN7B9VLma6YqMKX5k0,671
|
|
12
12
|
compass_api_sdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
13
|
-
compass_api_sdk/models/__init__.py,sha256=
|
|
13
|
+
compass_api_sdk/models/__init__.py,sha256=N3fpWPAiRL4UKgdf96Bu3dII-Nzx59bP28LWxZgQ5SA,116094
|
|
14
14
|
compass_api_sdk/models/aave_avg_rateop.py,sha256=Qn7IkBwZv5zY_L15V_LONkANzQPTbtmK2Wwhc2iqYz8,3718
|
|
15
15
|
compass_api_sdk/models/aave_historical_transactionsop.py,sha256=7Ghmin3AWvh2knbC-M0CZ0chL8q3fJU-GeDgXeoY0s4,1789
|
|
16
16
|
compass_api_sdk/models/aave_liquidity_changeop.py,sha256=o9G4dD2foyhbunziTv_177Qr2AK37KTIQsQfvPxo5Fs,2785
|
|
@@ -25,7 +25,6 @@ compass_api_sdk/models/aaveborrowparams.py,sha256=Sb_i4KtK1ZVGGzkt7WU391cJzCryRp
|
|
|
25
25
|
compass_api_sdk/models/aaveborrowrequest.py,sha256=IUHTHTa3icfr9esg4owq98SyckK2rzOX-odpVFn6l8w,3568
|
|
26
26
|
compass_api_sdk/models/aavehistoricaltransactionsresponse.py,sha256=G9yw8V7UHQL9m8mJZgHSqhvdymo5mJbJoIKtbtRSzlg,2504
|
|
27
27
|
compass_api_sdk/models/aaveliquiditychangeresponse.py,sha256=G_fjNFMMAViJVXUejTdqNDyNrv-BieQDDpT6iwtwCwg,811
|
|
28
|
-
compass_api_sdk/models/aavelooprequest.py,sha256=AfqNPvHRaCCrZPlqcQ5KG8qcEB52SkKV0zHDLElBmEs,3874
|
|
29
28
|
compass_api_sdk/models/aaverateresponse.py,sha256=7Ra_FKYbGrm7ZqzNi8-1T0v2xDAGyZf6Iw5Juh1bXBI,1156
|
|
30
29
|
compass_api_sdk/models/aaverepayparams.py,sha256=CJxfD0lckwHMqvoEqGvJFCS0yN4ADsgMLbaD0ajdOTg,3293
|
|
31
30
|
compass_api_sdk/models/aaverepayrequest.py,sha256=wAT4zqxF_FlFj_QycGKXRr-aenw3AQlHSVr6J6maXCo,3552
|
|
@@ -125,9 +124,6 @@ compass_api_sdk/models/morphowithdrawcollateralrequest.py,sha256=0i6sFnv2YRWCzi_
|
|
|
125
124
|
compass_api_sdk/models/morphowithdrawparams.py,sha256=Tm_uYiD04bl7ZOxyfubRk0pmTup_EtNM8sb0lVHbLqA,2511
|
|
126
125
|
compass_api_sdk/models/morphowithdrawrequest.py,sha256=9xEVCTNG9yxffOODyX3UtNaULL70TmdcDm07v1JHRBY,2868
|
|
127
126
|
compass_api_sdk/models/movement10percent.py,sha256=z_GUd5GJyXpqsLM3X01GShe7Uwg3uwp8LOy7sjiOUgw,767
|
|
128
|
-
compass_api_sdk/models/multicallauthorizationrequest.py,sha256=h5-2acLlhV9assgIIHyVIgTak1IJathqa-viS-PkvMA,1155
|
|
129
|
-
compass_api_sdk/models/multicallauthorizationresponse.py,sha256=3jjdz9Mz-tKjhBzZbVaJW51no58HSqcxfHJwuZsgnhg,914
|
|
130
|
-
compass_api_sdk/models/multicallexecuterequest.py,sha256=iVCfkarzlLYQrdo2sCRB9YJyJ-dayaf321j0Hh4Fit8,1095
|
|
131
127
|
compass_api_sdk/models/openposition.py,sha256=jd5t6ku3f7J0PA-1LmfWyrNYrQybGF68ebfVKgkSzdc,1013
|
|
132
128
|
compass_api_sdk/models/pendle_marketop.py,sha256=HYn46j-GhbEhuLoN0yWgaRUlgGs8n8OHYmGpO6K7VB0,1124
|
|
133
129
|
compass_api_sdk/models/pendle_marketsop.py,sha256=k4G89uNzGBzBNYSqdmlDM1PierxtEjC4_e_hbD2XjPI,830
|
|
@@ -175,7 +171,7 @@ compass_api_sdk/models/syposition.py,sha256=AZK-1B3zsZphz-zmYOR_cTONyyhbPJnVe3x9
|
|
|
175
171
|
compass_api_sdk/models/token_addressop.py,sha256=4rmH4aUL9rPQWpeI3YSUPr-UVgIvB8q4QEMRHPHMv7g,2161
|
|
176
172
|
compass_api_sdk/models/token_balanceop.py,sha256=IJ9QjyIDvpNNvGzeUF9E4FsCR8Q-tciB6zvFcskK_ic,1793
|
|
177
173
|
compass_api_sdk/models/token_enum.py,sha256=klu_nFSPn35oWFaduBEjRQm5WjkNOpZztRVj0FucuK4,1166
|
|
178
|
-
compass_api_sdk/models/token_priceop.py,sha256=
|
|
174
|
+
compass_api_sdk/models/token_priceop.py,sha256=bZDad3twIJFyssyzutUlw5cw8MpBE-JZYwKHAWg2-ko,2161
|
|
179
175
|
compass_api_sdk/models/tokenaddressresponse.py,sha256=alnjhUzaC_oBUWl1iyoSTh3La_I49CT5YyrPNN0ukmk,399
|
|
180
176
|
compass_api_sdk/models/tokenbalanceresponse.py,sha256=CvSBOatB-SsFtkXkfYsOplcJyN0AhmP1PailafwloPs,1193
|
|
181
177
|
compass_api_sdk/models/tokeninfo.py,sha256=XJxb3m5dS8sRBGCpHS128VemtSU4q09EXOEwaA6mc2o,483
|
|
@@ -222,12 +218,11 @@ compass_api_sdk/models/yieldrange.py,sha256=WEpZR24JddnCS1_13y2P1CdD0lBi6dPktysC
|
|
|
222
218
|
compass_api_sdk/morpho.py,sha256=JtcZoP-M_V0fw2zCCbxejmPrgrXZOiLDZILW1W0J2oQ,134352
|
|
223
219
|
compass_api_sdk/pendle.py,sha256=BQ2SQn3jtaVjsmaU2fpqi_gj8mwCGL5zY7aSz3GwoJ0,97156
|
|
224
220
|
compass_api_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
225
|
-
compass_api_sdk/sdk.py,sha256=
|
|
221
|
+
compass_api_sdk/sdk.py,sha256=S1HG4x3TWzARXyognplU_20az1zI0NdfpxIFtr9_snU,7439
|
|
226
222
|
compass_api_sdk/sdkconfiguration.py,sha256=5nec4ViMLCsNWBd3DyEv8zWqU5Z77YZfzwX69jkdSnM,1607
|
|
227
223
|
compass_api_sdk/sky.py,sha256=oZcj2VX26yc-nMTo5WIktz97mAjZT1J0K2IHvi_m3oM,43965
|
|
228
224
|
compass_api_sdk/smart_account.py,sha256=iUrXLNi0QyPUNYBCP92PHziUFQ0qkRYdhyvfHVXvQWQ,9150
|
|
229
|
-
compass_api_sdk/token_sdk.py,sha256=
|
|
230
|
-
compass_api_sdk/transaction_batching.py,sha256=w4mJU9kdeufmOKxHrcZJcEFglyoBjWz-51ufz42dhXI,32233
|
|
225
|
+
compass_api_sdk/token_sdk.py,sha256=bAhzzPnxG4Qs9fH6LM9QxUKt7CfLVbaM0M-whx73NTY,34602
|
|
231
226
|
compass_api_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
232
227
|
compass_api_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
233
228
|
compass_api_sdk/uniswap_v3.py,sha256=oCVz-gLG3uNMd_3QhFSkgmEtyEtXUrVjCYnt8C-3J_o,109087
|
|
@@ -248,6 +243,6 @@ compass_api_sdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFId
|
|
|
248
243
|
compass_api_sdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
249
244
|
compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
250
245
|
compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
251
|
-
compass_api_sdk-0.9.
|
|
252
|
-
compass_api_sdk-0.9.
|
|
253
|
-
compass_api_sdk-0.9.
|
|
246
|
+
compass_api_sdk-0.9.12.dist-info/METADATA,sha256=877-ObCO2iiuLUxw64ha33cue5n-K8LohhnQeE2KXd8,26099
|
|
247
|
+
compass_api_sdk-0.9.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
248
|
+
compass_api_sdk-0.9.12.dist-info/RECORD,,
|
|
@@ -1,113 +0,0 @@
|
|
|
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
|
-
InitialCollateralAmountTypedDict = TypeAliasType(
|
|
13
|
-
"InitialCollateralAmountTypedDict", Union[float, str]
|
|
14
|
-
)
|
|
15
|
-
r"""Amount of collateral token to supply to Aave"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
InitialCollateralAmount = TypeAliasType("InitialCollateralAmount", Union[float, str])
|
|
19
|
-
r"""Amount of collateral token to supply to Aave"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
MultiplierTypedDict = TypeAliasType("MultiplierTypedDict", Union[float, str])
|
|
23
|
-
r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Multiplier = TypeAliasType("Multiplier", Union[float, str])
|
|
27
|
-
r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
MaxSlippagePercentTypedDict = TypeAliasType(
|
|
31
|
-
"MaxSlippagePercentTypedDict", Union[float, str]
|
|
32
|
-
)
|
|
33
|
-
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
MaxSlippagePercent = TypeAliasType("MaxSlippagePercent", Union[float, str])
|
|
37
|
-
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
LoanToValueTypedDict = TypeAliasType("LoanToValueTypedDict", Union[float, str])
|
|
41
|
-
r"""Loan To Value percentage of the loop"""
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
LoanToValue = TypeAliasType("LoanToValue", Union[float, str])
|
|
45
|
-
r"""Loan To Value percentage of the loop"""
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class AaveLoopRequestTypedDict(TypedDict):
|
|
49
|
-
r"""Request model for executing an Aave loop strategy."""
|
|
50
|
-
|
|
51
|
-
chain: Chain
|
|
52
|
-
r"""The chain to use."""
|
|
53
|
-
sender: str
|
|
54
|
-
r"""The address of the transaction sender."""
|
|
55
|
-
signed_authorization: SignedAuthorizationTypedDict
|
|
56
|
-
collateral_token: TokenEnum
|
|
57
|
-
r"""A class representing the token.
|
|
58
|
-
|
|
59
|
-
This class is used to represent the token in the system. Notice individual
|
|
60
|
-
endpoints' documentation where per chain tokens are presented.
|
|
61
|
-
"""
|
|
62
|
-
borrow_token: TokenEnum
|
|
63
|
-
r"""A class representing the token.
|
|
64
|
-
|
|
65
|
-
This class is used to represent the token in the system. Notice individual
|
|
66
|
-
endpoints' documentation where per chain tokens are presented.
|
|
67
|
-
"""
|
|
68
|
-
initial_collateral_amount: InitialCollateralAmountTypedDict
|
|
69
|
-
r"""Amount of collateral token to supply to Aave"""
|
|
70
|
-
multiplier: MultiplierTypedDict
|
|
71
|
-
r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
|
|
72
|
-
max_slippage_percent: MaxSlippagePercentTypedDict
|
|
73
|
-
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
74
|
-
loan_to_value: LoanToValueTypedDict
|
|
75
|
-
r"""Loan To Value percentage of the loop"""
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class AaveLoopRequest(BaseModel):
|
|
79
|
-
r"""Request model for executing an Aave loop strategy."""
|
|
80
|
-
|
|
81
|
-
chain: Chain
|
|
82
|
-
r"""The chain to use."""
|
|
83
|
-
|
|
84
|
-
sender: str
|
|
85
|
-
r"""The address of the transaction sender."""
|
|
86
|
-
|
|
87
|
-
signed_authorization: SignedAuthorization
|
|
88
|
-
|
|
89
|
-
collateral_token: TokenEnum
|
|
90
|
-
r"""A class representing the token.
|
|
91
|
-
|
|
92
|
-
This class is used to represent the token in the system. Notice individual
|
|
93
|
-
endpoints' documentation where per chain tokens are presented.
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
borrow_token: TokenEnum
|
|
97
|
-
r"""A class representing the token.
|
|
98
|
-
|
|
99
|
-
This class is used to represent the token in the system. Notice individual
|
|
100
|
-
endpoints' documentation where per chain tokens are presented.
|
|
101
|
-
"""
|
|
102
|
-
|
|
103
|
-
initial_collateral_amount: InitialCollateralAmount
|
|
104
|
-
r"""Amount of collateral token to supply to Aave"""
|
|
105
|
-
|
|
106
|
-
multiplier: Multiplier
|
|
107
|
-
r"""Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`"""
|
|
108
|
-
|
|
109
|
-
max_slippage_percent: MaxSlippagePercent
|
|
110
|
-
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
111
|
-
|
|
112
|
-
loan_to_value: LoanToValue
|
|
113
|
-
r"""Loan To Value percentage of the loop"""
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
|
-
from compass_api_sdk.types import BaseModel
|
|
6
|
-
from typing_extensions import TypedDict
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class MulticallAuthorizationRequestTypedDict(TypedDict):
|
|
10
|
-
r"""Request model for getting a multicall authorization.
|
|
11
|
-
|
|
12
|
-
This model is used to authorize a sender address to perform multicall operations,
|
|
13
|
-
allowing it to call multiple functions on multiple contracts in a single
|
|
14
|
-
transaction.
|
|
15
|
-
|
|
16
|
-
Only needs to be done once per an EOA.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
chain: Chain
|
|
20
|
-
r"""The chain to use."""
|
|
21
|
-
sender: str
|
|
22
|
-
r"""The Ethereum address to use for authorization"""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class MulticallAuthorizationRequest(BaseModel):
|
|
26
|
-
r"""Request model for getting a multicall authorization.
|
|
27
|
-
|
|
28
|
-
This model is used to authorize a sender address to perform multicall operations,
|
|
29
|
-
allowing it to call multiple functions on multiple contracts in a single
|
|
30
|
-
transaction.
|
|
31
|
-
|
|
32
|
-
Only needs to be done once per an EOA.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
chain: Chain
|
|
36
|
-
r"""The chain to use."""
|
|
37
|
-
|
|
38
|
-
sender: str
|
|
39
|
-
r"""The Ethereum address to use for authorization"""
|
|
@@ -1,30 +0,0 @@
|
|
|
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 MulticallAuthorizationResponseTypedDict(TypedDict):
|
|
10
|
-
r"""Response model for multicall authorization."""
|
|
11
|
-
|
|
12
|
-
nonce: int
|
|
13
|
-
r"""A unique nonce value for this authorization"""
|
|
14
|
-
address: str
|
|
15
|
-
r"""The Ethereum address authorized for multicall"""
|
|
16
|
-
chain_id: int
|
|
17
|
-
r"""The chain ID for the blockchain network"""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class MulticallAuthorizationResponse(BaseModel):
|
|
21
|
-
r"""Response model for multicall authorization."""
|
|
22
|
-
|
|
23
|
-
nonce: int
|
|
24
|
-
r"""A unique nonce value for this authorization"""
|
|
25
|
-
|
|
26
|
-
address: str
|
|
27
|
-
r"""The Ethereum address authorized for multicall"""
|
|
28
|
-
|
|
29
|
-
chain_id: Annotated[int, pydantic.Field(alias="chainId")]
|
|
30
|
-
r"""The chain ID for the blockchain network"""
|
|
@@ -1,36 +0,0 @@
|
|
|
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 .useroperation import UserOperation, UserOperationTypedDict
|
|
7
|
-
from compass_api_sdk.types import BaseModel
|
|
8
|
-
from typing import List
|
|
9
|
-
from typing_extensions import TypedDict
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class MulticallExecuteRequestTypedDict(TypedDict):
|
|
13
|
-
r"""Request model for executing a multicall."""
|
|
14
|
-
|
|
15
|
-
chain: Chain
|
|
16
|
-
r"""The chain to use."""
|
|
17
|
-
sender: str
|
|
18
|
-
r"""The address of the transaction sender."""
|
|
19
|
-
signed_authorization: SignedAuthorizationTypedDict
|
|
20
|
-
actions: List[UserOperationTypedDict]
|
|
21
|
-
r"""List of possible actions for multicall"""
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class MulticallExecuteRequest(BaseModel):
|
|
25
|
-
r"""Request model for executing a multicall."""
|
|
26
|
-
|
|
27
|
-
chain: Chain
|
|
28
|
-
r"""The chain to use."""
|
|
29
|
-
|
|
30
|
-
sender: str
|
|
31
|
-
r"""The address of the transaction sender."""
|
|
32
|
-
|
|
33
|
-
signed_authorization: SignedAuthorization
|
|
34
|
-
|
|
35
|
-
actions: List[UserOperation]
|
|
36
|
-
r"""List of possible actions for multicall"""
|
|
@@ -1,765 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from .basesdk import BaseSDK
|
|
4
|
-
from compass_api_sdk import errors, models, utils
|
|
5
|
-
from compass_api_sdk._hooks import HookContext
|
|
6
|
-
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
-
from typing import Any, List, Mapping, Optional, Union
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TransactionBatching(BaseSDK):
|
|
11
|
-
def authorization(
|
|
12
|
-
self,
|
|
13
|
-
*,
|
|
14
|
-
chain: models.Chain,
|
|
15
|
-
sender: str,
|
|
16
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
|
-
server_url: Optional[str] = None,
|
|
18
|
-
timeout_ms: Optional[int] = None,
|
|
19
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
-
) -> models.MulticallAuthorizationResponse:
|
|
21
|
-
r"""Enable transaction bundling.
|
|
22
|
-
|
|
23
|
-
Get authorization for bundling transactions.
|
|
24
|
-
|
|
25
|
-
Currently this is required for every transaction bundle to prevent replay attacks
|
|
26
|
-
and ensure transaction ordering when batching multiple actions into a single
|
|
27
|
-
transaction. The authorization includes a nonce and chain ID to guarantee
|
|
28
|
-
transaction uniqueness and proper network targeting.
|
|
29
|
-
|
|
30
|
-
:param chain: The chain to use.
|
|
31
|
-
:param sender: The Ethereum address to use for authorization
|
|
32
|
-
:param retries: Override the default retry configuration for this method
|
|
33
|
-
:param server_url: Override the default server URL for this method
|
|
34
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
35
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
36
|
-
"""
|
|
37
|
-
base_url = None
|
|
38
|
-
url_variables = None
|
|
39
|
-
if timeout_ms is None:
|
|
40
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
41
|
-
|
|
42
|
-
if server_url is not None:
|
|
43
|
-
base_url = server_url
|
|
44
|
-
else:
|
|
45
|
-
base_url = self._get_url(base_url, url_variables)
|
|
46
|
-
|
|
47
|
-
request = models.MulticallAuthorizationRequest(
|
|
48
|
-
chain=chain,
|
|
49
|
-
sender=sender,
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
req = self._build_request(
|
|
53
|
-
method="POST",
|
|
54
|
-
path="/v0/multicall/authorization",
|
|
55
|
-
base_url=base_url,
|
|
56
|
-
url_variables=url_variables,
|
|
57
|
-
request=request,
|
|
58
|
-
request_body_required=True,
|
|
59
|
-
request_has_path_params=False,
|
|
60
|
-
request_has_query_params=True,
|
|
61
|
-
user_agent_header="user-agent",
|
|
62
|
-
accept_header_value="application/json",
|
|
63
|
-
http_headers=http_headers,
|
|
64
|
-
security=self.sdk_configuration.security,
|
|
65
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
66
|
-
request, False, False, "json", models.MulticallAuthorizationRequest
|
|
67
|
-
),
|
|
68
|
-
timeout_ms=timeout_ms,
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
if retries == UNSET:
|
|
72
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
73
|
-
retries = self.sdk_configuration.retry_config
|
|
74
|
-
|
|
75
|
-
retry_config = None
|
|
76
|
-
if isinstance(retries, utils.RetryConfig):
|
|
77
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
78
|
-
|
|
79
|
-
http_res = self.do_request(
|
|
80
|
-
hook_ctx=HookContext(
|
|
81
|
-
config=self.sdk_configuration,
|
|
82
|
-
base_url=base_url or "",
|
|
83
|
-
operation_id="multicall_authorization",
|
|
84
|
-
oauth2_scopes=[],
|
|
85
|
-
security_source=self.sdk_configuration.security,
|
|
86
|
-
),
|
|
87
|
-
request=req,
|
|
88
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
89
|
-
retry_config=retry_config,
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
response_data: Any = None
|
|
93
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
94
|
-
return utils.unmarshal_json(
|
|
95
|
-
http_res.text, models.MulticallAuthorizationResponse
|
|
96
|
-
)
|
|
97
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
98
|
-
response_data = utils.unmarshal_json(
|
|
99
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
100
|
-
)
|
|
101
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
102
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
103
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
104
|
-
raise errors.APIError(
|
|
105
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
106
|
-
)
|
|
107
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
108
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
109
|
-
raise errors.APIError(
|
|
110
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
content_type = http_res.headers.get("Content-Type")
|
|
114
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
115
|
-
raise errors.APIError(
|
|
116
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
117
|
-
http_res.status_code,
|
|
118
|
-
http_res_text,
|
|
119
|
-
http_res,
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
async def authorization_async(
|
|
123
|
-
self,
|
|
124
|
-
*,
|
|
125
|
-
chain: models.Chain,
|
|
126
|
-
sender: str,
|
|
127
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
128
|
-
server_url: Optional[str] = None,
|
|
129
|
-
timeout_ms: Optional[int] = None,
|
|
130
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
131
|
-
) -> models.MulticallAuthorizationResponse:
|
|
132
|
-
r"""Enable transaction bundling.
|
|
133
|
-
|
|
134
|
-
Get authorization for bundling transactions.
|
|
135
|
-
|
|
136
|
-
Currently this is required for every transaction bundle to prevent replay attacks
|
|
137
|
-
and ensure transaction ordering when batching multiple actions into a single
|
|
138
|
-
transaction. The authorization includes a nonce and chain ID to guarantee
|
|
139
|
-
transaction uniqueness and proper network targeting.
|
|
140
|
-
|
|
141
|
-
:param chain: The chain to use.
|
|
142
|
-
:param sender: The Ethereum address to use for authorization
|
|
143
|
-
:param retries: Override the default retry configuration for this method
|
|
144
|
-
:param server_url: Override the default server URL for this method
|
|
145
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
146
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
147
|
-
"""
|
|
148
|
-
base_url = None
|
|
149
|
-
url_variables = None
|
|
150
|
-
if timeout_ms is None:
|
|
151
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
152
|
-
|
|
153
|
-
if server_url is not None:
|
|
154
|
-
base_url = server_url
|
|
155
|
-
else:
|
|
156
|
-
base_url = self._get_url(base_url, url_variables)
|
|
157
|
-
|
|
158
|
-
request = models.MulticallAuthorizationRequest(
|
|
159
|
-
chain=chain,
|
|
160
|
-
sender=sender,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
req = self._build_request_async(
|
|
164
|
-
method="POST",
|
|
165
|
-
path="/v0/multicall/authorization",
|
|
166
|
-
base_url=base_url,
|
|
167
|
-
url_variables=url_variables,
|
|
168
|
-
request=request,
|
|
169
|
-
request_body_required=True,
|
|
170
|
-
request_has_path_params=False,
|
|
171
|
-
request_has_query_params=True,
|
|
172
|
-
user_agent_header="user-agent",
|
|
173
|
-
accept_header_value="application/json",
|
|
174
|
-
http_headers=http_headers,
|
|
175
|
-
security=self.sdk_configuration.security,
|
|
176
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
177
|
-
request, False, False, "json", models.MulticallAuthorizationRequest
|
|
178
|
-
),
|
|
179
|
-
timeout_ms=timeout_ms,
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
if retries == UNSET:
|
|
183
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
184
|
-
retries = self.sdk_configuration.retry_config
|
|
185
|
-
|
|
186
|
-
retry_config = None
|
|
187
|
-
if isinstance(retries, utils.RetryConfig):
|
|
188
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
189
|
-
|
|
190
|
-
http_res = await self.do_request_async(
|
|
191
|
-
hook_ctx=HookContext(
|
|
192
|
-
config=self.sdk_configuration,
|
|
193
|
-
base_url=base_url or "",
|
|
194
|
-
operation_id="multicall_authorization",
|
|
195
|
-
oauth2_scopes=[],
|
|
196
|
-
security_source=self.sdk_configuration.security,
|
|
197
|
-
),
|
|
198
|
-
request=req,
|
|
199
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
200
|
-
retry_config=retry_config,
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
response_data: Any = None
|
|
204
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
205
|
-
return utils.unmarshal_json(
|
|
206
|
-
http_res.text, models.MulticallAuthorizationResponse
|
|
207
|
-
)
|
|
208
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
209
|
-
response_data = utils.unmarshal_json(
|
|
210
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
211
|
-
)
|
|
212
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
213
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
214
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
215
|
-
raise errors.APIError(
|
|
216
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
217
|
-
)
|
|
218
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
219
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
220
|
-
raise errors.APIError(
|
|
221
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
content_type = http_res.headers.get("Content-Type")
|
|
225
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
226
|
-
raise errors.APIError(
|
|
227
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
228
|
-
http_res.status_code,
|
|
229
|
-
http_res_text,
|
|
230
|
-
http_res,
|
|
231
|
-
)
|
|
232
|
-
|
|
233
|
-
def execute(
|
|
234
|
-
self,
|
|
235
|
-
*,
|
|
236
|
-
chain: models.Chain,
|
|
237
|
-
sender: str,
|
|
238
|
-
signed_authorization: Union[
|
|
239
|
-
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
240
|
-
],
|
|
241
|
-
actions: Union[List[models.UserOperation], List[models.UserOperationTypedDict]],
|
|
242
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
243
|
-
server_url: Optional[str] = None,
|
|
244
|
-
timeout_ms: Optional[int] = None,
|
|
245
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
246
|
-
) -> models.UnsignedMulticallTransaction:
|
|
247
|
-
r"""Construct Bundled Transaction
|
|
248
|
-
|
|
249
|
-
Bundle arbitrary transactions together into a single multicall transaction using
|
|
250
|
-
EIP-7702.
|
|
251
|
-
|
|
252
|
-
This endpoint allows bundling multiple contract calls into a single atomic
|
|
253
|
-
transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
254
|
-
together. The transaction must be authorized using the /authorization endpoint to
|
|
255
|
-
prevent replay attacks.
|
|
256
|
-
|
|
257
|
-
:param chain: The chain to use.
|
|
258
|
-
:param sender: The address of the transaction sender.
|
|
259
|
-
:param signed_authorization:
|
|
260
|
-
:param actions: List of possible actions for multicall
|
|
261
|
-
:param retries: Override the default retry configuration for this method
|
|
262
|
-
:param server_url: Override the default server URL for this method
|
|
263
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
264
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
265
|
-
"""
|
|
266
|
-
base_url = None
|
|
267
|
-
url_variables = None
|
|
268
|
-
if timeout_ms is None:
|
|
269
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
270
|
-
|
|
271
|
-
if server_url is not None:
|
|
272
|
-
base_url = server_url
|
|
273
|
-
else:
|
|
274
|
-
base_url = self._get_url(base_url, url_variables)
|
|
275
|
-
|
|
276
|
-
request = models.MulticallExecuteRequest(
|
|
277
|
-
chain=chain,
|
|
278
|
-
sender=sender,
|
|
279
|
-
signed_authorization=utils.get_pydantic_model(
|
|
280
|
-
signed_authorization, models.SignedAuthorization
|
|
281
|
-
),
|
|
282
|
-
actions=utils.get_pydantic_model(actions, List[models.UserOperation]),
|
|
283
|
-
)
|
|
284
|
-
|
|
285
|
-
req = self._build_request(
|
|
286
|
-
method="POST",
|
|
287
|
-
path="/v0/multicall/execute",
|
|
288
|
-
base_url=base_url,
|
|
289
|
-
url_variables=url_variables,
|
|
290
|
-
request=request,
|
|
291
|
-
request_body_required=True,
|
|
292
|
-
request_has_path_params=False,
|
|
293
|
-
request_has_query_params=True,
|
|
294
|
-
user_agent_header="user-agent",
|
|
295
|
-
accept_header_value="application/json",
|
|
296
|
-
http_headers=http_headers,
|
|
297
|
-
security=self.sdk_configuration.security,
|
|
298
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
299
|
-
request, False, False, "json", models.MulticallExecuteRequest
|
|
300
|
-
),
|
|
301
|
-
timeout_ms=timeout_ms,
|
|
302
|
-
)
|
|
303
|
-
|
|
304
|
-
if retries == UNSET:
|
|
305
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
306
|
-
retries = self.sdk_configuration.retry_config
|
|
307
|
-
|
|
308
|
-
retry_config = None
|
|
309
|
-
if isinstance(retries, utils.RetryConfig):
|
|
310
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
311
|
-
|
|
312
|
-
http_res = self.do_request(
|
|
313
|
-
hook_ctx=HookContext(
|
|
314
|
-
config=self.sdk_configuration,
|
|
315
|
-
base_url=base_url or "",
|
|
316
|
-
operation_id="multicall_execute",
|
|
317
|
-
oauth2_scopes=[],
|
|
318
|
-
security_source=self.sdk_configuration.security,
|
|
319
|
-
),
|
|
320
|
-
request=req,
|
|
321
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
322
|
-
retry_config=retry_config,
|
|
323
|
-
)
|
|
324
|
-
|
|
325
|
-
response_data: Any = None
|
|
326
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
327
|
-
return utils.unmarshal_json(
|
|
328
|
-
http_res.text, models.UnsignedMulticallTransaction
|
|
329
|
-
)
|
|
330
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
331
|
-
response_data = utils.unmarshal_json(
|
|
332
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
333
|
-
)
|
|
334
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
335
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
336
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
337
|
-
raise errors.APIError(
|
|
338
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
339
|
-
)
|
|
340
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
341
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
342
|
-
raise errors.APIError(
|
|
343
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
344
|
-
)
|
|
345
|
-
|
|
346
|
-
content_type = http_res.headers.get("Content-Type")
|
|
347
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
348
|
-
raise errors.APIError(
|
|
349
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
350
|
-
http_res.status_code,
|
|
351
|
-
http_res_text,
|
|
352
|
-
http_res,
|
|
353
|
-
)
|
|
354
|
-
|
|
355
|
-
async def execute_async(
|
|
356
|
-
self,
|
|
357
|
-
*,
|
|
358
|
-
chain: models.Chain,
|
|
359
|
-
sender: str,
|
|
360
|
-
signed_authorization: Union[
|
|
361
|
-
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
362
|
-
],
|
|
363
|
-
actions: Union[List[models.UserOperation], List[models.UserOperationTypedDict]],
|
|
364
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
365
|
-
server_url: Optional[str] = None,
|
|
366
|
-
timeout_ms: Optional[int] = None,
|
|
367
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
368
|
-
) -> models.UnsignedMulticallTransaction:
|
|
369
|
-
r"""Construct Bundled Transaction
|
|
370
|
-
|
|
371
|
-
Bundle arbitrary transactions together into a single multicall transaction using
|
|
372
|
-
EIP-7702.
|
|
373
|
-
|
|
374
|
-
This endpoint allows bundling multiple contract calls into a single atomic
|
|
375
|
-
transaction, reducing gas costs and ensuring all operations succeed or fail
|
|
376
|
-
together. The transaction must be authorized using the /authorization endpoint to
|
|
377
|
-
prevent replay attacks.
|
|
378
|
-
|
|
379
|
-
:param chain: The chain to use.
|
|
380
|
-
:param sender: The address of the transaction sender.
|
|
381
|
-
:param signed_authorization:
|
|
382
|
-
:param actions: List of possible actions for multicall
|
|
383
|
-
:param retries: Override the default retry configuration for this method
|
|
384
|
-
:param server_url: Override the default server URL for this method
|
|
385
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
386
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
387
|
-
"""
|
|
388
|
-
base_url = None
|
|
389
|
-
url_variables = None
|
|
390
|
-
if timeout_ms is None:
|
|
391
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
392
|
-
|
|
393
|
-
if server_url is not None:
|
|
394
|
-
base_url = server_url
|
|
395
|
-
else:
|
|
396
|
-
base_url = self._get_url(base_url, url_variables)
|
|
397
|
-
|
|
398
|
-
request = models.MulticallExecuteRequest(
|
|
399
|
-
chain=chain,
|
|
400
|
-
sender=sender,
|
|
401
|
-
signed_authorization=utils.get_pydantic_model(
|
|
402
|
-
signed_authorization, models.SignedAuthorization
|
|
403
|
-
),
|
|
404
|
-
actions=utils.get_pydantic_model(actions, List[models.UserOperation]),
|
|
405
|
-
)
|
|
406
|
-
|
|
407
|
-
req = self._build_request_async(
|
|
408
|
-
method="POST",
|
|
409
|
-
path="/v0/multicall/execute",
|
|
410
|
-
base_url=base_url,
|
|
411
|
-
url_variables=url_variables,
|
|
412
|
-
request=request,
|
|
413
|
-
request_body_required=True,
|
|
414
|
-
request_has_path_params=False,
|
|
415
|
-
request_has_query_params=True,
|
|
416
|
-
user_agent_header="user-agent",
|
|
417
|
-
accept_header_value="application/json",
|
|
418
|
-
http_headers=http_headers,
|
|
419
|
-
security=self.sdk_configuration.security,
|
|
420
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
421
|
-
request, False, False, "json", models.MulticallExecuteRequest
|
|
422
|
-
),
|
|
423
|
-
timeout_ms=timeout_ms,
|
|
424
|
-
)
|
|
425
|
-
|
|
426
|
-
if retries == UNSET:
|
|
427
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
428
|
-
retries = self.sdk_configuration.retry_config
|
|
429
|
-
|
|
430
|
-
retry_config = None
|
|
431
|
-
if isinstance(retries, utils.RetryConfig):
|
|
432
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
433
|
-
|
|
434
|
-
http_res = await self.do_request_async(
|
|
435
|
-
hook_ctx=HookContext(
|
|
436
|
-
config=self.sdk_configuration,
|
|
437
|
-
base_url=base_url or "",
|
|
438
|
-
operation_id="multicall_execute",
|
|
439
|
-
oauth2_scopes=[],
|
|
440
|
-
security_source=self.sdk_configuration.security,
|
|
441
|
-
),
|
|
442
|
-
request=req,
|
|
443
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
444
|
-
retry_config=retry_config,
|
|
445
|
-
)
|
|
446
|
-
|
|
447
|
-
response_data: Any = None
|
|
448
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
449
|
-
return utils.unmarshal_json(
|
|
450
|
-
http_res.text, models.UnsignedMulticallTransaction
|
|
451
|
-
)
|
|
452
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
453
|
-
response_data = utils.unmarshal_json(
|
|
454
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
455
|
-
)
|
|
456
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
457
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
458
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
459
|
-
raise errors.APIError(
|
|
460
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
461
|
-
)
|
|
462
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
463
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
464
|
-
raise errors.APIError(
|
|
465
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
466
|
-
)
|
|
467
|
-
|
|
468
|
-
content_type = http_res.headers.get("Content-Type")
|
|
469
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
470
|
-
raise errors.APIError(
|
|
471
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
472
|
-
http_res.status_code,
|
|
473
|
-
http_res_text,
|
|
474
|
-
http_res,
|
|
475
|
-
)
|
|
476
|
-
|
|
477
|
-
def aave_loop(
|
|
478
|
-
self,
|
|
479
|
-
*,
|
|
480
|
-
chain: models.Chain,
|
|
481
|
-
sender: str,
|
|
482
|
-
signed_authorization: Union[
|
|
483
|
-
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
484
|
-
],
|
|
485
|
-
collateral_token: models.TokenEnum,
|
|
486
|
-
borrow_token: models.TokenEnum,
|
|
487
|
-
initial_collateral_amount: Union[
|
|
488
|
-
models.InitialCollateralAmount, models.InitialCollateralAmountTypedDict
|
|
489
|
-
],
|
|
490
|
-
multiplier: Union[models.Multiplier, models.MultiplierTypedDict],
|
|
491
|
-
max_slippage_percent: Union[
|
|
492
|
-
models.MaxSlippagePercent, models.MaxSlippagePercentTypedDict
|
|
493
|
-
],
|
|
494
|
-
loan_to_value: Union[models.LoanToValue, models.LoanToValueTypedDict],
|
|
495
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
496
|
-
server_url: Optional[str] = None,
|
|
497
|
-
timeout_ms: Optional[int] = None,
|
|
498
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
499
|
-
) -> models.UnsignedMulticallTransaction:
|
|
500
|
-
r"""AAVE leverage long/short
|
|
501
|
-
|
|
502
|
-
Execute an Aave looping strategy that involves repeated supply and borrow
|
|
503
|
-
operations.
|
|
504
|
-
|
|
505
|
-
This endpoint creates a multicall transaction that performs a series of operations:
|
|
506
|
-
1. Approves and supplies initial token
|
|
507
|
-
2. For each loop:
|
|
508
|
-
- Borrows another token
|
|
509
|
-
- Swaps borrowed token back to supply token
|
|
510
|
-
- Supplies the swapped tokens
|
|
511
|
-
|
|
512
|
-
The transaction must be authorized using the /authorization endpoint to prevent replay attacks.
|
|
513
|
-
|
|
514
|
-
:param chain: The chain to use.
|
|
515
|
-
:param sender: The address of the transaction sender.
|
|
516
|
-
:param signed_authorization:
|
|
517
|
-
:param collateral_token: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
|
|
518
|
-
:param borrow_token: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
|
|
519
|
-
:param initial_collateral_amount: Amount of collateral token to supply to Aave
|
|
520
|
-
:param multiplier: Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
|
|
521
|
-
:param max_slippage_percent: Maximum allowed slippage for token swaps in percentage
|
|
522
|
-
:param loan_to_value: Loan To Value percentage of the loop
|
|
523
|
-
:param retries: Override the default retry configuration for this method
|
|
524
|
-
:param server_url: Override the default server URL for this method
|
|
525
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
526
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
527
|
-
"""
|
|
528
|
-
base_url = None
|
|
529
|
-
url_variables = None
|
|
530
|
-
if timeout_ms is None:
|
|
531
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
532
|
-
|
|
533
|
-
if server_url is not None:
|
|
534
|
-
base_url = server_url
|
|
535
|
-
else:
|
|
536
|
-
base_url = self._get_url(base_url, url_variables)
|
|
537
|
-
|
|
538
|
-
request = models.AaveLoopRequest(
|
|
539
|
-
chain=chain,
|
|
540
|
-
sender=sender,
|
|
541
|
-
signed_authorization=utils.get_pydantic_model(
|
|
542
|
-
signed_authorization, models.SignedAuthorization
|
|
543
|
-
),
|
|
544
|
-
collateral_token=collateral_token,
|
|
545
|
-
borrow_token=borrow_token,
|
|
546
|
-
initial_collateral_amount=initial_collateral_amount,
|
|
547
|
-
multiplier=multiplier,
|
|
548
|
-
max_slippage_percent=max_slippage_percent,
|
|
549
|
-
loan_to_value=loan_to_value,
|
|
550
|
-
)
|
|
551
|
-
|
|
552
|
-
req = self._build_request(
|
|
553
|
-
method="POST",
|
|
554
|
-
path="/v0/multicall/aave/loop",
|
|
555
|
-
base_url=base_url,
|
|
556
|
-
url_variables=url_variables,
|
|
557
|
-
request=request,
|
|
558
|
-
request_body_required=True,
|
|
559
|
-
request_has_path_params=False,
|
|
560
|
-
request_has_query_params=True,
|
|
561
|
-
user_agent_header="user-agent",
|
|
562
|
-
accept_header_value="application/json",
|
|
563
|
-
http_headers=http_headers,
|
|
564
|
-
security=self.sdk_configuration.security,
|
|
565
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
566
|
-
request, False, False, "json", models.AaveLoopRequest
|
|
567
|
-
),
|
|
568
|
-
timeout_ms=timeout_ms,
|
|
569
|
-
)
|
|
570
|
-
|
|
571
|
-
if retries == UNSET:
|
|
572
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
573
|
-
retries = self.sdk_configuration.retry_config
|
|
574
|
-
|
|
575
|
-
retry_config = None
|
|
576
|
-
if isinstance(retries, utils.RetryConfig):
|
|
577
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
578
|
-
|
|
579
|
-
http_res = self.do_request(
|
|
580
|
-
hook_ctx=HookContext(
|
|
581
|
-
config=self.sdk_configuration,
|
|
582
|
-
base_url=base_url or "",
|
|
583
|
-
operation_id="multicall_aave_loop",
|
|
584
|
-
oauth2_scopes=[],
|
|
585
|
-
security_source=self.sdk_configuration.security,
|
|
586
|
-
),
|
|
587
|
-
request=req,
|
|
588
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
589
|
-
retry_config=retry_config,
|
|
590
|
-
)
|
|
591
|
-
|
|
592
|
-
response_data: Any = None
|
|
593
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
594
|
-
return utils.unmarshal_json(
|
|
595
|
-
http_res.text, models.UnsignedMulticallTransaction
|
|
596
|
-
)
|
|
597
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
598
|
-
response_data = utils.unmarshal_json(
|
|
599
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
600
|
-
)
|
|
601
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
602
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
603
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
604
|
-
raise errors.APIError(
|
|
605
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
606
|
-
)
|
|
607
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
608
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
609
|
-
raise errors.APIError(
|
|
610
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
611
|
-
)
|
|
612
|
-
|
|
613
|
-
content_type = http_res.headers.get("Content-Type")
|
|
614
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
615
|
-
raise errors.APIError(
|
|
616
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
617
|
-
http_res.status_code,
|
|
618
|
-
http_res_text,
|
|
619
|
-
http_res,
|
|
620
|
-
)
|
|
621
|
-
|
|
622
|
-
async def aave_loop_async(
|
|
623
|
-
self,
|
|
624
|
-
*,
|
|
625
|
-
chain: models.Chain,
|
|
626
|
-
sender: str,
|
|
627
|
-
signed_authorization: Union[
|
|
628
|
-
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
629
|
-
],
|
|
630
|
-
collateral_token: models.TokenEnum,
|
|
631
|
-
borrow_token: models.TokenEnum,
|
|
632
|
-
initial_collateral_amount: Union[
|
|
633
|
-
models.InitialCollateralAmount, models.InitialCollateralAmountTypedDict
|
|
634
|
-
],
|
|
635
|
-
multiplier: Union[models.Multiplier, models.MultiplierTypedDict],
|
|
636
|
-
max_slippage_percent: Union[
|
|
637
|
-
models.MaxSlippagePercent, models.MaxSlippagePercentTypedDict
|
|
638
|
-
],
|
|
639
|
-
loan_to_value: Union[models.LoanToValue, models.LoanToValueTypedDict],
|
|
640
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
641
|
-
server_url: Optional[str] = None,
|
|
642
|
-
timeout_ms: Optional[int] = None,
|
|
643
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
644
|
-
) -> models.UnsignedMulticallTransaction:
|
|
645
|
-
r"""AAVE leverage long/short
|
|
646
|
-
|
|
647
|
-
Execute an Aave looping strategy that involves repeated supply and borrow
|
|
648
|
-
operations.
|
|
649
|
-
|
|
650
|
-
This endpoint creates a multicall transaction that performs a series of operations:
|
|
651
|
-
1. Approves and supplies initial token
|
|
652
|
-
2. For each loop:
|
|
653
|
-
- Borrows another token
|
|
654
|
-
- Swaps borrowed token back to supply token
|
|
655
|
-
- Supplies the swapped tokens
|
|
656
|
-
|
|
657
|
-
The transaction must be authorized using the /authorization endpoint to prevent replay attacks.
|
|
658
|
-
|
|
659
|
-
:param chain: The chain to use.
|
|
660
|
-
:param sender: The address of the transaction sender.
|
|
661
|
-
:param signed_authorization:
|
|
662
|
-
:param collateral_token: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
|
|
663
|
-
:param borrow_token: A class representing the token. This class is used to represent the token in the system. Notice individual endpoints' documentation where per chain tokens are presented.
|
|
664
|
-
:param initial_collateral_amount: Amount of collateral token to supply to Aave
|
|
665
|
-
:param multiplier: Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
|
|
666
|
-
:param max_slippage_percent: Maximum allowed slippage for token swaps in percentage
|
|
667
|
-
:param loan_to_value: Loan To Value percentage of the loop
|
|
668
|
-
:param retries: Override the default retry configuration for this method
|
|
669
|
-
:param server_url: Override the default server URL for this method
|
|
670
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
671
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
672
|
-
"""
|
|
673
|
-
base_url = None
|
|
674
|
-
url_variables = None
|
|
675
|
-
if timeout_ms is None:
|
|
676
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
677
|
-
|
|
678
|
-
if server_url is not None:
|
|
679
|
-
base_url = server_url
|
|
680
|
-
else:
|
|
681
|
-
base_url = self._get_url(base_url, url_variables)
|
|
682
|
-
|
|
683
|
-
request = models.AaveLoopRequest(
|
|
684
|
-
chain=chain,
|
|
685
|
-
sender=sender,
|
|
686
|
-
signed_authorization=utils.get_pydantic_model(
|
|
687
|
-
signed_authorization, models.SignedAuthorization
|
|
688
|
-
),
|
|
689
|
-
collateral_token=collateral_token,
|
|
690
|
-
borrow_token=borrow_token,
|
|
691
|
-
initial_collateral_amount=initial_collateral_amount,
|
|
692
|
-
multiplier=multiplier,
|
|
693
|
-
max_slippage_percent=max_slippage_percent,
|
|
694
|
-
loan_to_value=loan_to_value,
|
|
695
|
-
)
|
|
696
|
-
|
|
697
|
-
req = self._build_request_async(
|
|
698
|
-
method="POST",
|
|
699
|
-
path="/v0/multicall/aave/loop",
|
|
700
|
-
base_url=base_url,
|
|
701
|
-
url_variables=url_variables,
|
|
702
|
-
request=request,
|
|
703
|
-
request_body_required=True,
|
|
704
|
-
request_has_path_params=False,
|
|
705
|
-
request_has_query_params=True,
|
|
706
|
-
user_agent_header="user-agent",
|
|
707
|
-
accept_header_value="application/json",
|
|
708
|
-
http_headers=http_headers,
|
|
709
|
-
security=self.sdk_configuration.security,
|
|
710
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
711
|
-
request, False, False, "json", models.AaveLoopRequest
|
|
712
|
-
),
|
|
713
|
-
timeout_ms=timeout_ms,
|
|
714
|
-
)
|
|
715
|
-
|
|
716
|
-
if retries == UNSET:
|
|
717
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
718
|
-
retries = self.sdk_configuration.retry_config
|
|
719
|
-
|
|
720
|
-
retry_config = None
|
|
721
|
-
if isinstance(retries, utils.RetryConfig):
|
|
722
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
723
|
-
|
|
724
|
-
http_res = await self.do_request_async(
|
|
725
|
-
hook_ctx=HookContext(
|
|
726
|
-
config=self.sdk_configuration,
|
|
727
|
-
base_url=base_url or "",
|
|
728
|
-
operation_id="multicall_aave_loop",
|
|
729
|
-
oauth2_scopes=[],
|
|
730
|
-
security_source=self.sdk_configuration.security,
|
|
731
|
-
),
|
|
732
|
-
request=req,
|
|
733
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
734
|
-
retry_config=retry_config,
|
|
735
|
-
)
|
|
736
|
-
|
|
737
|
-
response_data: Any = None
|
|
738
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
739
|
-
return utils.unmarshal_json(
|
|
740
|
-
http_res.text, models.UnsignedMulticallTransaction
|
|
741
|
-
)
|
|
742
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
743
|
-
response_data = utils.unmarshal_json(
|
|
744
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
745
|
-
)
|
|
746
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
747
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
748
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
749
|
-
raise errors.APIError(
|
|
750
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
751
|
-
)
|
|
752
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
753
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
754
|
-
raise errors.APIError(
|
|
755
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
756
|
-
)
|
|
757
|
-
|
|
758
|
-
content_type = http_res.headers.get("Content-Type")
|
|
759
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
760
|
-
raise errors.APIError(
|
|
761
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
762
|
-
http_res.status_code,
|
|
763
|
-
http_res_text,
|
|
764
|
-
http_res,
|
|
765
|
-
)
|
|
File without changes
|