abstract-solana 0.0.2.133__py3-none-any.whl → 0.0.2.137__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.
- abstract_solana/abstract_solana_utils/genesis_functions.py +17 -9
- abstract_solana/rpc_utils/rpc_utils.py +13 -9
- {abstract_solana-0.0.2.133.dist-info → abstract_solana-0.0.2.137.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.2.133.dist-info → abstract_solana-0.0.2.137.dist-info}/RECORD +6 -6
- {abstract_solana-0.0.2.133.dist-info → abstract_solana-0.0.2.137.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.2.133.dist-info → abstract_solana-0.0.2.137.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
from abstract_apis import get_headers,get_response,get_text_response,load_inner_json
|
|
2
|
-
from abstract_solcatcher import
|
|
1
|
+
from abstract_apis import get_async_response,get_headers,get_response,get_text_response,load_inner_json
|
|
2
|
+
from abstract_solcatcher import call_solcatcher_db,async_call_solcatcher_py,async_make_rate_limited_call
|
|
3
3
|
from abstract_utilities import get_any_value,make_list
|
|
4
4
|
from ..rpc_utils import get_signatures,async_get_signatures
|
|
5
5
|
import asyncio,httpx,logging
|
|
6
|
+
async def call_async_function(func, *args, **kwargs):
|
|
7
|
+
"""Helper function to call async functions in sync or async contexts."""
|
|
8
|
+
if asyncio.isrunning():
|
|
9
|
+
# If an event loop is already running, use await
|
|
10
|
+
return await func(*args, **kwargs)
|
|
11
|
+
else:
|
|
12
|
+
# If no event loop is running, use asyncio.run()
|
|
13
|
+
return await asyncio.run(func(*args, **kwargs))
|
|
6
14
|
def get_block_time_from_txn(txnData):
|
|
7
15
|
return int(get_any_value(txnData,'blockTime') or 0)
|
|
8
16
|
def get_error_message_from_txn(txnData):
|
|
@@ -20,24 +28,24 @@ def return_oldest_last_and_original_length_from_signature_array(signatureArray):
|
|
|
20
28
|
return {"oldest":return_oldest_from_signature_array(signatureArray),
|
|
21
29
|
"oldestValid":return_oldest_from_signature_array(signatureArray,errorless=True),
|
|
22
30
|
"length":len(signatureArray or '')}
|
|
23
|
-
def get_first_sigs(address, until=None, limit=1000,get_signature_function=None):
|
|
31
|
+
async def get_first_sigs(address, until=None, limit=1000,get_signature_function=None):
|
|
24
32
|
get_signature_function = get_signature_function or async_get_signatures
|
|
25
33
|
original_length=None
|
|
26
34
|
while True:
|
|
27
|
-
signatureArray =
|
|
35
|
+
signatureArray = await get_signature_function(address,until=until, limit=limit)
|
|
28
36
|
if signatureArray:
|
|
29
37
|
original_length = len(signatureArray)
|
|
30
38
|
if original_length:
|
|
31
39
|
return signatureArray
|
|
32
|
-
def
|
|
40
|
+
async def async_getGenesisSignature(address, limit=1000, until=None,encoding='jsonParsed',commitment=0,get_signature_function=None,errorProof=True,url_1_only=True,url_2_only=False):
|
|
33
41
|
method = "getGenesisSignature"
|
|
34
42
|
validBefore=None
|
|
35
43
|
get_signature_function = get_signature_function or async_get_signatures
|
|
36
|
-
signatureArray =
|
|
44
|
+
signatureArray = await get_first_sigs(address, until=until, limit=limit,get_signature_function=get_signature_function)
|
|
37
45
|
original_length=len(signatureArray)
|
|
38
46
|
while True:
|
|
39
47
|
if validBefore != None:
|
|
40
|
-
signatureArray =
|
|
48
|
+
signatureArray = await get_signature_function(address, until=until, limit=limit)
|
|
41
49
|
if signatureArray:
|
|
42
50
|
original_length = len(signatureArray)
|
|
43
51
|
else:
|
|
@@ -48,9 +56,9 @@ def getGenesisSignature(address, limit=1000, until=None,encoding='jsonParsed',co
|
|
|
48
56
|
if original_length < limit or original_length == 0 or (original_length>0 and (oldest == validOldest or oldest == validBefore) and oldest != None):
|
|
49
57
|
return validOldest
|
|
50
58
|
validBefore = oldest
|
|
51
|
-
|
|
59
|
+
|
|
52
60
|
def getGenesisSignature(*args,**kwargs):
|
|
53
|
-
return
|
|
61
|
+
return get_async_response(async_getGenesisSignature,*args,**kwargs))
|
|
54
62
|
|
|
55
63
|
|
|
56
64
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import requests,json
|
|
2
|
+
from abstract_security import get_env_value
|
|
3
|
+
solana_rpc_url="http://api.mainnet-beta.solana.com"
|
|
2
4
|
def get_if_None(obj,fallBack):
|
|
3
5
|
return obj if obj != None else fallBack
|
|
4
6
|
def get_rpc_payload(method,params=None,id=None,jsonrpc=None):
|
|
@@ -20,11 +22,11 @@ def get_result(response):
|
|
|
20
22
|
except:
|
|
21
23
|
result = response.text
|
|
22
24
|
return result
|
|
23
|
-
def make_rpc_call(method, params=[]):
|
|
24
|
-
|
|
25
|
+
def make_rpc_call(method, params=[],rpc_url=None):
|
|
26
|
+
rpc_url = rpc_url or solana_rpc_url
|
|
25
27
|
headers = {'Content-Type': 'application/json'}
|
|
26
28
|
payload = get_rpc_payload(method=method, params=params)
|
|
27
|
-
response = requests.post(
|
|
29
|
+
response = requests.post(rpc_url, data=json.dumps(payload), headers=headers)
|
|
28
30
|
return response
|
|
29
31
|
def get_transaction(signature):
|
|
30
32
|
transaction=None
|
|
@@ -36,13 +38,15 @@ def get_transaction(signature):
|
|
|
36
38
|
if transaction:
|
|
37
39
|
break
|
|
38
40
|
return transaction
|
|
39
|
-
def get_signatures(address, until=None, limit=1000):
|
|
41
|
+
def get_signatures(address, until=None, limit=1000,rpc_url=None):
|
|
42
|
+
rpc_url = rpc_url or solana_rpc_url
|
|
40
43
|
method = 'getSignaturesForAddress'
|
|
41
|
-
params = [address, {"limit": limit}]
|
|
42
|
-
response = make_rpc_call(method=method,params=params)
|
|
44
|
+
params = [address, {"until":until,"limit": limit}]
|
|
45
|
+
response = make_rpc_call(method=method,params=params,rpc_url=rpc_url)
|
|
43
46
|
return get_result(response)
|
|
44
|
-
async def async_get_signatures(address, until=None, limit=1000):
|
|
47
|
+
async def async_get_signatures(address, until=None, limit=1000,rpc_url=None):
|
|
48
|
+
rpc_url = rpc_url or solana_rpc_url
|
|
45
49
|
method = 'getSignaturesForAddress'
|
|
46
|
-
params = [address, {"limit": limit}]
|
|
47
|
-
response = make_rpc_call(method=method,params=params)
|
|
50
|
+
params = [address, {"until":until,"limit": limit}]
|
|
51
|
+
response = make_rpc_call(method=method,params=params,rpc_url=rpc_url)
|
|
48
52
|
return get_result(response)
|
|
@@ -7,7 +7,7 @@ abstract_solana/abstract_rpcs/rate_limiter.py,sha256=yfUwmdMXty05VN_A-baTrOKY4EH
|
|
|
7
7
|
abstract_solana/abstract_rpcs/solana_rpc_client.py,sha256=s-Mg0mDcDwjU3dm6nK_U6wWysaWTLoC4eXpSHbYsbyY,4132
|
|
8
8
|
abstract_solana/abstract_solana_utils/__init__.py,sha256=9wyZpK5Gv3xMhmhHWA9OarvH3VqLXLO6mx4RNU6bgSo,89
|
|
9
9
|
abstract_solana/abstract_solana_utils/bondingCurves.py,sha256=06vmusYnq2jcZasPNC8mzsv6Qoz0AaRenue3VCmiXzw,1342
|
|
10
|
-
abstract_solana/abstract_solana_utils/genesis_functions.py,sha256=
|
|
10
|
+
abstract_solana/abstract_solana_utils/genesis_functions.py,sha256=hzJMzKo0G3clOHDj3djTM3W9KJwUwzQ5puQk8FhoL5E,3537
|
|
11
11
|
abstract_solana/abstract_solana_utils/pubKeyUtils.py,sha256=IZuQN7TUFCUxqv0q_FiufIw1OkNgF252gF6W-LzAluA,1856
|
|
12
12
|
abstract_solana/abstract_utils/__init__.py,sha256=d0JzaSlwLMU4GPq8PO7UucTtNXUSVdBjOAtIZ8BDAQE,60
|
|
13
13
|
abstract_solana/abstract_utils/account_key_utils.py,sha256=VMJd4GOTK1vn8UZsfXDnjxDOGoQWGY6fvflJqPZ7Xvs,877
|
|
@@ -28,12 +28,12 @@ abstract_solana/pump_functions/buy_sell_pump.py,sha256=gjv_1et20s1Li0ygcURofO29V
|
|
|
28
28
|
abstract_solana/pump_functions/pump_fun_keys.py,sha256=BeWbV9_wd-c6ydF33drW-gZBDPWolbsMZL4cNhP3eOU,8537
|
|
29
29
|
abstract_solana/pump_functions/token_utils.py,sha256=O-Fgj3L1NhND-k4INa3WvLAEXg2N9u1fVqyLFzn1PwM,2714
|
|
30
30
|
abstract_solana/rpc_utils/__init__.py,sha256=N0ZEvVoLpxi0lWX0ZjBt3mKWGLVvDw35moj_2e9vChk,25
|
|
31
|
-
abstract_solana/rpc_utils/rpc_utils.py,sha256=
|
|
31
|
+
abstract_solana/rpc_utils/rpc_utils.py,sha256=SbB2rYVr7rLtrDHsAGPGV_kBBL6DcagYaPiJkMFMto0,1984
|
|
32
32
|
abstract_solana/utils/__init__.py,sha256=9wyZpK5Gv3xMhmhHWA9OarvH3VqLXLO6mx4RNU6bgSo,89
|
|
33
33
|
abstract_solana/utils/bondingCurves.py,sha256=gGAm0dyrth3ScTRzhIWwb1_cA7GMztdkwmuB2ylT79c,1717
|
|
34
34
|
abstract_solana/utils/genesis_functions.py,sha256=-O44ZHYb6zrhvqhPpN1cZzdUpvON2q4sPblS4Ezo-ag,2223
|
|
35
35
|
abstract_solana/utils/pubKeyUtils.py,sha256=IZuQN7TUFCUxqv0q_FiufIw1OkNgF252gF6W-LzAluA,1856
|
|
36
|
-
abstract_solana-0.0.2.
|
|
37
|
-
abstract_solana-0.0.2.
|
|
38
|
-
abstract_solana-0.0.2.
|
|
39
|
-
abstract_solana-0.0.2.
|
|
36
|
+
abstract_solana-0.0.2.137.dist-info/METADATA,sha256=APeZqK9PPIcQlKKuo1U4_w9jVIaO7BB10u2nGYV8oBU,1162
|
|
37
|
+
abstract_solana-0.0.2.137.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
38
|
+
abstract_solana-0.0.2.137.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
39
|
+
abstract_solana-0.0.2.137.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|