abstract-solana 0.0.0.59__py3-none-any.whl → 0.0.0.60__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/pumpFun/pump_fun_keys.py +3 -3
- abstract_solana/pumpFun/token_utils.py +15 -2
- {abstract_solana-0.0.0.59.dist-info → abstract_solana-0.0.0.60.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.0.59.dist-info → abstract_solana-0.0.0.60.dist-info}/RECORD +6 -6
- {abstract_solana-0.0.0.59.dist-info → abstract_solana-0.0.0.60.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.0.59.dist-info → abstract_solana-0.0.0.60.dist-info}/top_level.txt +0 -0
|
@@ -103,13 +103,13 @@ def get_pump_fun_data(mint_str: str):
|
|
|
103
103
|
|
|
104
104
|
return txn_types
|
|
105
105
|
|
|
106
|
-
def getKeys(mint_str,
|
|
106
|
+
def getKeys(mint_str,token_account,payer_pubkey,buy=True):
|
|
107
107
|
coin_data = get_pump_fun_data(str(mint_str))
|
|
108
108
|
MINT = get_pubkey(str(mint_str))
|
|
109
109
|
BONDING_CURVE = get_pubkey(coin_data['bonding_curve'])
|
|
110
110
|
ASSOCIATED_BONDING_CURVE = get_pubkey(coin_data['associated_bonding_curve'])
|
|
111
|
-
ASSOCIATED_USER =
|
|
112
|
-
USER =
|
|
111
|
+
ASSOCIATED_USER = Pubkey.from_string(str(token_account))
|
|
112
|
+
USER = Pubkey.from_string(str(payer_pubkey))
|
|
113
113
|
PUMP_FUN_TOKEN_PROGRAM_SWITCH = TOKEN_PROGRAM_ID_PUBKEY if buy else PUMP_FUN_ASSOC_TOKEN_ACC_PROG_PUBKEY
|
|
114
114
|
PUMP_FUN_RENT_PROGRAM_SWITCH = RENT_PUBKEY if buy else TOKEN_PROGRAM_ID_PUBKEY
|
|
115
115
|
# Build account key list
|
|
@@ -4,6 +4,7 @@ from .pump_fun_keys import get_pump_fun_data
|
|
|
4
4
|
from abstract_solcatcher import getTokenAccountBalance,getTokenAccountsByOwner
|
|
5
5
|
from spl.token.instructions import create_associated_token_account, get_associated_token_address
|
|
6
6
|
from abstract_utilities import get_any_value
|
|
7
|
+
import requests
|
|
7
8
|
def get_token_balance(payer,mint: str):
|
|
8
9
|
response = getTokenAccountBalance(str(payer),str(mint))
|
|
9
10
|
response=response.get('value',response)
|
|
@@ -24,8 +25,20 @@ def get_token_price(mint: str) -> float:
|
|
|
24
25
|
except Exception as e:
|
|
25
26
|
print(f"Error calculating token price: {e}")
|
|
26
27
|
return None
|
|
27
|
-
def get_account_by_owner(payer,
|
|
28
|
-
|
|
28
|
+
def get_account_by_owner(payer, mint_str: str) -> dict:
|
|
29
|
+
payload = {
|
|
30
|
+
"jsonrpc": "2.0",
|
|
31
|
+
"id": 1,
|
|
32
|
+
"method": "getTokenAccountsByOwner",
|
|
33
|
+
"params": [payer, {"mint": mint_str}, {"encoding": "jsonParsed"}]
|
|
34
|
+
}
|
|
35
|
+
response = requests.post(
|
|
36
|
+
url="https://rpc.ankr.com/solana/c3b7fd92e298d5682b6ef095eaa4e92160989a713f5ee9ac2693b4da8ff5a370",
|
|
37
|
+
json=payload
|
|
38
|
+
)
|
|
39
|
+
response_json = response.json()
|
|
40
|
+
|
|
41
|
+
result = response_json.get('result')
|
|
29
42
|
if not result or 'value' not in result:
|
|
30
43
|
return None
|
|
31
44
|
|
|
@@ -13,9 +13,9 @@ abstract_solana/utils.py,sha256=RcnGEiZ0aJbcw8ObpjHU3WUFU4Tmy-exCs6qIbEu4_c,444
|
|
|
13
13
|
abstract_solana/pumpFun/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4hjczjzvuwy3sHg,85
|
|
14
14
|
abstract_solana/pumpFun/buy_sell_pump.py,sha256=6bNyqlfAmXvlV8_0QYLgEVVEKXArzHNCwDfnOryrIxg,7300
|
|
15
15
|
abstract_solana/pumpFun/pumpFunKeys.py,sha256=yMS_fT-0ESndluVpZ17XdMhpXVtSfhtIG5njy7DJkfI,7961
|
|
16
|
-
abstract_solana/pumpFun/pump_fun_keys.py,sha256=
|
|
17
|
-
abstract_solana/pumpFun/token_utils.py,sha256=
|
|
18
|
-
abstract_solana-0.0.0.
|
|
19
|
-
abstract_solana-0.0.0.
|
|
20
|
-
abstract_solana-0.0.0.
|
|
21
|
-
abstract_solana-0.0.0.
|
|
16
|
+
abstract_solana/pumpFun/pump_fun_keys.py,sha256=3ykkcogaptbzJ6MwI6OWzUdo5rA1qW54fY0KAJAXgIc,8050
|
|
17
|
+
abstract_solana/pumpFun/token_utils.py,sha256=NhMvpTnw3QZk8DmeKYFzuqEMEZEHUlrBKfFp7662ohw,2684
|
|
18
|
+
abstract_solana-0.0.0.60.dist-info/METADATA,sha256=vPOnQ-HRjsghz2AzPE-zK5rw-FRIwqvlywnULYm3li4,924
|
|
19
|
+
abstract_solana-0.0.0.60.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
20
|
+
abstract_solana-0.0.0.60.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
21
|
+
abstract_solana-0.0.0.60.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|