@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/events.d.ts
CHANGED
|
@@ -1,227 +1,131 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const eventFrameAddedSchema: 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
|
-
'strip',
|
|
51
|
-
z.ZodTypeAny,
|
|
52
|
-
{
|
|
53
|
-
event: 'frame_removed'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
event: 'frame_removed'
|
|
57
|
-
}
|
|
58
|
-
>
|
|
59
|
-
export type EventFrameRemoved = z.infer<typeof eventFrameRemovedSchema>
|
|
60
|
-
export declare const eventNotificationsEnabledSchema: z.ZodObject<
|
|
61
|
-
{
|
|
62
|
-
event: z.ZodLiteral<'notifications_enabled'>
|
|
63
|
-
notificationDetails: z.ZodObject<
|
|
64
|
-
{
|
|
65
|
-
url: z.ZodString
|
|
66
|
-
token: z.ZodString
|
|
67
|
-
},
|
|
68
|
-
'strip',
|
|
69
|
-
z.ZodTypeAny,
|
|
70
|
-
{
|
|
71
|
-
url: string
|
|
72
|
-
token: string
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
url: string
|
|
76
|
-
token: string
|
|
77
|
-
}
|
|
78
|
-
>
|
|
79
|
-
},
|
|
80
|
-
'strip',
|
|
81
|
-
z.ZodTypeAny,
|
|
82
|
-
{
|
|
83
|
-
event: 'notifications_enabled'
|
|
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";
|
|
84
50
|
notificationDetails: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
event: 'notifications_enabled'
|
|
51
|
+
url: string;
|
|
52
|
+
token: string;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
event: "notifications_enabled";
|
|
91
56
|
notificationDetails: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
event:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
z.ZodTypeAny,
|
|
168
|
-
{
|
|
169
|
-
event: 'frame_removed'
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
event: 'frame_removed'
|
|
173
|
-
}
|
|
174
|
-
>,
|
|
175
|
-
z.ZodObject<
|
|
176
|
-
{
|
|
177
|
-
event: z.ZodLiteral<'notifications_enabled'>
|
|
178
|
-
notificationDetails: z.ZodObject<
|
|
179
|
-
{
|
|
180
|
-
url: z.ZodString
|
|
181
|
-
token: z.ZodString
|
|
182
|
-
},
|
|
183
|
-
'strip',
|
|
184
|
-
z.ZodTypeAny,
|
|
185
|
-
{
|
|
186
|
-
url: string
|
|
187
|
-
token: string
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
url: string
|
|
191
|
-
token: string
|
|
192
|
-
}
|
|
193
|
-
>
|
|
194
|
-
},
|
|
195
|
-
'strip',
|
|
196
|
-
z.ZodTypeAny,
|
|
197
|
-
{
|
|
198
|
-
event: 'notifications_enabled'
|
|
199
|
-
notificationDetails: {
|
|
200
|
-
url: string
|
|
201
|
-
token: string
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
event: 'notifications_enabled'
|
|
206
|
-
notificationDetails: {
|
|
207
|
-
url: string
|
|
208
|
-
token: string
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
>,
|
|
212
|
-
z.ZodObject<
|
|
213
|
-
{
|
|
214
|
-
event: z.ZodLiteral<'notifications_disabled'>
|
|
215
|
-
},
|
|
216
|
-
'strip',
|
|
217
|
-
z.ZodTypeAny,
|
|
218
|
-
{
|
|
219
|
-
event: 'notifications_disabled'
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
event: 'notifications_disabled'
|
|
223
|
-
}
|
|
224
|
-
>,
|
|
225
|
-
]
|
|
226
|
-
>
|
|
227
|
-
export type FrameServerEvent = z.infer<typeof serverEventSchema>
|
|
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>;
|
package/esm/schemas/events.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import { notificationDetailsSchema } from './notifications'
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { notificationDetailsSchema } from './notifications';
|
|
3
3
|
export const eventFrameAddedSchema = z.object({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
4
|
+
event: z.literal('frame_added'),
|
|
5
|
+
notificationDetails: notificationDetailsSchema.optional(),
|
|
6
|
+
});
|
|
7
7
|
export const eventFrameRemovedSchema = z.object({
|
|
8
|
-
|
|
9
|
-
})
|
|
8
|
+
event: z.literal('frame_removed'),
|
|
9
|
+
});
|
|
10
10
|
export const eventNotificationsEnabledSchema = z.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
11
|
+
event: z.literal('notifications_enabled'),
|
|
12
|
+
notificationDetails: notificationDetailsSchema.required(),
|
|
13
|
+
});
|
|
14
14
|
export const notificationsDisabledSchema = z.object({
|
|
15
|
-
|
|
16
|
-
})
|
|
15
|
+
event: z.literal('notifications_disabled'),
|
|
16
|
+
});
|
|
17
17
|
export const serverEventSchema = z.discriminatedUnion('event', [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
])
|
|
18
|
+
eventFrameAddedSchema,
|
|
19
|
+
eventFrameRemovedSchema,
|
|
20
|
+
eventNotificationsEnabledSchema,
|
|
21
|
+
notificationsDisabledSchema,
|
|
22
|
+
]);
|
package/esm/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './embeds'
|
|
2
|
-
export * from './events'
|
|
3
|
-
export * from './shared'
|
|
4
|
-
export * from './manifest'
|
|
5
|
-
export * from './notifications'
|
|
1
|
+
export * from './embeds';
|
|
2
|
+
export * from './events';
|
|
3
|
+
export * from './shared';
|
|
4
|
+
export * from './manifest';
|
|
5
|
+
export * from './notifications';
|
package/esm/schemas/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './embeds'
|
|
2
|
-
export * from './events'
|
|
3
|
-
export * from './shared'
|
|
4
|
-
export * from './manifest'
|
|
5
|
-
export * from './notifications'
|
|
1
|
+
export * from './embeds';
|
|
2
|
+
export * from './events';
|
|
3
|
+
export * from './shared';
|
|
4
|
+
export * from './manifest';
|
|
5
|
+
export * from './notifications';
|