compass_api_sdk 0.9.35__py3-none-any.whl → 0.9.37__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 +196 -478
- compass_api_sdk/aerodrome_slipstream.py +102 -256
- compass_api_sdk/basesdk.py +4 -4
- compass_api_sdk/erc_4626_vaults.py +42 -108
- compass_api_sdk/errors/__init__.py +15 -2
- compass_api_sdk/errors/apierror.py +30 -14
- compass_api_sdk/errors/compassapierror.py +26 -0
- compass_api_sdk/errors/httpvalidationerror.py +11 -6
- compass_api_sdk/errors/no_response_error.py +13 -0
- compass_api_sdk/errors/responsevalidationerror.py +25 -0
- compass_api_sdk/models/apy.py +3 -0
- compass_api_sdk/models/morpho_vaultop.py +65 -7
- compass_api_sdk/morpho.py +224 -482
- compass_api_sdk/pendle.py +166 -400
- compass_api_sdk/sky.py +74 -180
- compass_api_sdk/smart_account.py +16 -38
- compass_api_sdk/token_sdk.py +56 -144
- compass_api_sdk/transaction_bundler.py +48 -114
- compass_api_sdk/uniswap_v3.py +152 -368
- compass_api_sdk/universal.py +112 -288
- compass_api_sdk/utils/__init__.py +3 -0
- compass_api_sdk/utils/serializers.py +21 -3
- {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-0.9.37.dist-info}/METADATA +42 -24
- {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-0.9.37.dist-info}/RECORD +26 -23
- {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-0.9.37.dist-info}/WHEEL +0 -0
compass_api_sdk/token_sdk.py
CHANGED
|
@@ -83,31 +83,20 @@ class TokenSDK(BaseSDK):
|
|
|
83
83
|
|
|
84
84
|
response_data: Any = None
|
|
85
85
|
if utils.match_response(http_res, "200", "application/json"):
|
|
86
|
-
return utils.
|
|
86
|
+
return utils.unmarshal_json_response(models.TokenAddressResponse, http_res)
|
|
87
87
|
if utils.match_response(http_res, "422", "application/json"):
|
|
88
|
-
response_data = utils.
|
|
89
|
-
|
|
88
|
+
response_data = utils.unmarshal_json_response(
|
|
89
|
+
errors.HTTPValidationErrorData, http_res
|
|
90
90
|
)
|
|
91
|
-
raise errors.HTTPValidationError(
|
|
91
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
92
92
|
if utils.match_response(http_res, "4XX", "*"):
|
|
93
93
|
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
-
raise errors.APIError(
|
|
95
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
96
|
-
)
|
|
94
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
97
95
|
if utils.match_response(http_res, "5XX", "*"):
|
|
98
96
|
http_res_text = utils.stream_to_text(http_res)
|
|
99
|
-
raise errors.APIError(
|
|
100
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
101
|
-
)
|
|
97
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
98
|
|
|
103
|
-
|
|
104
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
105
|
-
raise errors.APIError(
|
|
106
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
107
|
-
http_res.status_code,
|
|
108
|
-
http_res_text,
|
|
109
|
-
http_res,
|
|
110
|
-
)
|
|
99
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
111
100
|
|
|
112
101
|
async def address_async(
|
|
113
102
|
self,
|
|
@@ -184,31 +173,20 @@ class TokenSDK(BaseSDK):
|
|
|
184
173
|
|
|
185
174
|
response_data: Any = None
|
|
186
175
|
if utils.match_response(http_res, "200", "application/json"):
|
|
187
|
-
return utils.
|
|
176
|
+
return utils.unmarshal_json_response(models.TokenAddressResponse, http_res)
|
|
188
177
|
if utils.match_response(http_res, "422", "application/json"):
|
|
189
|
-
response_data = utils.
|
|
190
|
-
|
|
178
|
+
response_data = utils.unmarshal_json_response(
|
|
179
|
+
errors.HTTPValidationErrorData, http_res
|
|
191
180
|
)
|
|
192
|
-
raise errors.HTTPValidationError(
|
|
181
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
193
182
|
if utils.match_response(http_res, "4XX", "*"):
|
|
194
183
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
195
|
-
raise errors.APIError(
|
|
196
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
197
|
-
)
|
|
184
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
198
185
|
if utils.match_response(http_res, "5XX", "*"):
|
|
199
186
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
200
|
-
raise errors.APIError(
|
|
201
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
202
|
-
)
|
|
187
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
203
188
|
|
|
204
|
-
|
|
205
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
206
|
-
raise errors.APIError(
|
|
207
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
208
|
-
http_res.status_code,
|
|
209
|
-
http_res_text,
|
|
210
|
-
http_res,
|
|
211
|
-
)
|
|
189
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
212
190
|
|
|
213
191
|
def price(
|
|
214
192
|
self,
|
|
@@ -289,31 +267,20 @@ class TokenSDK(BaseSDK):
|
|
|
289
267
|
|
|
290
268
|
response_data: Any = None
|
|
291
269
|
if utils.match_response(http_res, "200", "application/json"):
|
|
292
|
-
return utils.
|
|
270
|
+
return utils.unmarshal_json_response(models.TokenPriceResponse, http_res)
|
|
293
271
|
if utils.match_response(http_res, "422", "application/json"):
|
|
294
|
-
response_data = utils.
|
|
295
|
-
|
|
272
|
+
response_data = utils.unmarshal_json_response(
|
|
273
|
+
errors.HTTPValidationErrorData, http_res
|
|
296
274
|
)
|
|
297
|
-
raise errors.HTTPValidationError(
|
|
275
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
298
276
|
if utils.match_response(http_res, "4XX", "*"):
|
|
299
277
|
http_res_text = utils.stream_to_text(http_res)
|
|
300
|
-
raise errors.APIError(
|
|
301
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
302
|
-
)
|
|
278
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
303
279
|
if utils.match_response(http_res, "5XX", "*"):
|
|
304
280
|
http_res_text = utils.stream_to_text(http_res)
|
|
305
|
-
raise errors.APIError(
|
|
306
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
307
|
-
)
|
|
281
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
308
282
|
|
|
309
|
-
|
|
310
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
311
|
-
raise errors.APIError(
|
|
312
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
313
|
-
http_res.status_code,
|
|
314
|
-
http_res_text,
|
|
315
|
-
http_res,
|
|
316
|
-
)
|
|
283
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
317
284
|
|
|
318
285
|
async def price_async(
|
|
319
286
|
self,
|
|
@@ -394,31 +361,20 @@ class TokenSDK(BaseSDK):
|
|
|
394
361
|
|
|
395
362
|
response_data: Any = None
|
|
396
363
|
if utils.match_response(http_res, "200", "application/json"):
|
|
397
|
-
return utils.
|
|
364
|
+
return utils.unmarshal_json_response(models.TokenPriceResponse, http_res)
|
|
398
365
|
if utils.match_response(http_res, "422", "application/json"):
|
|
399
|
-
response_data = utils.
|
|
400
|
-
|
|
366
|
+
response_data = utils.unmarshal_json_response(
|
|
367
|
+
errors.HTTPValidationErrorData, http_res
|
|
401
368
|
)
|
|
402
|
-
raise errors.HTTPValidationError(
|
|
369
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
403
370
|
if utils.match_response(http_res, "4XX", "*"):
|
|
404
371
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
405
|
-
raise errors.APIError(
|
|
406
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
407
|
-
)
|
|
372
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
408
373
|
if utils.match_response(http_res, "5XX", "*"):
|
|
409
374
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
410
|
-
raise errors.APIError(
|
|
411
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
412
|
-
)
|
|
375
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
413
376
|
|
|
414
|
-
|
|
415
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
416
|
-
raise errors.APIError(
|
|
417
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
418
|
-
http_res.status_code,
|
|
419
|
-
http_res_text,
|
|
420
|
-
http_res,
|
|
421
|
-
)
|
|
377
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
422
378
|
|
|
423
379
|
def balance(
|
|
424
380
|
self,
|
|
@@ -498,31 +454,20 @@ class TokenSDK(BaseSDK):
|
|
|
498
454
|
|
|
499
455
|
response_data: Any = None
|
|
500
456
|
if utils.match_response(http_res, "200", "application/json"):
|
|
501
|
-
return utils.
|
|
457
|
+
return utils.unmarshal_json_response(models.TokenBalanceResponse, http_res)
|
|
502
458
|
if utils.match_response(http_res, "422", "application/json"):
|
|
503
|
-
response_data = utils.
|
|
504
|
-
|
|
459
|
+
response_data = utils.unmarshal_json_response(
|
|
460
|
+
errors.HTTPValidationErrorData, http_res
|
|
505
461
|
)
|
|
506
|
-
raise errors.HTTPValidationError(
|
|
462
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
507
463
|
if utils.match_response(http_res, "4XX", "*"):
|
|
508
464
|
http_res_text = utils.stream_to_text(http_res)
|
|
509
|
-
raise errors.APIError(
|
|
510
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
511
|
-
)
|
|
465
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
512
466
|
if utils.match_response(http_res, "5XX", "*"):
|
|
513
467
|
http_res_text = utils.stream_to_text(http_res)
|
|
514
|
-
raise errors.APIError(
|
|
515
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
516
|
-
)
|
|
468
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
517
469
|
|
|
518
|
-
|
|
519
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
520
|
-
raise errors.APIError(
|
|
521
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
522
|
-
http_res.status_code,
|
|
523
|
-
http_res_text,
|
|
524
|
-
http_res,
|
|
525
|
-
)
|
|
470
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
526
471
|
|
|
527
472
|
async def balance_async(
|
|
528
473
|
self,
|
|
@@ -602,31 +547,20 @@ class TokenSDK(BaseSDK):
|
|
|
602
547
|
|
|
603
548
|
response_data: Any = None
|
|
604
549
|
if utils.match_response(http_res, "200", "application/json"):
|
|
605
|
-
return utils.
|
|
550
|
+
return utils.unmarshal_json_response(models.TokenBalanceResponse, http_res)
|
|
606
551
|
if utils.match_response(http_res, "422", "application/json"):
|
|
607
|
-
response_data = utils.
|
|
608
|
-
|
|
552
|
+
response_data = utils.unmarshal_json_response(
|
|
553
|
+
errors.HTTPValidationErrorData, http_res
|
|
609
554
|
)
|
|
610
|
-
raise errors.HTTPValidationError(
|
|
555
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
611
556
|
if utils.match_response(http_res, "4XX", "*"):
|
|
612
557
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
613
|
-
raise errors.APIError(
|
|
614
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
615
|
-
)
|
|
558
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
616
559
|
if utils.match_response(http_res, "5XX", "*"):
|
|
617
560
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
618
|
-
raise errors.APIError(
|
|
619
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
620
|
-
)
|
|
561
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
621
562
|
|
|
622
|
-
|
|
623
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
624
|
-
raise errors.APIError(
|
|
625
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
626
|
-
http_res.status_code,
|
|
627
|
-
http_res_text,
|
|
628
|
-
http_res,
|
|
629
|
-
)
|
|
563
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
630
564
|
|
|
631
565
|
def transfer(
|
|
632
566
|
self,
|
|
@@ -720,31 +654,20 @@ class TokenSDK(BaseSDK):
|
|
|
720
654
|
|
|
721
655
|
response_data: Any = None
|
|
722
656
|
if utils.match_response(http_res, "200", "application/json"):
|
|
723
|
-
return utils.
|
|
657
|
+
return utils.unmarshal_json_response(models.TxResponse, http_res)
|
|
724
658
|
if utils.match_response(http_res, "422", "application/json"):
|
|
725
|
-
response_data = utils.
|
|
726
|
-
|
|
659
|
+
response_data = utils.unmarshal_json_response(
|
|
660
|
+
errors.HTTPValidationErrorData, http_res
|
|
727
661
|
)
|
|
728
|
-
raise errors.HTTPValidationError(
|
|
662
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
729
663
|
if utils.match_response(http_res, "4XX", "*"):
|
|
730
664
|
http_res_text = utils.stream_to_text(http_res)
|
|
731
|
-
raise errors.APIError(
|
|
732
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
733
|
-
)
|
|
665
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
734
666
|
if utils.match_response(http_res, "5XX", "*"):
|
|
735
667
|
http_res_text = utils.stream_to_text(http_res)
|
|
736
|
-
raise errors.APIError(
|
|
737
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
738
|
-
)
|
|
668
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
739
669
|
|
|
740
|
-
|
|
741
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
742
|
-
raise errors.APIError(
|
|
743
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
744
|
-
http_res.status_code,
|
|
745
|
-
http_res_text,
|
|
746
|
-
http_res,
|
|
747
|
-
)
|
|
670
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
748
671
|
|
|
749
672
|
async def transfer_async(
|
|
750
673
|
self,
|
|
@@ -838,28 +761,17 @@ class TokenSDK(BaseSDK):
|
|
|
838
761
|
|
|
839
762
|
response_data: Any = None
|
|
840
763
|
if utils.match_response(http_res, "200", "application/json"):
|
|
841
|
-
return utils.
|
|
764
|
+
return utils.unmarshal_json_response(models.TxResponse, http_res)
|
|
842
765
|
if utils.match_response(http_res, "422", "application/json"):
|
|
843
|
-
response_data = utils.
|
|
844
|
-
|
|
766
|
+
response_data = utils.unmarshal_json_response(
|
|
767
|
+
errors.HTTPValidationErrorData, http_res
|
|
845
768
|
)
|
|
846
|
-
raise errors.HTTPValidationError(
|
|
769
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
847
770
|
if utils.match_response(http_res, "4XX", "*"):
|
|
848
771
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
849
|
-
raise errors.APIError(
|
|
850
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
851
|
-
)
|
|
772
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
852
773
|
if utils.match_response(http_res, "5XX", "*"):
|
|
853
774
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
854
|
-
raise errors.APIError(
|
|
855
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
856
|
-
)
|
|
775
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
857
776
|
|
|
858
|
-
|
|
859
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
860
|
-
raise errors.APIError(
|
|
861
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
862
|
-
http_res.status_code,
|
|
863
|
-
http_res_text,
|
|
864
|
-
http_res,
|
|
865
|
-
)
|
|
777
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
@@ -91,33 +91,22 @@ class TransactionBundler(BaseSDK):
|
|
|
91
91
|
|
|
92
92
|
response_data: Any = None
|
|
93
93
|
if utils.match_response(http_res, "200", "application/json"):
|
|
94
|
-
return utils.
|
|
95
|
-
|
|
94
|
+
return utils.unmarshal_json_response(
|
|
95
|
+
models.MulticallAuthorizationResponse, http_res
|
|
96
96
|
)
|
|
97
97
|
if utils.match_response(http_res, "422", "application/json"):
|
|
98
|
-
response_data = utils.
|
|
99
|
-
|
|
98
|
+
response_data = utils.unmarshal_json_response(
|
|
99
|
+
errors.HTTPValidationErrorData, http_res
|
|
100
100
|
)
|
|
101
|
-
raise errors.HTTPValidationError(
|
|
101
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
102
102
|
if utils.match_response(http_res, "4XX", "*"):
|
|
103
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
|
-
)
|
|
104
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
107
105
|
if utils.match_response(http_res, "5XX", "*"):
|
|
108
106
|
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
|
-
)
|
|
107
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
112
108
|
|
|
113
|
-
|
|
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
|
-
)
|
|
109
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
121
110
|
|
|
122
111
|
async def bundler_authorization_async(
|
|
123
112
|
self,
|
|
@@ -202,33 +191,22 @@ class TransactionBundler(BaseSDK):
|
|
|
202
191
|
|
|
203
192
|
response_data: Any = None
|
|
204
193
|
if utils.match_response(http_res, "200", "application/json"):
|
|
205
|
-
return utils.
|
|
206
|
-
|
|
194
|
+
return utils.unmarshal_json_response(
|
|
195
|
+
models.MulticallAuthorizationResponse, http_res
|
|
207
196
|
)
|
|
208
197
|
if utils.match_response(http_res, "422", "application/json"):
|
|
209
|
-
response_data = utils.
|
|
210
|
-
|
|
198
|
+
response_data = utils.unmarshal_json_response(
|
|
199
|
+
errors.HTTPValidationErrorData, http_res
|
|
211
200
|
)
|
|
212
|
-
raise errors.HTTPValidationError(
|
|
201
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
213
202
|
if utils.match_response(http_res, "4XX", "*"):
|
|
214
203
|
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
|
-
)
|
|
204
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
218
205
|
if utils.match_response(http_res, "5XX", "*"):
|
|
219
206
|
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
|
-
)
|
|
207
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
223
208
|
|
|
224
|
-
|
|
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
|
-
)
|
|
209
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
232
210
|
|
|
233
211
|
def bundler_execute(
|
|
234
212
|
self,
|
|
@@ -324,33 +302,22 @@ class TransactionBundler(BaseSDK):
|
|
|
324
302
|
|
|
325
303
|
response_data: Any = None
|
|
326
304
|
if utils.match_response(http_res, "200", "application/json"):
|
|
327
|
-
return utils.
|
|
328
|
-
|
|
305
|
+
return utils.unmarshal_json_response(
|
|
306
|
+
models.UnsignedMulticallTransaction, http_res
|
|
329
307
|
)
|
|
330
308
|
if utils.match_response(http_res, "422", "application/json"):
|
|
331
|
-
response_data = utils.
|
|
332
|
-
|
|
309
|
+
response_data = utils.unmarshal_json_response(
|
|
310
|
+
errors.HTTPValidationErrorData, http_res
|
|
333
311
|
)
|
|
334
|
-
raise errors.HTTPValidationError(
|
|
312
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
335
313
|
if utils.match_response(http_res, "4XX", "*"):
|
|
336
314
|
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
|
-
)
|
|
315
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
340
316
|
if utils.match_response(http_res, "5XX", "*"):
|
|
341
317
|
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
|
-
)
|
|
318
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
345
319
|
|
|
346
|
-
|
|
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
|
-
)
|
|
320
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
354
321
|
|
|
355
322
|
async def bundler_execute_async(
|
|
356
323
|
self,
|
|
@@ -446,33 +413,22 @@ class TransactionBundler(BaseSDK):
|
|
|
446
413
|
|
|
447
414
|
response_data: Any = None
|
|
448
415
|
if utils.match_response(http_res, "200", "application/json"):
|
|
449
|
-
return utils.
|
|
450
|
-
|
|
416
|
+
return utils.unmarshal_json_response(
|
|
417
|
+
models.UnsignedMulticallTransaction, http_res
|
|
451
418
|
)
|
|
452
419
|
if utils.match_response(http_res, "422", "application/json"):
|
|
453
|
-
response_data = utils.
|
|
454
|
-
|
|
420
|
+
response_data = utils.unmarshal_json_response(
|
|
421
|
+
errors.HTTPValidationErrorData, http_res
|
|
455
422
|
)
|
|
456
|
-
raise errors.HTTPValidationError(
|
|
423
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
457
424
|
if utils.match_response(http_res, "4XX", "*"):
|
|
458
425
|
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
|
-
)
|
|
426
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
462
427
|
if utils.match_response(http_res, "5XX", "*"):
|
|
463
428
|
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
|
-
)
|
|
429
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
467
430
|
|
|
468
|
-
|
|
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
|
-
)
|
|
431
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
476
432
|
|
|
477
433
|
def bundler_aave_loop(
|
|
478
434
|
self,
|
|
@@ -591,33 +547,22 @@ class TransactionBundler(BaseSDK):
|
|
|
591
547
|
|
|
592
548
|
response_data: Any = None
|
|
593
549
|
if utils.match_response(http_res, "200", "application/json"):
|
|
594
|
-
return utils.
|
|
595
|
-
|
|
550
|
+
return utils.unmarshal_json_response(
|
|
551
|
+
models.UnsignedMulticallTransaction, http_res
|
|
596
552
|
)
|
|
597
553
|
if utils.match_response(http_res, "422", "application/json"):
|
|
598
|
-
response_data = utils.
|
|
599
|
-
|
|
554
|
+
response_data = utils.unmarshal_json_response(
|
|
555
|
+
errors.HTTPValidationErrorData, http_res
|
|
600
556
|
)
|
|
601
|
-
raise errors.HTTPValidationError(
|
|
557
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
602
558
|
if utils.match_response(http_res, "4XX", "*"):
|
|
603
559
|
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
|
-
)
|
|
560
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
607
561
|
if utils.match_response(http_res, "5XX", "*"):
|
|
608
562
|
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
|
-
)
|
|
563
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
612
564
|
|
|
613
|
-
|
|
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
|
-
)
|
|
565
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
621
566
|
|
|
622
567
|
async def bundler_aave_loop_async(
|
|
623
568
|
self,
|
|
@@ -736,30 +681,19 @@ class TransactionBundler(BaseSDK):
|
|
|
736
681
|
|
|
737
682
|
response_data: Any = None
|
|
738
683
|
if utils.match_response(http_res, "200", "application/json"):
|
|
739
|
-
return utils.
|
|
740
|
-
|
|
684
|
+
return utils.unmarshal_json_response(
|
|
685
|
+
models.UnsignedMulticallTransaction, http_res
|
|
741
686
|
)
|
|
742
687
|
if utils.match_response(http_res, "422", "application/json"):
|
|
743
|
-
response_data = utils.
|
|
744
|
-
|
|
688
|
+
response_data = utils.unmarshal_json_response(
|
|
689
|
+
errors.HTTPValidationErrorData, http_res
|
|
745
690
|
)
|
|
746
|
-
raise errors.HTTPValidationError(
|
|
691
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
747
692
|
if utils.match_response(http_res, "4XX", "*"):
|
|
748
693
|
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
|
-
)
|
|
694
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
752
695
|
if utils.match_response(http_res, "5XX", "*"):
|
|
753
696
|
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
|
-
)
|
|
697
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
757
698
|
|
|
758
|
-
|
|
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
|
-
)
|
|
699
|
+
raise errors.APIError("Unexpected response received", http_res)
|