defi-state-querier 0.5.0__py3-none-any.whl → 0.5.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- defi_services/__init__.py +1 -1
- defi_services/jobs/processors/call_state_processor.py +12 -0
- defi_services/jobs/processors/multi_call_state_processor.py +12 -0
- defi_services/jobs/processors/multi_state_processor.py +1 -1
- defi_services/jobs/queriers/{multicall_state_querier.py → call_state_querier.py} +2 -2
- defi_services/services/multicall/multicall_v2.py +5 -1
- {defi_state_querier-0.5.0.dist-info → defi_state_querier-0.5.2.dist-info}/METADATA +1 -1
- {defi_state_querier-0.5.0.dist-info → defi_state_querier-0.5.2.dist-info}/RECORD +11 -10
- defi_services/jobs/processors/multicall_state_processor.py +0 -15
- {defi_state_querier-0.5.0.dist-info → defi_state_querier-0.5.2.dist-info}/LICENSE +0 -0
- {defi_state_querier-0.5.0.dist-info → defi_state_querier-0.5.2.dist-info}/WHEEL +0 -0
- {defi_state_querier-0.5.0.dist-info → defi_state_querier-0.5.2.dist-info}/top_level.txt +0 -0
defi_services/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.5.
|
1
|
+
__version__ = "0.5.2"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
from defi_services.jobs.processors.state_processor import StateProcessor
|
4
|
+
from defi_services.jobs.queriers.call_state_querier import CallStateQuerier
|
5
|
+
|
6
|
+
logger = logging.getLogger("CallStateProcessor")
|
7
|
+
|
8
|
+
|
9
|
+
class CallStateProcessor(StateProcessor):
|
10
|
+
def __init__(self, provider_uri: str, chain_id: str):
|
11
|
+
super().__init__(provider_uri, chain_id)
|
12
|
+
self.state_querier = CallStateQuerier(provider_uri, chain_id)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
from defi_services.jobs.processors.multi_state_processor import MultiStateProcessor
|
4
|
+
from defi_services.jobs.queriers.call_state_querier import CallStateQuerier
|
5
|
+
|
6
|
+
logger = logging.getLogger("MultiCallStateProcessor")
|
7
|
+
|
8
|
+
|
9
|
+
class MultiCallStateProcessor(MultiStateProcessor):
|
10
|
+
def __init__(self, provider_uri: str, chain_id: str):
|
11
|
+
super().__init__(provider_uri, chain_id)
|
12
|
+
self.state_querier = CallStateQuerier(provider_uri, chain_id)
|
@@ -10,7 +10,7 @@ from defi_services.services.protocol_services import ProtocolServices
|
|
10
10
|
from defi_services.services.token_services import TokenServices
|
11
11
|
from defi_services.utils.init_services import init_services
|
12
12
|
|
13
|
-
logger = logging.getLogger("
|
13
|
+
logger = logging.getLogger("MultiStateProcessor")
|
14
14
|
|
15
15
|
|
16
16
|
class MultiStateProcessor:
|
@@ -11,10 +11,10 @@ from defi_services.services.multicall.batch_queries_service import decode_data_r
|
|
11
11
|
decode_data_response
|
12
12
|
from defi_services.services.multicall.multicall_v2 import W3Multicall, add_rpc_multicall
|
13
13
|
|
14
|
-
logger = logging.getLogger("
|
14
|
+
logger = logging.getLogger("CallStateQuerier")
|
15
15
|
|
16
16
|
|
17
|
-
class
|
17
|
+
class CallStateQuerier(StateQuerier):
|
18
18
|
def __init__(self, provider_uri, chain_id):
|
19
19
|
super().__init__(provider_uri)
|
20
20
|
self.chain_id = chain_id
|
@@ -57,7 +57,11 @@ class W3Multicall:
|
|
57
57
|
args = []
|
58
58
|
if fn_paras is not None:
|
59
59
|
if type(fn_paras) is list:
|
60
|
-
|
60
|
+
for item in fn_paras:
|
61
|
+
if Web3.is_address(item):
|
62
|
+
args.append(Web3.to_checksum_address(item))
|
63
|
+
else:
|
64
|
+
args.append(item)
|
61
65
|
else:
|
62
66
|
if Web3.is_address(fn_paras):
|
63
67
|
fn_paras = Web3.to_checksum_address(fn_paras)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
defi_services/__init__.py,sha256=
|
1
|
+
defi_services/__init__.py,sha256=isJrmDBLRag7Zc2UK9ZovWGOv7ji1Oh-zJtJMNJFkXw,22
|
2
2
|
defi_services/abis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
defi_services/abis/multicall_v3_abi.py,sha256=0aPxjrJJFU17fODjvYFRDn5Y5J1yi_AJKc8v1uohNGY,12352
|
4
4
|
defi_services/abis/dex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -312,14 +312,15 @@ defi_services/constants/entities/vault_constant.py,sha256=IGGd4--T-BQcm8mlU8XAJ_
|
|
312
312
|
defi_services/constants/entities/vault_services.py,sha256=IMmQc15wS1KA7EuQqM_AraQtCthnZ7hoNee0E_DOyw8,567
|
313
313
|
defi_services/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
314
314
|
defi_services/jobs/processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
315
|
+
defi_services/jobs/processors/call_state_processor.py,sha256=WseX0OaMA5D_ANYofrz7W2BooSMdHlGRay4NuiABmM4,436
|
315
316
|
defi_services/jobs/processors/cosmos_state_processor.py,sha256=2S5fhqHQ4pUtRaLnbFJNUo4jKc5MHq7HA-0FHebOJyo,1334
|
316
|
-
defi_services/jobs/processors/
|
317
|
-
defi_services/jobs/processors/
|
317
|
+
defi_services/jobs/processors/multi_call_state_processor.py,sha256=AksswGMSyStbnvkQcBVb0Y2tdpkUgc1CWoeSiMpGy8U,462
|
318
|
+
defi_services/jobs/processors/multi_state_processor.py,sha256=Od7Y8zPz7xj0L-_0YuK4wg_94fX8Q1PquuKUUYteIJU,5731
|
318
319
|
defi_services/jobs/processors/solana_state_processor.py,sha256=szsBYrkEV8kBzuA_iaSVescnwKJ2MHoTbut5kORbWTs,4065
|
319
320
|
defi_services/jobs/processors/state_processor.py,sha256=Ze_5isU_l_APB262E-VV_4KZwEG6W0XE6PikJZIcAoM,7291
|
320
321
|
defi_services/jobs/processors/substrate_state_processor.py,sha256=KkiY1NkaxnizNJBTfn4twB-zuQo3fT3akOlbie8VF5g,3940
|
321
322
|
defi_services/jobs/queriers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
322
|
-
defi_services/jobs/queriers/
|
323
|
+
defi_services/jobs/queriers/call_state_querier.py,sha256=xbprHHL3BHMTsYEwaxjAZkueFfQIbcxtMoGqDBOsm4A,4779
|
323
324
|
defi_services/jobs/queriers/solana_state_querier.py,sha256=TQELYo6GUoF8s-LfetqYbclNaH8bakQqC7y2ifACIb8,3239
|
324
325
|
defi_services/jobs/queriers/state_querier.py,sha256=q7cAW395urZjcWTpqw8m_nDunLyyTuAXJ3DRx_1HOxo,7384
|
325
326
|
defi_services/jobs/queriers/substrate_state_querier.py,sha256=_T0Dk06sP_uBKaxgj2J_EBtJDoq-hi8jU7Np4iuO0LA,3858
|
@@ -439,7 +440,7 @@ defi_services/services/lending/lending_info/tron/__init__.py,sha256=47DEQpj8HBSa
|
|
439
440
|
defi_services/services/lending/lending_info/tron/justlend_tron.py,sha256=2F4M8zFEE6-gqDKi82M-Xd6kcb2HP8-qmpNzDYorpXE,3741
|
440
441
|
defi_services/services/multicall/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
441
442
|
defi_services/services/multicall/batch_queries_service.py,sha256=HzgKOdkP6kpjR7gySD78aZfX2Bkln3JM3OQ8ehjGWx0,3457
|
442
|
-
defi_services/services/multicall/multicall_v2.py,sha256=
|
443
|
+
defi_services/services/multicall/multicall_v2.py,sha256=5JAqb3Jn5Z-23-Gwz5lMa5DokES-Pf7WtigHMGlG-7k,18695
|
443
444
|
defi_services/services/multicall/state_query_service.py,sha256=1Ob5NX0tXmVUrSB1_mOvFBkOUA8KZJPwH2DMiHwlGhI,23709
|
444
445
|
defi_services/services/vault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
445
446
|
defi_services/services/vault/trava_vault_services.py,sha256=9Sj5W6o7o478MKu7ZOUdqkTtPUzT59eS9yBcU8O4UrM,7705
|
@@ -463,8 +464,8 @@ defi_services/utils/market_service.py,sha256=imPtPHBkpEx5JnhqeIWYqbCjsIEm8IKBYHN
|
|
463
464
|
defi_services/utils/memory_storage.py,sha256=BOT8laB0iVSCGE-oDlpWJQLbSC6X2blKX4zuQbs4inc,851
|
464
465
|
defi_services/utils/sqrt_price_math.py,sha256=9lgUeWFT4wjl3Vq3b7-jZ2bGvvZx7dDBSfVnM3lsZ8o,5575
|
465
466
|
defi_services/utils/thread_proxy.py,sha256=5Z8biAyEReUkh3vfJSvEv7GwMe3CsE5M8CbghkQtePw,2951
|
466
|
-
defi_state_querier-0.5.
|
467
|
-
defi_state_querier-0.5.
|
468
|
-
defi_state_querier-0.5.
|
469
|
-
defi_state_querier-0.5.
|
470
|
-
defi_state_querier-0.5.
|
467
|
+
defi_state_querier-0.5.2.dist-info/LICENSE,sha256=6jmfxa8nUIwfKnzZUxAHJSJ_IS7h7mpbJq26cWjoo-o,1063
|
468
|
+
defi_state_querier-0.5.2.dist-info/METADATA,sha256=9XG6utO08H5bumNn1j90VVJB_iqmMMI7TL3iykTyS6c,4387
|
469
|
+
defi_state_querier-0.5.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
470
|
+
defi_state_querier-0.5.2.dist-info/top_level.txt,sha256=C-OTxHK6MknKK-nAbEzCPDUl1M6pktRhgJrmsozdf6g,14
|
471
|
+
defi_state_querier-0.5.2.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
|
3
|
-
from defi_services.constants.chain_constant import Chain
|
4
|
-
from defi_services.constants.query_constant import Query
|
5
|
-
from defi_services.jobs.processors.state_processor import StateProcessor
|
6
|
-
from defi_services.jobs.queriers.multicall_state_querier import MulticallStateQuerier
|
7
|
-
from defi_services.utils.convert_address import base58_to_hex
|
8
|
-
|
9
|
-
logger = logging.getLogger("MulticallStateProcessor")
|
10
|
-
|
11
|
-
|
12
|
-
class MulticallStateProcessor(StateProcessor):
|
13
|
-
def __init__(self, provider_uri: str, chain_id: str):
|
14
|
-
super().__init__(provider_uri, chain_id)
|
15
|
-
self.state_querier = MulticallStateQuerier(provider_uri, chain_id)
|
File without changes
|
File without changes
|
File without changes
|