abstract-solana 0.0.2.115__py3-none-any.whl → 0.0.2.117__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/__init__.py +1 -1
- abstract_solana/abstract_solana_utils/__init__.py +3 -0
- abstract_solana/abstract_solana_utils/bondingCurves.py +29 -0
- abstract_solana/abstract_solana_utils/genesis_functions.py +38 -0
- abstract_solana/abstract_solana_utils/pubKeyUtils.py +79 -0
- abstract_solana/pumpFun/constants.py +1 -1
- {abstract_solana-0.0.2.115.dist-info → abstract_solana-0.0.2.117.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.2.115.dist-info → abstract_solana-0.0.2.117.dist-info}/RECORD +10 -6
- {abstract_solana-0.0.2.115.dist-info → abstract_solana-0.0.2.117.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.2.115.dist-info → abstract_solana-0.0.2.117.dist-info}/top_level.txt +0 -0
abstract_solana/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
from .
|
|
1
|
+
from .abstract_solana_utils import *
|
|
2
2
|
from .pumpFun import *
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from .pubKeyUtils import get_pubkey,pubkey_find_program_address,Pubkey
|
|
2
|
+
from spl.token.instructions import create_associated_token_account, get_associated_token_address
|
|
3
|
+
from ..pumpFun import PUMP_FUN_PROGRAM
|
|
4
|
+
def derive_associated_bonding_curve(mint,programId=None):
|
|
5
|
+
return get_associated_token_address(derive_bonding_curve(mint,get_pubkey(programId))[0], get_pubkey(mint))
|
|
6
|
+
def derive_bonding_curve(mint,programId=None):
|
|
7
|
+
programId = programId or PUMP_FUN_PROGRAM
|
|
8
|
+
return Pubkey.find_program_address(["bonding-curve".encode(), get_pubkey_bytes(mint)],get_pubkey(programId))
|
|
9
|
+
def derive_bonding_curve_accounts(mint_str: str,programId=None):
|
|
10
|
+
mintPubKey = get_pubkey(mint_str)
|
|
11
|
+
if not mintPubKey.is_on_curve():
|
|
12
|
+
return {}
|
|
13
|
+
bonding_curve, _ = derive_bonding_curve(mintPubKey,programId)
|
|
14
|
+
associated_bonding_curve = get_associated_token_address(bonding_curve, mintPubKey)
|
|
15
|
+
return {'bonding_curve': bonding_curve, "associated_bonding_curve": associated_bonding_curve}
|
|
16
|
+
def get_bonding_curve(mint:str):
|
|
17
|
+
return derive_bonding_curve_accounts(mint).get('bonding_curve')
|
|
18
|
+
def get_associated_bonding_curve(mint:str):
|
|
19
|
+
return derive_bonding_curve_accounts(mint).get("associated_bonding_curve")
|
|
20
|
+
def isOnCurve(obj):
|
|
21
|
+
pubkey = get_pubkey(obj)
|
|
22
|
+
is_on_curve = pubkey.is_on_curve()
|
|
23
|
+
return is_on_curve
|
|
24
|
+
def derive_associated_bonding_curve(mint,programId=None):
|
|
25
|
+
programId = programId or PUMP_FUN_PROGRAM
|
|
26
|
+
return get_associated_token_address(derive_bonding_curve(mint,get_pubkey(programId))[0], get_pubkey(mint))
|
|
27
|
+
def derive_bonding_curve(mint,programId=None):
|
|
28
|
+
programId = programId or PUMP_FUN_PROGRAM
|
|
29
|
+
return pubkey_find_program_address("bonding-curve",mint,get_pubkey(programId))
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from abstract_apis import 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
|
+
import asyncio
|
|
4
|
+
import asyncio,httpx,logging
|
|
5
|
+
def get_block_time_from_txn(txnData):
|
|
6
|
+
return int(get_any_value('txnDatablockTime') or 0)
|
|
7
|
+
def get_error_message_from_txn(txnData):
|
|
8
|
+
return make_list(get_any_value(txnData,'err'))[0]
|
|
9
|
+
def get_errorless_txn_from_signature_array(signatureArray):
|
|
10
|
+
return [sig for sig in signatureArray or [] if get_error_message_from_txn(sig) == None]
|
|
11
|
+
def return_oldest_from_signature_array(signatureArray,errorless=False):
|
|
12
|
+
if errorless:
|
|
13
|
+
signatureArray = get_errorless_txn_from_signature_array(signatureArray)
|
|
14
|
+
if signatureArray and isinstance(signatureArray,list):
|
|
15
|
+
if get_block_time_from_txn(signatureArray[0])<get_block_time_from_txn(signatureArray[-1]):
|
|
16
|
+
return signatureArray[0].get('signature')
|
|
17
|
+
return signatureArray[-1].get('signature')
|
|
18
|
+
def return_oldest_last_and_original_length_from_signature_array(signatureArray):
|
|
19
|
+
return {"oldest":return_oldest_from_signature_array(signatureArray),
|
|
20
|
+
"oldestValid":return_oldest_from_signature_array(signatureArray,errorless=True),
|
|
21
|
+
"length":len(signatureArray or '')}
|
|
22
|
+
async def getGenesisSignature(address, limit=1000, before=None,encoding='jsonParsed',commitment=0,errorProof=True):
|
|
23
|
+
method = "getGenesisSignature"
|
|
24
|
+
validBefore=None
|
|
25
|
+
oldest=None
|
|
26
|
+
validOldest=None
|
|
27
|
+
while True:
|
|
28
|
+
signatureArray = await async_make_rate_limited_call(method ="getSignaturesForAddress",params=[address, {"limit":limit, "until":before}],solcatcherSettings={"getResponse":True,"getResult":'result'})
|
|
29
|
+
original_length = len(signatureArray or '')
|
|
30
|
+
signature_array_data = return_oldest_last_and_original_length_from_signature_array(signatureArray)
|
|
31
|
+
oldest = signature_array_data.get('oldest',oldest) or oldest
|
|
32
|
+
validOldest = signature_array_data.get('oldestValid',validOldest) or validOldest
|
|
33
|
+
if original_length < limit or original_length == 0 or (original_length>0 and (oldest == validOldest or oldest == before) and last_sig != None):
|
|
34
|
+
return validOldest
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from solders.pubkey import Pubkey
|
|
2
|
+
from solders.signature import Signature
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def pubkey_find_program_address(string,address,programId):
|
|
6
|
+
return Pubkey.find_program_address([str(string).encode(), bytes(get_pubkey(address))],get_pubkey(programId))
|
|
7
|
+
|
|
8
|
+
def get_pubString(obj):
|
|
9
|
+
return Pubkey.from_string(str(obj))
|
|
10
|
+
|
|
11
|
+
def get_sigString(obj):
|
|
12
|
+
return Signature.from_string(str(obj))
|
|
13
|
+
|
|
14
|
+
def is_sigkey(obj):
|
|
15
|
+
return isinstance(obj,Signature)
|
|
16
|
+
|
|
17
|
+
def is_pubkey(obj):
|
|
18
|
+
return isinstance(obj,Pubkey)
|
|
19
|
+
|
|
20
|
+
def get_pubBytes(obj):
|
|
21
|
+
return Pubkey.from_bytes(obj)
|
|
22
|
+
|
|
23
|
+
def get_sigBytes(obj):
|
|
24
|
+
return Signature.from_bytes(obj)
|
|
25
|
+
|
|
26
|
+
def try_pubkey(obj):
|
|
27
|
+
return is_pubkey(get_pubkey(obj))
|
|
28
|
+
|
|
29
|
+
def try_sigkey(obj):
|
|
30
|
+
return is_sigkey(get_sigkey(obj))
|
|
31
|
+
|
|
32
|
+
def get_pubkey(obj):
|
|
33
|
+
if is_pubkey(obj):
|
|
34
|
+
return obj
|
|
35
|
+
address = obj
|
|
36
|
+
if isinstance(obj,bytes):
|
|
37
|
+
pubkey = get_pubBytes(address)
|
|
38
|
+
if is_pubkey(pubkey):
|
|
39
|
+
return pubkey
|
|
40
|
+
if isinstance(obj,str):
|
|
41
|
+
try:
|
|
42
|
+
pubkey= get_pubString(obj)
|
|
43
|
+
except:
|
|
44
|
+
pubkey = obj
|
|
45
|
+
if is_pubkey(pubkey):
|
|
46
|
+
return pubkey
|
|
47
|
+
return obj
|
|
48
|
+
|
|
49
|
+
def get_pubkey_bytes(obj):
|
|
50
|
+
pubkey = get_pubkey(obj)
|
|
51
|
+
try:
|
|
52
|
+
pubKeyBytes = bytes(pubkey)
|
|
53
|
+
return pubKeyBytes
|
|
54
|
+
except:
|
|
55
|
+
return obj
|
|
56
|
+
|
|
57
|
+
def get_pubkey_base58(obj):
|
|
58
|
+
pubkey = get_pubkey(obj)
|
|
59
|
+
address = pubkey.to_base58() # Convert to string
|
|
60
|
+
return address
|
|
61
|
+
|
|
62
|
+
def get_sigkey(obj):
|
|
63
|
+
if is_sigkey(obj):
|
|
64
|
+
return obj
|
|
65
|
+
signature = obj
|
|
66
|
+
if isinstance(signature,bytes):
|
|
67
|
+
sigKey = get_sigBytes(signature)
|
|
68
|
+
if is_sigkey(sigKey):
|
|
69
|
+
return sigKey
|
|
70
|
+
if isinstance(signature,str):
|
|
71
|
+
try:
|
|
72
|
+
sigKey= get_sigString(signature)
|
|
73
|
+
except:
|
|
74
|
+
sigKey = signature
|
|
75
|
+
if is_sigkey(sigKey):
|
|
76
|
+
return sigKey
|
|
77
|
+
return obj
|
|
78
|
+
|
|
79
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from ..
|
|
1
|
+
from ..abstract_solana_utils import get_pubkey,Pubkey
|
|
2
2
|
PUMP_FUN_GLOBAL = get_pubkey("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf")
|
|
3
3
|
PUMP_FUN_FEE_RECIPIENT = get_pubkey("CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM")
|
|
4
4
|
PUMP_FUN_SYSTEM_PROGRAM = get_pubkey("11111111111111111111111111111111")
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
abstract_solana/__init__.py,sha256=
|
|
1
|
+
abstract_solana/__init__.py,sha256=j8z8TgBVpbo74aoBEvch6iB1pAACaMTa3Vk9S6WIX4Q,60
|
|
2
2
|
abstract_solana/abstract_rpcs/__init__.py,sha256=LIkUCWcuzUWVN1WjzcXjQ9Pl7cbcN8TwknXir-Uk34c,168
|
|
3
3
|
abstract_solana/abstract_rpcs/db_templates.py,sha256=sjdHfHIq9bO6VuDm3hwzn46NUrXXrGnB0knYNeVU7k8,29839
|
|
4
4
|
abstract_solana/abstract_rpcs/get_api_gui.py,sha256=zii6XCRD_wmgcupqCSH5lyXIvg5nxZdpmcQm4ykDi0o,12180
|
|
5
5
|
abstract_solana/abstract_rpcs/get_body.py,sha256=UV85217q7mIpYOhVZdnzfmgZxD3QM0w0J0oevXyYtdE,51272
|
|
6
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
|
+
abstract_solana/abstract_solana_utils/__init__.py,sha256=9wyZpK5Gv3xMhmhHWA9OarvH3VqLXLO6mx4RNU6bgSo,89
|
|
9
|
+
abstract_solana/abstract_solana_utils/bondingCurves.py,sha256=gGAm0dyrth3ScTRzhIWwb1_cA7GMztdkwmuB2ylT79c,1717
|
|
10
|
+
abstract_solana/abstract_solana_utils/genesis_functions.py,sha256=-O44ZHYb6zrhvqhPpN1cZzdUpvON2q4sPblS4Ezo-ag,2223
|
|
11
|
+
abstract_solana/abstract_solana_utils/pubKeyUtils.py,sha256=IZuQN7TUFCUxqv0q_FiufIw1OkNgF252gF6W-LzAluA,1856
|
|
8
12
|
abstract_solana/abstract_utils/__init__.py,sha256=d0JzaSlwLMU4GPq8PO7UucTtNXUSVdBjOAtIZ8BDAQE,60
|
|
9
13
|
abstract_solana/abstract_utils/account_key_utils.py,sha256=VMJd4GOTK1vn8UZsfXDnjxDOGoQWGY6fvflJqPZ7Xvs,877
|
|
10
14
|
abstract_solana/abstract_utils/constants.py,sha256=cSmCKzQiNZocX1YkKYrdY-O449aYhi7BT_j-45HZN-E,1418
|
|
@@ -18,7 +22,7 @@ abstract_solana/abstract_utils/pubkey_utils.py,sha256=TAYF74fKAuTBnqIP2SnA-BttO5
|
|
|
18
22
|
abstract_solana/abstract_utils/signature_data_parse.py,sha256=5AOMtJZADWcwR0JLDbd2kXZNzW129qeB0lvYUrE_tm0,1974
|
|
19
23
|
abstract_solana/abstract_utils/utils.py,sha256=RcnGEiZ0aJbcw8ObpjHU3WUFU4Tmy-exCs6qIbEu4_c,444
|
|
20
24
|
abstract_solana/pumpFun/__init__.py,sha256=81quoggCuIypZjZs3bbf1Ty70KHdva5RGEJxi0oC57E,25
|
|
21
|
-
abstract_solana/pumpFun/constants.py,sha256=
|
|
25
|
+
abstract_solana/pumpFun/constants.py,sha256=jmSZWzfH2HkfKUoIUgvTzAtn9PqsPTZJ0I3UQXV4l0c,779
|
|
22
26
|
abstract_solana/pump_functions/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4hjczjzvuwy3sHg,85
|
|
23
27
|
abstract_solana/pump_functions/buy_sell_pump.py,sha256=gjv_1et20s1Li0ygcURofO29VPkO1v-a5G5Bo_sZs_c,7860
|
|
24
28
|
abstract_solana/pump_functions/pump_fun_keys.py,sha256=BeWbV9_wd-c6ydF33drW-gZBDPWolbsMZL4cNhP3eOU,8537
|
|
@@ -27,7 +31,7 @@ abstract_solana/utils/__init__.py,sha256=9wyZpK5Gv3xMhmhHWA9OarvH3VqLXLO6mx4RNU6
|
|
|
27
31
|
abstract_solana/utils/bondingCurves.py,sha256=gGAm0dyrth3ScTRzhIWwb1_cA7GMztdkwmuB2ylT79c,1717
|
|
28
32
|
abstract_solana/utils/genesis_functions.py,sha256=-O44ZHYb6zrhvqhPpN1cZzdUpvON2q4sPblS4Ezo-ag,2223
|
|
29
33
|
abstract_solana/utils/pubKeyUtils.py,sha256=IZuQN7TUFCUxqv0q_FiufIw1OkNgF252gF6W-LzAluA,1856
|
|
30
|
-
abstract_solana-0.0.2.
|
|
31
|
-
abstract_solana-0.0.2.
|
|
32
|
-
abstract_solana-0.0.2.
|
|
33
|
-
abstract_solana-0.0.2.
|
|
34
|
+
abstract_solana-0.0.2.117.dist-info/METADATA,sha256=h11AoDwYEyhIjq3tWh9b2DPzSwgqLTfy9Y4KJxZHuTA,1162
|
|
35
|
+
abstract_solana-0.0.2.117.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
36
|
+
abstract_solana-0.0.2.117.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
37
|
+
abstract_solana-0.0.2.117.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|