Skip to content

Commit

Permalink
fix(prediction): Subgraph endpoint + typo (pancakeswap#1320)
Browse files Browse the repository at this point in the history
* chore(prediction): Subgraph endpoint

* fix(prediction): Typo
  • Loading branch information
ChefKai authored May 25, 2021
1 parent 9200676 commit 51d84de
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ REACT_APP_NODE_2 = "https://bsc-dataseed1.defibit.io"
REACT_APP_NODE_3 = "https://bsc-dataseed.binance.org"

REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile"
REACT_APP_GRAPH_API_PREDICTIONS = "https://api.bscgraph.org/subgraphs/name/pancakeswap/prediction"
REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction"
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ REACT_APP_NODE_2 = "https://bsc-dataseed1.defibit.io"
REACT_APP_NODE_3 = "https://bsc-dataseed.binance.org"

REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile"
REACT_APP_GRAPH_API_PREDICTIONS = "https://api.bscgraph.org/subgraphs/name/pancakeswap/prediction"
REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction"
3 changes: 1 addition & 2 deletions src/config/constants/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const GRAPH_API_PROFILE = process.env.REACT_APP_GRAPH_API_PROFILE
export const GRAPH_API_PREDICTIONS = process.env.REACT_APP_GRAPH_API_PREDICTIONS
export const GRAPH_WS_PREDICTIONS = process.env.REACT_APP_GRAPH_WS_PREDICTIONS
export const GRAPH_API_PREDICTION = process.env.REACT_APP_GRAPH_API_PREDICTION
10 changes: 5 additions & 5 deletions src/state/predictions/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { request, gql } from 'graphql-request'
import { GRAPH_API_PREDICTIONS } from 'config/constants/endpoints'
import { GRAPH_API_PREDICTION } from 'config/constants/endpoints'
import { Bet, BetPosition, Market, PredictionStatus, Round, RoundData } from 'state/types'
import makeBatchRequest from 'utils/makeBatchRequest'
import { getPredictionsContract } from 'utils/contractHelpers'
Expand Down Expand Up @@ -203,7 +203,7 @@ export const getMarketData = async (): Promise<{
market: Market
}> => {
const response = (await request(
GRAPH_API_PREDICTIONS,
GRAPH_API_PREDICTION,
gql`
query getMarketData {
rounds(first: 5, orderBy: epoch, orderDirection: desc) {
Expand All @@ -228,7 +228,7 @@ export const getMarketData = async (): Promise<{

export const getRound = async (id: string) => {
const response = await request(
GRAPH_API_PREDICTIONS,
GRAPH_API_PREDICTION,
gql`
query getRound($id: ID!) {
round(id: $id) {
Expand All @@ -255,7 +255,7 @@ export const getBetHistory = async (
skip = 0,
): Promise<BetResponse[]> => {
const response = await request(
GRAPH_API_PREDICTIONS,
GRAPH_API_PREDICTION,
gql`
query getBetHistory($first: Int!, $skip: Int!, $where: Bet_filter) {
bets(first: $first, skip: $skip, where: $where) {
Expand All @@ -276,7 +276,7 @@ export const getBetHistory = async (

export const getBet = async (betId: string): Promise<BetResponse> => {
const response = await request(
GRAPH_API_PREDICTIONS,
GRAPH_API_PREDICTION,
gql`
query getBet($id: ID!) {
bet(id: $id) {
Expand Down

0 comments on commit 51d84de

Please sign in to comment.