@farcaster/frame-core 0.0.0-canary-20250430150627
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/actions/AddFrame.d.ts +36 -0
- package/dist/actions/AddFrame.js +57 -0
- package/dist/actions/ComposeCast.d.ts +32 -0
- package/dist/actions/ComposeCast.js +2 -0
- package/dist/actions/Ready.d.ts +13 -0
- package/dist/actions/Ready.js +6 -0
- package/dist/actions/SendToken.d.ts +48 -0
- package/dist/actions/SendToken.js +2 -0
- package/dist/actions/SignIn.d.ts +41 -0
- package/dist/actions/SignIn.js +47 -0
- package/dist/actions/SwapToken.d.ts +46 -0
- package/dist/actions/SwapToken.js +2 -0
- package/dist/actions/ViewProfile.d.ts +4 -0
- package/dist/actions/ViewProfile.js +2 -0
- package/dist/actions/ViewToken.d.ts +4 -0
- package/dist/actions/ViewToken.js +2 -0
- package/dist/actions/index.d.ts +8 -0
- package/dist/actions/index.js +44 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +2 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +46 -0
- package/dist/internal/types.d.ts +8 -0
- package/dist/internal/types.js +2 -0
- package/dist/manifest.d.ts +101 -0
- package/dist/manifest.js +2 -0
- package/dist/schemas/embeds.d.ts +243 -0
- package/dist/schemas/embeds.js +32 -0
- package/dist/schemas/events.d.ts +131 -0
- package/dist/schemas/events.js +25 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +21 -0
- package/dist/schemas/manifest.d.ts +208 -0
- package/dist/schemas/manifest.js +61 -0
- package/dist/schemas/notifications.d.ts +60 -0
- package/dist/schemas/notifications.js +23 -0
- package/dist/schemas/shared.d.ts +39 -0
- package/dist/schemas/shared.js +58 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +21 -0
- package/dist/wallet/ethereum.d.ts +47 -0
- package/dist/wallet/ethereum.js +2 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +37 -0
- package/esm/actions/AddFrame.d.ts +36 -0
- package/esm/actions/AddFrame.js +19 -0
- package/esm/actions/ComposeCast.d.ts +32 -0
- package/esm/actions/ComposeCast.js +1 -0
- package/esm/actions/Ready.d.ts +13 -0
- package/esm/actions/Ready.js +3 -0
- package/esm/actions/SendToken.d.ts +48 -0
- package/esm/actions/SendToken.js +1 -0
- package/esm/actions/SignIn.d.ts +41 -0
- package/esm/actions/SignIn.js +10 -0
- package/esm/actions/SwapToken.d.ts +46 -0
- package/esm/actions/SwapToken.js +1 -0
- package/esm/actions/ViewProfile.d.ts +4 -0
- package/esm/actions/ViewProfile.js +1 -0
- package/esm/actions/ViewToken.d.ts +4 -0
- package/esm/actions/ViewToken.js +1 -0
- package/esm/actions/index.d.ts +8 -0
- package/esm/actions/index.js +8 -0
- package/esm/context.d.ts +72 -0
- package/esm/context.js +1 -0
- package/esm/errors.d.ts +13 -0
- package/esm/errors.js +8 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +7 -0
- package/esm/internal/types.d.ts +8 -0
- package/esm/internal/types.js +1 -0
- package/esm/manifest.d.ts +101 -0
- package/esm/manifest.js +1 -0
- package/esm/schemas/embeds.d.ts +243 -0
- package/esm/schemas/embeds.js +28 -0
- package/esm/schemas/events.d.ts +131 -0
- package/esm/schemas/events.js +22 -0
- package/esm/schemas/index.d.ts +5 -0
- package/esm/schemas/index.js +5 -0
- package/esm/schemas/manifest.d.ts +208 -0
- package/esm/schemas/manifest.js +58 -0
- package/esm/schemas/notifications.d.ts +60 -0
- package/esm/schemas/notifications.js +20 -0
- package/esm/schemas/shared.d.ts +39 -0
- package/esm/schemas/shared.js +54 -0
- package/esm/tsconfig.tsbuildinfo +1 -0
- package/esm/types.d.ts +60 -0
- package/esm/types.js +3 -0
- package/esm/wallet/ethereum.d.ts +47 -0
- package/esm/wallet/ethereum.js +1 -0
- package/esm/wallet/index.d.ts +1 -0
- package/esm/wallet/index.js +1 -0
- package/package.json +41 -0
- package/src/actions/AddFrame.ts +51 -0
- package/src/actions/ComposeCast.ts +36 -0
- package/src/actions/Ready.ts +15 -0
- package/src/actions/SendToken.ts +57 -0
- package/src/actions/SignIn.ts +51 -0
- package/src/actions/SwapToken.ts +54 -0
- package/src/actions/ViewProfile.ts +5 -0
- package/src/actions/ViewToken.ts +5 -0
- package/src/actions/index.ts +8 -0
- package/src/context.ts +90 -0
- package/src/errors.ts +21 -0
- package/src/index.ts +7 -0
- package/src/internal/types.ts +20 -0
- package/src/manifest.ts +113 -0
- package/src/schemas/embeds.ts +44 -0
- package/src/schemas/events.ts +41 -0
- package/src/schemas/index.ts +5 -0
- package/src/schemas/manifest.ts +68 -0
- package/src/schemas/notifications.ts +33 -0
- package/src/schemas/shared.ts +81 -0
- package/src/types.ts +95 -0
- package/src/wallet/ethereum.ts +65 -0
- package/src/wallet/index.ts +1 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const actionLaunchFrameSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
url: z.ZodOptional<z.ZodString>;
|
|
6
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
type: "launch_frame";
|
|
10
|
+
name: string;
|
|
11
|
+
url?: string | undefined;
|
|
12
|
+
splashImageUrl?: string | undefined;
|
|
13
|
+
splashBackgroundColor?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
type: "launch_frame";
|
|
16
|
+
name: string;
|
|
17
|
+
url?: string | undefined;
|
|
18
|
+
splashImageUrl?: string | undefined;
|
|
19
|
+
splashBackgroundColor?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const actionViewTokenSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"view_token">;
|
|
23
|
+
token: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
type: "view_token";
|
|
26
|
+
token: string;
|
|
27
|
+
}, {
|
|
28
|
+
type: "view_token";
|
|
29
|
+
token: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
url: z.ZodOptional<z.ZodString>;
|
|
35
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
36
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
type: "launch_frame";
|
|
39
|
+
name: string;
|
|
40
|
+
url?: string | undefined;
|
|
41
|
+
splashImageUrl?: string | undefined;
|
|
42
|
+
splashBackgroundColor?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
type: "launch_frame";
|
|
45
|
+
name: string;
|
|
46
|
+
url?: string | undefined;
|
|
47
|
+
splashImageUrl?: string | undefined;
|
|
48
|
+
splashBackgroundColor?: string | undefined;
|
|
49
|
+
}>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"view_token">;
|
|
51
|
+
token: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "view_token";
|
|
54
|
+
token: string;
|
|
55
|
+
}, {
|
|
56
|
+
type: "view_token";
|
|
57
|
+
token: string;
|
|
58
|
+
}>]>;
|
|
59
|
+
export declare const buttonSchema: z.ZodObject<{
|
|
60
|
+
title: z.ZodString;
|
|
61
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
url: z.ZodOptional<z.ZodString>;
|
|
65
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
66
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
type: "launch_frame";
|
|
69
|
+
name: string;
|
|
70
|
+
url?: string | undefined;
|
|
71
|
+
splashImageUrl?: string | undefined;
|
|
72
|
+
splashBackgroundColor?: string | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
type: "launch_frame";
|
|
75
|
+
name: string;
|
|
76
|
+
url?: string | undefined;
|
|
77
|
+
splashImageUrl?: string | undefined;
|
|
78
|
+
splashBackgroundColor?: string | undefined;
|
|
79
|
+
}>, z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"view_token">;
|
|
81
|
+
token: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
type: "view_token";
|
|
84
|
+
token: string;
|
|
85
|
+
}, {
|
|
86
|
+
type: "view_token";
|
|
87
|
+
token: string;
|
|
88
|
+
}>]>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
title: string;
|
|
91
|
+
action: {
|
|
92
|
+
type: "launch_frame";
|
|
93
|
+
name: string;
|
|
94
|
+
url?: string | undefined;
|
|
95
|
+
splashImageUrl?: string | undefined;
|
|
96
|
+
splashBackgroundColor?: string | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
type: "view_token";
|
|
99
|
+
token: string;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
title: string;
|
|
103
|
+
action: {
|
|
104
|
+
type: "launch_frame";
|
|
105
|
+
name: string;
|
|
106
|
+
url?: string | undefined;
|
|
107
|
+
splashImageUrl?: string | undefined;
|
|
108
|
+
splashBackgroundColor?: string | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
type: "view_token";
|
|
111
|
+
token: string;
|
|
112
|
+
};
|
|
113
|
+
}>;
|
|
114
|
+
export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
115
|
+
version: z.ZodLiteral<"next">;
|
|
116
|
+
imageUrl: z.ZodString;
|
|
117
|
+
aspectRatio: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>>;
|
|
118
|
+
button: z.ZodObject<{
|
|
119
|
+
title: z.ZodString;
|
|
120
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
121
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
122
|
+
name: z.ZodString;
|
|
123
|
+
url: z.ZodOptional<z.ZodString>;
|
|
124
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
125
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
type: "launch_frame";
|
|
128
|
+
name: string;
|
|
129
|
+
url?: string | undefined;
|
|
130
|
+
splashImageUrl?: string | undefined;
|
|
131
|
+
splashBackgroundColor?: string | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
type: "launch_frame";
|
|
134
|
+
name: string;
|
|
135
|
+
url?: string | undefined;
|
|
136
|
+
splashImageUrl?: string | undefined;
|
|
137
|
+
splashBackgroundColor?: string | undefined;
|
|
138
|
+
}>, z.ZodObject<{
|
|
139
|
+
type: z.ZodLiteral<"view_token">;
|
|
140
|
+
token: z.ZodString;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
type: "view_token";
|
|
143
|
+
token: string;
|
|
144
|
+
}, {
|
|
145
|
+
type: "view_token";
|
|
146
|
+
token: string;
|
|
147
|
+
}>]>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
title: string;
|
|
150
|
+
action: {
|
|
151
|
+
type: "launch_frame";
|
|
152
|
+
name: string;
|
|
153
|
+
url?: string | undefined;
|
|
154
|
+
splashImageUrl?: string | undefined;
|
|
155
|
+
splashBackgroundColor?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
type: "view_token";
|
|
158
|
+
token: string;
|
|
159
|
+
};
|
|
160
|
+
}, {
|
|
161
|
+
title: string;
|
|
162
|
+
action: {
|
|
163
|
+
type: "launch_frame";
|
|
164
|
+
name: string;
|
|
165
|
+
url?: string | undefined;
|
|
166
|
+
splashImageUrl?: string | undefined;
|
|
167
|
+
splashBackgroundColor?: string | undefined;
|
|
168
|
+
} | {
|
|
169
|
+
type: "view_token";
|
|
170
|
+
token: string;
|
|
171
|
+
};
|
|
172
|
+
}>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
version: "next";
|
|
175
|
+
imageUrl: string;
|
|
176
|
+
button: {
|
|
177
|
+
title: string;
|
|
178
|
+
action: {
|
|
179
|
+
type: "launch_frame";
|
|
180
|
+
name: string;
|
|
181
|
+
url?: string | undefined;
|
|
182
|
+
splashImageUrl?: string | undefined;
|
|
183
|
+
splashBackgroundColor?: string | undefined;
|
|
184
|
+
} | {
|
|
185
|
+
type: "view_token";
|
|
186
|
+
token: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
version: "next";
|
|
192
|
+
imageUrl: string;
|
|
193
|
+
button: {
|
|
194
|
+
title: string;
|
|
195
|
+
action: {
|
|
196
|
+
type: "launch_frame";
|
|
197
|
+
name: string;
|
|
198
|
+
url?: string | undefined;
|
|
199
|
+
splashImageUrl?: string | undefined;
|
|
200
|
+
splashBackgroundColor?: string | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
type: "view_token";
|
|
203
|
+
token: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
207
|
+
}>;
|
|
208
|
+
export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseReturnType<{
|
|
209
|
+
version: "next";
|
|
210
|
+
imageUrl: string;
|
|
211
|
+
button: {
|
|
212
|
+
title: string;
|
|
213
|
+
action: {
|
|
214
|
+
type: "launch_frame";
|
|
215
|
+
name: string;
|
|
216
|
+
url?: string | undefined;
|
|
217
|
+
splashImageUrl?: string | undefined;
|
|
218
|
+
splashBackgroundColor?: string | undefined;
|
|
219
|
+
} | {
|
|
220
|
+
type: "view_token";
|
|
221
|
+
token: string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
225
|
+
}, {
|
|
226
|
+
version: "next";
|
|
227
|
+
imageUrl: string;
|
|
228
|
+
button: {
|
|
229
|
+
title: string;
|
|
230
|
+
action: {
|
|
231
|
+
type: "launch_frame";
|
|
232
|
+
name: string;
|
|
233
|
+
url?: string | undefined;
|
|
234
|
+
splashImageUrl?: string | undefined;
|
|
235
|
+
splashBackgroundColor?: string | undefined;
|
|
236
|
+
} | {
|
|
237
|
+
type: "view_token";
|
|
238
|
+
token: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
export type FrameEmbedNext = z.infer<typeof frameEmbedNextSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { aspectRatioSchema, buttonTitleSchema, caip19TokenSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from './shared';
|
|
3
|
+
export const actionLaunchFrameSchema = z.object({
|
|
4
|
+
type: z.literal('launch_frame'),
|
|
5
|
+
name: frameNameSchema,
|
|
6
|
+
url: secureUrlSchema.optional(),
|
|
7
|
+
splashImageUrl: secureUrlSchema.optional(),
|
|
8
|
+
splashBackgroundColor: hexColorSchema.optional(),
|
|
9
|
+
});
|
|
10
|
+
export const actionViewTokenSchema = z.object({
|
|
11
|
+
type: z.literal('view_token'),
|
|
12
|
+
token: caip19TokenSchema,
|
|
13
|
+
});
|
|
14
|
+
export const actionSchema = z.discriminatedUnion('type', [
|
|
15
|
+
actionLaunchFrameSchema,
|
|
16
|
+
actionViewTokenSchema,
|
|
17
|
+
]);
|
|
18
|
+
export const buttonSchema = z.object({
|
|
19
|
+
title: buttonTitleSchema,
|
|
20
|
+
action: actionSchema,
|
|
21
|
+
});
|
|
22
|
+
export const frameEmbedNextSchema = z.object({
|
|
23
|
+
version: z.literal('next'),
|
|
24
|
+
imageUrl: secureUrlSchema,
|
|
25
|
+
aspectRatio: aspectRatioSchema.optional(),
|
|
26
|
+
button: buttonSchema,
|
|
27
|
+
});
|
|
28
|
+
export const safeParseFrameEmbed = (rawResponse) => frameEmbedNextSchema.safeParse(rawResponse);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const eventFrameAddedSchema: z.ZodObject<{
|
|
3
|
+
event: z.ZodLiteral<"frame_added">;
|
|
4
|
+
notificationDetails: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
url: z.ZodString;
|
|
6
|
+
token: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
url: string;
|
|
9
|
+
token: string;
|
|
10
|
+
}, {
|
|
11
|
+
url: string;
|
|
12
|
+
token: string;
|
|
13
|
+
}>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
event: "frame_added";
|
|
16
|
+
notificationDetails?: {
|
|
17
|
+
url: string;
|
|
18
|
+
token: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
event: "frame_added";
|
|
22
|
+
notificationDetails?: {
|
|
23
|
+
url: string;
|
|
24
|
+
token: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type EventFrameAdded = z.infer<typeof eventFrameAddedSchema>;
|
|
28
|
+
export declare const eventFrameRemovedSchema: z.ZodObject<{
|
|
29
|
+
event: z.ZodLiteral<"frame_removed">;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
event: "frame_removed";
|
|
32
|
+
}, {
|
|
33
|
+
event: "frame_removed";
|
|
34
|
+
}>;
|
|
35
|
+
export type EventFrameRemoved = z.infer<typeof eventFrameRemovedSchema>;
|
|
36
|
+
export declare const eventNotificationsEnabledSchema: z.ZodObject<{
|
|
37
|
+
event: z.ZodLiteral<"notifications_enabled">;
|
|
38
|
+
notificationDetails: z.ZodObject<{
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
token: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
url: string;
|
|
43
|
+
token: string;
|
|
44
|
+
}, {
|
|
45
|
+
url: string;
|
|
46
|
+
token: string;
|
|
47
|
+
}>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
event: "notifications_enabled";
|
|
50
|
+
notificationDetails: {
|
|
51
|
+
url: string;
|
|
52
|
+
token: string;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
event: "notifications_enabled";
|
|
56
|
+
notificationDetails: {
|
|
57
|
+
url: string;
|
|
58
|
+
token: string;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
export type EventNotificationsEnabled = z.infer<typeof eventNotificationsEnabledSchema>;
|
|
62
|
+
export declare const notificationsDisabledSchema: z.ZodObject<{
|
|
63
|
+
event: z.ZodLiteral<"notifications_disabled">;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
event: "notifications_disabled";
|
|
66
|
+
}, {
|
|
67
|
+
event: "notifications_disabled";
|
|
68
|
+
}>;
|
|
69
|
+
export type EventNotificationsDisabled = z.infer<typeof notificationsDisabledSchema>;
|
|
70
|
+
export declare const serverEventSchema: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
|
|
71
|
+
event: z.ZodLiteral<"frame_added">;
|
|
72
|
+
notificationDetails: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
token: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
url: string;
|
|
77
|
+
token: string;
|
|
78
|
+
}, {
|
|
79
|
+
url: string;
|
|
80
|
+
token: string;
|
|
81
|
+
}>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
event: "frame_added";
|
|
84
|
+
notificationDetails?: {
|
|
85
|
+
url: string;
|
|
86
|
+
token: string;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
event: "frame_added";
|
|
90
|
+
notificationDetails?: {
|
|
91
|
+
url: string;
|
|
92
|
+
token: string;
|
|
93
|
+
} | undefined;
|
|
94
|
+
}>, z.ZodObject<{
|
|
95
|
+
event: z.ZodLiteral<"frame_removed">;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
event: "frame_removed";
|
|
98
|
+
}, {
|
|
99
|
+
event: "frame_removed";
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
event: z.ZodLiteral<"notifications_enabled">;
|
|
102
|
+
notificationDetails: z.ZodObject<{
|
|
103
|
+
url: z.ZodString;
|
|
104
|
+
token: z.ZodString;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
url: string;
|
|
107
|
+
token: string;
|
|
108
|
+
}, {
|
|
109
|
+
url: string;
|
|
110
|
+
token: string;
|
|
111
|
+
}>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
event: "notifications_enabled";
|
|
114
|
+
notificationDetails: {
|
|
115
|
+
url: string;
|
|
116
|
+
token: string;
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
event: "notifications_enabled";
|
|
120
|
+
notificationDetails: {
|
|
121
|
+
url: string;
|
|
122
|
+
token: string;
|
|
123
|
+
};
|
|
124
|
+
}>, z.ZodObject<{
|
|
125
|
+
event: z.ZodLiteral<"notifications_disabled">;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
event: "notifications_disabled";
|
|
128
|
+
}, {
|
|
129
|
+
event: "notifications_disabled";
|
|
130
|
+
}>]>;
|
|
131
|
+
export type FrameServerEvent = z.infer<typeof serverEventSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { notificationDetailsSchema } from './notifications';
|
|
3
|
+
export const eventFrameAddedSchema = z.object({
|
|
4
|
+
event: z.literal('frame_added'),
|
|
5
|
+
notificationDetails: notificationDetailsSchema.optional(),
|
|
6
|
+
});
|
|
7
|
+
export const eventFrameRemovedSchema = z.object({
|
|
8
|
+
event: z.literal('frame_removed'),
|
|
9
|
+
});
|
|
10
|
+
export const eventNotificationsEnabledSchema = z.object({
|
|
11
|
+
event: z.literal('notifications_enabled'),
|
|
12
|
+
notificationDetails: notificationDetailsSchema.required(),
|
|
13
|
+
});
|
|
14
|
+
export const notificationsDisabledSchema = z.object({
|
|
15
|
+
event: z.literal('notifications_disabled'),
|
|
16
|
+
});
|
|
17
|
+
export const serverEventSchema = z.discriminatedUnion('event', [
|
|
18
|
+
eventFrameAddedSchema,
|
|
19
|
+
eventFrameRemovedSchema,
|
|
20
|
+
eventNotificationsEnabledSchema,
|
|
21
|
+
notificationsDisabledSchema,
|
|
22
|
+
]);
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
3
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
iconUrl: z.ZodString;
|
|
6
|
+
homeUrl: z.ZodString;
|
|
7
|
+
/** deprecated, set ogImageUrl instead */
|
|
8
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
/** deprecated, will rely on fc:frame meta tag */
|
|
10
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
11
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
14
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
15
|
+
subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
16
|
+
description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
17
|
+
screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
|
|
19
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
|
|
20
|
+
heroImageUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
+
tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
22
|
+
ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
23
|
+
ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
24
|
+
ogImageUrl: z.ZodOptional<z.ZodString>;
|
|
25
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
26
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
30
|
+
iconUrl: string;
|
|
31
|
+
homeUrl: string;
|
|
32
|
+
splashImageUrl?: string | undefined;
|
|
33
|
+
splashBackgroundColor?: string | undefined;
|
|
34
|
+
imageUrl?: string | undefined;
|
|
35
|
+
buttonTitle?: string | undefined;
|
|
36
|
+
webhookUrl?: string | undefined;
|
|
37
|
+
subtitle?: string | undefined;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
screenshotUrls?: string[] | undefined;
|
|
40
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
41
|
+
tags?: string[] | undefined;
|
|
42
|
+
heroImageUrl?: string | undefined;
|
|
43
|
+
tagline?: string | undefined;
|
|
44
|
+
ogTitle?: string | undefined;
|
|
45
|
+
ogDescription?: string | undefined;
|
|
46
|
+
ogImageUrl?: string | undefined;
|
|
47
|
+
noindex?: boolean | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
51
|
+
iconUrl: string;
|
|
52
|
+
homeUrl: string;
|
|
53
|
+
splashImageUrl?: string | undefined;
|
|
54
|
+
splashBackgroundColor?: string | undefined;
|
|
55
|
+
imageUrl?: string | undefined;
|
|
56
|
+
buttonTitle?: string | undefined;
|
|
57
|
+
webhookUrl?: string | undefined;
|
|
58
|
+
subtitle?: string | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
screenshotUrls?: string[] | undefined;
|
|
61
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
62
|
+
tags?: string[] | undefined;
|
|
63
|
+
heroImageUrl?: string | undefined;
|
|
64
|
+
tagline?: string | undefined;
|
|
65
|
+
ogTitle?: string | undefined;
|
|
66
|
+
ogDescription?: string | undefined;
|
|
67
|
+
ogImageUrl?: string | undefined;
|
|
68
|
+
noindex?: boolean | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const domainManifestSchema: z.ZodObject<{
|
|
71
|
+
accountAssociation: z.ZodObject<{
|
|
72
|
+
header: z.ZodString;
|
|
73
|
+
payload: z.ZodString;
|
|
74
|
+
signature: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
header: string;
|
|
77
|
+
payload: string;
|
|
78
|
+
signature: string;
|
|
79
|
+
}, {
|
|
80
|
+
header: string;
|
|
81
|
+
payload: string;
|
|
82
|
+
signature: string;
|
|
83
|
+
}>;
|
|
84
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
iconUrl: z.ZodString;
|
|
88
|
+
homeUrl: z.ZodString;
|
|
89
|
+
/** deprecated, set ogImageUrl instead */
|
|
90
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
91
|
+
/** deprecated, will rely on fc:frame meta tag */
|
|
92
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
93
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
94
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
95
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
96
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
97
|
+
subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
98
|
+
description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
99
|
+
screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
100
|
+
primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
|
|
101
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
|
|
102
|
+
heroImageUrl: z.ZodOptional<z.ZodString>;
|
|
103
|
+
tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
104
|
+
ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
105
|
+
ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
106
|
+
ogImageUrl: z.ZodOptional<z.ZodString>;
|
|
107
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
108
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
name: string;
|
|
111
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
112
|
+
iconUrl: string;
|
|
113
|
+
homeUrl: string;
|
|
114
|
+
splashImageUrl?: string | undefined;
|
|
115
|
+
splashBackgroundColor?: string | undefined;
|
|
116
|
+
imageUrl?: string | undefined;
|
|
117
|
+
buttonTitle?: string | undefined;
|
|
118
|
+
webhookUrl?: string | undefined;
|
|
119
|
+
subtitle?: string | undefined;
|
|
120
|
+
description?: string | undefined;
|
|
121
|
+
screenshotUrls?: string[] | undefined;
|
|
122
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
123
|
+
tags?: string[] | undefined;
|
|
124
|
+
heroImageUrl?: string | undefined;
|
|
125
|
+
tagline?: string | undefined;
|
|
126
|
+
ogTitle?: string | undefined;
|
|
127
|
+
ogDescription?: string | undefined;
|
|
128
|
+
ogImageUrl?: string | undefined;
|
|
129
|
+
noindex?: boolean | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
name: string;
|
|
132
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
133
|
+
iconUrl: string;
|
|
134
|
+
homeUrl: string;
|
|
135
|
+
splashImageUrl?: string | undefined;
|
|
136
|
+
splashBackgroundColor?: string | undefined;
|
|
137
|
+
imageUrl?: string | undefined;
|
|
138
|
+
buttonTitle?: string | undefined;
|
|
139
|
+
webhookUrl?: string | undefined;
|
|
140
|
+
subtitle?: string | undefined;
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
screenshotUrls?: string[] | undefined;
|
|
143
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
144
|
+
tags?: string[] | undefined;
|
|
145
|
+
heroImageUrl?: string | undefined;
|
|
146
|
+
tagline?: string | undefined;
|
|
147
|
+
ogTitle?: string | undefined;
|
|
148
|
+
ogDescription?: string | undefined;
|
|
149
|
+
ogImageUrl?: string | undefined;
|
|
150
|
+
noindex?: boolean | undefined;
|
|
151
|
+
}>>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
accountAssociation: {
|
|
154
|
+
header: string;
|
|
155
|
+
payload: string;
|
|
156
|
+
signature: string;
|
|
157
|
+
};
|
|
158
|
+
frame?: {
|
|
159
|
+
name: string;
|
|
160
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
161
|
+
iconUrl: string;
|
|
162
|
+
homeUrl: string;
|
|
163
|
+
splashImageUrl?: string | undefined;
|
|
164
|
+
splashBackgroundColor?: string | undefined;
|
|
165
|
+
imageUrl?: string | undefined;
|
|
166
|
+
buttonTitle?: string | undefined;
|
|
167
|
+
webhookUrl?: string | undefined;
|
|
168
|
+
subtitle?: string | undefined;
|
|
169
|
+
description?: string | undefined;
|
|
170
|
+
screenshotUrls?: string[] | undefined;
|
|
171
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
172
|
+
tags?: string[] | undefined;
|
|
173
|
+
heroImageUrl?: string | undefined;
|
|
174
|
+
tagline?: string | undefined;
|
|
175
|
+
ogTitle?: string | undefined;
|
|
176
|
+
ogDescription?: string | undefined;
|
|
177
|
+
ogImageUrl?: string | undefined;
|
|
178
|
+
noindex?: boolean | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
accountAssociation: {
|
|
182
|
+
header: string;
|
|
183
|
+
payload: string;
|
|
184
|
+
signature: string;
|
|
185
|
+
};
|
|
186
|
+
frame?: {
|
|
187
|
+
name: string;
|
|
188
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
189
|
+
iconUrl: string;
|
|
190
|
+
homeUrl: string;
|
|
191
|
+
splashImageUrl?: string | undefined;
|
|
192
|
+
splashBackgroundColor?: string | undefined;
|
|
193
|
+
imageUrl?: string | undefined;
|
|
194
|
+
buttonTitle?: string | undefined;
|
|
195
|
+
webhookUrl?: string | undefined;
|
|
196
|
+
subtitle?: string | undefined;
|
|
197
|
+
description?: string | undefined;
|
|
198
|
+
screenshotUrls?: string[] | undefined;
|
|
199
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
200
|
+
tags?: string[] | undefined;
|
|
201
|
+
heroImageUrl?: string | undefined;
|
|
202
|
+
tagline?: string | undefined;
|
|
203
|
+
ogTitle?: string | undefined;
|
|
204
|
+
ogDescription?: string | undefined;
|
|
205
|
+
ogImageUrl?: string | undefined;
|
|
206
|
+
noindex?: boolean | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
}>;
|