abstract-solana 0.0.2.96__py3-none-any.whl → 0.0.2.97__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 abstract-solana might be problematic. Click here for more details.
- abstract_solana/abstract_rpcs/rate_limiter.py +12 -8
- {abstract_solana-0.0.2.96.dist-info → abstract_solana-0.0.2.97.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.2.96.dist-info → abstract_solana-0.0.2.97.dist-info}/RECORD +5 -5
- {abstract_solana-0.0.2.96.dist-info → abstract_solana-0.0.2.97.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.2.96.dist-info → abstract_solana-0.0.2.97.dist-info}/top_level.txt +0 -0
|
@@ -39,7 +39,7 @@ class RateLimiter(metaclass=SingletonMeta):
|
|
|
39
39
|
def __init__(self, rpc_url=None, fallback_rpc_url=None, env_directory=None,save_state_path = None):
|
|
40
40
|
if not hasattr(self, 'initialized'): # Prevent reinitialization
|
|
41
41
|
self.initialized = True
|
|
42
|
-
self.rpc_url = rpc_url or get_env_value(key="solana_primary_rpc_url", path=env_directory) or "
|
|
42
|
+
self.rpc_url = rpc_url or get_env_value(key="solana_primary_rpc_url", path=env_directory) or "https://api.mainnet-beta.solana.com"
|
|
43
43
|
self.fallback_rpc_url = fallback_rpc_url or get_env_value(key="solana_fallback_rpc_url", path=env_directory)
|
|
44
44
|
self.state_file = save_state_path or getSaveStatePath()
|
|
45
45
|
self.url1 = self.rpc_url
|
|
@@ -83,15 +83,17 @@ class RateLimiter(metaclass=SingletonMeta):
|
|
|
83
83
|
return {}
|
|
84
84
|
|
|
85
85
|
def is_all_limit(self, url, method):
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
if method not in self.last_mb[url]:
|
|
87
|
+
self.last_mb[url][method] = 0
|
|
88
|
+
|
|
89
|
+
if self.set_cooldown(url, method):
|
|
90
90
|
print(f'set_cooldown for method {method} in {url} hit')
|
|
91
91
|
return True
|
|
92
92
|
|
|
93
93
|
# Clean up expired queries for the current URL
|
|
94
|
-
self.rate_limits[url] = [
|
|
94
|
+
self.rate_limits[url] = [
|
|
95
|
+
query for query in self.rate_limits[url] if is_time_interval(query.get('time') or 0, 30)
|
|
96
|
+
]
|
|
95
97
|
last_rate_limit = self.get_last_rate_limit(url)
|
|
96
98
|
|
|
97
99
|
# Check data size limits
|
|
@@ -109,7 +111,9 @@ class RateLimiter(metaclass=SingletonMeta):
|
|
|
109
111
|
print(f'time_rate {time_rate} of timerate limit 100 hit')
|
|
110
112
|
return True
|
|
111
113
|
|
|
112
|
-
method_specific_time_rate = [
|
|
114
|
+
method_specific_time_rate = [
|
|
115
|
+
query for query in time_rate if query['method'] == method
|
|
116
|
+
]
|
|
113
117
|
if len(method_specific_time_rate) > 40:
|
|
114
118
|
print(f'method_specific_time_rate {len(method_specific_time_rate)} of method_specific_time_rate limit 40 hit')
|
|
115
119
|
return True
|
|
@@ -168,6 +172,6 @@ class RateLimiter(metaclass=SingletonMeta):
|
|
|
168
172
|
if not is_limit:
|
|
169
173
|
self.last_method = method
|
|
170
174
|
self.last_url = self.url1
|
|
175
|
+
print([is_limit,self.last_url])
|
|
171
176
|
return self.last_url
|
|
172
177
|
|
|
173
|
-
|
|
@@ -3,7 +3,7 @@ abstract_solana/abstract_rpcs/__init__.py,sha256=LIkUCWcuzUWVN1WjzcXjQ9Pl7cbcN8T
|
|
|
3
3
|
abstract_solana/abstract_rpcs/db_templates.py,sha256=sjdHfHIq9bO6VuDm3hwzn46NUrXXrGnB0knYNeVU7k8,29839
|
|
4
4
|
abstract_solana/abstract_rpcs/get_api_gui.py,sha256=OZ61HHb0gwdYjirwFFmnwk8z9x5np3cecCj9MdmuF8U,12372
|
|
5
5
|
abstract_solana/abstract_rpcs/get_body.py,sha256=UV85217q7mIpYOhVZdnzfmgZxD3QM0w0J0oevXyYtdE,51272
|
|
6
|
-
abstract_solana/abstract_rpcs/rate_limiter.py,sha256=
|
|
6
|
+
abstract_solana/abstract_rpcs/rate_limiter.py,sha256=yfUwmdMXty05VN_A-baTrOKY4EH9fYF1Vc7SKPZgcTk,7248
|
|
7
7
|
abstract_solana/abstract_rpcs/solana_rpc_client.py,sha256=s-Mg0mDcDwjU3dm6nK_U6wWysaWTLoC4eXpSHbYsbyY,4132
|
|
8
8
|
abstract_solana/abstract_utils/__init__.py,sha256=HCbBVQ5BIFCVkFqqTMHp1Y__YQAO4HTq_KHVdMCe89U,296
|
|
9
9
|
abstract_solana/abstract_utils/account_key_utils.py,sha256=VMJd4GOTK1vn8UZsfXDnjxDOGoQWGY6fvflJqPZ7Xvs,877
|
|
@@ -20,7 +20,7 @@ abstract_solana/pump_functions/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4h
|
|
|
20
20
|
abstract_solana/pump_functions/buy_sell_pump.py,sha256=gjv_1et20s1Li0ygcURofO29VPkO1v-a5G5Bo_sZs_c,7860
|
|
21
21
|
abstract_solana/pump_functions/pump_fun_keys.py,sha256=BeWbV9_wd-c6ydF33drW-gZBDPWolbsMZL4cNhP3eOU,8537
|
|
22
22
|
abstract_solana/pump_functions/token_utils.py,sha256=O-Fgj3L1NhND-k4INa3WvLAEXg2N9u1fVqyLFzn1PwM,2714
|
|
23
|
-
abstract_solana-0.0.2.
|
|
24
|
-
abstract_solana-0.0.2.
|
|
25
|
-
abstract_solana-0.0.2.
|
|
26
|
-
abstract_solana-0.0.2.
|
|
23
|
+
abstract_solana-0.0.2.97.dist-info/METADATA,sha256=IYWiMCR0vie-B4rhySGJ8gf2VJ8YgPWgOLVu_FeXcsM,981
|
|
24
|
+
abstract_solana-0.0.2.97.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
25
|
+
abstract_solana-0.0.2.97.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
26
|
+
abstract_solana-0.0.2.97.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|