-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvConfig.ts
More file actions
32 lines (23 loc) · 801 Bytes
/
envConfig.ts
File metadata and controls
32 lines (23 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { config } from "dotenv";
config();
export const getInfuraProjectId = (): string => {
const infuraProjectId = process.env.INFURA_PROJECT_ID;
if (!infuraProjectId) {
throw new Error("INFURA_PROJECT_ID environment variable is not set.");
}
return infuraProjectId;
};
export const getExplorerApiKeyMatic = (): string => {
const explorerApiKeyMatic = process.env.EXPLORER_API_KEY_MATIC;
if (!explorerApiKeyMatic) {
throw new Error("EXPLORER_API_KEY_MATIC environment variable is not set.");
}
return explorerApiKeyMatic;
};
export const getPrivateKeyMatic = (): string => {
const privateKeyMatic = process.env.PRIVATE_KEY_MATIC;
if (!privateKeyMatic) {
throw new Error("PRIVATE_KEY_MATIC environment variable is not set.");
}
return privateKeyMatic;
};