Skip to content

Commit

Permalink
Harshal/v2 split routing (#350)
Browse files Browse the repository at this point in the history
* single hop split routing

* wip

* wip

* remove duplicated pools line

* fix infinite loop

* multihop and remove consoles

* fix page break

* console single trade

* fix wrong output

* log txn

* fix type error

* wip

* increase splits

* fix tradedetails dropdown

* add loading state

* fix big int amount issue

* maxhops 2

* no split txn works

* fix exact out

* fix tradedetails modal

* add split

* fix swap details dropdown

* reset state on currency or input change

* fix fetching button state

* add v1routes

* dont show price until v2 is fetched

* 2 hops

* update data on the rewards page (#342)

* CI: bumps version to v7.2.8

* don't display quote for unsufficient balance (#341)

* CI: bumps version to v7.2.9

* fix (#345)

* CI: bumps version to v7.2.10

* claim date update (#347)

* CI: bumps version to v7.2.11

* vault mobile (#344)

* vault landing page mobile optimised

* vault details page mobile responsive

* vault mobile corrections

* misc vault mobile fix

* CI: bumps version to v8.0.0

* vault mobile gap fix (#351)

* CI: bumps version to v8.0.1

* added link to docs (#354)

* CI: bumps version to v8.0.2

* feat: adding pfp (#195)

* feat: adding pfp

* upgrading starknet react

* added proper number type to price (#355)

* CI: bumps version to v8.0.3

* add twitter slink

* fix twitter:image tag

* preview (#368)

* preview

* update url

* update player height

* fix link

* fix dimentions

* decrease size

* upldate slinks dimensions

* add overflow auto

---------

Co-authored-by: Vinay Singh <[email protected]>

* update site url and twiiter name (#370)

* CI: bumps version to v8.1.0

* claim august 01 (#371)

* CI: bumps version to v8.1.1

* added allocation error handling (#372)

* CI: bumps version to v8.1.2

* block identifier added to claimed rewards contract call to fetch the latest claimed amount (#374)

* CI: bumps version to v8.1.3

* fix tvl and user deposit calculations (#375)

* CI: bumps version to v8.1.4

* Update VaultWithdrawInput.tsx (#376)

* CI: bumps version to v8.1.5

* remove leading zeros (#377)

* CI: bumps version to v8.1.6

* hide global data for now (#380)

* CI: bumps version to v8.1.7

* fix deposit and withdraw issues (#383)

* CI: bumps version to v8.1.8

* CI: bumps version to v8.1.9

* 09 august claim date (#385)

* CI: bumps version to v8.1.10

* claim 16 august (#387)

* CI: bumps version to v8.1.11

* Revert "feat: adding pfp (#195)" (#390)

This reverts commit 2838777.

* CI: bumps version to v9.0.0

* wip

* fix tradedetails dropdown

* fix tradedetails modal

* stop refetch on tab focus

* fix singlehop

---------

Co-authored-by: iamoskvin <[email protected]>
Co-authored-by: Automated Version Bump <[email protected]>
Co-authored-by: Vinay Singh <[email protected]>
Co-authored-by: Nico <[email protected]>
  • Loading branch information
5 people authored Aug 15, 2024
1 parent ac696ed commit 66de463
Show file tree
Hide file tree
Showing 9 changed files with 1,147 additions and 619 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"@graphql-codegen/typescript-operations": "^3.0.2",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@graphql-codegen/typescript-resolvers": "^3.2.1",
"@harshalmaniya/jediswap-sdk-v3": "^19.1.1",
"@jediswap/sdk": "^2.3.5",
"@juggle/resize-observer": "^3.4.0",
"@lingui/core": "^4.3.0",
Expand Down
17 changes: 9 additions & 8 deletions src/components/RoutingDiagram/RoutingDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Z_INDEX } from 'theme/zIndex'
import { RoutingDiagramEntry } from 'utils/getRoutingDiagramEntries'
import { ReactComponent as DotLine } from '../../assets/svg/dot_line.svg'
import { MouseoverTooltip, TooltipSize } from '../Tooltip'
import { useFormatter } from 'utils/formatNumbers'

const Wrapper = styled(Box)`
align-items: center;
Expand Down Expand Up @@ -107,19 +108,19 @@ export default function RoutingDiagram({
}) {
const tokenIn = useTokenInfoFromActiveList(currencyIn)
const tokenOut = useTokenInfoFromActiveList(currencyOut)
const { formatPercent } = useFormatter()

return (
<Wrapper>
{routes.map((entry, index) => (
<RouteContainerRow key={index}>
{index === 0 && (
<WrapperLabel>
<CurrencyLogo currency={tokenIn} size="20px" />
<PoolBadgeWhite>
{routes?.[0].type} <BadgeText style={{ fontWeight: 300, marginLeft: '4px' }}>100%</BadgeText>
</PoolBadgeWhite>
</WrapperLabel>
)}
<WrapperLabel>
<CurrencyLogo currency={tokenIn} size="20px" />
<PoolBadgeWhite>
{entry.type}
<BadgeText style={{ fontWeight: 300, marginLeft: '4px' }}>{formatPercent(entry.percent)}%</BadgeText>
</PoolBadgeWhite>
</WrapperLabel>
<Route entry={entry} />
<CurrencyLogo currency={tokenOut} size="20px" />
</RouteContainerRow>
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useAllV3Routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function useAllV3Routes(
): { loading: boolean; routes: any[] } {
const { chainId } = useAccountDetails()
const { pools, loading: poolsLoading } = useV3SwapPools(allPools, currencyIn, currencyOut)

// const [singleHopOnly] = useUserSingleHopOnly()
const singleHopOnly = false

Expand Down
Loading

0 comments on commit 66de463

Please sign in to comment.