@@ -201,20 +201,17 @@ const SwapActionPage: NextPage = () => {
201201 throw 'Missing JSON payload'
202202 }
203203
204- quoteParams . chainId = quoteParams . originChainId
205- quoteParams . toChainId = quoteParams . destinationChainId
206- quoteParams . currency = quoteParams . originCurrency
207- quoteParams . toCurrency = quoteParams . destinationCurrency
204+ console . log ( quoteParams , 'PARAMS' )
208205
209- if ( ! quoteParams . chainId ) {
206+ if ( ! quoteParams . originChainId ) {
210207 setError ( 'Missing chainId' )
211208 throw 'Missing chainId'
212209 }
213210
214211 let executionWallet
215212
216213 if (
217- quoteParams . chainId === 792703809 &&
214+ quoteParams . originChainId === 792703809 &&
218215 isSolanaWallet ( primaryWallet )
219216 ) {
220217 const connection = await primaryWallet . getConnection ( )
@@ -259,7 +256,7 @@ const SwapActionPage: NextPage = () => {
259256
260257 executionWallet = adaptSuiWallet (
261258 primaryWallet ?. address ,
262- quoteParams . chainId ,
259+ quoteParams . originChainId ,
263260 walletClient ,
264261 async ( tx ) => {
265262 const signedTransaction =
@@ -279,12 +276,29 @@ const SwapActionPage: NextPage = () => {
279276 throw 'Unable to configure wallet'
280277 }
281278
279+ const {
280+ destinationCurrency,
281+ destinationChainId,
282+ originCurrency,
283+ originChainId,
284+ amount,
285+ tradeType,
286+ referrer,
287+ ...options
288+ } = quoteParams
289+
282290 const quote = await client ?. actions . getQuote (
283291 {
284292 wallet : executionWallet ,
285293 user : primaryWallet . address ,
286294 recipient : primaryWallet . address ,
287- ...quoteParams
295+ toCurrency : destinationCurrency ,
296+ toChainId : destinationChainId ,
297+ currency : originCurrency ,
298+ chainId : originChainId ,
299+ amount,
300+ tradeType,
301+ options
288302 } ,
289303 true
290304 )
0 commit comments