feat: build, inspect, and export fee-bump transactions with inner-env… - #919
Merged
Nanle-code merged 2 commits intoAug 31, 2026
Merged
Conversation
…elope details
Three things were broken for fee-bump transactions:
1. Builder.tsx uses stellar.ts buildTransaction/simulateTransaction, which had
no fee-bump support at all. A feeBump operation would silently skip during
build and crash on simulate with a misleading error.
2. TransactionSigner accepted any XDR but never inspected the envelope — pasting
a FeeBumpTransaction gave no way to see what you were actually signing (inner
source, operations, fee, signature count were all invisible).
3. No utility existed to parse XDR and safely identify its type or surface
inner-envelope details without throwing.
Changes:
src/utils/feeBumpInspector.ts (new)
Pure utility with no side effects. inspectEnvelope(xdr, network) returns a
typed discriminated union. For FeeBumpTransaction: outer hash, feeSource,
outer fee, and full inner envelope (hash, source, fee, sequence, signatures,
operation list). For plain Transaction: the same fields directly. Never
throws — callers check .ok before accessing .envelope.
src/components/dashboard/TransactionSigner.tsx
- Added envelopeInfo state driven by inspectEnvelope on every XDR change.
- handleXdrChange now also clears signedXdr and error on new input so stale
state never lingers alongside a new paste.
- EnvelopeDetails component renders below the textarea: for fee-bump it shows
a nested two-panel layout (outer wrapper + inner transaction); for plain
transactions it shows the standard field set.
src/lib/stellar.ts
- buildTransaction return type widened to Transaction | FeeBumpTransaction.
Fee-bump path added before the account-load path: validates feeSource,
baseFee, innerTransaction XDR with explicit error messages, then calls
TransactionBuilder.buildFeeBumpTransaction. Mixed fee-bump + other ops
rejected with a clear error.
- simulateTransaction: skips validateSimulationParams (which requires a
sourceAccount) when the only operation is feeBump; uses instanceof
FeeBumpTransaction to compute operationCount correctly (inner ops + 1);
guards the Soroban simulation path with the same check.
- exportTransactionXDR is unaffected — .toXDR() exists on both types.
tests/unit/lib/feeBumpInspector.test.js (new)
17 tests across 4 groups: primary fee-bump flow (type, feeSource, inner
details, hashes, fee ordering), plain transaction flow, boundary cases
(unsigned tx, whitespace input, unknown network), failure cases (empty
string, garbage, truncated XDR, null/non-string inputs — never throws).
|
Someone is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@praizeD10 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
@praizeD10 Please fix all the CI checks failure! |
Collaborator
|
@praizeD10 Please resolve conflicts so I can merge!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #758
…elope details
Three things were broken for fee-bump transactions:
Builder.tsx uses stellar.ts buildTransaction/simulateTransaction, which had no fee-bump support at all. A feeBump operation would silently skip during build and crash on simulate with a misleading error.
TransactionSigner accepted any XDR but never inspected the envelope — pasting a FeeBumpTransaction gave no way to see what you were actually signing (inner source, operations, fee, signature count were all invisible).
No utility existed to parse XDR and safely identify its type or surface inner-envelope details without throwing.
Changes:
src/utils/feeBumpInspector.ts (new)
Pure utility with no side effects. inspectEnvelope(xdr, network) returns a
typed discriminated union. For FeeBumpTransaction: outer hash, feeSource,
outer fee, and full inner envelope (hash, source, fee, sequence, signatures,
operation list). For plain Transaction: the same fields directly. Never
throws — callers check .ok before accessing .envelope.
src/components/dashboard/TransactionSigner.tsx
src/lib/stellar.ts
tests/unit/lib/feeBumpInspector.test.js (new)
17 tests across 4 groups: primary fee-bump flow (type, feeSource, inner
details, hashes, fee ordering), plain transaction flow, boundary cases
(unsigned tx, whitespace input, unknown network), failure cases (empty
string, garbage, truncated XDR, null/non-string inputs — never throws).