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

@@ -45,9 +45,9 @@ def get_all_buy_sell_info(mint,payer_pubkey,token_balance=None,sol_in=0,buy=True
45
45
 
46
46
  print("Owner Public Key:", payer_pubkey)
47
47
  mint_str = str(mint)
48
- if not get_pubkey(mint_str).is_on_curve():
49
- print('Mint public key is not on curve')
50
- return False,amount,token_balance,token_price,token_account,token_account_instructions
48
+ #if not get_pubkey(mint_str).is_on_curve():
49
+ # print('Mint public key is not on curve')
50
+ # return False,amount,token_balance,token_price,token_account,token_account_instructions
51
51
  mint_pubkey = get_pubkey(mint_str)
52
52
  token_account, token_account_instructions = check_existing_token_account(payer_pubkey, mint_pubkey)
53
53
  token_account_pubkey = get_pubkey(token_account)
@@ -83,11 +83,9 @@ def get_virtual_reserves(bonding_curve: Pubkey):
83
83
 
84
84
  # Retrieves comprehensive transaction and reserve data for the mint
85
85
  def get_pump_fun_data(mint_str: str=None,signature=None,commitment="finalized"):
86
- if mint_str:
87
- txn_types = change_keys_lower(getTxnTypes(mint_str))
88
- if signature:
86
+ if not mint_str and signature:
89
87
  txn_types = change_keys_lower(get_txnTypesFromGenesisSignature(signature,commitment=commitment))
90
- mint_str = mint_str or txn_types.get('mint')
88
+ mint_str = mint_str or txn_types.get('mint')
91
89
  bonding_curve = derive_bonding_curve(mint_str)
92
90
  virtual_reserves = get_virtual_reserves(bonding_curve)
93
91
  if virtual_reserves is None:
@@ -106,10 +104,9 @@ def get_pump_fun_data(mint_str: str=None,signature=None,commitment="finalized"):
106
104
  return txn_types
107
105
 
108
106
  def getKeys(mint_str,token_account,payer_pubkey,buy=True):
109
- coin_data = get_pump_fun_data(str(mint_str))
110
107
  MINT = get_pubkey(str(mint_str))
111
- BONDING_CURVE = get_pubkey(coin_data['bonding_curve'])
112
- ASSOCIATED_BONDING_CURVE = get_pubkey(coin_data['associated_bonding_curve'])
108
+ BONDING_CURVE = get_pubkey(derive_bonding_curve(mint_str))
109
+ ASSOCIATED_BONDING_CURVE = get_pubkey(derive_associated_bonding_curve(mint_str))
113
110
  ASSOCIATED_USER = Pubkey.from_string(str(token_account))
114
111
  USER = Pubkey.from_string(str(payer_pubkey))
115
112
  PUMP_FUN_TOKEN_PROGRAM_SWITCH = TOKEN_PROGRAM_ID_PUBKEY if buy else PUMP_FUN_ASSOC_TOKEN_ACC_PROG_PUBKEY
@@ -1,6 +1,6 @@
1
1
  from ..constants import TOKEN_DECIMAL_EXP,SOL_DECIMAL_EXP
2
- from ..pubkey_utils import Pubkey
3
- from .pump_fun_keys import get_pump_fun_data
2
+ from ..pubkey_utils import Pubkey,derive_bonding_curve
3
+ from .pump_fun_keys import get_virtual_reserves,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
@@ -12,13 +12,10 @@ def get_token_balance(payer,mint: str):
12
12
  return float(ui_amount)
13
13
  def get_token_price(mint: str) -> float:
14
14
  try:
15
- # Get coin data
16
- coin_data = get_pump_fun_data(str(mint))
17
- if not coin_data:
18
- print("Failed to retrieve coin data...")
19
- return None
20
- virtual_sol_reserves = coin_data['virtual_sol_reserves'] / SOL_DECIMAL_EXP
21
- virtual_token_reserves = coin_data['virtual_token_reserves'] / TOKEN_DECIMAL_EXP
15
+ bonding_curve = derive_bonding_curve(mint_str)
16
+ virtual_reserves = get_virtual_reserves(bonding_curve)
17
+ virtual_sol_reserves = virtual_reserves.virtualSolReserves / SOL_DECIMAL_EXP
18
+ virtual_token_reserves = virtual_reserves.virtualTokenReserves / TOKEN_DECIMAL_EXP
22
19
  token_price = virtual_sol_reserves / virtual_token_reserves
23
20
  print(f"Token Price: {token_price:.20f} SOL")
24
21
  return token_price
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: abstract_solana
3
- Version: 0.0.0.81
3
+ Version: 0.0.0.83
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=fBJRFVfH00bczQ1ZrVPaHh4ot8eJ8ZwanqfPSpp2ur0,7830
14
+ abstract_solana/pumpFun/buy_sell_pump.py,sha256=3souQvQs3pEUpLxQ3GyZiTqJxOJhTcBQOj4bhzBOKxQ,7833
15
15
  abstract_solana/pumpFun/pumpFunKeys.py,sha256=yMS_fT-0ESndluVpZ17XdMhpXVtSfhtIG5njy7DJkfI,7961
16
- abstract_solana/pumpFun/pump_fun_keys.py,sha256=4FTgJ50UWUZJXU-zr1IwxW1vqSP80KrlXi7FyLSw3ko,8420
17
- abstract_solana/pumpFun/token_utils.py,sha256=NhMvpTnw3QZk8DmeKYFzuqEMEZEHUlrBKfFp7662ohw,2684
18
- abstract_solana-0.0.0.81.dist-info/METADATA,sha256=JxZjJI2MSBLF9huEU_SVZEu3y8bG3qb_5yYrikWi4wg,981
19
- abstract_solana-0.0.0.81.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
20
- abstract_solana-0.0.0.81.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
21
- abstract_solana-0.0.0.81.dist-info/RECORD,,
16
+ abstract_solana/pumpFun/pump_fun_keys.py,sha256=UB87UnJ16wMqmj5q84kdU5wBF__7rnaxyK3-npsULTE,8322
17
+ abstract_solana/pumpFun/token_utils.py,sha256=gggf_02239SXG78NPzpusHBTFsjfqmeqW0a8WZOneTA,2672
18
+ abstract_solana-0.0.0.83.dist-info/METADATA,sha256=qZ6jRzf4zmgU79AS11eLQzoDW-MRHOkbSEYciNGfM10,981
19
+ abstract_solana-0.0.0.83.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
20
+ abstract_solana-0.0.0.83.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
21
+ abstract_solana-0.0.0.83.dist-info/RECORD,,