abstract-solana 0.0.0.72__py3-none-any.whl → 0.0.0.74__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 +13 -14
- abstract_solana/pumpFun/pump_fun_keys.py +13 -12
- {abstract_solana-0.0.0.72.dist-info → abstract_solana-0.0.0.74.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.0.72.dist-info → abstract_solana-0.0.0.74.dist-info}/RECORD +6 -6
- {abstract_solana-0.0.0.72.dist-info → abstract_solana-0.0.0.74.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.0.72.dist-info → abstract_solana-0.0.0.74.dist-info}/top_level.txt +0 -0
|
@@ -115,22 +115,21 @@ async def confirm_txn(txn_sig, max_retries=20, retry_interval=3):
|
|
|
115
115
|
print(f"Failed to confirm transaction after {max_retries} attempts.")
|
|
116
116
|
return txn_sig
|
|
117
117
|
|
|
118
|
-
async def complete_txn(txn, payer_keypair,confirm=
|
|
118
|
+
async def complete_txn(txn, payer_keypair,confirm=False):
|
|
119
119
|
txn_sig = await sendTransaction(txn=txn, payer_keypair=payer_keypair, skip_preflight=True) # Await this async call
|
|
120
120
|
print("Transaction Signature", txn_sig)
|
|
121
|
-
if confirm:
|
|
122
|
-
|
|
121
|
+
if confirm == False:
|
|
122
|
+
return txn_sig
|
|
123
|
+
confirm = await confirm_txn(txn_sig) # Await confirmation
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return txn_sig
|
|
133
|
-
def buy_pump(mint: str, payer_keypair: Pubkey, sol_in=None, slippage=None,confirm=True):
|
|
125
|
+
while not confirm:
|
|
126
|
+
print("Waiting for transaction confirmation...")
|
|
127
|
+
await asyncio.sleep(1) # Use asyncio.sleep instead of time.sleep to avoid blocking
|
|
128
|
+
confirm = await confirm_txn(txn_sig) # Await confirmation check again
|
|
129
|
+
|
|
130
|
+
print("Transaction confirmed:", confirm)
|
|
131
|
+
return confirm
|
|
132
|
+
def buy_pump(mint: str, payer_keypair: Pubkey, sol_in=None, slippage=None,confirm=False):
|
|
134
133
|
sol_in = sol_in or 0.001
|
|
135
134
|
slippage = slippage or 25
|
|
136
135
|
payer_pubkey = get_pubkey(payer_keypair.pubkey())
|
|
@@ -140,7 +139,7 @@ def buy_pump(mint: str, payer_keypair: Pubkey, sol_in=None, slippage=None,confir
|
|
|
140
139
|
print("Buy transaction failed")
|
|
141
140
|
return completed
|
|
142
141
|
|
|
143
|
-
def sell_pump(mint:str, payer_keypair:Pubkey, token_balance=None, slippage=None,confirm=
|
|
142
|
+
def sell_pump(mint:str, payer_keypair:Pubkey, token_balance=None, slippage=None,confirm=False):
|
|
144
143
|
slippage = slippage or 25
|
|
145
144
|
payer_pubkey = get_pubkey(payer_keypair.pubkey())
|
|
146
145
|
txn = pump_fun_sell(mint=mint, payer_pubkey=payer_pubkey, token_balance=token_balance, slippage=slippage)
|
|
@@ -40,27 +40,25 @@ def get_create_map():
|
|
|
40
40
|
{'instruction_number': '14', 'instruction_name': 'Program', 'token_address': '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P', 'token_name': 'Pump.fun'}
|
|
41
41
|
]
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
bonding_curve = str(derive_bonding_curve(mint)[0])
|
|
46
|
-
bonding_curve_signature = getGenesisSignature(address=bonding_curve)
|
|
47
|
-
txn_data = getTransaction(signature=bonding_curve_signature)
|
|
43
|
+
def get_txnTypesFromGenesisSignature(genesisSignature):
|
|
44
|
+
txn_data = getTransaction(signature=genesisSignature)
|
|
48
45
|
txn_data = get_for_program_ids_info(txn_data)
|
|
49
|
-
|
|
50
46
|
for new_map in get_create_map():
|
|
51
47
|
instructions = txn_data['transaction']['message']['instructions']
|
|
52
48
|
inner_instructions = txn_data['meta']['innerInstructions'][0]['instructions']
|
|
53
49
|
all_instructions = instructions + inner_instructions
|
|
54
|
-
|
|
55
50
|
instruction = [inst for inst in all_instructions if len(inst.get('associatedAccounts', [])) > 13]
|
|
56
|
-
|
|
57
51
|
txn_types = {create_index['instruction_name']: instruction[0]['associatedAccounts'][int(create_index['instruction_number']) - 1] for create_index in get_create_map()}
|
|
58
|
-
|
|
59
52
|
if txn_types:
|
|
60
|
-
txn_types['signature'] =
|
|
53
|
+
txn_types['signature'] = genesisSignature
|
|
61
54
|
break
|
|
62
55
|
return txn_types
|
|
63
56
|
|
|
57
|
+
# Fetches and organizes transaction types based on provided mint
|
|
58
|
+
def getTxnTypes(mint):
|
|
59
|
+
bonding_curve = str(derive_bonding_curve(mint)[0])
|
|
60
|
+
bonding_curve_signature = getGenesisSignature(address=bonding_curve)
|
|
61
|
+
return get_txnTypesFromGenesisSignature(bonding_curve_signature)
|
|
64
62
|
# Retrieve virtual reserves for a bonding curve using a structured layout
|
|
65
63
|
def get_virtual_reserves(bonding_curve: Pubkey):
|
|
66
64
|
bonding_curve_struct = Struct(
|
|
@@ -84,8 +82,11 @@ def get_virtual_reserves(bonding_curve: Pubkey):
|
|
|
84
82
|
return parsed_data
|
|
85
83
|
|
|
86
84
|
# Retrieves comprehensive transaction and reserve data for the mint
|
|
87
|
-
def get_pump_fun_data(mint_str: str):
|
|
88
|
-
|
|
85
|
+
def get_pump_fun_data(mint_str: str=None,signature=None):
|
|
86
|
+
if mint_str:
|
|
87
|
+
txn_types = change_keys_lower(getTxnTypes(mint_str))
|
|
88
|
+
if signature:
|
|
89
|
+
txn_types = change_keys_lower(get_txnTypesFromGenesisSignature(signature))
|
|
89
90
|
bonding_curve = derive_bonding_curve(mint_str)
|
|
90
91
|
virtual_reserves = get_virtual_reserves(bonding_curve)
|
|
91
92
|
if virtual_reserves is None:
|
|
@@ -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=fBJRFVfH00bczQ1ZrVPaHh4ot8eJ8ZwanqfPSpp2ur0,7830
|
|
15
15
|
abstract_solana/pumpFun/pumpFunKeys.py,sha256=yMS_fT-0ESndluVpZ17XdMhpXVtSfhtIG5njy7DJkfI,7961
|
|
16
|
-
abstract_solana/pumpFun/pump_fun_keys.py,sha256=
|
|
16
|
+
abstract_solana/pumpFun/pump_fun_keys.py,sha256=bSXjZXAMdnppFhkICcvL_QyHia55GcUe1r20COi9sP8,8291
|
|
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.74.dist-info/METADATA,sha256=YrJAj6X-Sg9YYqajG9lQZmUG-Ketdo4pMiZVb0OPMwA,981
|
|
19
|
+
abstract_solana-0.0.0.74.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
20
|
+
abstract_solana-0.0.0.74.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
21
|
+
abstract_solana-0.0.0.74.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|