-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.ts
140 lines (134 loc) · 4.08 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import Constants from "expo-constants";
import { Platform } from "react-native";
import { base, baseSepolia } from "wagmi/chains";
declare const process: {
env: {
[key: string]: string;
};
};
const defaultConfig = {
debugMenu: false,
contactAddress: process.env.EXPO_PUBLIC_CONTACT_ADDRESS,
debugAddresses:
process.env.EXPO_PUBLIC_DEBUG_ADDRESSES?.toLowerCase().split(",") || [],
conversationDomain: "converse.xyz",
lensApiDomain: "api.lens.dev",
lensSuffix: ".lens",
sentryDSN: process.env.EXPO_PUBLIC_SENTRY_DSN,
walletConnectConfig: {
projectId: process.env.EXPO_PUBLIC_WALLETCONNECT_PROJECT_ID,
appMetadata: {
name: "Converse",
description:
"Converse lets you communicate and transact freely and safely.",
url: "https://converse.xyz",
logoUrl: "https://converse.xyz/icon.png",
icons: [],
},
},
thirdwebClientId: process.env.EXPO_PUBLIC_THIRDWEB_CLIENT_ID,
expoProjectId: process.env.EXPO_PUBLIC_EXPO_PROJECT_ID,
privy: {
appId: process.env.EXPO_PUBLIC_PRIVY_APP_ID,
defaultChain: baseSepolia,
},
evm: {
transactionChainId: "0x14a34", // Base Sepolia
USDC: {
contractAddress: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", // Base Sepolia USDC
name: "USDC",
version: "2",
decimals: 6,
},
rpcEndpoint: process.env.EXPO_PUBLIC_EVM_RPC_ENDPOINT,
},
splitScreenThreshold: 600,
framesAllowedSchemes: ["http", "https", "ethereum"],
};
const isAndroid = Platform.OS === "android";
const ENV = {
dev: {
...defaultConfig,
env: "dev",
xmtpEnv: process.env.EXPO_PUBLIC_DEV_XMTP_ENV || "dev",
apiURI:
Platform.OS === "web"
? "http://localhost:9875"
: process.env.EXPO_PUBLIC_DEV_API_URI || "",
debugMenu: true,
bundleId: "com.converse.dev",
appleAppGroup: "group.com.converse.dev",
scheme: "converse-dev",
websiteDomain: "dev.converse.xyz",
usernameSuffix: ".conversedev.eth",
universalLinks: ["dev.converse.xyz/", "dev.getconverse.app/"].flatMap(
(domain) => [`https://${domain}`, `http://${domain}`, domain]
),
enableTransactionFrames: true,
alphaGroupChatUrl:
"https://converse.xyz/group-invite/UDv3aYZONQGc6_XPJY6Ch",
},
preview: {
...defaultConfig,
env: "preview",
xmtpEnv: "dev",
apiURI: "https://backend-staging.converse.xyz",
debugMenu: true,
bundleId: "com.converse.preview",
appleAppGroup: "group.com.converse.preview",
scheme: "converse-preview",
websiteDomain: "preview.converse.xyz",
usernameSuffix: ".conversedev.eth",
universalLinks: [
"preview.converse.xyz/",
"preview.getconverse.app/",
].flatMap((domain) => [`https://${domain}`, `http://${domain}`, domain]),
enableTransactionFrames: true,
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
},
prod: {
...defaultConfig,
env: "prod",
xmtpEnv: "production",
apiURI: "https://backend-prod.converse.xyz",
debugMenu: false,
bundleId: isAndroid ? "com.converse.prod" : "com.converse.native",
appleAppGroup: "group.com.converse.native",
scheme: "converse",
websiteDomain: "converse.xyz",
usernameSuffix: ".converse.xyz",
universalLinks: ["converse.xyz/", "getconverse.app/"].flatMap((domain) => [
`https://${domain}`,
`http://${domain}`,
domain,
]),
privy: {
appId: process.env.EXPO_PUBLIC_PRIVY_APP_ID,
defaultChain: base,
},
evm: {
transactionChainId: "0x2105", // Base Mainnet
USDC: {
contractAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // Native Base USDC
name: "USD Coin",
version: "2",
decimals: 6,
},
rpcEndpoint: process.env.EXPO_PUBLIC_EVM_RPC_ENDPOINT,
},
enableTransactionFrames: false,
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
},
};
const getConfig = () => {
if (__DEV__) {
return ENV.dev;
} else if (Constants.expoConfig?.extra?.ENV === "preview") {
return ENV.preview;
} else {
return ENV.prod;
}
};
export default getConfig();