Skip to content

Commit

Permalink
Update pump_fun.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AL-THE-BOT-FATHER authored May 11, 2024
1 parent 71d2058 commit 74b7c0b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pump_fun_py/pump_fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from constants import *
from solana.rpc.types import TokenAccountOpts
from utils import get_coin_data, get_token_balance, confirm_txn
from solders.system_program import TransferParams, transfer
from solders.transaction import VersionedTransaction #type: ignore
from solana.rpc.types import TxOpts

Expand Down Expand Up @@ -85,9 +84,6 @@ def buy(mint_str, sol_in=0.01, slippage_percent=.01):
token_out,
max_sol_cost
]

print(token_out)
print(max_sol_cost)

# Pack integers into binary segments
binary_segments = [struct.pack('<Q', integer) for integer in integers]
Expand All @@ -103,7 +99,6 @@ def buy(mint_str, sol_in=0.01, slippage_percent=.01):
instructions.append(token_account_instructions)
instructions.append(swap_instruction)


# Compile message
print("Compiling message...")
compiled_message = MessageV0.try_compile(
Expand All @@ -122,6 +117,7 @@ def buy(mint_str, sol_in=0.01, slippage_percent=.01):
# Confirm transaction
confirm = confirm_txn(txn_sig)
print(confirm)

except Exception as e:
print(e)

Expand Down Expand Up @@ -194,15 +190,12 @@ def sell(mint_str, token_balance=None, slippage_percent=.01):
instructions.append(set_compute_unit_limit(UNIT_BUDGET))
instructions.append(swap_instruction)

# Get latest blockhash
recent_blockhash = client.get_latest_blockhash()

# Compile message
compiled_message = MessageV0.try_compile(
payer_keypair.pubkey(),
instructions,
[],
recent_blockhash.value.blockhash,
client.get_latest_blockhash().value.blockhash,
)

# Create and send transaction
Expand Down

0 comments on commit 74b7c0b

Please sign in to comment.