abstract-solana 0.0.2.99__py3-none-any.whl → 0.0.2.100__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_utils/__init__.py +1 -10
- abstract_solana/abstract_utils/pubKeyUtils.py +72 -0
- {abstract_solana-0.0.2.99.dist-info → abstract_solana-0.0.2.100.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.2.99.dist-info → abstract_solana-0.0.2.100.dist-info}/RECORD +6 -5
- {abstract_solana-0.0.2.99.dist-info → abstract_solana-0.0.2.100.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.2.99.dist-info → abstract_solana-0.0.2.100.dist-info}/top_level.txt +0 -0
|
@@ -1,10 +1 @@
|
|
|
1
|
-
from .
|
|
2
|
-
from .genesis_functions import *
|
|
3
|
-
from .index_utils import *
|
|
4
|
-
from .price_utils import *
|
|
5
|
-
from .pubkey_utils import *
|
|
6
|
-
from .signature_data_parse import *
|
|
7
|
-
from .utils import *
|
|
8
|
-
from .log_message_functions import *
|
|
9
|
-
from .constants import *
|
|
10
|
-
from .keypair_utils import *
|
|
1
|
+
from .pubKeyUtils import *
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from solders.pubkey import Pubkey
|
|
2
|
+
from solders.signature import Signature
|
|
3
|
+
from spl.token.instructions import get_associated_token_address
|
|
4
|
+
TOKEN_PROGRAM_ID = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
|
|
5
|
+
|
|
6
|
+
def pubkey_find_program_address(string,address,programId):
|
|
7
|
+
return Pubkey.find_program_address([str(string).encode(), bytes(get_pubkey(address))],get_pubkey(programId))
|
|
8
|
+
|
|
9
|
+
def get_pubString(obj):
|
|
10
|
+
return Pubkey.from_string(str(obj))
|
|
11
|
+
|
|
12
|
+
def get_sigString(obj):
|
|
13
|
+
return Signature.from_string(str(obj))
|
|
14
|
+
|
|
15
|
+
def is_sigkey(obj):
|
|
16
|
+
return isinstance(obj,Signature)
|
|
17
|
+
|
|
18
|
+
def is_pubkey(obj):
|
|
19
|
+
return isinstance(obj,Pubkey)
|
|
20
|
+
|
|
21
|
+
def get_pubBytes(obj):
|
|
22
|
+
return Pubkey.from_bytes(obj)
|
|
23
|
+
|
|
24
|
+
def get_sigBytes(obj):
|
|
25
|
+
return Signature.from_bytes(obj)
|
|
26
|
+
|
|
27
|
+
def try_pubkey(obj):
|
|
28
|
+
return is_pubkey(get_pubkey(obj))
|
|
29
|
+
|
|
30
|
+
def try_sigkey(obj):
|
|
31
|
+
return is_sigkey(get_sigkey(obj))
|
|
32
|
+
|
|
33
|
+
def get_pubkey(obj):
|
|
34
|
+
if is_pubkey(obj):
|
|
35
|
+
return obj
|
|
36
|
+
address = obj
|
|
37
|
+
if isinstance(obj,bytes):
|
|
38
|
+
pubkey = get_pubBytes(address)
|
|
39
|
+
if is_pubkey(pubkey):
|
|
40
|
+
return pubkey
|
|
41
|
+
if isinstance(obj,str):
|
|
42
|
+
try:
|
|
43
|
+
pubkey= get_pubString(obj)
|
|
44
|
+
except:
|
|
45
|
+
pubkey = obj
|
|
46
|
+
if is_pubkey(pubkey):
|
|
47
|
+
return pubkey
|
|
48
|
+
return obj
|
|
49
|
+
|
|
50
|
+
def get_sigkey(obj):
|
|
51
|
+
if is_sigkey(obj):
|
|
52
|
+
return obj
|
|
53
|
+
signature = obj
|
|
54
|
+
if isinstance(signature,bytes):
|
|
55
|
+
sigKey = get_sigBytes(signature)
|
|
56
|
+
if is_sigkey(sigKey):
|
|
57
|
+
return sigKey
|
|
58
|
+
if isinstance(signature,str):
|
|
59
|
+
try:
|
|
60
|
+
sigKey= get_sigString(signature)
|
|
61
|
+
except:
|
|
62
|
+
sigKey = signature
|
|
63
|
+
if is_sigkey(sigKey):
|
|
64
|
+
return sigKey
|
|
65
|
+
return obj
|
|
66
|
+
|
|
67
|
+
def derive_associated_bonding_curve(mint,programId=None):
|
|
68
|
+
return get_associated_token_address(derive_bonding_curve(mint,programId)[0], get_pubkey(mint))
|
|
69
|
+
|
|
70
|
+
def derive_bonding_curve(mint,programId=None):
|
|
71
|
+
programId = programId or TOKEN_PROGRAM_ID
|
|
72
|
+
return pubkey_find_program_address("bonding-curve",mint,programId)
|
|
@@ -5,7 +5,7 @@ abstract_solana/abstract_rpcs/get_api_gui.py,sha256=zii6XCRD_wmgcupqCSH5lyXIvg5n
|
|
|
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_utils/__init__.py,sha256=
|
|
8
|
+
abstract_solana/abstract_utils/__init__.py,sha256=syjcqNbZ5Q_jNTvZIklEDgMAjygtH4pcFUbhM8kJ5x4,27
|
|
9
9
|
abstract_solana/abstract_utils/account_key_utils.py,sha256=VMJd4GOTK1vn8UZsfXDnjxDOGoQWGY6fvflJqPZ7Xvs,877
|
|
10
10
|
abstract_solana/abstract_utils/constants.py,sha256=cSmCKzQiNZocX1YkKYrdY-O449aYhi7BT_j-45HZN-E,1418
|
|
11
11
|
abstract_solana/abstract_utils/genesis_functions.py,sha256=v-EUF2pA0TWU1hs7lw9KzvrYMztlGUViK1OQtoGkRNM,2091
|
|
@@ -13,6 +13,7 @@ abstract_solana/abstract_utils/index_utils.py,sha256=Ed07BYTZWp-SVfpthAUqjRY00U3
|
|
|
13
13
|
abstract_solana/abstract_utils/keypair_utils.py,sha256=VgbwbX9BcXnypkbBJkPwXmSIKORUlMVakkoLk7hTXCw,572
|
|
14
14
|
abstract_solana/abstract_utils/log_message_functions.py,sha256=smkTnxpe8nMxh6NEFjzPoxrn7ojEcLwBLX21K7wAWzs,8104
|
|
15
15
|
abstract_solana/abstract_utils/price_utils.py,sha256=BLkwFLhlsTHeW0NTdzCAUi2xhc2lX7SrHz5sslDbUrY,4288
|
|
16
|
+
abstract_solana/abstract_utils/pubKeyUtils.py,sha256=TAYF74fKAuTBnqIP2SnA-BttO5uoHbxI9BRZRpGCMNY,2010
|
|
16
17
|
abstract_solana/abstract_utils/pubkey_utils.py,sha256=TAYF74fKAuTBnqIP2SnA-BttO5uoHbxI9BRZRpGCMNY,2010
|
|
17
18
|
abstract_solana/abstract_utils/signature_data_parse.py,sha256=5AOMtJZADWcwR0JLDbd2kXZNzW129qeB0lvYUrE_tm0,1974
|
|
18
19
|
abstract_solana/abstract_utils/utils.py,sha256=RcnGEiZ0aJbcw8ObpjHU3WUFU4Tmy-exCs6qIbEu4_c,444
|
|
@@ -20,7 +21,7 @@ abstract_solana/pump_functions/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4h
|
|
|
20
21
|
abstract_solana/pump_functions/buy_sell_pump.py,sha256=gjv_1et20s1Li0ygcURofO29VPkO1v-a5G5Bo_sZs_c,7860
|
|
21
22
|
abstract_solana/pump_functions/pump_fun_keys.py,sha256=BeWbV9_wd-c6ydF33drW-gZBDPWolbsMZL4cNhP3eOU,8537
|
|
22
23
|
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.
|
|
24
|
+
abstract_solana-0.0.2.100.dist-info/METADATA,sha256=nIMcgVMUDxJVy8NF8XoLpoXP82MxAo4N9y5WL1c7RVg,982
|
|
25
|
+
abstract_solana-0.0.2.100.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
|
26
|
+
abstract_solana-0.0.2.100.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
27
|
+
abstract_solana-0.0.2.100.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|