Add env vars to config.json

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2021-06-18 09:21:45 -03:00
parent 40570de998
commit 2b9a452efd
2 changed files with 3 additions and 8 deletions
+1
View File
@@ -62,6 +62,7 @@
},
"tokens": []
},
"radicle": { "api": "" },
"abi": {
"registrar": [
"function rad() view returns (address)",
+2 -8
View File
@@ -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`;