I'm trying to make an arbitrage program. Although I'm not able to write the transactions code using solana. I did refer from here(Sending solana transactions with python). I've made 2 accounts one with phantom and another with solflare. Hence, the account in the following code has public keys from phantom and new_account has public keys from solflare.
def perform_transaction():
private_key = PRIVATEKEYPHANTOM
keypair = get_keypair(private_key)
cli = Client('https://solana-api.projectserum.com')
account = Account(keypair[:32])
new_account = Account(KEYPAIRSOLFLARE[:32])
# print(new_account.public_key())
# print(new_account.keypair())
transaction = Transaction()
transaction.add(sp.create_account(sp.CreateAccountParams(
from_pubkey=account.public_key(),
new_account_pubkey=new_account.public_key(),
lamports=cli.get_minimum_balance_for_rent_exemption(88).get('result'),
space=88,
program_id=PublicKey(a_public_key),
)))
send_tx = cli.send_transaction(transaction, new_account)
print(transaction)
I get the following error
raise ValueError("invalid public key input:", value) from err
ValueError: ('invalid public key input:', '<solana.account.Account object at 0x7f8ca6429d00>')
I've never dealt with crypto transactions and this might be a very simple error. What's wrong here?