feat: sponsored fee-bump transactions for low-XLM wallets#66
Merged
prodbycorne merged 1 commit intoJun 28, 2026
Merged
Conversation
- Add buildFeeBumpTransaction helper in src/lib/soroban.ts using the correct TransactionBuilder.buildFeeBumpTransaction(feeSource, baseFee, innerTx, networkPassphrase) positional API - Add fetchAccountBalances utility in src/lib/stellar.ts (404-safe) - Add POST /api/sign-fee-bump route handler that wraps and signs the inner transaction with STELLAR_FEE_SPONSOR_SECRET - Integrate automatic fee-bump detection into lockAssets and unlockAssets: fetches native XLM balance, enables sponsor mode when balance < 1.0 XLM and NEXT_PUBLIC_FEE_SPONSOR_PUBLIC_KEY is configured - Display sponsored warning banner in both deposit modals (farm list page and pool detail page) when fee-bump is active - Fix pre-existing duplicate isDisabled prop in UnlockModal - Fix pre-existing getEvents pagination type error in soroban.ts - 2 new unit tests for buildFeeBumpTransaction (all 66 tests pass) Closes SmartDropLabs#30
Contributor
|
Good Job |
6 tasks
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.
Summary
Implements Issue #30 — sponsored fee-bump transaction support so users with < 1 XLM can still deposit into pools without paying transaction fees directly.
Changes
New Files
src/lib/stellar.ts—fetchAccountBalances(publicKey)query utility (404-safe for unfunded accounts)src/app/api/sign-fee-bump/route.ts—POST /api/sign-fee-bumpRoute Handler; wraps a user-signed inner tx in a sponsor fee-bump envelope signed withSTELLAR_FEE_SPONSOR_SECRETsrc/lib/soroban.feebump.test.ts— Unit tests for the fee-bump builder (2 tests)Modified Files
src/lib/soroban.tsbuildFeeBumpTransaction(innerTx, sponsorPublicKey, networkPassphrase)helper using the correct SDK positional API:TransactionBuilder.buildFeeBumpTransaction(feeSource, baseFee, innerTx, networkPassphrase)lockAssets— checks native XLM balance; if < 1.0 XLM andNEXT_PUBLIC_FEE_SPONSOR_PUBLIC_KEYis set, calls/api/sign-fee-bumpand submits the wrapped envelopeunlockAssets— same sponsored flowgetEventspaginationtype error (movedlimitto top level)src/app/farm/page.tsx— addsisFeeSponsoreddetection and warning banner in the deposit modalsrc/app/farm/[poolId]/PoolDetailClient.tsx— same sponsored banner in the pool detail deposit modalsrc/components/UnlockModal/UnlockModal.tsx— fixed pre-existing duplicateisDisabledpropEnvironment Variables Required
STELLAR_FEE_SPONSOR_SECRET.env.local)NEXT_PUBLIC_FEE_SPONSOR_PUBLIC_KEY.env.local)Testing
npm run test)npm run build)Closes #30