-
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: create reusable chains package (#3562)
* feat: create reusable chains package * feat: remove RPC and subgraph URLs from chains package
- Loading branch information
1 parent
1e548b1
commit 7f5455a
Showing
63 changed files
with
660 additions
and
719 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@venusprotocol/evm": minor | ||
--- | ||
|
||
create reusable chains package |
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 |
---|---|---|
@@ -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 One | ||
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 | ||
VITE_CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY= | ||
|
||
# The Graph | ||
VITE_THE_GRAPH_API_KEY= | ||
## Used at build-time only to generate subgraph types | ||
VITE_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,60 @@ | ||
/** @type {import('graphql-config').IGraphQLConfig } */ | ||
|
||
import { ChainId } from '@venusprotocol/chains/types'; | ||
|
||
import { getGovernanceSubgraphUrls, getIsolatedPoolsSubgraphUrls } from './src/config/subgraphUrls'; | ||
|
||
const keys = { | ||
nodeRealApiKey: process.env.VITE_CODEGEN_UNRESTRICTED_NODE_REAL_API_KEY!, | ||
theGraphApiKey: process.env.VITE_CODEGEN_UNRESTRICTED_THE_GRAPH_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'], | ||
errorsOnly: true, | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./src/clients/subgraph/gql/generated/isolatedPools.ts': { | ||
plugins, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
governanceBsc: { | ||
schema: governanceSubgraphUrls[ChainId.BSC_MAINNET], | ||
documents: ['./src/clients/subgraph/queries/governanceBsc/**/*.graphql'], | ||
errorsOnly: true, | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./src/clients/subgraph/gql/generated/governanceBsc.ts': { | ||
plugins, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
governanceNonBsc: { | ||
schema: governanceSubgraphUrls[ChainId.ETHEREUM], | ||
documents: ['./src/clients/subgraph/queries/governanceNonBsc/**/*.graphql'], | ||
errorsOnly: true, | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./src/clients/subgraph/gql/generated/governanceNonBsc.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
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
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
2 changes: 1 addition & 1 deletion
2
...es/formatToProposal/formatToRemoteProposal/getRemoteProposalState/__tests__/index.spec.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
2 changes: 1 addition & 1 deletion
2
...ubgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/index.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
2 changes: 1 addition & 1 deletion
2
apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/index.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 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
Oops, something went wrong.