@farcaster/frame-core 0.0.29 → 0.0.31

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.
Files changed (65) hide show
  1. package/README.md +13 -0
  2. package/dist/actions/ComposeCast.d.ts +32 -0
  3. package/dist/actions/ComposeCast.js +2 -0
  4. package/dist/actions/index.d.ts +1 -0
  5. package/dist/actions/index.js +2 -1
  6. package/dist/errors.d.ts +3 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +3 -1
  9. package/dist/manifest.d.ts +101 -0
  10. package/dist/manifest.js +2 -0
  11. package/dist/schemas/shared.js +1 -1
  12. package/dist/types.d.ts +3 -1
  13. package/esm/actions/AddFrame.d.ts +23 -27
  14. package/esm/actions/AddFrame.js +9 -9
  15. package/esm/actions/ComposeCast.d.ts +32 -0
  16. package/esm/actions/ComposeCast.js +1 -0
  17. package/esm/actions/Ready.d.ts +11 -11
  18. package/esm/actions/Ready.js +2 -2
  19. package/esm/actions/SignIn.d.ts +33 -35
  20. package/esm/actions/SignIn.js +5 -5
  21. package/esm/actions/Swap.d.ts +43 -44
  22. package/esm/actions/Swap.js +1 -1
  23. package/esm/actions/ViewProfile.d.ts +3 -3
  24. package/esm/actions/ViewProfile.js +1 -1
  25. package/esm/actions/ViewToken.d.ts +3 -3
  26. package/esm/actions/ViewToken.js +1 -1
  27. package/esm/actions/index.d.ts +7 -6
  28. package/esm/actions/index.js +7 -6
  29. package/esm/context.d.ts +61 -65
  30. package/esm/context.js +1 -1
  31. package/esm/errors.d.ts +10 -9
  32. package/esm/errors.js +6 -6
  33. package/esm/index.d.ts +7 -5
  34. package/esm/index.js +7 -5
  35. package/esm/internal/types.d.ts +7 -18
  36. package/esm/internal/types.js +1 -1
  37. package/esm/manifest.d.ts +101 -0
  38. package/esm/manifest.js +1 -0
  39. package/esm/schemas/embeds.d.ts +239 -346
  40. package/esm/schemas/embeds.js +23 -31
  41. package/esm/schemas/events.d.ts +129 -225
  42. package/esm/schemas/events.js +17 -17
  43. package/esm/schemas/index.d.ts +5 -5
  44. package/esm/schemas/index.js +5 -5
  45. package/esm/schemas/manifest.d.ts +110 -154
  46. package/esm/schemas/manifest.js +23 -29
  47. package/esm/schemas/notifications.d.ts +58 -86
  48. package/esm/schemas/notifications.js +17 -17
  49. package/esm/schemas/shared.d.ts +35 -53
  50. package/esm/schemas/shared.js +23 -25
  51. package/esm/tsconfig.tsbuildinfo +1 -1
  52. package/esm/types.d.ts +53 -70
  53. package/esm/types.js +2 -2
  54. package/esm/wallet/ethereum.d.ts +35 -50
  55. package/esm/wallet/ethereum.js +1 -1
  56. package/esm/wallet/index.d.ts +1 -1
  57. package/esm/wallet/index.js +1 -1
  58. package/package.json +1 -1
  59. package/src/actions/ComposeCast.ts +36 -0
  60. package/src/actions/index.ts +1 -0
  61. package/src/errors.ts +4 -0
  62. package/src/index.ts +2 -0
  63. package/src/manifest.ts +113 -0
  64. package/src/schemas/shared.ts +1 -1
  65. package/src/types.ts +7 -0
