Skip to content

unexpected keyword argument 'prioritization_fee_lamports' #25

Description

@GoodSamoSamo

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())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions