@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.
- package/README.md +13 -0
- package/dist/actions/ComposeCast.d.ts +32 -0
- package/dist/actions/ComposeCast.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/errors.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/manifest.d.ts +101 -0
- package/dist/manifest.js +2 -0
- package/dist/schemas/shared.js +1 -1
- package/dist/types.d.ts +3 -1
- package/esm/actions/AddFrame.d.ts +23 -27
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/ComposeCast.d.ts +32 -0
- package/esm/actions/ComposeCast.js +1 -0
- package/esm/actions/Ready.d.ts +11 -11
- package/esm/actions/Ready.js +2 -2
- package/esm/actions/SignIn.d.ts +33 -35
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/Swap.d.ts +43 -44
- package/esm/actions/Swap.js +1 -1
- package/esm/actions/ViewProfile.d.ts +3 -3
- package/esm/actions/ViewProfile.js +1 -1
- package/esm/actions/ViewToken.d.ts +3 -3
- package/esm/actions/ViewToken.js +1 -1
- package/esm/actions/index.d.ts +7 -6
- package/esm/actions/index.js +7 -6
- package/esm/context.d.ts +61 -65
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +10 -9
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +7 -5
- package/esm/index.js +7 -5
- package/esm/internal/types.d.ts +7 -18
- package/esm/internal/types.js +1 -1
- package/esm/manifest.d.ts +101 -0
- package/esm/manifest.js +1 -0
- package/esm/schemas/embeds.d.ts +239 -346
- package/esm/schemas/embeds.js +23 -31
- package/esm/schemas/events.d.ts +129 -225
- package/esm/schemas/events.js +17 -17
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.d.ts +110 -154
- package/esm/schemas/manifest.js +23 -29
- package/esm/schemas/notifications.d.ts +58 -86
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +35 -53
- package/esm/schemas/shared.js +23 -25
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +53 -70
- package/esm/types.js +2 -2
- package/esm/wallet/ethereum.d.ts +35 -50
- package/esm/wallet/ethereum.js +1 -1
- package/esm/wallet/index.d.ts +1 -1
- package/esm/wallet/index.js +1 -1
- package/package.json +1 -1
- package/src/actions/ComposeCast.ts +36 -0
- package/src/actions/index.ts +1 -0
- package/src/errors.ts +4 -0
- package/src/index.ts +2 -0
- package/src/manifest.ts +113 -0
- package/src/schemas/shared.ts +1 -1
- package/src/types.ts +7 -0
package/esm/schemas/embeds.d.ts
CHANGED
|
@@ -1,350 +1,243 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const actionLaunchFrameSchema: z.ZodObject<
|
|
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
|
-
type:
|
|
84
|
-
token: string
|
|
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
|
-
z.ZodObject<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
version:
|
|
175
|
-
imageUrl:
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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>;
|
package/esm/schemas/embeds.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
11
|
+
type: z.literal('view_token'),
|
|
12
|
+
token: caip19TokenSchema,
|
|
13
|
+
});
|
|
21
14
|
export const actionSchema = z.discriminatedUnion('type', [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
])
|
|
15
|
+
actionLaunchFrameSchema,
|
|
16
|
+
actionViewTokenSchema,
|
|
17
|
+
]);
|
|
25
18
|
export const buttonSchema = z.object({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
19
|
+
title: buttonTitleSchema,
|
|
20
|
+
action: actionSchema,
|
|
21
|
+
});
|
|
29
22
|
export const frameEmbedNextSchema = z.object({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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);
|