File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/ui/src/contexts/SwapProvider/providers Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,15 @@ export const JupiterProvider: SwapProvider = {
149149 throw swapError ( CommonError . MismatchingProvider ) ;
150150 }
151151
152+ // If no fee account is available, remove platformFee from quote to maintain consistency
153+ // Jupiter API expects either both platformFee + feeAccount or neither
154+ const cleanedQuote = feeAccount
155+ ? quote
156+ : {
157+ ...quote ,
158+ platformFee : null ,
159+ } ;
160+
152161 const [ txResponse , buildTxError ] = await resolve (
153162 fetchAndVerify (
154163 [
@@ -159,10 +168,10 @@ export const JupiterProvider: SwapProvider = {
159168 'Content-Type' : 'application/json' ,
160169 } ,
161170 body : JSON . stringify ( {
162- quoteResponse : quote ,
171+ quoteResponse : cleanedQuote ,
163172 userPublicKey : userAddress ,
164173 dynamicComputeUnitLimit : true , // Gives us a higher chance of the transaction landing
165- feeAccount,
174+ ... ( feeAccount && { feeAccount } ) ,
166175 } ) ,
167176 } ,
168177 ] ,
You can’t perform that action at this time.
0 commit comments