-
Notifications
You must be signed in to change notification settings - Fork 1
/
env.ts
49 lines (47 loc) · 1.7 KB
/
env.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
import { createEnv } from '@t3-oss/env-core'
import { zeroAddress } from 'viem'
import { z } from 'zod'
const zBoolean = z
.enum(['true', 'false'])
.transform((value) => value === 'true')
.optional()
.default('true')
/**
* Represents the environment configuration object.
*
* @dev zod-checked and typed environment variables.
* Here you should define all the environment variables that your application uses.
*/
export const env = createEnv({
clientPrefix: 'PUBLIC_',
client: {
PUBLIC_ALCHEMY_KEY: z.string().optional(),
PUBLIC_APP_DESCRIPTION: z.string().min(1).optional(),
PUBLIC_APP_LOGO: z.string().optional(),
PUBLIC_APP_NAME: z.string().min(1),
PUBLIC_APP_URL: z.string().optional(),
PUBLIC_USE_DEFAULT_TOKENS: zBoolean,
PUBLIC_INFURA_KEY: z.string().optional(),
PUBLIC_NATIVE_TOKEN_ADDRESS: z
.string()
.optional()
.default(zeroAddress)
.transform((value) => value.toLowerCase()),
PUBLIC_RPC_ARBITRUM: z.string().optional(),
PUBLIC_RPC_ARBITRUM_SEPOLIA: z.string().optional(),
PUBLIC_RPC_BASE: z.string().optional(),
PUBLIC_RPC_BASE_SEPOLIA: z.string().optional(),
PUBLIC_RPC_GNOSIS: z.string().optional(),
PUBLIC_RPC_GNOSIS_CHIADO: z.string().optional(),
PUBLIC_RPC_MAINNET: z.string().optional(),
PUBLIC_RPC_OPTIMISM: z.string().optional(),
PUBLIC_RPC_OPTIMISM_SEPOLIA: z.string().optional(),
PUBLIC_RPC_POLYGON: z.string().optional(),
PUBLIC_RPC_POLYGON_MUMBAI: z.string().optional(),
PUBLIC_RPC_SEPOLIA: z.string().optional(),
PUBLIC_WALLETCONNECT_PROJECT_ID: z.string().optional().default(''),
PUBLIC_INCLUDE_TESTNETS: zBoolean,
},
runtimeEnv: import.meta.env,
emptyStringAsUndefined: true,
})