Skip to content

Commit

Permalink
Merge pull request #276 from jediswaplabs/revert-226-iamoskvin/pools_…
Browse files Browse the repository at this point in the history
…page

Revert "Iamoskvin/pools page"
  • Loading branch information
vnaysngh-mudrex authored May 18, 2024
2 parents 8102826 + ae80a19 commit bb25ac6
Show file tree
Hide file tree
Showing 34 changed files with 4,485 additions and 2,152 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESLINT_NO_DEV_ERRORS=true
REACT_APP_AMPLITUDE_PROXY_URL="https://api.uniswap.org/v1/amplitude-proxy"
REACT_APP_AWS_API_REGION="us-east-2"
REACT_APP_AWS_API_ENDPOINT="https://api.v2.jediswap.xyz/graphql"
REACT_APP_AWS_API_ENDPOINT="https://beta.api.uniswap.org/v1/graphql"
REACT_APP_BNB_RPC_URL="https://rough-sleek-hill.bsc.quiknode.pro/413cc98cbc776cda8fdf1d0f47003583ff73d9bf"
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847"
REACT_APP_QUICKNODE_MAINNET_RPC_URL="https://magical-alien-tab.quiknode.pro/669e87e569a8277d3fbd9e202f9df93189f19f4c"
Expand Down
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These API keys are intentionally public. Please do not report them - thank you for your concern.
REACT_APP_AMPLITUDE_PROXY_URL="https://api.uniswap.org/v1/amplitude-proxy"
REACT_APP_AWS_API_ENDPOINT="https://api.v2.jediswap.xyz/graphql"
REACT_APP_AWS_API_ENDPOINT="https://api.uniswap.org/v1/graphql"
REACT_APP_BNB_RPC_URL="https://old-wispy-arrow.bsc.quiknode.pro/f5c060177236065c1058531a0615ab4f7a34a2fd"
REACT_APP_FIREBASE_KEY="AIzaSyBcZWwTcTJHj_R6ipZcrJkXdq05PuX0Rs0"
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@
"node-fetch": "^3.3.2",
"node-vibrant": "^3.2.1-alpha.1",
"numbro": "^2.4.0",
"numeral": "2",
"polished": "^3.3.2",
"polyfill-object.fromentries": "^1.0.1",
"qrcode.react": "^3.1.0",
Expand All @@ -278,10 +277,7 @@
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-spring": "^9.5.5",
"react-switch": "^7.0.0",
"react-table": "^7.8.0",
"react-tooltip": "^5.26.3",
"react-use": "^17.5.0",
"react-use-gesture": "^6.0.14",
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "^1.8.5",
Expand Down
93 changes: 0 additions & 93 deletions src/api/PoolsData.ts

This file was deleted.

46 changes: 22 additions & 24 deletions src/apollo/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,41 @@ import { ChainId } from '@vnaysn/jediswap-sdk-core'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { HttpLink } from 'apollo-link-http'

function createCache() {
return new InMemoryCache({
dataIdFromObject: (object) => {
switch (object.__typename) {
case 'TokenDayData': {
return `${object.tokenAddress}${object.datetime}`
}
case 'FactoryDayData': {
return `${object.id}${object.dayId}`
}
case 'Token': {
return `${object.tokenAddress}${object.name}`
}
case 'Pool': {
return `${object.poolAddress}${object.datetime}`
}
default: {
return object.id || object._id
}
const cache = new InMemoryCache({
dataIdFromObject: (object) => {
switch (object.__typename) {
case 'TokenDayData': {
return `${object.tokenAddress}${object.datetime}`
}
},
})
}
case 'FactoryDayData': {
return `${object.id}${object.dayId}`
}
case 'Token': {
return `${object.tokenAddress}${object.name}`
}
case 'Pool': {
return `${object.poolAddress}${object.datetime}`
}
default: {
return object.id || object._id
}
}
},
})

export const jediSwapClient = new ApolloClient({
link: new HttpLink({
uri: 'https://api.v2.jediswap.xyz/graphql',
}),
cache: createCache(),
cache,
shouldBatch: true,
})

export const jediSwapClientSepolia = new ApolloClient({
link: new HttpLink({
uri: 'https://api.v2.sepolia.jediswap.xyz/graphql',
}),
cache: createCache(),
cache,
shouldBatch: true,
})

Expand Down
69 changes: 0 additions & 69 deletions src/apollo/queries.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { apiTimeframeOptions } from 'constants/apiTimeframeOptions'
import gql from 'graphql-tag'

const TokenFields = `
Expand All @@ -16,33 +15,6 @@ const TokenFields = `
feesUSD
}
`
const PoolFields = `
fragment PoolFields on Pool {
poolAddress
token0 {
tokenAddress
symbol
name
#totalValueLocked
}
token1 {
tokenAddress
symbol
name
#totalValueLocked
}
volumeToken0
volumeToken1
volumeUSD
totalValueLockedUSD
totalValueLockedETH
totalValueLockedToken0
totalValueLockedToken1
token0Price
token1Price
fee
}
`

export const TOKENS_DATA = ({ tokenIds = [] }) => {
const tokenString = `[${tokenIds.map((token) => `"${token}"`).join(',')}]`
Expand All @@ -58,44 +30,3 @@ export const TOKENS_DATA = ({ tokenIds = [] }) => {
`
return gql(queryString)
}

export const HISTORICAL_POOLS_DATA = ({ tokenIds = [], periods = [] }) => {
const tokensString = `[${tokenIds.map((token) => `"${token}",`)}]`
const periodString = `[${periods.map((period) => `"${period}"`).join(',')}]`

let queryString = `
${PoolFields}
query poolsData {
poolsData(
first: 500,
where: {
periodIn: ${periodString},
bothTokenAddressIn: ${tokensString},
}
) {
pool {
...PoolFields
}
period
}
}
`
return gql(queryString)
}

export const HISTORICAL_GLOBAL_DATA = () => {
const queryString = ` query jediswapFactories {
factoriesData {
${apiTimeframeOptions.oneDay}
${apiTimeframeOptions.twoDays}
}
}`
return gql(queryString)
}

export const STRK_REWARDS_DATA = () => {
const queryString = ` query strkGrantData {
strkGrantData
}`
return gql(queryString)
}
17 changes: 0 additions & 17 deletions src/components/FeeBadge/index.tsx

This file was deleted.

59 changes: 0 additions & 59 deletions src/components/FormattedName/index.tsx

This file was deleted.

Loading

0 comments on commit bb25ac6

Please sign in to comment.