From 2b9a452efdfe23f4c99a108824f143c56907f2f5 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Thu, 17 Jun 2021 22:31:07 -0300 Subject: [PATCH] Add env vars to config.json Signed-off-by: Sebastian Martinez --- src/config.json | 1 + src/config.ts | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/config.json b/src/config.json index 506157538..284063b05 100644 --- a/src/config.json +++ b/src/config.json @@ -62,6 +62,7 @@ }, "tokens": [] }, + "radicle": { "api": "" }, "abi": { "registrar": [ "function rad() view returns (address)", diff --git a/src/config.ts b/src/config.ts index 3e4ce00d4..0dcf4b4a4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,12 +8,6 @@ declare global { registrarState: any; } - interface ImportMeta { - env: { - RADICLE_ALCHEMY_API_KEY: string | null; - RADICLE_HTTP_API: string | null; - }; - } } export class Config { @@ -27,7 +21,7 @@ export class Config { signer: ethers.Signer & TypedDataSigner | null; safe: { api: string | null; viewer: string | null }; abi: { [contract: string]: string[] }; - seed: { api: string | null }; + seed: { api?: string }; tokens: string[]; token: ethers.Contract; @@ -37,7 +31,7 @@ export class Config { signer: ethers.Signer & TypedDataSigner | null, ) { const cfg = (> config)[network.name]; - const api = import.meta.env.RADICLE_HTTP_API; + const api = config.radicle.api; if (!cfg) { throw `Network ${network.name} is not supported`;