jupiter-python-sdk
jupiter-python-sdk copied to clipboard
unexpected keyword argument 'prioritization_fee_lamports'
I am trying to complete a swap using the newly introduct "prioritization_fee_lamports" param as part of jupiter.swap() function.
However, I keep getting the error:
TypeError: Jupiter.swap() got an unexpected keyword argument 'prioritization_fee_lamports'
Here is my code:
async def buy():
transaction_data = await jupiter.swap(
input_mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
output_mint="So11111111111111111111111111111111111111112",
amount=5_000_000,
prioritization_fee_lamports = 5000,
slippage_bps=1)
raw_transaction = VersionedTransaction.from_bytes(base64.b64decode(transaction_data))
signature = private_key.sign_message(message.to_bytes_versioned(raw_transaction.message))
signed_txn = VersionedTransaction.populate(raw_transaction.message, [signature])
opts = TxOpts(skip_preflight=False, preflight_commitment=Processed)
result = await async_client.send_raw_transaction(txn=bytes(signed_txn), opts=opts)
transaction_id = json.loads(result.to_json())['result']
print(f"Transaction sent: https://solscan.io/tx/{transaction_id}")
asyncio.run(buy())
He has not pushed the most recent version to pypi. In order to use this feature you have to download the source code.