fix: yield solana unsignedTransaction breaking changes #11788
Merged
+188
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Description
This fixes yield.xyz
unsignedTransactionfield in/enterand/exitwhich is not a base64 string anymore but a hex-encoded string without0xprefix for Solana transactions.Before: The code used viem's
isHex()to detect hex encoding, butisHex()requires a0xprefix. Since yield.xyz returns bare hex (e.g.01000000...), the code fell through to the base64 decode branch, producing a corrupted buffer.VersionedTransaction.deserializethen failed with "Reached end of buffer unexpectedly".After: The code now checks both
isHex(unsignedTransaction)andisHex(0x${unsignedTransaction})to handle bare hex. Base64 strings are unaffected since they contain characters (=,+,/) that failisHexeven with a0xprefix prepended.Changes:
decodeSolanaTransactionhelper to handle hex (with/without0xprefix) and base64 encodingstoHexOrDefaultandtoHexDatahelpers for testabilityRisk
Low risk — the fix is scoped entirely to the Solana code path (
executeSolanaTransaction). EVM, Cosmos, Sui, Near, and Tron paths are completely separate and unaffected.Testing
Engineering
yarn test -- src/lib/yieldxyz/executeTransaction.test.ts— 21 tests passingOperations
Screenshots (if applicable)
https://jam.dev/c/051720a1-f1e1-4faa-9b21-0e2661df58fc
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.