Skip to content

Commit

Permalink
api url update for rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex committed Mar 8, 2024
1 parent 6dcbd22 commit 2720687
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const STRK_PRICE_API_URL = 'https://api.binance.com/api/v3/ticker/price?s

export const getApiUrl = () => {
if (isTestnetEnvironment()) {
return 'https://api.goerli.jediswap.xyz/graphql'
return 'https://api.jediswap.xyz/graphql'
}
return 'https://api.jediswap.xyz/graphql'
}
Expand Down
11 changes: 7 additions & 4 deletions src/pages/Rewards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ const pairs = [

export default function Rewards() {
const [pairsData, setPairsData] = useState([])
const [pairsLoading, setPairsLoading] = useState(false)
useEffect(() => {
setPairsLoading(true)
const pairIds = pairs.map(pair => pair.poolAddress)

async function getPairsData() {
Expand Down Expand Up @@ -404,6 +406,7 @@ export default function Rewards() {
})

setPairsData(sortedRewardsPositions)
setPairsLoading(false)
}

if (!pairsData.length) {
Expand Down Expand Up @@ -542,7 +545,7 @@ export default function Rewards() {
margin
/> */}
<PairName>
{pair.token0.symbol}-{pair.token1.symbol}
{pair?.token0?.symbol}-{pair?.token1?.symbol}
</PairName>
<TotalAPR>
<div>Total APR:</div>
Expand All @@ -561,6 +564,8 @@ export default function Rewards() {
)
}

console.log(pairsData, 'pairsData')

return (
<PageWrapper>
<TransactionConfirmationModal
Expand Down Expand Up @@ -590,9 +595,7 @@ export default function Rewards() {
<DefiSpringTitle>Earn STRK incentives by providing liquidity to these pools:</DefiSpringTitle>
<RowFixed>
<ResponsiveRow>
{pairsData.map(pair => (
<PairListItem key={pair} pair={pair} />
))}
{pairsData.length ? pairsData.map(pair => <PairListItem key={pair} pair={pair} />) : 'Loading'}
</ResponsiveRow>
</RowFixed>
</div>
Expand Down

0 comments on commit 2720687

Please sign in to comment.