compass_api_sdk 1.1.2__py3-none-any.whl → 1.1.3rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of compass_api_sdk might be problematic. Click here for more details.
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/aave_v3.py +44 -44
- compass_api_sdk/aerodrome_slipstream.py +32 -32
- compass_api_sdk/models/__init__.py +0 -254
- compass_api_sdk/models/aaveborrowparams.py +4 -13
- compass_api_sdk/models/aaveborrowrequest.py +4 -13
- compass_api_sdk/models/aavelooprequest.py +8 -25
- compass_api_sdk/models/aaverepayparams.py +4 -13
- compass_api_sdk/models/aaverepayrequest.py +4 -13
- compass_api_sdk/models/aavesupplyparams.py +4 -13
- compass_api_sdk/models/aavesupplyrequest.py +4 -13
- compass_api_sdk/models/aavewithdrawparams.py +4 -13
- compass_api_sdk/models/aavewithdrawrequest.py +4 -13
- compass_api_sdk/models/aerodromeposition.py +4 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +8 -25
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +8 -25
- compass_api_sdk/models/batcheduseroperationsrequest.py +8 -2
- compass_api_sdk/models/compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py +4 -13
- compass_api_sdk/models/odosswapparams.py +4 -25
- compass_api_sdk/models/odosswaprequest.py +4 -27
- compass_api_sdk/models/pendlemanageliquidityparams.py +2 -15
- compass_api_sdk/models/pendlemanageliquidityrequest.py +2 -15
- compass_api_sdk/models/pendletradeptparams.py +2 -15
- compass_api_sdk/models/pendletradeptrequest.py +2 -15
- compass_api_sdk/models/pendletradeytparams.py +2 -15
- compass_api_sdk/models/pendletradeytrequest.py +2 -15
- compass_api_sdk/models/reserve.py +6 -15
- compass_api_sdk/models/setallowanceparams.py +2 -15
- compass_api_sdk/models/setallowancerequest.py +2 -15
- compass_api_sdk/models/skysellrequest.py +4 -4
- compass_api_sdk/models/tokenbalanceresponse.py +5 -15
- compass_api_sdk/models/tokentransferparams.py +2 -15
- compass_api_sdk/models/tokentransferrequest.py +2 -15
- compass_api_sdk/models/uniswapbuyexactlyparams.py +8 -33
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +8 -33
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +8 -25
- compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
- compass_api_sdk/models/uniswapsellexactlyparams.py +4 -29
- compass_api_sdk/models/uniswapsellexactlyrequest.py +4 -29
- compass_api_sdk/models/v1_aave_avg_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_liquidity_changeop.py +5 -83
- compass_api_sdk/models/v1_aave_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_reserve_overviewop.py +5 -83
- compass_api_sdk/models/v1_aave_std_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_token_priceop.py +5 -83
- compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +5 -83
- compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +10 -166
- compass_api_sdk/models/v1_generic_allowanceop.py +7 -21
- compass_api_sdk/models/v1_morpho_marketsop.py +9 -29
- compass_api_sdk/models/v1_morpho_vaultsop.py +5 -15
- compass_api_sdk/models/v1_sky_positionop.py +4 -5
- compass_api_sdk/models/v1_token_balanceop.py +10 -23
- compass_api_sdk/models/v1_token_priceop.py +7 -8
- compass_api_sdk/models/v1_uniswap_pool_priceop.py +10 -166
- compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +10 -166
- compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +10 -166
- compass_api_sdk/morpho.py +12 -24
- compass_api_sdk/pendle.py +6 -20
- compass_api_sdk/sdk.py +3 -3
- compass_api_sdk/sky.py +14 -16
- compass_api_sdk/swap.py +4 -12
- compass_api_sdk/{token_sdk.py → token.py} +13 -197
- compass_api_sdk/transaction_bundler.py +8 -8
- compass_api_sdk/uniswap_v3.py +44 -68
- compass_api_sdk/universal.py +6 -188
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3rc0.dist-info}/METADATA +5 -7
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3rc0.dist-info}/RECORD +74 -79
- compass_api_sdk/models/token_enum.py +0 -81
- compass_api_sdk/models/tokenaddressresponse.py +0 -15
- compass_api_sdk/models/tokeninfo.py +0 -17
- compass_api_sdk/models/v1_generic_supported_tokensop.py +0 -24
- compass_api_sdk/models/v1_token_addressop.py +0 -109
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3rc0.dist-info}/WHEEL +0 -0
compass_api_sdk/pendle.py
CHANGED
|
@@ -568,9 +568,7 @@ class Pendle(BaseSDK):
|
|
|
568
568
|
*,
|
|
569
569
|
market_address: str,
|
|
570
570
|
action: models.PendleTradePtRequestAction,
|
|
571
|
-
token:
|
|
572
|
-
models.PendleTradePtRequestToken, models.PendleTradePtRequestTokenTypedDict
|
|
573
|
-
],
|
|
571
|
+
token: str,
|
|
574
572
|
amount_in: Union[
|
|
575
573
|
models.PendleTradePtRequestAmountIn,
|
|
576
574
|
models.PendleTradePtRequestAmountInTypedDict,
|
|
@@ -694,9 +692,7 @@ class Pendle(BaseSDK):
|
|
|
694
692
|
*,
|
|
695
693
|
market_address: str,
|
|
696
694
|
action: models.PendleTradePtRequestAction,
|
|
697
|
-
token:
|
|
698
|
-
models.PendleTradePtRequestToken, models.PendleTradePtRequestTokenTypedDict
|
|
699
|
-
],
|
|
695
|
+
token: str,
|
|
700
696
|
amount_in: Union[
|
|
701
697
|
models.PendleTradePtRequestAmountIn,
|
|
702
698
|
models.PendleTradePtRequestAmountInTypedDict,
|
|
@@ -820,9 +816,7 @@ class Pendle(BaseSDK):
|
|
|
820
816
|
*,
|
|
821
817
|
market_address: str,
|
|
822
818
|
action: models.PendleTradeYtRequestAction,
|
|
823
|
-
token:
|
|
824
|
-
models.PendleTradeYtRequestToken, models.PendleTradeYtRequestTokenTypedDict
|
|
825
|
-
],
|
|
819
|
+
token: str,
|
|
826
820
|
amount_in: Union[
|
|
827
821
|
models.PendleTradeYtRequestAmountIn,
|
|
828
822
|
models.PendleTradeYtRequestAmountInTypedDict,
|
|
@@ -946,9 +940,7 @@ class Pendle(BaseSDK):
|
|
|
946
940
|
*,
|
|
947
941
|
market_address: str,
|
|
948
942
|
action: models.PendleTradeYtRequestAction,
|
|
949
|
-
token:
|
|
950
|
-
models.PendleTradeYtRequestToken, models.PendleTradeYtRequestTokenTypedDict
|
|
951
|
-
],
|
|
943
|
+
token: str,
|
|
952
944
|
amount_in: Union[
|
|
953
945
|
models.PendleTradeYtRequestAmountIn,
|
|
954
946
|
models.PendleTradeYtRequestAmountInTypedDict,
|
|
@@ -1072,10 +1064,7 @@ class Pendle(BaseSDK):
|
|
|
1072
1064
|
*,
|
|
1073
1065
|
market_address: str,
|
|
1074
1066
|
action: models.PendleManageLiquidityRequestAction,
|
|
1075
|
-
token:
|
|
1076
|
-
models.PendleManageLiquidityRequestToken,
|
|
1077
|
-
models.PendleManageLiquidityRequestTokenTypedDict,
|
|
1078
|
-
],
|
|
1067
|
+
token: str,
|
|
1079
1068
|
amount_in: Union[
|
|
1080
1069
|
models.PendleManageLiquidityRequestAmountIn,
|
|
1081
1070
|
models.PendleManageLiquidityRequestAmountInTypedDict,
|
|
@@ -1202,10 +1191,7 @@ class Pendle(BaseSDK):
|
|
|
1202
1191
|
*,
|
|
1203
1192
|
market_address: str,
|
|
1204
1193
|
action: models.PendleManageLiquidityRequestAction,
|
|
1205
|
-
token:
|
|
1206
|
-
models.PendleManageLiquidityRequestToken,
|
|
1207
|
-
models.PendleManageLiquidityRequestTokenTypedDict,
|
|
1208
|
-
],
|
|
1194
|
+
token: str,
|
|
1209
1195
|
amount_in: Union[
|
|
1210
1196
|
models.PendleManageLiquidityRequestAmountIn,
|
|
1211
1197
|
models.PendleManageLiquidityRequestAmountInTypedDict,
|
compass_api_sdk/sdk.py
CHANGED
|
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
|
|
|
24
24
|
from compass_api_sdk.sky import Sky
|
|
25
25
|
from compass_api_sdk.smart_account import SmartAccount
|
|
26
26
|
from compass_api_sdk.swap import Swap
|
|
27
|
-
from compass_api_sdk.
|
|
27
|
+
from compass_api_sdk.token import Token
|
|
28
28
|
from compass_api_sdk.transaction_bundler import TransactionBundler
|
|
29
29
|
from compass_api_sdk.uniswap_v3 import UniswapV3
|
|
30
30
|
from compass_api_sdk.universal import Universal
|
|
@@ -37,7 +37,7 @@ class CompassAPI(BaseSDK):
|
|
|
37
37
|
aerodrome_slipstream: "AerodromeSlipstream"
|
|
38
38
|
morpho: "Morpho"
|
|
39
39
|
sky: "Sky"
|
|
40
|
-
token: "
|
|
40
|
+
token: "Token"
|
|
41
41
|
uniswap_v3: "UniswapV3"
|
|
42
42
|
universal: "Universal"
|
|
43
43
|
pendle: "Pendle"
|
|
@@ -54,7 +54,7 @@ class CompassAPI(BaseSDK):
|
|
|
54
54
|
),
|
|
55
55
|
"morpho": ("compass_api_sdk.morpho", "Morpho"),
|
|
56
56
|
"sky": ("compass_api_sdk.sky", "Sky"),
|
|
57
|
-
"token": ("compass_api_sdk.
|
|
57
|
+
"token": ("compass_api_sdk.token", "Token"),
|
|
58
58
|
"uniswap_v3": ("compass_api_sdk.uniswap_v3", "UniswapV3"),
|
|
59
59
|
"universal": ("compass_api_sdk.universal", "Universal"),
|
|
60
60
|
"pendle": ("compass_api_sdk.pendle", "Pendle"),
|
compass_api_sdk/sky.py
CHANGED
|
@@ -12,8 +12,8 @@ class Sky(BaseSDK):
|
|
|
12
12
|
def sky_position(
|
|
13
13
|
self,
|
|
14
14
|
*,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
chain: models.V1SkyPositionChain = models.V1SkyPositionChain.ETHEREUM,
|
|
16
|
+
user_address: str = "0xacCEE9C7A5a759f814C7A770e2D8F78d662b1F60",
|
|
17
17
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
18
18
|
server_url: Optional[str] = None,
|
|
19
19
|
timeout_ms: Optional[int] = None,
|
|
@@ -23,8 +23,8 @@ class Sky(BaseSDK):
|
|
|
23
23
|
|
|
24
24
|
Check the USDS overall position.
|
|
25
25
|
|
|
26
|
-
:param user_address: The user-address of the desired position.
|
|
27
26
|
:param chain:
|
|
27
|
+
:param user_address: The user-address of the desired position.
|
|
28
28
|
:param retries: Override the default retry configuration for this method
|
|
29
29
|
:param server_url: Override the default server URL for this method
|
|
30
30
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -102,8 +102,8 @@ class Sky(BaseSDK):
|
|
|
102
102
|
async def sky_position_async(
|
|
103
103
|
self,
|
|
104
104
|
*,
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
chain: models.V1SkyPositionChain = models.V1SkyPositionChain.ETHEREUM,
|
|
106
|
+
user_address: str = "0xacCEE9C7A5a759f814C7A770e2D8F78d662b1F60",
|
|
107
107
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
108
108
|
server_url: Optional[str] = None,
|
|
109
109
|
timeout_ms: Optional[int] = None,
|
|
@@ -113,8 +113,8 @@ class Sky(BaseSDK):
|
|
|
113
113
|
|
|
114
114
|
Check the USDS overall position.
|
|
115
115
|
|
|
116
|
-
:param user_address: The user-address of the desired position.
|
|
117
116
|
:param chain:
|
|
117
|
+
:param user_address: The user-address of the desired position.
|
|
118
118
|
:param retries: Override the default retry configuration for this method
|
|
119
119
|
:param server_url: Override the default server URL for this method
|
|
120
120
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -216,6 +216,7 @@ class Sky(BaseSDK):
|
|
|
216
216
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
217
217
|
|
|
218
218
|
- `SkyUsdcUsdsConverter`
|
|
219
|
+
- `SkyDaiUsdsConverter`
|
|
219
220
|
</Info>
|
|
220
221
|
|
|
221
222
|
|
|
@@ -329,6 +330,7 @@ class Sky(BaseSDK):
|
|
|
329
330
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
330
331
|
|
|
331
332
|
- `SkyUsdcUsdsConverter`
|
|
333
|
+
- `SkyDaiUsdsConverter`
|
|
332
334
|
</Info>
|
|
333
335
|
|
|
334
336
|
|
|
@@ -422,10 +424,8 @@ class Sky(BaseSDK):
|
|
|
422
424
|
amount: Union[
|
|
423
425
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
424
426
|
],
|
|
427
|
+
chain: models.SkySellRequestChain,
|
|
425
428
|
sender: str,
|
|
426
|
-
chain: Optional[
|
|
427
|
-
models.SkySellRequestChain
|
|
428
|
-
] = models.SkySellRequestChain.ETHEREUM,
|
|
429
429
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
430
430
|
server_url: Optional[str] = None,
|
|
431
431
|
timeout_ms: Optional[int] = None,
|
|
@@ -446,13 +446,14 @@ class Sky(BaseSDK):
|
|
|
446
446
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
447
447
|
|
|
448
448
|
- `SkyUsdcUsdsConverter`
|
|
449
|
+
- `SkyDaiUsdsConverter`
|
|
449
450
|
</Info>
|
|
450
451
|
|
|
451
452
|
|
|
452
453
|
:param token_out: The token you would like to swap 1:1 with USDS. Choose from DAI or USDC.
|
|
453
454
|
:param amount: The amount of USDS you would like to sell 1:1 for 'token_out'.
|
|
454
|
-
:param sender: The address of the transaction sender.
|
|
455
455
|
:param chain:
|
|
456
|
+
:param sender: The address of the transaction sender.
|
|
456
457
|
:param retries: Override the default retry configuration for this method
|
|
457
458
|
:param server_url: Override the default server URL for this method
|
|
458
459
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -539,10 +540,8 @@ class Sky(BaseSDK):
|
|
|
539
540
|
amount: Union[
|
|
540
541
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
541
542
|
],
|
|
543
|
+
chain: models.SkySellRequestChain,
|
|
542
544
|
sender: str,
|
|
543
|
-
chain: Optional[
|
|
544
|
-
models.SkySellRequestChain
|
|
545
|
-
] = models.SkySellRequestChain.ETHEREUM,
|
|
546
545
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
547
546
|
server_url: Optional[str] = None,
|
|
548
547
|
timeout_ms: Optional[int] = None,
|
|
@@ -563,13 +562,14 @@ class Sky(BaseSDK):
|
|
|
563
562
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
564
563
|
|
|
565
564
|
- `SkyUsdcUsdsConverter`
|
|
565
|
+
- `SkyDaiUsdsConverter`
|
|
566
566
|
</Info>
|
|
567
567
|
|
|
568
568
|
|
|
569
569
|
:param token_out: The token you would like to swap 1:1 with USDS. Choose from DAI or USDC.
|
|
570
570
|
:param amount: The amount of USDS you would like to sell 1:1 for 'token_out'.
|
|
571
|
-
:param sender: The address of the transaction sender.
|
|
572
571
|
:param chain:
|
|
572
|
+
:param sender: The address of the transaction sender.
|
|
573
573
|
:param retries: Override the default retry configuration for this method
|
|
574
574
|
:param server_url: Override the default server URL for this method
|
|
575
575
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -905,7 +905,6 @@ class Sky(BaseSDK):
|
|
|
905
905
|
|
|
906
906
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
907
907
|
|
|
908
|
-
- `SkyUsdcUsdsConverter`
|
|
909
908
|
- `SkyUsdsVault`
|
|
910
909
|
</Info>
|
|
911
910
|
|
|
@@ -1019,7 +1018,6 @@ class Sky(BaseSDK):
|
|
|
1019
1018
|
|
|
1020
1019
|
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1021
1020
|
|
|
1022
|
-
- `SkyUsdcUsdsConverter`
|
|
1023
1021
|
- `SkyUsdsVault`
|
|
1024
1022
|
</Info>
|
|
1025
1023
|
|
compass_api_sdk/swap.py
CHANGED
|
@@ -12,12 +12,8 @@ class Swap(BaseSDK):
|
|
|
12
12
|
def swap_odos(
|
|
13
13
|
self,
|
|
14
14
|
*,
|
|
15
|
-
token_in:
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
token_out: Union[
|
|
19
|
-
models.OdosSwapRequestTokenOut, models.OdosSwapRequestTokenOutTypedDict
|
|
20
|
-
],
|
|
15
|
+
token_in: str,
|
|
16
|
+
token_out: str,
|
|
21
17
|
amount: Union[
|
|
22
18
|
models.OdosSwapRequestAmount, models.OdosSwapRequestAmountTypedDict
|
|
23
19
|
],
|
|
@@ -131,12 +127,8 @@ class Swap(BaseSDK):
|
|
|
131
127
|
async def swap_odos_async(
|
|
132
128
|
self,
|
|
133
129
|
*,
|
|
134
|
-
token_in:
|
|
135
|
-
|
|
136
|
-
],
|
|
137
|
-
token_out: Union[
|
|
138
|
-
models.OdosSwapRequestTokenOut, models.OdosSwapRequestTokenOutTypedDict
|
|
139
|
-
],
|
|
130
|
+
token_in: str,
|
|
131
|
+
token_out: str,
|
|
140
132
|
amount: Union[
|
|
141
133
|
models.OdosSwapRequestAmount, models.OdosSwapRequestAmountTypedDict
|
|
142
134
|
],
|
|
@@ -8,192 +8,12 @@ from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_respons
|
|
|
8
8
|
from typing import Any, Mapping, Optional, Union
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
12
|
-
def token_address(
|
|
13
|
-
self,
|
|
14
|
-
*,
|
|
15
|
-
chain: models.V1TokenAddressChain = models.V1TokenAddressChain.ARBITRUM,
|
|
16
|
-
token: models.V1TokenAddressToken = models.V1TokenAddressToken.WETH,
|
|
17
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
18
|
-
server_url: Optional[str] = None,
|
|
19
|
-
timeout_ms: Optional[int] = None,
|
|
20
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
21
|
-
) -> models.TokenAddressResponse:
|
|
22
|
-
r"""Token Address
|
|
23
|
-
|
|
24
|
-
This endpoint retrieves the address for a token supported by us.
|
|
25
|
-
|
|
26
|
-
:param chain:
|
|
27
|
-
:param token: The token symbol to get the address for..
|
|
28
|
-
:param retries: Override the default retry configuration for this method
|
|
29
|
-
:param server_url: Override the default server URL for this method
|
|
30
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
31
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
32
|
-
"""
|
|
33
|
-
base_url = None
|
|
34
|
-
url_variables = None
|
|
35
|
-
if timeout_ms is None:
|
|
36
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
37
|
-
|
|
38
|
-
if server_url is not None:
|
|
39
|
-
base_url = server_url
|
|
40
|
-
else:
|
|
41
|
-
base_url = self._get_url(base_url, url_variables)
|
|
42
|
-
|
|
43
|
-
request = models.V1TokenAddressRequest(
|
|
44
|
-
chain=chain,
|
|
45
|
-
token=token,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
req = self._build_request(
|
|
49
|
-
method="GET",
|
|
50
|
-
path="/v1/token/address",
|
|
51
|
-
base_url=base_url,
|
|
52
|
-
url_variables=url_variables,
|
|
53
|
-
request=request,
|
|
54
|
-
request_body_required=False,
|
|
55
|
-
request_has_path_params=False,
|
|
56
|
-
request_has_query_params=True,
|
|
57
|
-
user_agent_header="user-agent",
|
|
58
|
-
accept_header_value="application/json",
|
|
59
|
-
http_headers=http_headers,
|
|
60
|
-
security=self.sdk_configuration.security,
|
|
61
|
-
timeout_ms=timeout_ms,
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
if retries == UNSET:
|
|
65
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
66
|
-
retries = self.sdk_configuration.retry_config
|
|
67
|
-
|
|
68
|
-
retry_config = None
|
|
69
|
-
if isinstance(retries, utils.RetryConfig):
|
|
70
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
71
|
-
|
|
72
|
-
http_res = self.do_request(
|
|
73
|
-
hook_ctx=HookContext(
|
|
74
|
-
config=self.sdk_configuration,
|
|
75
|
-
base_url=base_url or "",
|
|
76
|
-
operation_id="v1_token_address",
|
|
77
|
-
oauth2_scopes=[],
|
|
78
|
-
security_source=self.sdk_configuration.security,
|
|
79
|
-
),
|
|
80
|
-
request=req,
|
|
81
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
82
|
-
retry_config=retry_config,
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
response_data: Any = None
|
|
86
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
87
|
-
return unmarshal_json_response(models.TokenAddressResponse, http_res)
|
|
88
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
89
|
-
response_data = unmarshal_json_response(
|
|
90
|
-
errors.HTTPValidationErrorData, http_res
|
|
91
|
-
)
|
|
92
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
93
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
94
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
95
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
96
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
97
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
98
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
99
|
-
|
|
100
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
101
|
-
|
|
102
|
-
async def token_address_async(
|
|
103
|
-
self,
|
|
104
|
-
*,
|
|
105
|
-
chain: models.V1TokenAddressChain = models.V1TokenAddressChain.ARBITRUM,
|
|
106
|
-
token: models.V1TokenAddressToken = models.V1TokenAddressToken.WETH,
|
|
107
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
108
|
-
server_url: Optional[str] = None,
|
|
109
|
-
timeout_ms: Optional[int] = None,
|
|
110
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
111
|
-
) -> models.TokenAddressResponse:
|
|
112
|
-
r"""Token Address
|
|
113
|
-
|
|
114
|
-
This endpoint retrieves the address for a token supported by us.
|
|
115
|
-
|
|
116
|
-
:param chain:
|
|
117
|
-
:param token: The token symbol to get the address for..
|
|
118
|
-
:param retries: Override the default retry configuration for this method
|
|
119
|
-
:param server_url: Override the default server URL for this method
|
|
120
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
121
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
122
|
-
"""
|
|
123
|
-
base_url = None
|
|
124
|
-
url_variables = None
|
|
125
|
-
if timeout_ms is None:
|
|
126
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
127
|
-
|
|
128
|
-
if server_url is not None:
|
|
129
|
-
base_url = server_url
|
|
130
|
-
else:
|
|
131
|
-
base_url = self._get_url(base_url, url_variables)
|
|
132
|
-
|
|
133
|
-
request = models.V1TokenAddressRequest(
|
|
134
|
-
chain=chain,
|
|
135
|
-
token=token,
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
req = self._build_request_async(
|
|
139
|
-
method="GET",
|
|
140
|
-
path="/v1/token/address",
|
|
141
|
-
base_url=base_url,
|
|
142
|
-
url_variables=url_variables,
|
|
143
|
-
request=request,
|
|
144
|
-
request_body_required=False,
|
|
145
|
-
request_has_path_params=False,
|
|
146
|
-
request_has_query_params=True,
|
|
147
|
-
user_agent_header="user-agent",
|
|
148
|
-
accept_header_value="application/json",
|
|
149
|
-
http_headers=http_headers,
|
|
150
|
-
security=self.sdk_configuration.security,
|
|
151
|
-
timeout_ms=timeout_ms,
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
if retries == UNSET:
|
|
155
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
156
|
-
retries = self.sdk_configuration.retry_config
|
|
157
|
-
|
|
158
|
-
retry_config = None
|
|
159
|
-
if isinstance(retries, utils.RetryConfig):
|
|
160
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
161
|
-
|
|
162
|
-
http_res = await self.do_request_async(
|
|
163
|
-
hook_ctx=HookContext(
|
|
164
|
-
config=self.sdk_configuration,
|
|
165
|
-
base_url=base_url or "",
|
|
166
|
-
operation_id="v1_token_address",
|
|
167
|
-
oauth2_scopes=[],
|
|
168
|
-
security_source=self.sdk_configuration.security,
|
|
169
|
-
),
|
|
170
|
-
request=req,
|
|
171
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
172
|
-
retry_config=retry_config,
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
response_data: Any = None
|
|
176
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
177
|
-
return unmarshal_json_response(models.TokenAddressResponse, http_res)
|
|
178
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
179
|
-
response_data = unmarshal_json_response(
|
|
180
|
-
errors.HTTPValidationErrorData, http_res
|
|
181
|
-
)
|
|
182
|
-
raise errors.HTTPValidationError(response_data, http_res)
|
|
183
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
184
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
185
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
186
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
187
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
188
|
-
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
189
|
-
|
|
190
|
-
raise errors.APIError("Unexpected response received", http_res)
|
|
191
|
-
|
|
11
|
+
class Token(BaseSDK):
|
|
192
12
|
def token_price(
|
|
193
13
|
self,
|
|
194
14
|
*,
|
|
195
15
|
chain: models.V1TokenPriceChain = models.V1TokenPriceChain.ETHEREUM,
|
|
196
|
-
token:
|
|
16
|
+
token: str = "AAVE",
|
|
197
17
|
block: OptionalNullable[int] = UNSET,
|
|
198
18
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
199
19
|
server_url: Optional[str] = None,
|
|
@@ -209,7 +29,7 @@ class TokenSDK(BaseSDK):
|
|
|
209
29
|
with the update frequency of the oracle.
|
|
210
30
|
|
|
211
31
|
:param chain:
|
|
212
|
-
:param token: The symbol or address of the token for which to get the price
|
|
32
|
+
:param token: The symbol or address of the token for which to get the price..
|
|
213
33
|
:param block: Optional block number (defaults to latest).
|
|
214
34
|
:param retries: Override the default retry configuration for this method
|
|
215
35
|
:param server_url: Override the default server URL for this method
|
|
@@ -290,7 +110,7 @@ class TokenSDK(BaseSDK):
|
|
|
290
110
|
self,
|
|
291
111
|
*,
|
|
292
112
|
chain: models.V1TokenPriceChain = models.V1TokenPriceChain.ETHEREUM,
|
|
293
|
-
token:
|
|
113
|
+
token: str = "AAVE",
|
|
294
114
|
block: OptionalNullable[int] = UNSET,
|
|
295
115
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
296
116
|
server_url: Optional[str] = None,
|
|
@@ -306,7 +126,7 @@ class TokenSDK(BaseSDK):
|
|
|
306
126
|
with the update frequency of the oracle.
|
|
307
127
|
|
|
308
128
|
:param chain:
|
|
309
|
-
:param token: The symbol or address of the token for which to get the price
|
|
129
|
+
:param token: The symbol or address of the token for which to get the price..
|
|
310
130
|
:param block: Optional block number (defaults to latest).
|
|
311
131
|
:param retries: Override the default retry configuration for this method
|
|
312
132
|
:param server_url: Override the default server URL for this method
|
|
@@ -388,7 +208,7 @@ class TokenSDK(BaseSDK):
|
|
|
388
208
|
*,
|
|
389
209
|
chain: models.V1TokenBalanceChain = models.V1TokenBalanceChain.ARBITRUM,
|
|
390
210
|
user: str = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
391
|
-
token:
|
|
211
|
+
token: str = "USDC",
|
|
392
212
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
393
213
|
server_url: Optional[str] = None,
|
|
394
214
|
timeout_ms: Optional[int] = None,
|
|
@@ -399,8 +219,8 @@ class TokenSDK(BaseSDK):
|
|
|
399
219
|
Returns the balance of a specific ERC20 token for a given user address.
|
|
400
220
|
|
|
401
221
|
:param chain:
|
|
402
|
-
:param user: The user to get the
|
|
403
|
-
:param token: The symbol of the token for which the balance is checked
|
|
222
|
+
:param user: The user to get the token balance of.
|
|
223
|
+
:param token: The symbol or address of the token for which the balance is checked.
|
|
404
224
|
:param retries: Override the default retry configuration for this method
|
|
405
225
|
:param server_url: Override the default server URL for this method
|
|
406
226
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -481,7 +301,7 @@ class TokenSDK(BaseSDK):
|
|
|
481
301
|
*,
|
|
482
302
|
chain: models.V1TokenBalanceChain = models.V1TokenBalanceChain.ARBITRUM,
|
|
483
303
|
user: str = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
484
|
-
token:
|
|
304
|
+
token: str = "USDC",
|
|
485
305
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
486
306
|
server_url: Optional[str] = None,
|
|
487
307
|
timeout_ms: Optional[int] = None,
|
|
@@ -492,8 +312,8 @@ class TokenSDK(BaseSDK):
|
|
|
492
312
|
Returns the balance of a specific ERC20 token for a given user address.
|
|
493
313
|
|
|
494
314
|
:param chain:
|
|
495
|
-
:param user: The user to get the
|
|
496
|
-
:param token: The symbol of the token for which the balance is checked
|
|
315
|
+
:param user: The user to get the token balance of.
|
|
316
|
+
:param token: The symbol or address of the token for which the balance is checked.
|
|
497
317
|
:param retries: Override the default retry configuration for this method
|
|
498
318
|
:param server_url: Override the default server URL for this method
|
|
499
319
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -573,9 +393,7 @@ class TokenSDK(BaseSDK):
|
|
|
573
393
|
self,
|
|
574
394
|
*,
|
|
575
395
|
to: str,
|
|
576
|
-
token:
|
|
577
|
-
models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
|
|
578
|
-
],
|
|
396
|
+
token: str,
|
|
579
397
|
amount: Union[
|
|
580
398
|
models.TokenTransferRequestAmount,
|
|
581
399
|
models.TokenTransferRequestAmountTypedDict,
|
|
@@ -680,9 +498,7 @@ class TokenSDK(BaseSDK):
|
|
|
680
498
|
self,
|
|
681
499
|
*,
|
|
682
500
|
to: str,
|
|
683
|
-
token:
|
|
684
|
-
models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
|
|
685
|
-
],
|
|
501
|
+
token: str,
|
|
686
502
|
amount: Union[
|
|
687
503
|
models.TokenTransferRequestAmount,
|
|
688
504
|
models.TokenTransferRequestAmountTypedDict,
|
|
@@ -432,8 +432,8 @@ class TransactionBundler(BaseSDK):
|
|
|
432
432
|
*,
|
|
433
433
|
chain: models.AaveLoopRequestChain,
|
|
434
434
|
sender: str,
|
|
435
|
-
collateral_token:
|
|
436
|
-
borrow_token:
|
|
435
|
+
collateral_token: str,
|
|
436
|
+
borrow_token: str,
|
|
437
437
|
initial_collateral_amount: Union[
|
|
438
438
|
models.InitialCollateralAmount, models.InitialCollateralAmountTypedDict
|
|
439
439
|
],
|
|
@@ -467,8 +467,8 @@ class TransactionBundler(BaseSDK):
|
|
|
467
467
|
|
|
468
468
|
:param chain:
|
|
469
469
|
:param sender: The address of the transaction sender.
|
|
470
|
-
:param collateral_token:
|
|
471
|
-
:param borrow_token:
|
|
470
|
+
:param collateral_token: Symbol or address of token to supply to Aave..
|
|
471
|
+
:param borrow_token: Symbol or address of token to borrow from Aave..
|
|
472
472
|
:param initial_collateral_amount: Amount of collateral token to supply to Aave
|
|
473
473
|
:param multiplier: Leverage multiplier. Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
|
|
474
474
|
:param max_slippage_percent: Maximum allowed slippage for token swaps in percentage
|
|
@@ -569,8 +569,8 @@ class TransactionBundler(BaseSDK):
|
|
|
569
569
|
*,
|
|
570
570
|
chain: models.AaveLoopRequestChain,
|
|
571
571
|
sender: str,
|
|
572
|
-
collateral_token:
|
|
573
|
-
borrow_token:
|
|
572
|
+
collateral_token: str,
|
|
573
|
+
borrow_token: str,
|
|
574
574
|
initial_collateral_amount: Union[
|
|
575
575
|
models.InitialCollateralAmount, models.InitialCollateralAmountTypedDict
|
|
576
576
|
],
|
|
@@ -604,8 +604,8 @@ class TransactionBundler(BaseSDK):
|
|
|
604
604
|
|
|
605
605
|
:param chain:
|
|
606
606
|
:param sender: The address of the transaction sender.
|
|
607
|
-
:param collateral_token:
|
|
608
|
-
:param borrow_token:
|
|
607
|
+
:param collateral_token: Symbol or address of token to supply to Aave..
|
|
608
|
+
:param borrow_token: Symbol or address of token to borrow from Aave..
|
|
609
609
|
:param initial_collateral_amount: Amount of collateral token to supply to Aave
|
|
610
610
|
:param multiplier: Leverage multiplier. Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
|
|
611
611
|
:param max_slippage_percent: Maximum allowed slippage for token swaps in percentage
|