Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add env vars to config.json
Sebastian Martinez committed 4 years ago
commit 2b9a452efdfe23f4c99a108824f143c56907f2f5
parent 40570de99894d7f3270908094e830930ee25d9f9
2 files changed +3 -8
modified src/config.json
@@ -62,6 +62,7 @@
    },
    "tokens": []
  },
+
  "radicle": { "api": "" },
  "abi": {
    "registrar": [
      "function rad() view returns (address)",
modified 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 = (<Record<string, any>> 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`;