-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use gauges as routing reference (#8994)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview This PR adds new dependencies and introduces changes to the code in the `packages/tokens` and `packages/smart-router` directories. ### Detailed summary - Added new dependencies: `@pancakeswap/gauges` - Added `getTokensByChain` function in `helpers/getTokensByChain.ts` - Exported additional constants in `index.ts` - Updated `allTokens.ts` to include tokens for various chains - Updated `getPairCombinations.ts` in `smart-router` to include new imports and functions > The following files were skipped due to too many changes: `pnpm-lock.yaml` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
1 parent
c370217
commit d28653a
Showing
25 changed files
with
332 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ChainId } from '@pancakeswap/chains' | ||
|
||
import { bscTokens } from './constants/bsc' | ||
import { goerliTestnetTokens } from './constants/goerli' | ||
import { bscTestnetTokens } from './constants/bscTestnet' | ||
import { ethereumTokens } from './constants/eth' | ||
import { arbitrumTokens } from './constants/arb' | ||
import { polygonZkEvmTokens } from './constants/polygonZkEVM' | ||
import { polygonZkEvmTestnetTokens } from './constants/polygonZkEVMTestnet' | ||
import { zksyncTokens } from './constants/zkSync' | ||
import { zkSyncTestnetTokens } from './constants/zkSyncTestnet' | ||
import { lineaTestnetTokens } from './constants/lineaTestnet' | ||
import { lineaTokens } from './constants/linea' | ||
import { arbitrumGoerliTokens } from './constants/arbGoerli' | ||
import { opBnbTokens } from './constants/opBNB' | ||
import { opBnbTestnetTokens } from './constants/opBnbTestnet' | ||
import { baseTokens } from './constants/base' | ||
import { baseTestnetTokens } from './constants/baseTestnet' | ||
import { scrollSepoliaTokens } from './constants/scrollSepolia' | ||
|
||
export const allTokens = { | ||
[ChainId.GOERLI]: goerliTestnetTokens, | ||
[ChainId.BSC]: bscTokens, | ||
[ChainId.BSC_TESTNET]: bscTestnetTokens, | ||
[ChainId.ETHEREUM]: ethereumTokens, | ||
[ChainId.ARBITRUM_ONE]: arbitrumTokens, | ||
[ChainId.POLYGON_ZKEVM]: polygonZkEvmTokens, | ||
[ChainId.POLYGON_ZKEVM_TESTNET]: polygonZkEvmTestnetTokens, | ||
[ChainId.ZKSYNC]: zksyncTokens, | ||
[ChainId.ZKSYNC_TESTNET]: zkSyncTestnetTokens, | ||
[ChainId.LINEA_TESTNET]: lineaTestnetTokens, | ||
[ChainId.LINEA]: lineaTokens, | ||
[ChainId.ARBITRUM_GOERLI]: arbitrumGoerliTokens, | ||
[ChainId.OPBNB]: opBnbTokens, | ||
[ChainId.OPBNB_TESTNET]: opBnbTestnetTokens, | ||
[ChainId.BASE]: baseTokens, | ||
[ChainId.BASE_TESTNET]: baseTestnetTokens, | ||
[ChainId.SCROLL_SEPOLIA]: scrollSepoliaTokens, | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ChainId } from '@pancakeswap/chains' | ||
import { Token } from '@pancakeswap/sdk' | ||
|
||
import { allTokens } from '../allTokens' | ||
|
||
export function getTokensByChain(chainId?: ChainId): Token[] { | ||
if (!chainId) { | ||
return [] | ||
} | ||
|
||
const tokenMap = allTokens[chainId] | ||
return Object.values(tokenMap) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
export * from './common' | ||
export * from './constants/common' | ||
export * from './helpers' | ||
export * from './goerli' | ||
export * from './bsc' | ||
export * from './bscTestnet' | ||
export * from './eth' | ||
export * from './arb' | ||
export * from './polygonZkEVM' | ||
export * from './polygonZkEVMTestnet' | ||
export * from './zkSync' | ||
export * from './zkSyncTestnet' | ||
export * from './lineaTestnet' | ||
export * from './linea' | ||
export * from './arbGoerli' | ||
export * from './opBnbTestnet' | ||
export * from './opBNB' | ||
export * from './base' | ||
export * from './baseTestnet' | ||
export * from './scrollSepolia' | ||
export * from './constants/goerli' | ||
export * from './constants/bsc' | ||
export * from './constants/bscTestnet' | ||
export * from './constants/eth' | ||
export * from './constants/arb' | ||
export * from './constants/polygonZkEVM' | ||
export * from './constants/polygonZkEVMTestnet' | ||
export * from './constants/zkSync' | ||
export * from './constants/zkSyncTestnet' | ||
export * from './constants/lineaTestnet' | ||
export * from './constants/linea' | ||
export * from './constants/arbGoerli' | ||
export * from './constants/opBnbTestnet' | ||
export * from './constants/opBNB' | ||
export * from './constants/base' | ||
export * from './constants/baseTestnet' | ||
export * from './constants/scrollSepolia' |
Oops, something went wrong.