@@ -1,350 +1,243 @@
1
- import type { z } from 'zod'
2
- export declare const actionLaunchFrameSchema: z.ZodObject<
3
- {
4
- type: z.ZodLiteral<'launch_frame'>
5
- name: z.ZodString
6
- url: z.ZodString
7
- splashImageUrl: z.ZodOptional<z.ZodString>
8
- splashBackgroundColor: z.ZodOptional<z.ZodString>
9
- },
10
- 'strip',
11
- z.ZodTypeAny,
12
- {
13
- type: 'launch_frame'
14
- name: string
15
- url: string
16
- splashImageUrl?: string | undefined
17
- splashBackgroundColor?: string | undefined
18
- },
19
- {
20
- type: 'launch_frame'
21
- name: string
22
- url: string
23
- splashImageUrl?: string | undefined
24
- splashBackgroundColor?: string | undefined
25
- }
26
- >
27
- export declare const actionViewTokenSchema: z.ZodObject<
28
- {
29
- type: z.ZodLiteral<'view_token'>
30
- token: z.ZodString
31
- },
32
- 'strip',
33
- z.ZodTypeAny,
34
- {
35
- type: 'view_token'
36
- token: string
37
- },
38
- {
39
- type: 'view_token'
40
- token: string
41
- }
42
- >
43
- export declare const actionSchema: z.ZodDiscriminatedUnion<
44
- 'type',
45
- [
46
- z.ZodObject<
47
- {
48
- type: z.ZodLiteral<'launch_frame'>
49
- name: z.ZodString
50
- url: z.ZodString
51
- splashImageUrl: z.ZodOptional<z.ZodString>
52
- splashBackgroundColor: z.ZodOptional<z.ZodString>
53
- },
54
- 'strip',
55
- z.ZodTypeAny,
56
- {
57
- type: 'launch_frame'
58
- name: string
59
- url: string
60
- splashImageUrl?: string | undefined
61
- splashBackgroundColor?: string | undefined
62
- },
63
- {
64
- type: 'launch_frame'
65
- name: string
66
- url: string
67
- splashImageUrl?: string | undefined
68
- splashBackgroundColor?: string | undefined
69
- }
70
- >,
71
- z.ZodObject<
72
- {
73
- type: z.ZodLiteral<'view_token'>
74
- token: z.ZodString
75
- },
76
- 'strip',
77
- z.ZodTypeAny,
78
- {
79
- type: 'view_token'
80
- token: string
81
- },
82
- {
83
- type: 'view_token'
84
- token: string
85
- }
86
- >,
87
- ]
88
- >
89
- export declare const buttonSchema: z.ZodObject<
90
- {
91
- title: z.ZodString
92
- action: z.ZodDiscriminatedUnion<
93
- 'type',
94
- [
95
- z.ZodObject<
96
- {
97
- type: z.ZodLiteral<'launch_frame'>
98
- name: z.ZodString
99
- url: z.ZodString
100
- splashImageUrl: z.ZodOptional<z.ZodString>
101
- splashBackgroundColor: z.ZodOptional<z.ZodString>
102
- },
103
- 'strip',
104
- z.ZodTypeAny,
105
- {
106
- type: 'launch_frame'
107
- name: string
108
- url: string
109
- splashImageUrl?: string | undefined
110
- splashBackgroundColor?: string | undefined
111
- },
112
- {
113
- type: 'launch_frame'
114
- name: string
115
- url: string
116
- splashImageUrl?: string | undefined
117
- splashBackgroundColor?: string | undefined
118
- }
119
- >,
120
- z.ZodObject<
121
- {
122
- type: z.ZodLiteral<'view_token'>
123
- token: z.ZodString
124
- },
125
- 'strip',
126
- z.ZodTypeAny,
127
- {
128
- type: 'view_token'
129
- token: string
130
- },
131
- {
132
- type: 'view_token'
133
- token: string
134
- }
135
- >,
136
- ]
137
- >
138
- },
139
- 'strip',
140
- z.ZodTypeAny,
141
- {
142
- title: string
143
- action:
144
- | {
145
- type: 'launch_frame'
146
- name: string
147
- url: string
148
- splashImageUrl?: string | undefined
149
- splashBackgroundColor?: string | undefined
150
- }
151
- | {
152
- type: 'view_token'
153
- token: string
154
- }
155
- },
156
- {
157
- title: string
158
- action:
159
- | {
160
- type: 'launch_frame'
161
- name: string
162
- url: string
163
- splashImageUrl?: string | undefined
164
- splashBackgroundColor?: string | undefined
165
- }
166
- | {
167
- type: 'view_token'
168
- token: string
169
- }
170
- }
171
- >
172
- export declare const frameEmbedNextSchema: z.ZodObject<
173
- {
174
- version: z.ZodLiteral<'next'>
175
- imageUrl: z.ZodString
176
- aspectRatio: z.ZodOptional<
177
- z.ZodUnion<[z.ZodLiteral<'1:1'>, z.ZodLiteral<'3:2'>]>
178
- >
179
- button: z.ZodObject<
180
- {
181
- title: z.ZodString
182
- action: z.ZodDiscriminatedUnion<
183
- 'type',
184
- [
185
- z.ZodObject<
186
- {
187
- type: z.ZodLiteral<'launch_frame'>
188
- name: z.ZodString
189
- url: z.ZodString
190
- splashImageUrl: z.ZodOptional<z.ZodString>
191
- splashBackgroundColor: z.ZodOptional<z.ZodString>
192
- },
193
- 'strip',
194
- z.ZodTypeAny,
195
- {
196
- type: 'launch_frame'
197
- name: string
198
- url: string
199
- splashImageUrl?: string | undefined
200
- splashBackgroundColor?: string | undefined
201
- },
202
- {
203
- type: 'launch_frame'
204
- name: string
205
- url: string
206
- splashImageUrl?: string | undefined
207
- splashBackgroundColor?: string | undefined
208
- }
209
- >,
210
- z.ZodObject<
211
- {
212
- type: z.ZodLiteral<'view_token'>
213
- token: z.ZodString
214
- },
215
- 'strip',
216
- z.ZodTypeAny,
217
- {
218
- type: 'view_token'
219
- token: string
220
- },
221
- {
222
- type: 'view_token'
223
- token: string
224
- }
225
- >,
226
- ]
227
- >
228
- },
229
- 'strip',
230
- z.ZodTypeAny,
231
- {
232
- title: string
233
- action:
234
- | {
235
- type: 'launch_frame'
236
- name: string
237
- url: string
238
- splashImageUrl?: string | undefined
239
- splashBackgroundColor?: string | undefined
240
- }
241
- | {
242
- type: 'view_token'
243
- token: string
244
- }
245
- },
246
- {
247
- title: string
248
- action:
249
- | {
250
- type: 'launch_frame'
251
- name: string
252
- url: string
253
- splashImageUrl?: string | undefined
254
- splashBackgroundColor?: string | undefined
255
- }
256
- | {
257
- type: 'view_token'
258
- token: string
259
- }
260
- }
261
- >
262
- },
263
- 'strip',
264
- z.ZodTypeAny,
265
- {
266
- version: 'next'
267
- imageUrl: string
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.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;
12
+ splashImageUrl?: string | undefined;
13
+ splashBackgroundColor?: string | undefined;
14
+ }, {
15
+ type: "launch_frame";
16
+ name: string;
17
+ url: string;
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.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;
41
+ splashImageUrl?: string | undefined;
42
+ splashBackgroundColor?: string | undefined;
43
+ }, {
44
+ type: "launch_frame";
45
+ name: string;
46
+ url: string;
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.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;
71
+ splashImageUrl?: string | undefined;
72
+ splashBackgroundColor?: string | undefined;
73
+ }, {
74
+ type: "launch_frame";
75
+ name: string;
76
+ url: string;
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;
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;
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.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;
130
+ splashImageUrl?: string | undefined;
131
+ splashBackgroundColor?: string | undefined;
132
+ }, {
133
+ type: "launch_frame";
134
+ name: string;
135
+ url: string;
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;
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;
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;
268
176
  button: {
269
- title: string
270
- action:
271
- | {
272
- type: 'launch_frame'
273
- name: string
274
- url: string
275
- splashImageUrl?: string | undefined
276
- splashBackgroundColor?: string | undefined
277
- }
278
- | {
279
- type: 'view_token'
280
- token: string
281
- }
282
- }
283
- aspectRatio?: '1:1' | '3:2' | undefined
284
- },
285
- {
286
- version: 'next'
287
- imageUrl: string
177
+ title: string;
178
+ action: {
179
+ type: "launch_frame";
180
+ name: string;
181
+ url: string;
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;
288
193
  button: {
289
- title: string
290
- action:
291
- | {
292
- type: 'launch_frame'
293
- name: string
294
- url: string
295
- splashImageUrl?: string | undefined
296
- splashBackgroundColor?: string | undefined
297
- }
298
- | {
299
- type: 'view_token'
300
- token: string
301
- }
302
- }
303
- aspectRatio?: '1:1' | '3:2' | undefined
304
- }
305
- >
306
- export declare const safeParseFrameEmbed: (
307
- rawResponse: unknown,
308
- ) => z.SafeParseReturnType<
309
- {
310
- version: 'next'
311
- imageUrl: string
194
+ title: string;
195
+ action: {
196
+ type: "launch_frame";
197
+ name: string;
198
+ url: string;
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;
312
211
  button: {
313
- title: string
314
- action:
315
- | {
316
- type: 'launch_frame'
317
- name: string
318
- url: string
319
- splashImageUrl?: string | undefined
320
- splashBackgroundColor?: string | undefined
321
- }
322
- | {
323
- type: 'view_token'
324
- token: string
325
- }
326
- }
327
- aspectRatio?: '1:1' | '3:2' | undefined
328
- },
329
- {
330
- version: 'next'
331
- imageUrl: string
212
+ title: string;
213
+ action: {
214
+ type: "launch_frame";
215
+ name: string;
216
+ url: string;
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;
332
228
  button: {
333
- title: string
334
- action:
335
- | {
336
- type: 'launch_frame'
337
- name: string
338
- url: string
339
- splashImageUrl?: string | undefined
340
- splashBackgroundColor?: string | undefined
341
- }
342
- | {
343
- type: 'view_token'
344
- token: string
345
- }
346
- }
347
- aspectRatio?: '1:1' | '3:2' | undefined
348
- }
349
- >
350
- export type FrameEmbedNext = z.infer<typeof frameEmbedNextSchema>
229
+ title: string;
230
+ action: {
231
+ type: "launch_frame";
232
+ name: string;
233
+ url: string;
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>;
@@ -1,36 +1,28 @@
1
- import { z } from 'zod'
2
- import {
3
- aspectRatioSchema,
4
- buttonTitleSchema,
5
- caip19TokenSchema,
6
- frameNameSchema,
7
- hexColorSchema,
8
- secureUrlSchema,
9
- } from './shared'
1
+ import { z } from 'zod';
2
+ import { aspectRatioSchema, buttonTitleSchema, caip19TokenSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from './shared';
10
3
  export const actionLaunchFrameSchema = z.object({
11
- type: z.literal('launch_frame'),
12
- name: frameNameSchema,
13
- url: secureUrlSchema,
14
- splashImageUrl: secureUrlSchema.optional(),
15
- splashBackgroundColor: hexColorSchema.optional(),
16
- })
4
+ type: z.literal('launch_frame'),
5
+ name: frameNameSchema,
6
+ url: secureUrlSchema,
7
+ splashImageUrl: secureUrlSchema.optional(),
8
+ splashBackgroundColor: hexColorSchema.optional(),
9
+ });
17
10
  export const actionViewTokenSchema = z.object({
18
- type: z.literal('view_token'),
19
- token: caip19TokenSchema,
20
- })
11
+ type: z.literal('view_token'),
12
+ token: caip19TokenSchema,
13
+ });
21
14
  export const actionSchema = z.discriminatedUnion('type', [
22
- actionLaunchFrameSchema,
23
- actionViewTokenSchema,
24
- ])
15
+ actionLaunchFrameSchema,
16
+ actionViewTokenSchema,
17
+ ]);
25
18
  export const buttonSchema = z.object({
26
- title: buttonTitleSchema,
27
- action: actionSchema,
28
- })
19
+ title: buttonTitleSchema,
20
+ action: actionSchema,
21
+ });
29
22
  export const frameEmbedNextSchema = z.object({
30
- version: z.literal('next'),
31
- imageUrl: secureUrlSchema,
32
- aspectRatio: aspectRatioSchema.optional(),
33
- button: buttonSchema,
34
- })
35
- export const safeParseFrameEmbed = (rawResponse) =>
36
- frameEmbedNextSchema.safeParse(rawResponse)
23
+ version: z.literal('next'),
24
+ imageUrl: secureUrlSchema,
25
+ aspectRatio: aspectRatioSchema.optional(),
26
+ button: buttonSchema,
27
+ });
28
+ export const safeParseFrameEmbed = (rawResponse) => frameEmbedNextSchema.safeParse(rawResponse);