From 21413b54a87e9967260164db12a721535f955073 Mon Sep 17 00:00:00 2001 From: Elisha Okon Date: Thu, 24 Aug 2023 12:39:25 +0100 Subject: [PATCH 1/2] Update createEnv.ts with Project_ID argument --- helpers/utils/createEnv.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/helpers/utils/createEnv.ts b/helpers/utils/createEnv.ts index 682e49c..64d4697 100644 --- a/helpers/utils/createEnv.ts +++ b/helpers/utils/createEnv.ts @@ -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(); } From d93c0690432a265ab2426aeb03c3d8d2f2488a39 Mon Sep 17 00:00:00 2001 From: Elisha Okon Date: Thu, 24 Aug 2023 12:43:59 +0100 Subject: [PATCH 2/2] Update apiKeys.ts --- interfaces/apiKeys.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/interfaces/apiKeys.ts b/interfaces/apiKeys.ts index 978a726..0905348 100644 --- a/interfaces/apiKeys.ts +++ b/interfaces/apiKeys.ts @@ -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; }