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

parsedInstructionToInstruction method error #22

Open
ppeenegg opened this issue Jan 16, 2025 · 2 comments
Open

parsedInstructionToInstruction method error #22

ppeenegg opened this issue Jan 16, 2025 · 2 comments

Comments

@ppeenegg
Copy link

ppeenegg commented Jan 16, 2025

TypeError: Expected String

const connection = new Connection(process.env.HELIUS_RPC_URL as string);
const txn = await connection.getParsedTransaction(
    '4ZnWVLZqe4cjUEputJfTr2J5r1KMmY9aLzkdWi67zrqCQ5qCPiKnXEwzroSKRvpGH7D9DokT6UKnHhi441KSY2SE',
    {
        maxSupportedTransactionVersion: 0
    }
);
if(txn) {
    const solanaParser = new SolanaParser(
        [{ idl: pumpfunIdl as unknown as Idl, programId: pumpfunIdl.address }]
    );
    solanaParser.parseTransactionParsedData(
        txn?.transaction?.message
    );
}

UPD:
parsedInstructionToInstruction function try decode ParsedInstruction type

@devDesu
Copy link
Collaborator

devDesu commented Jan 17, 2025

Hey
getParsedTransaction is a method that returns already "parsed" transaction
I can't guarantee that response type won't change in some point of time hence it's better to use raw getTransaction method

@devDesu
Copy link
Collaborator

devDesu commented Jan 26, 2025

@ppeenegg I'm planning to remove support of the "parsed" encoding of the tx from the getTransaction endpoint
Lmk if I can close the issue

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