Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected keyword argument 'prioritization_fee_lamports' #25

Open
GoodSamoSamo opened this issue Jun 18, 2024 · 1 comment
Open

unexpected keyword argument 'prioritization_fee_lamports' #25

GoodSamoSamo opened this issue Jun 18, 2024 · 1 comment

Comments

@GoodSamoSamo
Copy link

GoodSamoSamo commented Jun 18, 2024

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())
@jmancool65
Copy link

He has not pushed the most recent version to pypi. In order to use this feature you have to download the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants