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

encoding overruns Uint8Array in v6.0.25 #37

Open
mczarnecki-mtt opened this issue Aug 5, 2024 · 0 comments
Open

encoding overruns Uint8Array in v6.0.25 #37

mczarnecki-mtt opened this issue Aug 5, 2024 · 0 comments

Comments

@mczarnecki-mtt
Copy link

mczarnecki-mtt commented Aug 5, 2024

When using the newest v6.0.25 version of the api and constructing a swap using /swap-instructions endpoint and trying to sign transaction using transaction.sign() I receive the following error:

encoding overruns Uint8Array

This was never happening in the previous versions of the API. When I go back to the previous version, the error stops occuring. What could be the issue? I feel like the transactions might exceed the transaction size limit.

I use the transactions like this:

const instructionsResponse = await this.jupiterSwapApi.getSwapInstructions(
quote,
this.wallet(),
);
const { computeBudgetInstructions, setupInstructions, swapInstruction, addressLookupTableAddresses } = instructionsResponse;

addressLookupTableAccounts.push(
...(await this.jupiterSwapApi.getAddressLookupTableAccounts(this.connection, addressLookupTableAddresses))
);
const instructions: TransactionInstruction[] = [];
instructions.push(...computeBudgetInstructions.map(this.jupiterSwapApi.deserializeInstruction));
instructions.push(...setupInstructions.map(this.jupiterSwapApi.deserializeInstruction));
instructions.push(this.jupiterSwapApi.deserializeInstruction(swapInstruction));

const messageV0 = new TransactionMessage({
payerKey: this.payer.publicKey,
recentBlockhash: lastValidBlock.lastBlockHash,
instructions
}).compileToV0Message([]);
const transaction = new VersionedTransaction(messageV0);
transaction.sign([this.wallet.asRawWallet().payer]);

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

1 participant