-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove RPC and subgraph URLs from chains package
- Loading branch information
1 parent
5bb2836
commit 20df1a0
Showing
19 changed files
with
265 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ build | |
out-tsc | ||
out | ||
generated | ||
.env.generated.ci | ||
|
||
# Local environment variables | ||
.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,23 @@ | ||
# Environment | ||
|
||
VITE_NETWORK=testnet | ||
VITE_ENV=local | ||
|
||
# Network-specific | ||
|
||
## BSC mainnet | ||
|
||
# BSC mainnet | ||
VITE_RPC_HTTP_URL_BSC_MAINNET= | ||
VITE_SUBGRAPH_MARKETS_URL_BSC_MAINNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_BSC_MAINNET= | ||
|
||
## BSC testnet | ||
VITE_RPC_HTTP_URL_BSC_TESTNET= | ||
VITE_SUBGRAPH_MARKETS_URL_BSC_TESTNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_BSC_TESTNET= | ||
|
||
## Ethereum | ||
VITE_RPC_HTTP_URL_ETHEREUM= | ||
VITE_SUBGRAPH_MARKETS_URL_ETHEREUM= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_ETHEREUM= | ||
|
||
## Sepolia | ||
VITE_RPC_HTTP_URL_SEPOLIA= | ||
VITE_SUBGRAPH_MARKETS_URL_SEPOLIA= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_SEPOLIA= | ||
|
||
## opBNB mainnet | ||
VITE_RPC_HTTP_URL_OPBNB_MAINNET= | ||
VITE_SUBGRAPH_MARKETS_URL_OPBNB_MAINNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_OPBNB_MAINNET= | ||
|
||
## opBNB testnet | ||
VITE_RPC_HTTP_URL_OPBNB_TESTNET= | ||
VITE_SUBGRAPH_MARKETS_URL_OPBNB_TESTNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_OPBNB_TESTNET= | ||
|
||
## Arbitrum | ||
VITE_RPC_HTTP_URL_ARBITRUM_ONE= | ||
VITE_SUBGRAPH_MARKETS_URL_ARBITRUM_ONE= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_ARBITRUM_ONE= | ||
|
||
## Arbitrum Sepolia | ||
VITE_RPC_HTTP_URL_ARBITRUM_SEPOLIA= | ||
VITE_SUBGRAPH_MARKETS_URL_ARBITRUM_SEPOLIA= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_ARBITRUM_SEPOLIA= | ||
|
||
## zkSync | ||
VITE_RPC_HTTP_URL_ZKSYNC_MAINNET= | ||
VITE_SUBGRAPH_MARKETS_URL_ZKSYNC_MAINNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_ZKSYNC_MAINNET= | ||
|
||
## zkSync Sepolia | ||
VITE_RPC_HTTP_URL_ZKSYNC_SEPOLIA= | ||
VITE_SUBGRAPH_MARKETS_URL_ZKSYNC_SEPOLIA= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_ZKSYNC_SEPOLIA= | ||
|
||
# Optimism mainnet | ||
VITE_RPC_HTTP_URL_OPTIMISM_MAINNET= | ||
VITE_SUBGRAPH_MARKETS_URL_OPTIMISM_MAINNET= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_OPTIMISM_MAINNET= | ||
|
||
# Optimism Sepolia | ||
VITE_RPC_HTTP_URL_OPTIMISM_SEPOLIA= | ||
VITE_SUBGRAPH_MARKETS_URL_OPTIMISM_SEPOLIA= | ||
VITE_SUBGRAPH_GOVERNANCE_URL_OPTIMISM_SEPOLIA= | ||
|
||
# Error reporting | ||
|
||
VITE_SENTRY_DSN= | ||
|
||
# Analytics | ||
|
||
VITE_POSTHOG_API_KEY= | ||
VITE_POSTHOG_HOST_URL= | ||
|
||
# ZyFi | ||
|
||
# Zyfi | ||
VITE_ZYFI_API_KEY= | ||
|
||
# NodeReal | ||
VITE_NODE_REAL_API_KEY= | ||
## Used at build-time only to generate subgraph types | ||
CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY= | ||
|
||
# The Graph | ||
VITE_THE_GRAPH_API_KEY= | ||
## Used at build-time only to generate subgraph types | ||
CODEGEN_UNRESTRICTED_THE_GRAPH_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @type {import('graphql-config').IGraphQLConfig } */ | ||
|
||
import { ChainId } from '@venusprotocol/chains/types'; | ||
|
||
import { getGovernanceSubgraphUrls, getIsolatedPoolsSubgraphUrls } from './src/config/subgraphUrls'; | ||
|
||
const keys = { | ||
nodeRealApiKey: process.env.CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY!, | ||
theGraphApiKey: process.env.CODEGEN_UNRESTRICTED_THE_GRAPH_API_KEY!, | ||
}; | ||
|
||
console.log('process.env', process.env); | ||
console.log( | ||
'process.env.CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY', | ||
process.env.CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY, | ||
); | ||
|
||
const isolatedPoolsSubgraphUrls = getIsolatedPoolsSubgraphUrls(keys); | ||
const governanceSubgraphUrls = getGovernanceSubgraphUrls(keys); | ||
|
||
const plugins = ['typescript', 'typed-document-node', 'typescript-operations']; | ||
|
||
export const projects = { | ||
isolatedPools: { | ||
schema: isolatedPoolsSubgraphUrls[ChainId.BSC_MAINNET], | ||
documents: ['./src/clients/subgraph/queries/isolatedPools/**/*.graphql'], | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./src/clients/subgraph/gql/generated/isolatedPools.ts': { | ||
plugins, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
governance: { | ||
schema: governanceSubgraphUrls[ChainId.BSC_MAINNET], | ||
documents: ['./src/clients/subgraph/queries/governance/**/*.graphql'], | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./src/clients/subgraph/gql/generated/governance.ts': { | ||
plugins, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
apps/evm/src/constants/api.ts → apps/evm/src/config/apiUrls.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.