Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dynamic swap page #1575

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

dennyscode
Copy link
Contributor

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jumper-exchange ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 10:35am

Copy link

github-actions bot commented Dec 9, 2024

Test results (3/4)

passed  5 passed

Details

stats  5 tests across 2 suites
duration  1 minute, 10 seconds
commit  fbc23a2

Copy link

github-actions bot commented Dec 9, 2024

Test results (4/4)

passed  5 passed

Details

stats  5 tests across 2 suites
duration  1 minute, 9 seconds
commit  fbc23a2

Copy link

github-actions bot commented Dec 9, 2024

Test results (2/4)

passed  4 passed
skipped  1 skipped

Details

stats  5 tests across 1 suite
duration  36.2 seconds
commit  fbc23a2

Skipped tests

chromium › e2e.spec.ts › Jumper full e2e flow › Should be able to open quests mission page and switch background color

Copy link

github-actions bot commented Dec 9, 2024

Test results (1/4)

passed  5 passed
skipped  1 skipped

Details

stats  6 tests across 2 suites
duration  1 minute, 7 seconds
commit  fbc23a2

Skipped tests

chromium › e2e.spec.ts › Jumper full e2e flow › Should be able to navigate to profile and open first Mission

@dennyscode
Copy link
Contributor Author

@tcheee
1.) CHAIN: The way it works now: It takes only the [segment] (of chain-name) and uses its chainId as sourceChain + destinationChain.
2.) Token: It fetches the token list for the specific chain first.

  • it takes the first (tokens[0]) entry from that list as the fromToken. It usually is the base token from what I noticed.
  • it takes the second entry (tokens[1]) from that list as the toToken. This likely was some kind of Wrapped baseToken but we may have to test further and investigate.

--> ToToken: We could potentially filter for a specific token name and only return USDT/USDC or somewhat. What do you prefer?

@dennyscode dennyscode added the WIP Work in Progress label Dec 11, 2024
@dennyscode
Copy link
Contributor Author

@tcheee

Todos:

  • populate correct FAQ infos
  • check content and possibly update texts
  • do we need to update some widget background-images? Like the "defaults" including Across as a returned quote?
  • do we need an image for the 2nd step: "Step 2: Make sure to have Funds on Polygon in your wallet". If yes, which one would that be?


const openGraph: Metadata['openGraph'] = {
title: title,
description: `Jumper offers the best way to swap tokenA to tokenB on ${sourceChain?.name} with the fastest speeds, lowest costs, and most secure swap providers available.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "to swap tokens on"

import { getSiteUrl } from '@/const/urls';

//Optimized function to generate ordered bridge pairs (tokens from different chains)
const generateBridgeOrderedPairs = (tokens: Token[]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we keep this ?

coins.filter((c) => availableChainsId.includes(c.chainId)) as Token[],
);

// Split the ordered array into chunks of 50,000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have only 32 (or something like this) page now?

const orderedChunks = ordered.slice(start, end);

const routes = orderedChunks.map(([a, b]) => ({
url: `${getSiteUrl()}/bridge/${`${getChainById(chains, a.chainId)?.name}-${a.symbol}-to-${getChainById(chains, b.chainId)?.name}-${b.symbol}`.toLowerCase()}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not good, seems to have bee copied without adaptation from the bridge


const BridgeExplanationSection = () => {
return (
<BridgePageContainer>
<SeoPageContainer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls don't call it SEO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call is TokenSwap or something like this

@@ -17,7 +17,13 @@ export function buildExplorerLink(
color="text.primary"
component={Link}
target="_blank"
href={`${blockExplorerUrls[0]}/tokens/${address}`}
href={`${blockExplorerUrls[0]}tokens/${address}`} // todo: on OP it needs to be "token/..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the ocmment ?

destinationToken?: Token;
}

const BridgePage = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls rename it

);
}

export function getChainInfoData(chainInfo: ExtendedChain) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we reuse the function from the "/bridge" page ?

el.attributes.Answer as unknown as BlocksProps[],
);
const text = el.Answer;
// used for data from strapi -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we nee to keep it?

import type { BoxProps } from '@mui/system';
import { Box, styled } from '@mui/system';

export const SeoPageContainer = styled(Box)<BoxProps>(({ theme }) => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to rename to "SwapPageContainer"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants