Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Sep 4, 2024
1 parent 73ac6df commit 7fbe2ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/swap/components/SwapProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function SwapProvider({
const { address } = useAccount();
// Feature flags
const { useAggregator } = experimental;
const maxSlippage = experimental.maxSlippage || 3;
const [maxSlippage, setMaxSlippage] = useState(experimental.maxSlippage || 3);
// Core Hooks
const config = useConfig();
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -193,7 +193,7 @@ export function SwapProvider({
amountReference: 'from',
from: source.token,
to: destination.token,
maxSlippage: maxSlippage.toString(),
maxSlippage: experimental.maxSlippage?.toString(),
useAggregator,
});
// If request resolves to error response set the quoteError
Expand Down Expand Up @@ -263,7 +263,7 @@ export function SwapProvider({
from: from.token,
to: to.token,
useAggregator,
maxSlippage: maxSlippage.toString(),
maxSlippage: experimental.maxSlippage?.toString(),
});
if (isSwapError(response)) {
setLifeCycleStatus({
Expand All @@ -278,11 +278,11 @@ export function SwapProvider({
}
await processSwapTransaction({
config,
maxSlippage,
sendTransactionAsync,
setLifeCycleStatus,
swapTransaction: response,
useAggregator,
maxSlippage,
});

// TODO: refresh balances
Expand Down
2 changes: 1 addition & 1 deletion src/swap/utils/processSwapTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import type { ProcessSwapTransactionParams } from '../types';

export async function processSwapTransaction({
config,
maxSlippage,
sendTransactionAsync,
setLifeCycleStatus,
swapTransaction,
useAggregator,
maxSlippage,
}: ProcessSwapTransactionParams) {
const { transaction, approveTransaction, quote } = swapTransaction;

Expand Down

0 comments on commit 7fbe2ec

Please sign in to comment.