Skip to content

Issue when wallet_index is not 0 #3

@fniko

Description

@fniko

Upon trying to implemnt Jupiter Ultra API using this example standalone_script_examples/ultra-api/order-and-execute/main.py. It works from SOL to USDC (So11111111111111111111111111111111111111112 -> EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v), however when I try going back USDC -> SOL, I am getting the following error

    signed_transaction = VersionedTransaction(raw_transaction.message, signers)
TypeError: argument 'keypairs': failed to extract enum Signer ('KeypairWrapper | PresignerWrapper | NullSignerWrapper')
- variant KeypairWrapper (KeypairWrapper): TypeError: failed to extract field Signer::KeypairWrapper.0, caused by TypeError: 'Signature' object cannot be converted to 'Keypair'
- variant PresignerWrapper (PresignerWrapper): TypeError: failed to extract field Signer::PresignerWrapper.0, caused by TypeError: 'Signature' object cannot be converted to 'Presigner'
- variant NullSignerWrapper (NullSignerWrapper): TypeError: failed to extract field Signer::NullSignerWrapper.0, caused by TypeError: 'Signature' object cannot be converted to 'NullSigner'

I have discovered that the issue is linked to the index of my (signer) wallet. When it's the first one (wallet_index == 0), it works. When wallet_index > 0 (aka wallet_index == 1) this issue occurs.

List of signers than looks like this

[Signature(
    1111111111111111111111111111111111111111111111111111111111111111,
), Keypair(
    Keypair(
        Keypair {
            secret: SecretKey: [...],
            public: PublicKey(CompressedEdwardsY: [...]), EdwardsPoint{
                X: FieldElement51([...]),
                Y: FieldElement51([...]),
                Z: FieldElement51([...]),
                T: FieldElement51([...])
            }),
        },
    ),
)]

Can you please advise how to swap in the opposite direction? Thanks

I have checked also the example in standalone_script_examples/ultra-api/sell-everything-back-to-sol/main.py and the issue is the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions