-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutils.ts
More file actions
30 lines (26 loc) · 779 Bytes
/
utils.ts
File metadata and controls
30 lines (26 loc) · 779 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
import { v5 as uuid } from "uuid";
import { http } from "viem";
export const getHost = (mode: string) => {
switch (mode) {
case "production":
return "https://teams.splits.org";
case "dev":
return "http://localhost:3001";
default:
return `https://teams.${mode}.splits.org`;
}
};
export const getRelay = (mode: string) => {
switch (mode) {
case "dev":
return http("http://localhost:8080/public/v1/connect");
default:
return http(`https://server.${mode}.splits.org/public/v1/connect`);
}
};
export const getName = (mode: string) =>
`Splits${mode === "production" ? "" : `-${mode}`}`;
export const getUUID = (mode: string) => {
const NAMESPACE = import.meta.env.WXT_NAMESPACE_UUID;
return uuid(mode, NAMESPACE);
};