Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ProjectID for WalletConnect Cloud #99

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions helpers/utils/createEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ export const createEnv = (
apiKeys: APIKeys,
projectPath = "./",
local: boolean,
projectId: string // Add the PROJECT_ID parameter here
) => {
if (Object.keys(apiKeys).length) {
const writeStream = fs.createWriteStream(
path.join(projectPath, local? ".env.local" : ".env")
path.join(projectPath, local ? ".env.local" : ".env")
);


// Write the PROJECT_ID for WalletConnectCloud to the environment file
if (projectId) {
writeStream.write(`PROJECT_ID=${projectId}\n`);
}

for (const [key, value] of Object.entries(apiKeys)) {
writeStream.write(`${key.toUpperCase()}=${value}\n`);
// Exclude PROJECT_ID from being written again
if (key !== "PROJECT_ID") {
writeStream.write(`${key.toUpperCase()}=${value}\n`);
}
}
writeStream.end();
}
Expand Down
15 changes: 8 additions & 7 deletions interfaces/apiKeys.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export interface APIKeys {
ALCHEMY_API_KEY: string;
PRIVATE_KEY?: string | null;
ETHERSCAN_API_KEY?: string | null;
ALCHEMY_NETWORK?: string | null;
NEXT_PUBLIC_ALCHEMY_NETWORK?: string | null;
NEXT_PUBLIC_DEFAULT_CHAIN?: string | null;
[key: string]: string | null | undefined;
ALCHEMY_API_KEY: string;
PROJECT_ID?: string; // Add PROJECT_ID property
PRIVATE_KEY?: string | null;
ETHERSCAN_API_KEY?: string | null;
ALCHEMY_NETWORK?: string | null;
NEXT_PUBLIC_ALCHEMY_NETWORK?: string | null;
NEXT_PUBLIC_DEFAULT_CHAIN?: string | null;
[key: string]: string | null | undefined;
}