-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update opbnb subgraph (#8821)
<!-- 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 ### Focus of this PR: This PR introduces a new environment variable `NODE_REAL_SUBGRAPH_API_KEY` and updates multiple files to use it for subgraph API endpoints. ### Detailed summary: - Added `NODE_REAL_SUBGRAPH_API_KEY` environment variable - Updated `apis/farms/src/provider.ts` to use `NODE_REAL_SUBGRAPH_API_KEY` for subgraph API endpoint - Updated `apis/farms/src/v3.ts` to use `NODE_REAL_SUBGRAPH_API_KEY` for subgraph API endpoint - Updated `apis/routing/src/provider.ts` to use `NODE_REAL_SUBGRAPH_API_KEY` for subgraph API endpoint - Updated `apis/routing/src/bindings.d.ts` to include `NODE_REAL_SUBGRAPH_API_KEY` constant - Updated `apis/farms/wrangler.toml` and `apis/routing/wrangler.toml` to include `NODE_REAL_SUBGRAPH_API_KEY` in secret put command - Updated `packages/chains/src/index.test.ts` to include `BLOCKS_SUBGRAPHS` and related functions > The following files were skipped due to too many changes: `packages/chains/src/subgraphs.ts` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
1 parent
ef50410
commit 8fcd67c
Showing
11 changed files
with
98 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@pancakeswap/chains': minor | ||
--- | ||
|
||
Add getters for subgraph endpoints by chain |
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
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
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
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,35 +1,67 @@ | ||
import { ChainId } from './chainId' | ||
|
||
export const V3_SUBGRAPHS = { | ||
[ChainId.ETHEREUM]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth', | ||
[ChainId.GOERLI]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-goerli', | ||
[ChainId.BSC]: `https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-bsc`, | ||
[ChainId.BSC_TESTNET]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-chapel', | ||
[ChainId.ARBITRUM_ONE]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-arb', | ||
[ChainId.ARBITRUM_GOERLI]: 'https://api.thegraph.com/subgraphs/name/chef-jojo/exhange-v3-arb-goerli', | ||
[ChainId.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest', | ||
[ChainId.POLYGON_ZKEVM_TESTNET]: null, | ||
[ChainId.ZKSYNC]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-zksync/version/latest', | ||
[ChainId.ZKSYNC_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-zksync-testnet/version/latest', | ||
[ChainId.LINEA]: 'https://graph-query.linea.build/subgraphs/name/pancakeswap/exchange-v3-linea', | ||
[ChainId.LINEA_TESTNET]: | ||
'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exchange-v3-linea-goerli', | ||
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest', | ||
[ChainId.BASE_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base-testnet/version/latest', | ||
[ChainId.OPBNB]: 'https://opbnb-mainnet-graph.nodereal.io/subgraphs/name/pancakeswap/exchange-v3', | ||
[ChainId.OPBNB_TESTNET]: null, | ||
[ChainId.SCROLL_SEPOLIA]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-scroll-sepolia/version/latest', | ||
} satisfies Record<ChainId, string | null> | ||
|
||
export const V2_SUBGRAPHS = { | ||
[ChainId.BSC]: 'https://proxy-worker-api.pancakeswap.com/bsc-exchange', | ||
[ChainId.ETHEREUM]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exhange-eth', | ||
[ChainId.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest', | ||
[ChainId.ZKSYNC_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-zksync-testnet/version/latest', | ||
[ChainId.ZKSYNC]: ' https://api.studio.thegraph.com/query/45376/exchange-v2-zksync/version/latest', | ||
[ChainId.LINEA_TESTNET]: 'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exhange-eth/', | ||
[ChainId.ARBITRUM_ONE]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-arbitrum/version/latest', | ||
[ChainId.LINEA]: 'https://graph-query.linea.build/subgraphs/name/pancakeswap/exhange-v2', | ||
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-base/version/latest', | ||
[ChainId.OPBNB]: 'https://opbnb-mainnet-graph.nodereal.io/subgraphs/name/pancakeswap/exchange-v2', | ||
type SubgraphParams = { | ||
noderealApiKey?: string | ||
} | ||
|
||
const publicSubgraphParams = { | ||
// Public key for nodereal subgraph endpoint | ||
noderealApiKey: '19bd2b3f75c24e23bb8a0e9d4f55b271', | ||
} | ||
|
||
export const V3_SUBGRAPHS = getV3Subgraphs(publicSubgraphParams) | ||
|
||
export const V2_SUBGRAPHS = getV2Subgraphs(publicSubgraphParams) | ||
|
||
export const BLOCKS_SUBGRAPHS = getBlocksSubgraphs(publicSubgraphParams) | ||
|
||
export function getV3Subgraphs({ noderealApiKey }: SubgraphParams) { | ||
return { | ||
[ChainId.ETHEREUM]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth', | ||
[ChainId.GOERLI]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-goerli', | ||
[ChainId.BSC]: `https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-bsc`, | ||
[ChainId.BSC_TESTNET]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-chapel', | ||
[ChainId.ARBITRUM_ONE]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-arb', | ||
[ChainId.ARBITRUM_GOERLI]: 'https://api.thegraph.com/subgraphs/name/chef-jojo/exhange-v3-arb-goerli', | ||
[ChainId.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest', | ||
[ChainId.POLYGON_ZKEVM_TESTNET]: null, | ||
[ChainId.ZKSYNC]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-zksync/version/latest', | ||
[ChainId.ZKSYNC_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-zksync-testnet/version/latest', | ||
[ChainId.LINEA]: 'https://graph-query.linea.build/subgraphs/name/pancakeswap/exchange-v3-linea', | ||
[ChainId.LINEA_TESTNET]: | ||
'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exchange-v3-linea-goerli', | ||
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest', | ||
[ChainId.BASE_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base-testnet/version/latest', | ||
[ChainId.OPBNB]: `https://open-platform-ap.nodereal.io/${noderealApiKey}/opbnb-mainnet-graph-query/subgraphs/name/pancakeswap/exchange-v3`, | ||
[ChainId.OPBNB_TESTNET]: null, | ||
[ChainId.SCROLL_SEPOLIA]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-scroll-sepolia/version/latest', | ||
} satisfies Record<ChainId, string | null> | ||
} | ||
|
||
export function getV2Subgraphs({ noderealApiKey }: SubgraphParams) { | ||
return { | ||
[ChainId.BSC]: 'https://proxy-worker-api.pancakeswap.com/bsc-exchange', | ||
[ChainId.ETHEREUM]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exhange-eth', | ||
[ChainId.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest', | ||
[ChainId.ZKSYNC_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-zksync-testnet/version/latest', | ||
[ChainId.ZKSYNC]: ' https://api.studio.thegraph.com/query/45376/exchange-v2-zksync/version/latest', | ||
[ChainId.LINEA_TESTNET]: 'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exhange-eth/', | ||
[ChainId.ARBITRUM_ONE]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-arbitrum/version/latest', | ||
[ChainId.LINEA]: 'https://graph-query.linea.build/subgraphs/name/pancakeswap/exhange-v2', | ||
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-base/version/latest', | ||
[ChainId.OPBNB]: `https://open-platform-ap.nodereal.io/${noderealApiKey}/opbnb-mainnet-graph-query/subgraphs/name/pancakeswap/exchange-v2`, | ||
} | ||
} | ||
|
||
export function getBlocksSubgraphs({ noderealApiKey }: SubgraphParams) { | ||
return { | ||
[ChainId.BSC]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/blocks', | ||
[ChainId.ETHEREUM]: 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks', | ||
[ChainId.POLYGON_ZKEVM]: 'https://api.studio.thegraph.com/query/45376/polygon-zkevm-block/version/latest', | ||
[ChainId.ZKSYNC]: 'https://api.studio.thegraph.com/query/45376/blocks-zksync/version/latest', | ||
[ChainId.ARBITRUM_ONE]: 'https://api.thegraph.com/subgraphs/name/ianlapham/arbitrum-one-blocks', | ||
[ChainId.LINEA]: 'https://graph-query.linea.build/subgraphs/name/kybernetwork/linea-blocks', | ||
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/48211/base-blocks/version/latest', | ||
[ChainId.OPBNB]: `https://open-platform-ap.nodereal.io/${noderealApiKey}/opbnb-mainnet-graph-query/subgraphs/name/pancakeswap/blocks`, | ||
} | ||
} |
8fcd67c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
uikit – ./packages/uikit
uikit-git-develop.pancake.run
uikit.pancake.run
8fcd67c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./apps/web
pancakeswap.finance
pancake-prod.vercel.app
www.pancakeswap.finance
web2.pancake.run
web.pancake.run