Skip to content

chore: bump to newest sdk#30

Open
SwenSchaeferjohann wants to merge 8 commits intomainfrom
bump-interface-changes
Open

chore: bump to newest sdk#30
SwenSchaeferjohann wants to merge 8 commits intomainfrom
bump-interface-changes

Conversation

@SwenSchaeferjohann
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann commented Mar 9, 2026

breaking changes


Open with Devin

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines +70 to +71
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Crash on undefined.unshift() if createTransferInterfaceInstructions returns empty array

The new code accesses instructions[instructions.length - 1] and calls .unshift(createAtaIx) on it without guarding against an empty instructions array. If createTransferInterfaceInstructions returns [], lastBatch is undefined and lastBatch.unshift(createAtaIx) throws a TypeError. The old code didn't have this crash path because it passed instructions directly to signAndSendBatches, which gracefully returns null for empty arrays (toolkits/sign-with-privy/react/src/hooks/signAndSendBatches.ts:43).

Suggested change
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
if (instructions.length === 0) {
throw new Error('Transfer returned no instructions');
}
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +65 to +66
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Crash on undefined.unshift() if createTransferInterfaceInstructions returns empty array

Same issue as in the Privy variant: instructions[instructions.length - 1] is undefined when instructions is empty, and calling .unshift() on it throws a TypeError. The old code passed instructions directly to signAndSendBatches (toolkits/sign-with-wallet-adapter/react/src/hooks/signAndSendBatches.ts:32-33), which handles empty arrays gracefully by returning null.

Suggested change
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
if (instructions.length === 0) {
throw new Error('Transfer returned no instructions');
}
const lastBatch = instructions[instructions.length - 1];
lastBatch.unshift(createAtaIx);
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

SwenSchaeferjohann and others added 4 commits March 18, 2026 21:25
createLoadAtaInstructions returns TransactionInstruction[][] (batched),
not TransactionInstruction[]. Iterate over batches to build individual
transactions.
devin-ai-integration[bot]

This comment was marked as resolved.

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

Successfully merging this pull request may close these issues.

1 participant