-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata.ts
More file actions
42 lines (39 loc) · 963 Bytes
/
Copy pathmetadata.ts
File metadata and controls
42 lines (39 loc) · 963 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
33
34
35
36
37
38
39
40
41
42
type FrameEmbed = {
version: "next";
imageUrl: string;
button: {
title: string;
action: {
type: "launch_frame";
name: string;
url: string;
splashImageUrl: string;
splashBackgroundColor: string;
};
};
};
async function writeMetadata(data: FrameEmbed) {
try {
const jsonString = JSON.stringify(data).replace(/"/g, """);
console.log(jsonString);
} catch (error) {
console.error("Error writing metadata:", error);
}
}
const frameData: FrameEmbed = {
version: "next",
imageUrl:
"https://github.com/jpfraneto/images/blob/main/hackathontoken.png?raw=true",
button: {
title: "$hackathon",
action: {
type: "launch_frame",
name: "$hackathon",
url: "https://hackathontoken.com",
splashImageUrl:
"https://github.com/jpfraneto/images/blob/main/hackathon.png?raw=true",
splashBackgroundColor: "#141413",
},
},
};
writeMetadata(frameData);