Skip to content

Commit

Permalink
Switch subgraph URLs to decentralized network
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAurelius committed Apr 24, 2024
1 parent d501124 commit 97f3c21
Showing 1 changed file with 45 additions and 18 deletions.
63 changes: 45 additions & 18 deletions flows/constants.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
CARBON_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/polygon-digital-carbon"
)
CARBON_LEGACY_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/polygon-bridged-carbon"
)
CARBON_ETH_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/ethereum-bridged-carbon"
)
CARBON_CELO_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/celo-bridged-carbon"
)
CARBON_HOLDERS_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/klimadao-user-carbon"
)
PAIRS_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/klimadao-pairs"
)
import os

GRAPH_API_KEY = os.env.get('GRAPH_API_KEY')
GRAPH_BASE_URL = f'https://gateway-arbitrum.network.thegraph.com/api/{GRAPH_API_KEY}/subgraphs/id/'
GRAPH_DEV_BASE_URL = 'https://api.studio.thegraph.com/query/71975/'
GRAPH_VERSION_SUFFIX = '/version/current'

if os.env.get('ENV') == 'production':
CARBON_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/polygon-digital-carbon"
)
CARBON_LEGACY_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/polygon-bridged-carbon"
)
CARBON_ETH_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/ethereum-bridged-carbon"
)
CARBON_CELO_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/celo-bridged-carbon"
)
CARBON_HOLDERS_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/klimadao-user-carbon"
)
PAIRS_SUBGRAPH_URL = (
"https://api.thegraph.com/subgraphs/name/klimadao/klimadao-pairs"
)
else:
CARBON_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-polygon-digital-carbon" + GRAPH_VERSION_SUFFIX
)
CARBON_LEGACY_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-polygon-bridged-carbon" + GRAPH_VERSION_SUFFIX
)
CARBON_ETH_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-ethereum-bridged-carbon" + GRAPH_VERSION_SUFFIX
)
CARBON_CELO_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-celo-bridged-carbon" + GRAPH_VERSION_SUFFIX
)
CARBON_HOLDERS_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-klimadao-user-carbon" + GRAPH_VERSION_SUFFIX
)
PAIRS_SUBGRAPH_URL = (
GRAPH_DEV_BASE_URL + "staging-klimadao-pairs" + GRAPH_VERSION_SUFFIX
)

BCT_ADDRESS = "0x2f800db0fdb5223b3c3f354886d907a671414a7f"
NCT_ADDRESS = "0xd838290e877e0188a4a44700463419ed96c16107"
Expand Down

0 comments on commit 97f3c21

Please sign in to comment.