Problem
New Stellar accounts with no XLM cannot pay transaction fees. SmartDrop targets early-stage token participants who may have only the staking asset (e.g. a project's custom token) but no native XLM for fees. Without fee-bump support, these users are blocked from depositing.
Expected Behaviour
When the app detects that the connected wallet's XLM balance is below the minimum fee reserve, it offers to wrap the user's transaction in a fee-bump envelope signed by a sponsor keypair (provided via environment variable or a backend endpoint). The sponsor pays the fee; the inner transaction is signed by the user.
Acceptance Criteria
Relevant Files
src/lib/soroban.ts — buildFeeBumpTransaction, integrate into lockAssets / unlockAssets
src/app/api/sign-fee-bump/route.ts — create new API route
src/lib/stellar.ts — fetchAccountBalances (needed for XLM check)
Problem
New Stellar accounts with no XLM cannot pay transaction fees. SmartDrop targets early-stage token participants who may have only the staking asset (e.g. a project's custom token) but no native XLM for fees. Without fee-bump support, these users are blocked from depositing.
Expected Behaviour
When the app detects that the connected wallet's XLM balance is below the minimum fee reserve, it offers to wrap the user's transaction in a fee-bump envelope signed by a sponsor keypair (provided via environment variable or a backend endpoint). The sponsor pays the fee; the inner transaction is signed by the user.
Acceptance Criteria
src/lib/soroban.tsgains abuildFeeBumpTransaction(innerTx, sponsorPublicKey, networkPassphrase)utility usingTransactionBuilder.buildFeeBumpfrom the Stellar SDKSorobanService.lockAssetsandunlockAssetsdetect XLM balance < fee threshold (fetched viafetchAccountBalances) and switch to fee-bump mode automaticallyprocess.env.NEXT_PUBLIC_FEE_SPONSOR_PUBLIC_KEY; the sponsor signature is obtained from a backend API routePOST /api/sign-fee-bumpthat receives the inner XDR and returns the signed fee-bump XDRsrc/app/api/sign-fee-bump/route.ts) that uses the sponsor secret stored inSTELLAR_FEE_SPONSOR_SECRET(server-side only, never exposed to the browser)buildFeeBumpTransactionwraps it correctly (correct source, fee, inner tx)Relevant Files
src/lib/soroban.ts—buildFeeBumpTransaction, integrate intolockAssets/unlockAssetssrc/app/api/sign-fee-bump/route.ts— create new API routesrc/lib/stellar.ts—fetchAccountBalances(needed for XLM check)