From 69fb34c2ba5adbadb14e3012846c3e15d9c5b734 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 3 Jul 2024 15:07:27 +1000 Subject: [PATCH] fix: Update to newest version of solana --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 89aaed4..45db243 100644 --- a/server.py +++ b/server.py @@ -254,14 +254,14 @@ def donateAmountPost(amount): receiver = Pubkey.from_string('AJsPEEe6S7XSiVcdZKbeV8GRp1QuhFUsG8mLrqL4XgiU') transfer_ix = transfer(TransferParams(from_pubkey=sender, to_pubkey=receiver, lamports=int(amount * 1000000000))) solana_client = Client("https://api.mainnet-beta.solana.com") - blockhashData = solana_client.get_recent_blockhash() - blockhash = blockhashData['result']['value']['blockhash'] + blockhashData = solana_client.get_latest_blockhash() + blockhash = blockhashData.value.blockhash msg = MessageV0.try_compile( payer=sender, instructions=[transfer_ix], address_lookup_table_accounts=[], - recent_blockhash=Hash.from_string(blockhash), + recent_blockhash=blockhash, ) tx = VersionedTransaction(message=msg, keypairs=[NullSigner(sender)]) tx = bytes(tx).hex()