abstract-solana 0.0.0.60__py3-none-any.whl → 0.0.0.61__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/pumpFun/buy_sell_pump.py +15 -16
- {abstract_solana-0.0.0.60.dist-info → abstract_solana-0.0.0.61.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.0.60.dist-info → abstract_solana-0.0.0.61.dist-info}/RECORD +5 -5
- {abstract_solana-0.0.0.60.dist-info → abstract_solana-0.0.0.61.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.0.60.dist-info → abstract_solana-0.0.0.61.dist-info}/top_level.txt +0 -0
|
@@ -65,9 +65,9 @@ def confirm_txn(txn_sig, max_retries=20, retry_interval=3):
|
|
|
65
65
|
time.sleep(retry_interval)
|
|
66
66
|
print("Max retries reached. Transaction confirmation failed.")
|
|
67
67
|
return None
|
|
68
|
-
def buildTxn(mint,payer_pubkey, amount, slippage,
|
|
68
|
+
def buildTxn(mint,payer_pubkey, amount, slippage, token_account,sol_in=0,token_price=0,token_balance=0,token_account_instructions=None,close_token_account=False,buy=True):
|
|
69
69
|
# Get keys for the transaction, pass the token account's pubkey instead of the AccountMeta object
|
|
70
|
-
keys = getKeys(mint,
|
|
70
|
+
keys = getKeys(mint, token_account=token_account, payer_pubkey=payer_pubkey,buy=buy)
|
|
71
71
|
slippage_adjustment = 1 - (slippage / 100)
|
|
72
72
|
sol_change = sol_in if buy else float(token_balance) * float(token_price)
|
|
73
73
|
sol_change_with_slippage = sol_change * slippage_adjustment
|
|
@@ -93,8 +93,8 @@ def buildTxn(mint,payer_pubkey, amount, slippage, token_account_pubkey,sol_in=0,
|
|
|
93
93
|
txn.add(close_account_instructions)
|
|
94
94
|
return txn
|
|
95
95
|
|
|
96
|
-
def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0):
|
|
97
|
-
|
|
96
|
+
def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,buy=True):
|
|
97
|
+
|
|
98
98
|
print("Owner Public Key:", payer_pubkey)
|
|
99
99
|
mint_str = str(mint)
|
|
100
100
|
if not get_pubkey(mint_str).is_on_curve():
|
|
@@ -116,17 +116,16 @@ def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0):
|
|
|
116
116
|
print(f"Token Price: {token_price:.20f} SOL")
|
|
117
117
|
amount = int(LAMPORTS_PER_SOL * token_price)
|
|
118
118
|
print("Calculated Amount:", amount)
|
|
119
|
-
if
|
|
120
|
-
token_balance
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
if buy == False:
|
|
120
|
+
if token_balance == None:
|
|
121
|
+
token_balance = get_token_balance(token_account,mint_str)
|
|
122
|
+
print("Token Balance:", token_balance)
|
|
123
|
+
if token_balance == 0:
|
|
124
|
+
return False
|
|
124
125
|
return mint,amount,token_balance,token_price,token_account_pubkey,token_account_instructions
|
|
125
|
-
|
|
126
|
-
print(e)
|
|
127
|
-
|
|
126
|
+
|
|
128
127
|
def pump_fun_sell(mint: str,payer_pubkey:Pubkey, token_balance: Optional[Union[int, float]] = None, slippage: int = 25, close_token_account: bool = True) -> bool:
|
|
129
|
-
mint,amount,token_balance,token_price,
|
|
128
|
+
mint,amount,token_balance,token_price,token_account,token_account_instructions = get_all_buy_sell_info(mint,payer_pubkey,token_balance=token_balance,buy=False)
|
|
130
129
|
return buildTxn(mint=mint,
|
|
131
130
|
payer_pubkey=payer_pubkey,
|
|
132
131
|
amount=amount,
|
|
@@ -134,12 +133,12 @@ def pump_fun_sell(mint: str,payer_pubkey:Pubkey, token_balance: Optional[Union[i
|
|
|
134
133
|
sol_in=0,
|
|
135
134
|
token_balance=token_balance,
|
|
136
135
|
token_price=token_price,
|
|
137
|
-
|
|
136
|
+
token_account=token_account,
|
|
138
137
|
token_account_instructions=token_account_instructions,
|
|
139
138
|
buy=False)
|
|
140
139
|
|
|
141
140
|
def pump_fun_buy(mint: str,payer_pubkey:Pubkey, sol_in: float = 0.001, slippage: int = 25) -> bool:
|
|
142
|
-
mint,amount,token_balance,token_price,
|
|
141
|
+
mint,amount,token_balance,token_price,token_account,token_account_instructions = get_all_buy_sell_info(mint,payer_pubkey,sol_in=sol_in,buy=True,)
|
|
143
142
|
# Build the transaction
|
|
144
143
|
return buildTxn(mint=mint,
|
|
145
144
|
payer_pubkey=payer_pubkey,
|
|
@@ -148,7 +147,7 @@ def pump_fun_buy(mint: str,payer_pubkey:Pubkey, sol_in: float = 0.001, slippage:
|
|
|
148
147
|
sol_in=sol_in,
|
|
149
148
|
token_balance=0,
|
|
150
149
|
token_price=0,
|
|
151
|
-
|
|
150
|
+
token_account=token_account,
|
|
152
151
|
token_account_instructions=token_account_instructions,
|
|
153
152
|
buy=True)
|
|
154
153
|
return True
|
|
@@ -11,11 +11,11 @@ abstract_solana/pumpFunKeys.py,sha256=KHZyQ_GFS9XzmNNMzEDQkAZsiM5Mpua6ZE1e3WebEr
|
|
|
11
11
|
abstract_solana/signature_data_parse.py,sha256=5AOMtJZADWcwR0JLDbd2kXZNzW129qeB0lvYUrE_tm0,1974
|
|
12
12
|
abstract_solana/utils.py,sha256=RcnGEiZ0aJbcw8ObpjHU3WUFU4Tmy-exCs6qIbEu4_c,444
|
|
13
13
|
abstract_solana/pumpFun/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4hjczjzvuwy3sHg,85
|
|
14
|
-
abstract_solana/pumpFun/buy_sell_pump.py,sha256=
|
|
14
|
+
abstract_solana/pumpFun/buy_sell_pump.py,sha256=ske5T-k1Mk8_beNi-lzNO1qvvGr2o46no70GN5xIstc,7255
|
|
15
15
|
abstract_solana/pumpFun/pumpFunKeys.py,sha256=yMS_fT-0ESndluVpZ17XdMhpXVtSfhtIG5njy7DJkfI,7961
|
|
16
16
|
abstract_solana/pumpFun/pump_fun_keys.py,sha256=3ykkcogaptbzJ6MwI6OWzUdo5rA1qW54fY0KAJAXgIc,8050
|
|
17
17
|
abstract_solana/pumpFun/token_utils.py,sha256=NhMvpTnw3QZk8DmeKYFzuqEMEZEHUlrBKfFp7662ohw,2684
|
|
18
|
-
abstract_solana-0.0.0.
|
|
19
|
-
abstract_solana-0.0.0.
|
|
20
|
-
abstract_solana-0.0.0.
|
|
21
|
-
abstract_solana-0.0.0.
|
|
18
|
+
abstract_solana-0.0.0.61.dist-info/METADATA,sha256=3mWt126YrfyjHWEf5UPOmlTB9WC6SUyxfUOkd3RJtls,924
|
|
19
|
+
abstract_solana-0.0.0.61.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
20
|
+
abstract_solana-0.0.0.61.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
21
|
+
abstract_solana-0.0.0.61.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|