Skip to content

Commit

Permalink
refactor: rename getLatestBridgeTokenAmount to updateLatestBridgeToke…
Browse files Browse the repository at this point in the history
…nAmount for clarity
  • Loading branch information
mohandast52 committed Nov 6, 2024
1 parent 734272c commit ea7a8c3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const useWsolDeposit = () => {
const customGetOrCreateAssociatedTokenAccount = useGetOrCreateAssociatedTokenAccount();
const program = new Program(idl, PROGRAM_ID, anchorProvider);

const getLatestBridgeTokenAmount = useCallback(async () => {
const updateLatestBridgeTokenAmount = useCallback(async () => {
if (!svmWalletPublicKey) return;
if (!connection) return;

Expand All @@ -138,8 +138,8 @@ export const useWsolDeposit = () => {
}, [connection, svmWalletPublicKey]);

useEffect(() => {
getLatestBridgeTokenAmount();
}, [getLatestBridgeTokenAmount]);
updateLatestBridgeTokenAmount();
}, [updateLatestBridgeTokenAmount]);

const getDepositIncreaseLiquidityQuote = async ({ sol, slippage }) => {
const { whirlpoolData, whirlpoolTokenA, whirlpoolTokenB } = await getWhirlpoolData();
Expand Down Expand Up @@ -336,7 +336,7 @@ export const useWsolDeposit = () => {

// wait for 2 seconds to allow the transaction to be processed
await new Promise((resolve) => setTimeout(resolve, 2000));
await getLatestBridgeTokenAmount(); // refetch bridged token amount
await updateLatestBridgeTokenAmount(); // refetch bridged token amount

return quote.liquidityAmount.toString();
};
Expand Down

0 comments on commit ea7a8c3

Please sign in to comment.