- {NativeDapps.map((dapp: Dapp) => (
+ {NativeDapps.map((dapp: GovernanceTopic) => (
- {Others.map((dapp: Dapp) => (
+ {Others.map((dapp: GovernanceTopic) => (
,
name: "BeraHub",
- link: "berahub",
+ slug: "berahub",
+ subgraph: governanceSubgraphUrl,
},
{
+ id: "honey",
color: "#EC8A19",
icon:
,
name: "Honey",
- link: "honey",
+ slug: "honey",
+ subgraph: governanceSubgraphUrl,
},
{
+ id: "bend",
color: "#7464E5",
icon:
,
name: "BEND",
- link: "bend",
+ slug: "bend",
+ subgraph: governanceSubgraphUrl,
},
{
+ id: "berps",
color: "#41D6E0",
icon:
,
name: "BERPS",
- link: "berps",
+ slug: "berps",
+ subgraph: governanceSubgraphUrl,
},
];
-export const Others: Dapp[] = [
+export const Others: GovernanceTopic[] = [
{
+ id: "general",
color: "#2F2F2F",
icon:
,
name: "General",
- link: "general",
+ slug: "general",
+ subgraph: governanceSubgraphUrl,
},
];
export const getDappByGenre = (genre: PROPOSAL_GENRE) => {
return (
- NativeDapps.find((dapp) => dapp.link === genre) ||
- Others.find((dapp) => dapp.link === genre)
+ NativeDapps.find((dapp) => dapp.id === genre) ||
+ Others.find((dapp) => dapp.id === genre)
);
};
export const isValidGenre = (genre: any): genre is PROPOSAL_GENRE => {
return (
- NativeDapps.some((dapp) => dapp.link === genre) ||
- Others.some((dapp) => dapp.link === genre)
+ NativeDapps.some((dapp) => dapp.id === genre) ||
+ Others.some((dapp) => dapp.id === genre)
);
};
diff --git a/apps/hub/src/app/governance/layout.tsx b/apps/hub/src/app/governance/layout.tsx
index f5595c6b9..d005cfa79 100755
--- a/apps/hub/src/app/governance/layout.tsx
+++ b/apps/hub/src/app/governance/layout.tsx
@@ -1,9 +1,3 @@
-import { GovernanceProvider } from "./components/governance-provider";
-
export default function Layout({ children }: { children: React.ReactNode }) {
- return (
-
-
-
- );
+ return
;
}
diff --git a/packages/berajs/src/constants/defaultBeraConfig.ts b/packages/berajs/src/constants/defaultBeraConfig.ts
index eec514110..57db22e7f 100755
--- a/packages/berajs/src/constants/defaultBeraConfig.ts
+++ b/packages/berajs/src/constants/defaultBeraConfig.ts
@@ -1,10 +1,16 @@
import {
beraTokenAddress,
+ bgtEndpointUrl,
+ bgtSubgraphUrl,
+ bgtTokenAddress,
crocDexAddress,
crocIndexerEndpoint,
crocMultiSwapAddress,
crocRouterEndpoint,
crocSubgraphEndpoint,
+ governanceSubgraphUrl,
+ governanceTimelockAddress,
+ governorAddress,
honeyRouterAddress,
honeySubgraphUrl,
lendOracleAddress,
@@ -13,15 +19,11 @@ import {
lendRewardsAddress,
lendSubgraphUrl,
lendUIDataProviderAddress,
+ marketListUrl,
multicallAddress,
tokenListUrl,
tradingContractAddress,
validatorListUrl,
- bgtEndpointUrl,
- bgtTokenAddress,
- marketListUrl,
- bgtSubgraphUrl,
- governanceSubgraphUrl,
} from "@bera/config";
import { BeraConfig } from "..";
@@ -56,5 +58,27 @@ export const defaultBeraConfig: BeraConfig = {
lendRewardsAggregatorAddress: lendRewardsAddress,
honeyRouterAddress: honeyRouterAddress,
perpsTradingContractAddress: tradingContractAddress,
+ governance: {
+ berahub: {
+ governor: governorAddress,
+ timelock: governanceTimelockAddress,
+ },
+ honey: {
+ governor: governorAddress,
+ timelock: governanceTimelockAddress,
+ },
+ bend: {
+ governor: governorAddress,
+ timelock: governanceTimelockAddress,
+ },
+ berps: {
+ governor: governorAddress,
+ timelock: governanceTimelockAddress,
+ },
+ general: {
+ governor: governorAddress,
+ timelock: governanceTimelockAddress,
+ },
+ },
},
};
diff --git a/packages/berajs/src/types/global.ts b/packages/berajs/src/types/global.ts
index fc126ec24..817c34ed1 100755
--- a/packages/berajs/src/types/global.ts
+++ b/packages/berajs/src/types/global.ts
@@ -33,6 +33,13 @@ export interface BeraConfig {
lendRewardsAggregatorAddress?: Address;
honeyRouterAddress?: Address;
perpsTradingContractAddress?: Address;
+ governance: {
+ berahub?: { governor: Address; timelock: Address };
+ honey?: { governor: Address; timelock: Address };
+ bend?: { governor: Address; timelock: Address };
+ berps?: { governor: Address; timelock: Address };
+ general?: { governor: Address; timelock: Address };
+ };
};
}
diff --git a/packages/config/env/index.ts b/packages/config/env/index.ts
index 5aa22a73e..70fdc5c9d 100755
--- a/packages/config/env/index.ts
+++ b/packages/config/env/index.ts
@@ -206,7 +206,7 @@ export const governorAddress = process.env
export const governanceTokenAddress = process.env
.NEXT_PUBLIC_GOVERNANCE_TOKEN_ADDRESS as Address;
export const governanceTimelockAddress = process.env
- .NEXT_PUBLIC_GOVERNANCE_TIMELOCK_ADDRESS as string;
+ .NEXT_PUBLIC_GOVERNANCE_TIMELOCK_ADDRESS as Address;
export const beraChefAddress = process.env
.NEXT_PUBLIC_BERA_CHEF_ADDRESS as Address;
export const governanceOrganizationId = process.env
diff --git a/packages/graphql/src/modules/clients/get-client.ts b/packages/graphql/src/modules/clients/get-client.ts
new file mode 100644
index 000000000..7f602c754
--- /dev/null
+++ b/packages/graphql/src/modules/clients/get-client.ts
@@ -0,0 +1,14 @@
+import { ApolloClient, InMemoryCache } from "@apollo/client";
+
+export const getClient = (subgraphEndpoint: string) =>
+ new ApolloClient({
+ uri: subgraphEndpoint,
+ cache: new InMemoryCache(),
+ });
+
+export const getSSRClient = (subgraphEndpoint: string) =>
+ new ApolloClient({
+ ssrMode: true,
+ uri: subgraphEndpoint,
+ cache: new InMemoryCache(),
+ });
diff --git a/packages/graphql/src/modules/clients/index.ts b/packages/graphql/src/modules/clients/index.ts
index 6132ac19c..4b0124379 100755
--- a/packages/graphql/src/modules/clients/index.ts
+++ b/packages/graphql/src/modules/clients/index.ts
@@ -2,3 +2,4 @@ export * from "./dex-client";
export * from "./honey-client";
export * from "./lend-client";
export * from "./bgt-client";
+export * from "./get-client";