diff --git a/.env b/.env index 1f0a8383..f97e9935 100644 --- a/.env +++ b/.env @@ -1,3 +1,4 @@ REACT_APP_CHAIN_ID="1" REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847" -REACT_APP_GOOGLE_ANALYTICS_ID="UA-128182339-6" \ No newline at end of file +REACT_APP_GOOGLE_ANALYTICS_ID="UA-128182339-6" +REACT_EDITOR=atom diff --git a/src/apollo/client.js b/src/apollo/client.js index d10bbbdc..96cb0268 100644 --- a/src/apollo/client.js +++ b/src/apollo/client.js @@ -57,3 +57,11 @@ export const ensClient = new ApolloClient({ cache: new InMemoryCache(), shouldBatch: true, }) + +export const candleClient = new ApolloClient({ + link: new HttpLink({ + uri: 'https://api.thegraph.com/subgraphs/name/candleplatforms/candlegovernor/graphql', + }), + cache: new InMemoryCache(), + shouldBatch: true, +}) diff --git a/src/assets/images/cndlLogo.png b/src/assets/images/cndlLogo.png new file mode 100644 index 00000000..b08cb053 Binary files /dev/null and b/src/assets/images/cndlLogo.png differ diff --git a/src/state/application/hooks.ts b/src/state/application/hooks.ts index 19b70e0f..4bfc8f7d 100644 --- a/src/state/application/hooks.ts +++ b/src/state/application/hooks.ts @@ -12,6 +12,7 @@ import { RADICLE_GOVERNANCE, NOUNS_GOVERNANCE, ENS_GOVERNANCE, + CNDL_GOVERNANCE, } from '../governance/reducer' import { uniswapClient, @@ -21,6 +22,7 @@ import { radicleClient, nounsClient, ensClient, + candleClient, } from '../../apollo/client' export function useBlockNumber(): number | undefined { @@ -126,6 +128,8 @@ export function useSubgraphClient() { if (activeProtocol?.id === ENS_GOVERNANCE.id) { return ensClient } - + if (activeProtocol?.id === CNDL_GOVERNANCE.id) { + return candleClient + } return undefined } diff --git a/src/state/governance/hooks.ts b/src/state/governance/hooks.ts index 2a1abc83..9d49c716 100644 --- a/src/state/governance/hooks.ts +++ b/src/state/governance/hooks.ts @@ -27,6 +27,7 @@ import { } from './actions' import { COMPOUND_GOVERNANCE, GlobaData, GovernanceInfo, NOUNS_GOVERNANCE, UNISWAP_GOVERNANCE } from './reducer' + export interface DelegateData { id: string delegatedVotes: number @@ -190,6 +191,7 @@ export function useAllProposalStates(): number[] | undefined { if ( activeProtocol === COMPOUND_GOVERNANCE || + activeProtocol === CNDL_GOVERNANCE || activeProtocol === NOUNS_GOVERNANCE || activeProtocol === UNISWAP_GOVERNANCE ) { diff --git a/src/state/governance/reducer.ts b/src/state/governance/reducer.ts index ce0e7e8d..95d88de0 100644 --- a/src/state/governance/reducer.ts +++ b/src/state/governance/reducer.ts @@ -17,6 +17,7 @@ import PoolLogo from '../../assets/images/pooltogether-icon.png' import RadicleLogo from '../../assets/images/radicle-logo.svg' import NounsLogo from '../../assets/images/nouns-logo.png' import ENSLogo from '../../assets/images/ens.jpeg' +import CandleLogo from '../../assets/images/cndlLogo.png' import AddAccount from '../../assets/images/AddAccount.png' import { serializeToken } from '../user/hooks' @@ -172,6 +173,21 @@ export const NOUNS_GOVERNANCE: GovernanceInfo = { emoji: EMOJIS[Math.floor(Math.random() * EMOJIS.length)], } +export const CNDL_GOVERNANCE_ADDRESS = '0xB80Be29667021AE0B617AC9eFe0a3A1a58033681' +export const CNDL_ADDRESS = '0xbc138bd20c98186cc0342c8e380953af0cb48ba8' +const CNDL = new Token(ChainId.MAINNET, CNDL_ADDRESS, 18, 'CNDL', 'Candle Token') +export const CNDL_GOVERNANCE: GovernanceInfo = { + id: 'cndl', + name: 'Candle Governance', + logo: CandleLogo, + primaryColor: '#6fbeff', + secondaryColor: '#ebfeff', + token: serializeToken(CNDL), + governanceAlphaAddresses: [CNDL_GOVERNANCE_ADDRESS], + social: '@candle_labs', + emoji: '👻', +} + // #/connect or #/delegates/connect // show only identity flow e.g. link to twitter export function identityOnlyPath(pathname: string) { @@ -187,6 +203,7 @@ export const SUPPORTED_PROTOCOLS: { [id: string]: GovernanceInfo } = { radicle: RADICLE_GOVERNANCE, nouns: NOUNS_GOVERNANCE, ens: ENS_GOVERNANCE, + cndl: CNDL_GOVERNANCE, connect: CONNECT_CONFIG, }