compass_api_sdk 0.6.1__py3-none-any.whl → 0.7.0__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/_hooks/types.py +7 -0
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/aave_v3.py +26 -0
- compass_api_sdk/aerodrome_slipstream.py +14 -0
- compass_api_sdk/basesdk.py +12 -20
- compass_api_sdk/models/__init__.py +106 -22
- compass_api_sdk/models/{tokenbalance.py → compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_pendle_read_response_positions_tokenbalance.py +18 -0
- compass_api_sdk/models/details.py +39 -0
- compass_api_sdk/models/increaseallowanceparams.py +20 -16
- compass_api_sdk/models/increaseallowancerequest.py +20 -16
- compass_api_sdk/models/lpbalance.py +20 -0
- compass_api_sdk/models/movement10percent.py +23 -0
- compass_api_sdk/models/multicallactiontype.py +0 -1
- compass_api_sdk/models/openposition.py +28 -0
- compass_api_sdk/models/pendle_marketop.py +1 -8
- compass_api_sdk/models/pendle_marketsop.py +73 -0
- compass_api_sdk/models/pendle_positionop.py +1 -1
- compass_api_sdk/models/pendle_positionsop.py +80 -0
- compass_api_sdk/models/pendlelistmarketsresponse.py +17 -0
- compass_api_sdk/models/pendlelistuserpositionsresponse.py +17 -0
- compass_api_sdk/models/pendlemarket.py +46 -0
- compass_api_sdk/models/portfolio.py +10 -3
- compass_api_sdk/models/position.py +41 -0
- compass_api_sdk/models/syposition.py +17 -0
- compass_api_sdk/models/useroperation.py +20 -26
- compass_api_sdk/models/yieldrange.py +16 -0
- compass_api_sdk/morpho.py +28 -0
- compass_api_sdk/pendle.py +422 -10
- compass_api_sdk/sdk.py +3 -3
- compass_api_sdk/sdkconfiguration.py +0 -7
- compass_api_sdk/sky.py +10 -0
- compass_api_sdk/smart_account.py +2 -0
- compass_api_sdk/token_sdk.py +8 -0
- compass_api_sdk/transaction_batching.py +6 -0
- compass_api_sdk/uniswap_v3.py +20 -0
- compass_api_sdk/universal.py +30 -8
- {compass_api_sdk-0.6.1.dist-info → compass_api_sdk-0.7.0.dist-info}/METADATA +5 -2
- {compass_api_sdk-0.6.1.dist-info → compass_api_sdk-0.7.0.dist-info}/RECORD +40 -29
- compass_api_sdk/models/contractname.py +0 -41
- compass_api_sdk/models/increaseallowanceanyparams.py +0 -58
- {compass_api_sdk-0.6.1.dist-info → compass_api_sdk-0.7.0.dist-info}/WHEEL +0 -0
compass_api_sdk/pendle.py
CHANGED
|
@@ -13,7 +13,7 @@ class Pendle(BaseSDK):
|
|
|
13
13
|
*,
|
|
14
14
|
chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
|
|
15
15
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
16
|
-
market_address: str = "
|
|
16
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
17
17
|
block: OptionalNullable[int] = UNSET,
|
|
18
18
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
19
|
server_url: Optional[str] = None,
|
|
@@ -76,6 +76,7 @@ class Pendle(BaseSDK):
|
|
|
76
76
|
|
|
77
77
|
http_res = self.do_request(
|
|
78
78
|
hook_ctx=HookContext(
|
|
79
|
+
config=self.sdk_configuration,
|
|
79
80
|
base_url=base_url or "",
|
|
80
81
|
operation_id="pendle_position",
|
|
81
82
|
oauth2_scopes=[],
|
|
@@ -121,7 +122,7 @@ class Pendle(BaseSDK):
|
|
|
121
122
|
*,
|
|
122
123
|
chain: models.PendlePositionChain = models.PendlePositionChain.ETHEREUM_MAINNET,
|
|
123
124
|
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
124
|
-
market_address: str = "
|
|
125
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
125
126
|
block: OptionalNullable[int] = UNSET,
|
|
126
127
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
127
128
|
server_url: Optional[str] = None,
|
|
@@ -184,6 +185,7 @@ class Pendle(BaseSDK):
|
|
|
184
185
|
|
|
185
186
|
http_res = await self.do_request_async(
|
|
186
187
|
hook_ctx=HookContext(
|
|
188
|
+
config=self.sdk_configuration,
|
|
187
189
|
base_url=base_url or "",
|
|
188
190
|
operation_id="pendle_position",
|
|
189
191
|
oauth2_scopes=[],
|
|
@@ -224,12 +226,425 @@ class Pendle(BaseSDK):
|
|
|
224
226
|
http_res,
|
|
225
227
|
)
|
|
226
228
|
|
|
229
|
+
def positions(
|
|
230
|
+
self,
|
|
231
|
+
*,
|
|
232
|
+
chain: models.PendlePositionsChain = models.PendlePositionsChain.ETHEREUM_MAINNET,
|
|
233
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
234
|
+
block: OptionalNullable[int] = UNSET,
|
|
235
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
236
|
+
server_url: Optional[str] = None,
|
|
237
|
+
timeout_ms: Optional[int] = None,
|
|
238
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
239
|
+
) -> models.PendleListUserPositionsResponse:
|
|
240
|
+
r"""List User's Market Positions
|
|
241
|
+
|
|
242
|
+
List the user's SY, PT, YT and LP positions for all markets on a given chain.
|
|
243
|
+
|
|
244
|
+
:param chain: The chain to use.
|
|
245
|
+
:param user_address: The user address of the desired position.
|
|
246
|
+
:param block: Optional block number (defaults to latest).
|
|
247
|
+
:param retries: Override the default retry configuration for this method
|
|
248
|
+
:param server_url: Override the default server URL for this method
|
|
249
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
250
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
251
|
+
"""
|
|
252
|
+
base_url = None
|
|
253
|
+
url_variables = None
|
|
254
|
+
if timeout_ms is None:
|
|
255
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
256
|
+
|
|
257
|
+
if server_url is not None:
|
|
258
|
+
base_url = server_url
|
|
259
|
+
else:
|
|
260
|
+
base_url = self._get_url(base_url, url_variables)
|
|
261
|
+
|
|
262
|
+
request = models.PendlePositionsRequest(
|
|
263
|
+
chain=chain,
|
|
264
|
+
block=block,
|
|
265
|
+
user_address=user_address,
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
req = self._build_request(
|
|
269
|
+
method="GET",
|
|
270
|
+
path="/v0/pendle/positions",
|
|
271
|
+
base_url=base_url,
|
|
272
|
+
url_variables=url_variables,
|
|
273
|
+
request=request,
|
|
274
|
+
request_body_required=False,
|
|
275
|
+
request_has_path_params=False,
|
|
276
|
+
request_has_query_params=True,
|
|
277
|
+
user_agent_header="user-agent",
|
|
278
|
+
accept_header_value="application/json",
|
|
279
|
+
http_headers=http_headers,
|
|
280
|
+
security=self.sdk_configuration.security,
|
|
281
|
+
timeout_ms=timeout_ms,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
if retries == UNSET:
|
|
285
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
286
|
+
retries = self.sdk_configuration.retry_config
|
|
287
|
+
|
|
288
|
+
retry_config = None
|
|
289
|
+
if isinstance(retries, utils.RetryConfig):
|
|
290
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
291
|
+
|
|
292
|
+
http_res = self.do_request(
|
|
293
|
+
hook_ctx=HookContext(
|
|
294
|
+
config=self.sdk_configuration,
|
|
295
|
+
base_url=base_url or "",
|
|
296
|
+
operation_id="pendle_positions",
|
|
297
|
+
oauth2_scopes=[],
|
|
298
|
+
security_source=self.sdk_configuration.security,
|
|
299
|
+
),
|
|
300
|
+
request=req,
|
|
301
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
302
|
+
retry_config=retry_config,
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
response_data: Any = None
|
|
306
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
307
|
+
return utils.unmarshal_json(
|
|
308
|
+
http_res.text, models.PendleListUserPositionsResponse
|
|
309
|
+
)
|
|
310
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
311
|
+
response_data = utils.unmarshal_json(
|
|
312
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
313
|
+
)
|
|
314
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
315
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
316
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
317
|
+
raise errors.APIError(
|
|
318
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
319
|
+
)
|
|
320
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
321
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
322
|
+
raise errors.APIError(
|
|
323
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
content_type = http_res.headers.get("Content-Type")
|
|
327
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
328
|
+
raise errors.APIError(
|
|
329
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
330
|
+
http_res.status_code,
|
|
331
|
+
http_res_text,
|
|
332
|
+
http_res,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def positions_async(
|
|
336
|
+
self,
|
|
337
|
+
*,
|
|
338
|
+
chain: models.PendlePositionsChain = models.PendlePositionsChain.ETHEREUM_MAINNET,
|
|
339
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
340
|
+
block: OptionalNullable[int] = UNSET,
|
|
341
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
342
|
+
server_url: Optional[str] = None,
|
|
343
|
+
timeout_ms: Optional[int] = None,
|
|
344
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
345
|
+
) -> models.PendleListUserPositionsResponse:
|
|
346
|
+
r"""List User's Market Positions
|
|
347
|
+
|
|
348
|
+
List the user's SY, PT, YT and LP positions for all markets on a given chain.
|
|
349
|
+
|
|
350
|
+
:param chain: The chain to use.
|
|
351
|
+
:param user_address: The user address of the desired position.
|
|
352
|
+
:param block: Optional block number (defaults to latest).
|
|
353
|
+
:param retries: Override the default retry configuration for this method
|
|
354
|
+
:param server_url: Override the default server URL for this method
|
|
355
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
356
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
357
|
+
"""
|
|
358
|
+
base_url = None
|
|
359
|
+
url_variables = None
|
|
360
|
+
if timeout_ms is None:
|
|
361
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
362
|
+
|
|
363
|
+
if server_url is not None:
|
|
364
|
+
base_url = server_url
|
|
365
|
+
else:
|
|
366
|
+
base_url = self._get_url(base_url, url_variables)
|
|
367
|
+
|
|
368
|
+
request = models.PendlePositionsRequest(
|
|
369
|
+
chain=chain,
|
|
370
|
+
block=block,
|
|
371
|
+
user_address=user_address,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
req = self._build_request_async(
|
|
375
|
+
method="GET",
|
|
376
|
+
path="/v0/pendle/positions",
|
|
377
|
+
base_url=base_url,
|
|
378
|
+
url_variables=url_variables,
|
|
379
|
+
request=request,
|
|
380
|
+
request_body_required=False,
|
|
381
|
+
request_has_path_params=False,
|
|
382
|
+
request_has_query_params=True,
|
|
383
|
+
user_agent_header="user-agent",
|
|
384
|
+
accept_header_value="application/json",
|
|
385
|
+
http_headers=http_headers,
|
|
386
|
+
security=self.sdk_configuration.security,
|
|
387
|
+
timeout_ms=timeout_ms,
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
if retries == UNSET:
|
|
391
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
392
|
+
retries = self.sdk_configuration.retry_config
|
|
393
|
+
|
|
394
|
+
retry_config = None
|
|
395
|
+
if isinstance(retries, utils.RetryConfig):
|
|
396
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
397
|
+
|
|
398
|
+
http_res = await self.do_request_async(
|
|
399
|
+
hook_ctx=HookContext(
|
|
400
|
+
config=self.sdk_configuration,
|
|
401
|
+
base_url=base_url or "",
|
|
402
|
+
operation_id="pendle_positions",
|
|
403
|
+
oauth2_scopes=[],
|
|
404
|
+
security_source=self.sdk_configuration.security,
|
|
405
|
+
),
|
|
406
|
+
request=req,
|
|
407
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
408
|
+
retry_config=retry_config,
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
response_data: Any = None
|
|
412
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
413
|
+
return utils.unmarshal_json(
|
|
414
|
+
http_res.text, models.PendleListUserPositionsResponse
|
|
415
|
+
)
|
|
416
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
417
|
+
response_data = utils.unmarshal_json(
|
|
418
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
419
|
+
)
|
|
420
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
421
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
422
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
423
|
+
raise errors.APIError(
|
|
424
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
425
|
+
)
|
|
426
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
427
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
428
|
+
raise errors.APIError(
|
|
429
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
content_type = http_res.headers.get("Content-Type")
|
|
433
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
434
|
+
raise errors.APIError(
|
|
435
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
436
|
+
http_res.status_code,
|
|
437
|
+
http_res_text,
|
|
438
|
+
http_res,
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
def markets(
|
|
442
|
+
self,
|
|
443
|
+
*,
|
|
444
|
+
chain: models.PendleMarketsChain = models.PendleMarketsChain.ETHEREUM_MAINNET,
|
|
445
|
+
block: OptionalNullable[int] = UNSET,
|
|
446
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
447
|
+
server_url: Optional[str] = None,
|
|
448
|
+
timeout_ms: Optional[int] = None,
|
|
449
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
450
|
+
) -> models.PendleListMarketsResponse:
|
|
451
|
+
r"""List Market Data
|
|
452
|
+
|
|
453
|
+
Get a list of active markets.
|
|
454
|
+
|
|
455
|
+
:param chain: The chain to use.
|
|
456
|
+
:param block: Optional block number (defaults to latest).
|
|
457
|
+
:param retries: Override the default retry configuration for this method
|
|
458
|
+
:param server_url: Override the default server URL for this method
|
|
459
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
460
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
461
|
+
"""
|
|
462
|
+
base_url = None
|
|
463
|
+
url_variables = None
|
|
464
|
+
if timeout_ms is None:
|
|
465
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
466
|
+
|
|
467
|
+
if server_url is not None:
|
|
468
|
+
base_url = server_url
|
|
469
|
+
else:
|
|
470
|
+
base_url = self._get_url(base_url, url_variables)
|
|
471
|
+
|
|
472
|
+
request = models.PendleMarketsRequest(
|
|
473
|
+
chain=chain,
|
|
474
|
+
block=block,
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
req = self._build_request(
|
|
478
|
+
method="GET",
|
|
479
|
+
path="/v0/pendle/markets",
|
|
480
|
+
base_url=base_url,
|
|
481
|
+
url_variables=url_variables,
|
|
482
|
+
request=request,
|
|
483
|
+
request_body_required=False,
|
|
484
|
+
request_has_path_params=False,
|
|
485
|
+
request_has_query_params=True,
|
|
486
|
+
user_agent_header="user-agent",
|
|
487
|
+
accept_header_value="application/json",
|
|
488
|
+
http_headers=http_headers,
|
|
489
|
+
security=self.sdk_configuration.security,
|
|
490
|
+
timeout_ms=timeout_ms,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
if retries == UNSET:
|
|
494
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
495
|
+
retries = self.sdk_configuration.retry_config
|
|
496
|
+
|
|
497
|
+
retry_config = None
|
|
498
|
+
if isinstance(retries, utils.RetryConfig):
|
|
499
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
500
|
+
|
|
501
|
+
http_res = self.do_request(
|
|
502
|
+
hook_ctx=HookContext(
|
|
503
|
+
config=self.sdk_configuration,
|
|
504
|
+
base_url=base_url or "",
|
|
505
|
+
operation_id="pendle_markets",
|
|
506
|
+
oauth2_scopes=[],
|
|
507
|
+
security_source=self.sdk_configuration.security,
|
|
508
|
+
),
|
|
509
|
+
request=req,
|
|
510
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
511
|
+
retry_config=retry_config,
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
response_data: Any = None
|
|
515
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
516
|
+
return utils.unmarshal_json(http_res.text, models.PendleListMarketsResponse)
|
|
517
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
518
|
+
response_data = utils.unmarshal_json(
|
|
519
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
520
|
+
)
|
|
521
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
522
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
523
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
524
|
+
raise errors.APIError(
|
|
525
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
526
|
+
)
|
|
527
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
528
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
529
|
+
raise errors.APIError(
|
|
530
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
content_type = http_res.headers.get("Content-Type")
|
|
534
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
535
|
+
raise errors.APIError(
|
|
536
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
537
|
+
http_res.status_code,
|
|
538
|
+
http_res_text,
|
|
539
|
+
http_res,
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
async def markets_async(
|
|
543
|
+
self,
|
|
544
|
+
*,
|
|
545
|
+
chain: models.PendleMarketsChain = models.PendleMarketsChain.ETHEREUM_MAINNET,
|
|
546
|
+
block: OptionalNullable[int] = UNSET,
|
|
547
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
548
|
+
server_url: Optional[str] = None,
|
|
549
|
+
timeout_ms: Optional[int] = None,
|
|
550
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
551
|
+
) -> models.PendleListMarketsResponse:
|
|
552
|
+
r"""List Market Data
|
|
553
|
+
|
|
554
|
+
Get a list of active markets.
|
|
555
|
+
|
|
556
|
+
:param chain: The chain to use.
|
|
557
|
+
:param block: Optional block number (defaults to latest).
|
|
558
|
+
:param retries: Override the default retry configuration for this method
|
|
559
|
+
:param server_url: Override the default server URL for this method
|
|
560
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
561
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
562
|
+
"""
|
|
563
|
+
base_url = None
|
|
564
|
+
url_variables = None
|
|
565
|
+
if timeout_ms is None:
|
|
566
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
567
|
+
|
|
568
|
+
if server_url is not None:
|
|
569
|
+
base_url = server_url
|
|
570
|
+
else:
|
|
571
|
+
base_url = self._get_url(base_url, url_variables)
|
|
572
|
+
|
|
573
|
+
request = models.PendleMarketsRequest(
|
|
574
|
+
chain=chain,
|
|
575
|
+
block=block,
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
req = self._build_request_async(
|
|
579
|
+
method="GET",
|
|
580
|
+
path="/v0/pendle/markets",
|
|
581
|
+
base_url=base_url,
|
|
582
|
+
url_variables=url_variables,
|
|
583
|
+
request=request,
|
|
584
|
+
request_body_required=False,
|
|
585
|
+
request_has_path_params=False,
|
|
586
|
+
request_has_query_params=True,
|
|
587
|
+
user_agent_header="user-agent",
|
|
588
|
+
accept_header_value="application/json",
|
|
589
|
+
http_headers=http_headers,
|
|
590
|
+
security=self.sdk_configuration.security,
|
|
591
|
+
timeout_ms=timeout_ms,
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
if retries == UNSET:
|
|
595
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
596
|
+
retries = self.sdk_configuration.retry_config
|
|
597
|
+
|
|
598
|
+
retry_config = None
|
|
599
|
+
if isinstance(retries, utils.RetryConfig):
|
|
600
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
601
|
+
|
|
602
|
+
http_res = await self.do_request_async(
|
|
603
|
+
hook_ctx=HookContext(
|
|
604
|
+
config=self.sdk_configuration,
|
|
605
|
+
base_url=base_url or "",
|
|
606
|
+
operation_id="pendle_markets",
|
|
607
|
+
oauth2_scopes=[],
|
|
608
|
+
security_source=self.sdk_configuration.security,
|
|
609
|
+
),
|
|
610
|
+
request=req,
|
|
611
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
612
|
+
retry_config=retry_config,
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
response_data: Any = None
|
|
616
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
617
|
+
return utils.unmarshal_json(http_res.text, models.PendleListMarketsResponse)
|
|
618
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
619
|
+
response_data = utils.unmarshal_json(
|
|
620
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
621
|
+
)
|
|
622
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
623
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
624
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
625
|
+
raise errors.APIError(
|
|
626
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
627
|
+
)
|
|
628
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
629
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
630
|
+
raise errors.APIError(
|
|
631
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
632
|
+
)
|
|
633
|
+
|
|
634
|
+
content_type = http_res.headers.get("Content-Type")
|
|
635
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
636
|
+
raise errors.APIError(
|
|
637
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
638
|
+
http_res.status_code,
|
|
639
|
+
http_res_text,
|
|
640
|
+
http_res,
|
|
641
|
+
)
|
|
642
|
+
|
|
227
643
|
def market(
|
|
228
644
|
self,
|
|
229
645
|
*,
|
|
230
646
|
chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
|
|
231
|
-
|
|
232
|
-
market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
|
|
647
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
233
648
|
block: OptionalNullable[int] = UNSET,
|
|
234
649
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
235
650
|
server_url: Optional[str] = None,
|
|
@@ -241,7 +656,6 @@ class Pendle(BaseSDK):
|
|
|
241
656
|
Get the market's implied APY, maturity date and the associated token data.
|
|
242
657
|
|
|
243
658
|
:param chain: The chain to use.
|
|
244
|
-
:param user_address: The user address of the desired position.
|
|
245
659
|
:param market_address: The market address of the desired position.
|
|
246
660
|
:param block: Optional block number (defaults to latest).
|
|
247
661
|
:param retries: Override the default retry configuration for this method
|
|
@@ -262,7 +676,6 @@ class Pendle(BaseSDK):
|
|
|
262
676
|
request = models.PendleMarketRequest(
|
|
263
677
|
chain=chain,
|
|
264
678
|
block=block,
|
|
265
|
-
user_address=user_address,
|
|
266
679
|
market_address=market_address,
|
|
267
680
|
)
|
|
268
681
|
|
|
@@ -292,6 +705,7 @@ class Pendle(BaseSDK):
|
|
|
292
705
|
|
|
293
706
|
http_res = self.do_request(
|
|
294
707
|
hook_ctx=HookContext(
|
|
708
|
+
config=self.sdk_configuration,
|
|
295
709
|
base_url=base_url or "",
|
|
296
710
|
operation_id="pendle_market",
|
|
297
711
|
oauth2_scopes=[],
|
|
@@ -334,8 +748,7 @@ class Pendle(BaseSDK):
|
|
|
334
748
|
self,
|
|
335
749
|
*,
|
|
336
750
|
chain: models.PendleMarketChain = models.PendleMarketChain.ETHEREUM_MAINNET,
|
|
337
|
-
|
|
338
|
-
market_address: str = "0xdace1121e10500e9e29d071f01593fd76b000f08",
|
|
751
|
+
market_address: str = "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
|
|
339
752
|
block: OptionalNullable[int] = UNSET,
|
|
340
753
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
341
754
|
server_url: Optional[str] = None,
|
|
@@ -347,7 +760,6 @@ class Pendle(BaseSDK):
|
|
|
347
760
|
Get the market's implied APY, maturity date and the associated token data.
|
|
348
761
|
|
|
349
762
|
:param chain: The chain to use.
|
|
350
|
-
:param user_address: The user address of the desired position.
|
|
351
763
|
:param market_address: The market address of the desired position.
|
|
352
764
|
:param block: Optional block number (defaults to latest).
|
|
353
765
|
:param retries: Override the default retry configuration for this method
|
|
@@ -368,7 +780,6 @@ class Pendle(BaseSDK):
|
|
|
368
780
|
request = models.PendleMarketRequest(
|
|
369
781
|
chain=chain,
|
|
370
782
|
block=block,
|
|
371
|
-
user_address=user_address,
|
|
372
783
|
market_address=market_address,
|
|
373
784
|
)
|
|
374
785
|
|
|
@@ -398,6 +809,7 @@ class Pendle(BaseSDK):
|
|
|
398
809
|
|
|
399
810
|
http_res = await self.do_request_async(
|
|
400
811
|
hook_ctx=HookContext(
|
|
812
|
+
config=self.sdk_configuration,
|
|
401
813
|
base_url=base_url or "",
|
|
402
814
|
operation_id="pendle_market",
|
|
403
815
|
oauth2_scopes=[],
|
compass_api_sdk/sdk.py
CHANGED
|
@@ -131,6 +131,9 @@ class CompassAPI(BaseSDK):
|
|
|
131
131
|
|
|
132
132
|
hooks = SDKHooks()
|
|
133
133
|
|
|
134
|
+
# pylint: disable=protected-access
|
|
135
|
+
self.sdk_configuration.__dict__["_hooks"] = hooks
|
|
136
|
+
|
|
134
137
|
current_server_url, *_ = self.sdk_configuration.get_server_details()
|
|
135
138
|
server_url, self.sdk_configuration.client = hooks.sdk_init(
|
|
136
139
|
current_server_url, client
|
|
@@ -138,9 +141,6 @@ class CompassAPI(BaseSDK):
|
|
|
138
141
|
if current_server_url != server_url:
|
|
139
142
|
self.sdk_configuration.server_url = server_url
|
|
140
143
|
|
|
141
|
-
# pylint: disable=protected-access
|
|
142
|
-
self.sdk_configuration.__dict__["_hooks"] = hooks
|
|
143
|
-
|
|
144
144
|
weakref.finalize(
|
|
145
145
|
self,
|
|
146
146
|
close_clients,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
-
from ._hooks import SDKHooks
|
|
4
3
|
from ._version import (
|
|
5
4
|
__gen_version__,
|
|
6
5
|
__openapi_doc_version__,
|
|
@@ -41,9 +40,6 @@ class SDKConfiguration:
|
|
|
41
40
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
|
42
41
|
timeout_ms: Optional[int] = None
|
|
43
42
|
|
|
44
|
-
def __post_init__(self):
|
|
45
|
-
self._hooks = SDKHooks()
|
|
46
|
-
|
|
47
43
|
def get_server_details(self) -> Tuple[str, Dict[str, str]]:
|
|
48
44
|
if self.server_url is not None and self.server_url:
|
|
49
45
|
return remove_suffix(self.server_url, "/"), {}
|
|
@@ -51,6 +47,3 @@ class SDKConfiguration:
|
|
|
51
47
|
self.server_idx = 0
|
|
52
48
|
|
|
53
49
|
return SERVERS[self.server_idx], {}
|
|
54
|
-
|
|
55
|
-
def get_hooks(self) -> SDKHooks:
|
|
56
|
-
return self._hooks
|
compass_api_sdk/sky.py
CHANGED
|
@@ -70,6 +70,7 @@ class Sky(BaseSDK):
|
|
|
70
70
|
|
|
71
71
|
http_res = self.do_request(
|
|
72
72
|
hook_ctx=HookContext(
|
|
73
|
+
config=self.sdk_configuration,
|
|
73
74
|
base_url=base_url or "",
|
|
74
75
|
operation_id="sky_position",
|
|
75
76
|
oauth2_scopes=[],
|
|
@@ -170,6 +171,7 @@ class Sky(BaseSDK):
|
|
|
170
171
|
|
|
171
172
|
http_res = await self.do_request_async(
|
|
172
173
|
hook_ctx=HookContext(
|
|
174
|
+
config=self.sdk_configuration,
|
|
173
175
|
base_url=base_url or "",
|
|
174
176
|
operation_id="sky_position",
|
|
175
177
|
oauth2_scopes=[],
|
|
@@ -282,6 +284,7 @@ class Sky(BaseSDK):
|
|
|
282
284
|
|
|
283
285
|
http_res = self.do_request(
|
|
284
286
|
hook_ctx=HookContext(
|
|
287
|
+
config=self.sdk_configuration,
|
|
285
288
|
base_url=base_url or "",
|
|
286
289
|
operation_id="sky_buy",
|
|
287
290
|
oauth2_scopes=[],
|
|
@@ -394,6 +397,7 @@ class Sky(BaseSDK):
|
|
|
394
397
|
|
|
395
398
|
http_res = await self.do_request_async(
|
|
396
399
|
hook_ctx=HookContext(
|
|
400
|
+
config=self.sdk_configuration,
|
|
397
401
|
base_url=base_url or "",
|
|
398
402
|
operation_id="sky_buy",
|
|
399
403
|
oauth2_scopes=[],
|
|
@@ -508,6 +512,7 @@ class Sky(BaseSDK):
|
|
|
508
512
|
|
|
509
513
|
http_res = self.do_request(
|
|
510
514
|
hook_ctx=HookContext(
|
|
515
|
+
config=self.sdk_configuration,
|
|
511
516
|
base_url=base_url or "",
|
|
512
517
|
operation_id="sky_sell",
|
|
513
518
|
oauth2_scopes=[],
|
|
@@ -622,6 +627,7 @@ class Sky(BaseSDK):
|
|
|
622
627
|
|
|
623
628
|
http_res = await self.do_request_async(
|
|
624
629
|
hook_ctx=HookContext(
|
|
630
|
+
config=self.sdk_configuration,
|
|
625
631
|
base_url=base_url or "",
|
|
626
632
|
operation_id="sky_sell",
|
|
627
633
|
oauth2_scopes=[],
|
|
@@ -732,6 +738,7 @@ class Sky(BaseSDK):
|
|
|
732
738
|
|
|
733
739
|
http_res = self.do_request(
|
|
734
740
|
hook_ctx=HookContext(
|
|
741
|
+
config=self.sdk_configuration,
|
|
735
742
|
base_url=base_url or "",
|
|
736
743
|
operation_id="sky_deposit",
|
|
737
744
|
oauth2_scopes=[],
|
|
@@ -842,6 +849,7 @@ class Sky(BaseSDK):
|
|
|
842
849
|
|
|
843
850
|
http_res = await self.do_request_async(
|
|
844
851
|
hook_ctx=HookContext(
|
|
852
|
+
config=self.sdk_configuration,
|
|
845
853
|
base_url=base_url or "",
|
|
846
854
|
operation_id="sky_deposit",
|
|
847
855
|
oauth2_scopes=[],
|
|
@@ -948,6 +956,7 @@ class Sky(BaseSDK):
|
|
|
948
956
|
|
|
949
957
|
http_res = self.do_request(
|
|
950
958
|
hook_ctx=HookContext(
|
|
959
|
+
config=self.sdk_configuration,
|
|
951
960
|
base_url=base_url or "",
|
|
952
961
|
operation_id="sky_withdraw",
|
|
953
962
|
oauth2_scopes=[],
|
|
@@ -1054,6 +1063,7 @@ class Sky(BaseSDK):
|
|
|
1054
1063
|
|
|
1055
1064
|
http_res = await self.do_request_async(
|
|
1056
1065
|
hook_ctx=HookContext(
|
|
1066
|
+
config=self.sdk_configuration,
|
|
1057
1067
|
base_url=base_url or "",
|
|
1058
1068
|
operation_id="sky_withdraw",
|
|
1059
1069
|
oauth2_scopes=[],
|
compass_api_sdk/smart_account.py
CHANGED
|
@@ -75,6 +75,7 @@ class SmartAccount(BaseSDK):
|
|
|
75
75
|
|
|
76
76
|
http_res = self.do_request(
|
|
77
77
|
hook_ctx=HookContext(
|
|
78
|
+
config=self.sdk_configuration,
|
|
78
79
|
base_url=base_url or "",
|
|
79
80
|
operation_id="smart_account_batched_user_operations",
|
|
80
81
|
oauth2_scopes=[],
|
|
@@ -182,6 +183,7 @@ class SmartAccount(BaseSDK):
|
|
|
182
183
|
|
|
183
184
|
http_res = await self.do_request_async(
|
|
184
185
|
hook_ctx=HookContext(
|
|
186
|
+
config=self.sdk_configuration,
|
|
185
187
|
base_url=base_url or "",
|
|
186
188
|
operation_id="smart_account_batched_user_operations",
|
|
187
189
|
oauth2_scopes=[],
|