abstract-solana 0.0.0.86__py3-none-any.whl → 0.0.0.88__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.

@@ -41,7 +41,7 @@ def buildTxn(mint,payer_pubkey, amount, slippage, token_account,sol_in=0,token_p
41
41
  txn.add(close_account_instructions)
42
42
  return txn
43
43
 
44
- def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,buy=True):
44
+ def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,amount=None,token_price=None,buy=True):
45
45
 
46
46
  print("Owner Public Key:", payer_pubkey)
47
47
  mint_str = str(mint)
@@ -60,9 +60,10 @@ def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,buy=True
60
60
  print("Failed to retrieve or create token account.")
61
61
  return False,amount,token_balance,token_price,token_account,token_account_instructions
62
62
  # Calculate token price
63
- token_price = get_token_price(mint_str)
64
- print(f"Token Price: {token_price:.20f} SOL")
65
- amount = int(LAMPORTS_PER_SOL * token_price)
63
+ if token_price == None:
64
+ token_price = get_token_price(mint_str)
65
+ print(f"Token Price: {token_price:.20f} SOL")
66
+ amount= int(LAMPORTS_PER_SOL * token_price)
66
67
  print("Calculated Amount:", amount)
67
68
  if buy == False:
68
69
  if token_balance == None:
@@ -72,8 +73,8 @@ def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,buy=True
72
73
  return False,amount,token_balance,token_price,token_account,token_account_instructions
73
74
  return mint,amount,token_balance,token_price,token_account_pubkey,token_account_instructions
74
75
 
75
- 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:
76
- 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)
76
+ def pump_fun_sell(mint: str,amountpayer_pubkey:Pubkey, token_balance: Optional[Union[int, float]] = None, slippage: int = 25, close_token_account: bool = True,amount=None,token_price=None) -> bool:
77
+ mint,amount,token_balance,token_price,token_account,token_account_instructions = get_all_buy_sell_info(mint,payer_pubkey,token_balance=token_balance,amount=amount,buy=False)
77
78
  if not mint:
78
79
  return mint
79
80
  return buildTxn(mint=mint,
@@ -87,8 +88,8 @@ def pump_fun_sell(mint: str,payer_pubkey:Pubkey, token_balance: Optional[Union[i
87
88
  token_account_instructions=token_account_instructions,
88
89
  buy=False)
89
90
 
90
- def pump_fun_buy(mint: str,payer_pubkey:Pubkey, sol_in: float = 0.001, slippage: int = 25) -> bool:
91
- 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)
91
+ def pump_fun_buy(mint: str,payer_pubkey:Pubkey, sol_in: float = 0.001, slippage: int = 25,amount=None,token_price=None) -> bool:
92
+ mint,amount,token_balance,token_price,token_account,token_account_instructions = get_all_buy_sell_info(mint,payer_pubkey,sol_in=sol_in,amount=amount,token_price=token_price,buy=True)
92
93
  if not mint:
93
94
  return mint
94
95
  return buildTxn(mint=mint,
@@ -129,20 +130,20 @@ async def complete_txn(txn, payer_keypair,confirm=False):
129
130
 
130
131
  print("Transaction confirmed:", confirm)
131
132
  return confirm
132
- def buy_pump(mint: str, payer_keypair: Pubkey, sol_in=None, slippage=None,confirm=False):
133
+ def buy_pump(mint: str, payer_keypair: Pubkey, sol_in=None, slippage=None,confirm=False,amount=None,token_price=None):
133
134
  sol_in = sol_in or 0.001
134
135
  slippage = slippage or 25
135
136
  payer_pubkey = get_pubkey(payer_keypair.pubkey())
136
- txn = pump_fun_buy(mint=mint, payer_pubkey=payer_pubkey, sol_in=sol_in, slippage=slippage)
137
+ txn = pump_fun_buy(mint=mint, payer_pubkey=payer_pubkey, sol_in=sol_in, slippage=slippage,amount=amount,token_price=token_price)
137
138
  completed = asyncio.run(complete_txn(txn, payer_keypair,confirm=confirm)) # Await here since `complete_txn` is async
138
139
  if not completed:
139
140
  print("Buy transaction failed")
140
141
  return completed
141
142
 
142
- def sell_pump(mint:str, payer_keypair:Pubkey, token_balance=None, slippage=None,confirm=False):
143
+ def sell_pump(mint:str, payer_keypair:Pubkey, token_balance=None, slippage=None,confirm=False,amount=None,token_price=None):
143
144
  slippage = slippage or 25
144
145
  payer_pubkey = get_pubkey(payer_keypair.pubkey())
145
- txn = pump_fun_sell(mint=mint, payer_pubkey=payer_pubkey, token_balance=token_balance, slippage=slippage)
146
+ txn = pump_fun_sell(mint=mint, payer_pubkey=payer_pubkey, token_balance=token_balance, slippage=slippage,amount=amount,token_price=token_price)
146
147
  completed = asyncio.run(complete_txn(txn, payer_keypair,confirm=confirm))
147
148
  if not completed:
148
149
  print("sell transaction failed")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: abstract_solana
3
- Version: 0.0.0.86
3
+ Version: 0.0.0.88
4
4
  Home-page: https://github.com/AbstractEndeavors/abstract_solana
5
5
  Author: putkoff
6
6
  Author-email: partners@abstractendeavors.com
@@ -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=3souQvQs3pEUpLxQ3GyZiTqJxOJhTcBQOj4bhzBOKxQ,7833
14
+ abstract_solana/pumpFun/buy_sell_pump.py,sha256=bdvotoGQbhjV93F7HFKyXXMCR4WmpAC-28-7Y5RvyxM,8155
15
15
  abstract_solana/pumpFun/pumpFunKeys.py,sha256=yMS_fT-0ESndluVpZ17XdMhpXVtSfhtIG5njy7DJkfI,7961
16
16
  abstract_solana/pumpFun/pump_fun_keys.py,sha256=iuxTjIGcWuwM8ZvlERqJdKNCMLig2xmZKXuoI0uqNL0,8340
17
17
  abstract_solana/pumpFun/token_utils.py,sha256=KeGGYDgG-Ebfr-M5PDUrPzFDrFe7TGFMP5R53VgnLq0,2814
18
- abstract_solana-0.0.0.86.dist-info/METADATA,sha256=hdz24BdHe6m2ZPyqALjRRE9j_C2B_ptoeHBXZ6i549I,981
19
- abstract_solana-0.0.0.86.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
20
- abstract_solana-0.0.0.86.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
21
- abstract_solana-0.0.0.86.dist-info/RECORD,,
18
+ abstract_solana-0.0.0.88.dist-info/METADATA,sha256=G-zjRhzda9zVV47CHv59O9rvwuYjSX6A3MtPrELGOAk,981
19
+ abstract_solana-0.0.0.88.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
20
+ abstract_solana-0.0.0.88.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
21
+ abstract_solana-0.0.0.88.dist-info/RECORD,,