-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
65 lines (61 loc) · 2.02 KB
/
config.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { getAddress, isHex, type Address, type Hex } from "viem";
import dotenv from "dotenv";
dotenv.config();
if (!process.env.PIMLICO_API_KEY) {
throw new Error("PIMLICO_API_KEY does not exist");
}
if (!process.env.ALCHEMY_API_KEY) {
throw new Error("ALCHEMY_API_KEY does not exist");
}
if (!process.env.RELAYER_URL) {
throw new Error("RELAYER_URL does not exist");
}
if (!process.env.OWNER_PRIVATE_KEY) {
throw new Error("OWNER_PRIVATE_KEY does not exist");
}
if (!isHex(process.env.OWNER_PRIVATE_KEY)) {
throw new Error("OWNER_PRIVATE_KEY is not a valid hex string");
}
if (!process.env.GUARDIAN_EMAIL) {
throw new Error("GUARDIAN_EMAIL does not exist");
}
if (!process.env.ACCOUNT_CODE) {
throw new Error("ACCOUNT_CODE does not exist");
}
if (!isHex(process.env.ACCOUNT_CODE)) {
throw new Error("ACCOUNT_CODE is not a valid hex string");
}
if (!process.env.NEW_OWNER) {
throw new Error("NEW_OWNER does not exist");
}
type Config = {
bundlerUrl: string;
rpcUrl: string;
relayerApiUrl: string;
ownerPrivateKey: `0x${string}`;
guardianEmail: string;
accountCode: Hex;
newOwner: Address;
addresses: {
universalEmailRecoveryModule: Address;
safe4337ModuleAddress: Address;
erc7569LaunchpadAddress: Address;
attestor: Address;
};
};
const config: Config = {
bundlerUrl: `https://api.pimlico.io/v2/base-sepolia/rpc?apikey=${process.env.PIMLICO_API_KEY}`,
rpcUrl: `https://base-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
relayerApiUrl: `${process.env.RELAYER_URL}`,
ownerPrivateKey: process.env.OWNER_PRIVATE_KEY,
guardianEmail: `${process.env.GUARDIAN_EMAIL}`,
accountCode: `${process.env.ACCOUNT_CODE}`,
newOwner: getAddress(process.env.NEW_OWNER),
addresses: {
universalEmailRecoveryModule: "0x72FbA28445187A0a95D2d463e5eab385689F3648",
safe4337ModuleAddress: "0x7579EE8307284F293B1927136486880611F20002",
erc7569LaunchpadAddress: "0x7579011aB74c46090561ea277Ba79D510c6C00ff",
attestor: "0xA4C777199658a41688E9488c4EcbD7a2925Cc23A",
},
};
export default config;