defi-state-querier 0.4.28__py3-none-any.whl → 0.4.29__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/multi_state_processor.py +21 -1
- {defi_state_querier-0.4.28.dist-info → defi_state_querier-0.4.29.dist-info}/METADATA +1 -1
- {defi_state_querier-0.4.28.dist-info → defi_state_querier-0.4.29.dist-info}/RECORD +7 -7
- {defi_state_querier-0.4.28.dist-info → defi_state_querier-0.4.29.dist-info}/LICENSE +0 -0
- {defi_state_querier-0.4.28.dist-info → defi_state_querier-0.4.29.dist-info}/WHEEL +0 -0
- {defi_state_querier-0.4.28.dist-info → defi_state_querier-0.4.29.dist-info}/top_level.txt +0 -0
defi_services/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.4.
|
1
|
+
__version__ = "0.4.29"
|
@@ -3,6 +3,7 @@ import logging
|
|
3
3
|
from web3 import Web3
|
4
4
|
|
5
5
|
from defi_services.constants.entities.lending_services import LendingServices
|
6
|
+
from defi_services.constants.query_constant import Query
|
6
7
|
from defi_services.jobs.queriers.state_querier import StateQuerier
|
7
8
|
from defi_services.services.nft_services import NFTServices
|
8
9
|
from defi_services.services.protocol_services import ProtocolServices
|
@@ -44,6 +45,15 @@ class MultiStateProcessor:
|
|
44
45
|
if entity_id in self.services:
|
45
46
|
entity_service: ProtocolServices = self.services.get(entity_id)
|
46
47
|
rpc_calls.update(entity_service.get_function_info([query_type], wallet, block_number, **kwargs))
|
48
|
+
|
49
|
+
if query_type == Query.token_balance:
|
50
|
+
entity_service: TokenServices = self.token_service
|
51
|
+
rpc_calls.update(entity_service.get_function_info(wallet, entity_id, block_number))
|
52
|
+
|
53
|
+
if query_type == Query.nft_balance:
|
54
|
+
entity_service: NFTServices = self.nft_service
|
55
|
+
rpc_calls.update(entity_service.get_function_info(wallet, entity_id, block_number))
|
56
|
+
|
47
57
|
queries[entity_id] = rpc_calls
|
48
58
|
|
49
59
|
return {query_id: queries}
|
@@ -77,7 +87,17 @@ class MultiStateProcessor:
|
|
77
87
|
query_value = decoded_data.get(query_id)
|
78
88
|
for entity, entity_value in query_value.items():
|
79
89
|
result["entity_id"] = entity
|
80
|
-
if
|
90
|
+
if query_type == Query.token_balance:
|
91
|
+
entity_service: TokenServices = self.token_service
|
92
|
+
data = entity_service.get_data(
|
93
|
+
wallet, entity, entity_value, block_number, **kwargs
|
94
|
+
)
|
95
|
+
elif query_type == Query.nft_balance:
|
96
|
+
entity_service: NFTServices = self.nft_service
|
97
|
+
data = entity_service.get_data(
|
98
|
+
wallet, entity, entity_value, block_number, **kwargs
|
99
|
+
)
|
100
|
+
elif entity in self.lending_services:
|
81
101
|
entity_service: ProtocolServices = self.services.get(entity)
|
82
102
|
data = entity_service.get_data(
|
83
103
|
[query_type], wallet, entity_value, block_number, **kwargs)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
defi_services/__init__.py,sha256=
|
1
|
+
defi_services/__init__.py,sha256=LtSKwkqgueDQK6uLnhs8HgKylJHH36EMo48UDeHgv2Y,23
|
2
2
|
defi_services/abis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
defi_services/abis/dex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
defi_services/abis/dex/biswap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -311,7 +311,7 @@ defi_services/constants/entities/vault_services.py,sha256=IMmQc15wS1KA7EuQqM_Ara
|
|
311
311
|
defi_services/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
312
312
|
defi_services/jobs/processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
313
313
|
defi_services/jobs/processors/cosmos_state_processor.py,sha256=2S5fhqHQ4pUtRaLnbFJNUo4jKc5MHq7HA-0FHebOJyo,1334
|
314
|
-
defi_services/jobs/processors/multi_state_processor.py,sha256=
|
314
|
+
defi_services/jobs/processors/multi_state_processor.py,sha256=W-5qLwIFj4kfx0V2Tj7eg0mjrRb3jyPdxEBB2TBxbW4,5726
|
315
315
|
defi_services/jobs/processors/solana_state_processor.py,sha256=szsBYrkEV8kBzuA_iaSVescnwKJ2MHoTbut5kORbWTs,4065
|
316
316
|
defi_services/jobs/processors/state_processor.py,sha256=Ze_5isU_l_APB262E-VV_4KZwEG6W0XE6PikJZIcAoM,7291
|
317
317
|
defi_services/jobs/processors/substrate_state_processor.py,sha256=KkiY1NkaxnizNJBTfn4twB-zuQo3fT3akOlbie8VF5g,3940
|
@@ -452,8 +452,8 @@ defi_services/utils/market_service.py,sha256=imPtPHBkpEx5JnhqeIWYqbCjsIEm8IKBYHN
|
|
452
452
|
defi_services/utils/memory_storage.py,sha256=BOT8laB0iVSCGE-oDlpWJQLbSC6X2blKX4zuQbs4inc,851
|
453
453
|
defi_services/utils/sqrt_price_math.py,sha256=9lgUeWFT4wjl3Vq3b7-jZ2bGvvZx7dDBSfVnM3lsZ8o,5575
|
454
454
|
defi_services/utils/thread_proxy.py,sha256=5Z8biAyEReUkh3vfJSvEv7GwMe3CsE5M8CbghkQtePw,2951
|
455
|
-
defi_state_querier-0.4.
|
456
|
-
defi_state_querier-0.4.
|
457
|
-
defi_state_querier-0.4.
|
458
|
-
defi_state_querier-0.4.
|
459
|
-
defi_state_querier-0.4.
|
455
|
+
defi_state_querier-0.4.29.dist-info/LICENSE,sha256=6jmfxa8nUIwfKnzZUxAHJSJ_IS7h7mpbJq26cWjoo-o,1063
|
456
|
+
defi_state_querier-0.4.29.dist-info/METADATA,sha256=g77_aICw-H-02oRz1njjw6NjNphiU_-p-IpgK8C9tdA,4388
|
457
|
+
defi_state_querier-0.4.29.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
458
|
+
defi_state_querier-0.4.29.dist-info/top_level.txt,sha256=C-OTxHK6MknKK-nAbEzCPDUl1M6pktRhgJrmsozdf6g,14
|
459
|
+
defi_state_querier-0.4.29.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|