diff --git a/web/package.json b/web/package.json index c38b679f..8e1bc4c3 100644 --- a/web/package.json +++ b/web/package.json @@ -29,7 +29,7 @@ "@orbisclub/components": "https://github.com/nvm1410/social-components#custom-comments", "@orbisclub/orbis-sdk": "^0.4.89", "@supabase/supabase-js": "^2.46.2", - "@swapr/sdk": "https://github.com/rodsouto/swapr-sdk#fork-with-postinstall", + "@swapr/sdk": "https://github.com/rodsouto/swapr-sdk#5e3b4f7abf8411434f0a05628a23653c8d6b87a0", "@tanstack/query-sync-storage-persister": "^5.59.9", "@tanstack/react-query": "^5.17.19", "@tanstack/react-query-devtools": "^5.20.5", diff --git a/web/src/components/Market/SwapTokens/SwapTokens.tsx b/web/src/components/Market/SwapTokens/SwapTokens.tsx index 5768e751..c414536e 100644 --- a/web/src/components/Market/SwapTokens/SwapTokens.tsx +++ b/web/src/components/Market/SwapTokens/SwapTokens.tsx @@ -119,6 +119,9 @@ export function SwapTokens({ isError: quoteIsError, } = useQuoteTrade(chainId, account, amount, outcomeToken, selectedCollateral, swapType); + const isCowFastQuote = + quoteData?.trade instanceof CoWTrade && quoteData?.trade?.quote?.expiration === "1970-01-01T00:00:00Z"; + const tradeTokens = useTrade(async () => { reset(); closeConfirmSwapModal(); @@ -289,11 +292,10 @@ export function SwapTokens({ useFormReturn={useFormReturn} /> - {Number(amount) > 0 && (
Price per share ={" "} - {quoteFetchStatus === "fetching" || isFetchingSharesToAssets || isFetchingAssetsToShares ? ( + {quoteIsPending || isFetchingSharesToAssets || isFetchingAssetsToShares ? (
) : ( <> @@ -307,11 +309,10 @@ export function SwapTokens({ )}
)} - {Number(amount) > 0 && (
{swapType === "buy" ? "Expected shares" : "Expected amount"} ={" "} - {quoteFetchStatus === "fetching" || isFetchingSharesToAssets ? ( + {quoteIsPending || isFetchingSharesToAssets ? (
) : ( <> @@ -349,8 +350,15 @@ export function SwapTokens({
- - {quoteData?.trade ? ( + {isCowFastQuote ? ( +