@farcaster/frame-core 0.1.8 → 0.2.0

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/dist/context.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface MiniappCast {
12
12
  parentFid?: number;
13
13
  timestamp?: number;
14
14
  mentions?: MiniappUser[];
15
+ text: string;
15
16
  embeds?: string[];
16
17
  channelKey?: string;
17
18
  }
@@ -98,4 +98,10 @@ export type FrameConfig = {
98
98
  * Required if the frame application uses notifications.
99
99
  */
100
100
  webhookUrl?: string;
101
+ /**
102
+ * Canonical domain for the frame application.
103
+ * If specified, this domain will be treated as the primary domain for the frame.
104
+ * Max length of 1024 characters.
105
+ */
106
+ canonicalDomain?: string;
101
107
  };
@@ -25,11 +25,13 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
25
25
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
26
26
  noindex: z.ZodOptional<z.ZodBoolean>;
27
27
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
28
- requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
29
- requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
28
+ requiredChains: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["eip155:1", "eip155:8453", "eip155:42161", "eip155:421614", "eip155:84532", "eip155:666666666", "eip155:100", "eip155:10", "eip155:11155420", "eip155:137", "eip155:11155111", "eip155:7777777", "eip155:130", "eip155:10143", "eip155:42220", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]>, "many">, ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[], ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[]>>;
29
+ requiredCapabilities: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"]>, "many">, ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[], ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[]>>;
30
30
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
31
31
  /** Documentation will be added once this feature is finalized. */
32
32
  castShareUrl: z.ZodOptional<z.ZodString>;
33
+ /** Canonical domain for the frame application */
34
+ canonicalDomain: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>>;
33
35
  }, "strip", z.ZodTypeAny, {
34
36
  name: string;
35
37
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -51,9 +53,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
51
53
  ogDescription?: string | undefined;
52
54
  ogImageUrl?: string | undefined;
53
55
  noindex?: boolean | undefined;
54
- requiredChains?: string[] | undefined;
55
- requiredCapabilities?: string[] | undefined;
56
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
57
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
56
58
  castShareUrl?: string | undefined;
59
+ canonicalDomain?: string | undefined;
57
60
  }, {
58
61
  name: string;
59
62
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -75,9 +78,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
75
78
  ogDescription?: string | undefined;
76
79
  ogImageUrl?: string | undefined;
77
80
  noindex?: boolean | undefined;
78
- requiredChains?: string[] | undefined;
79
- requiredCapabilities?: string[] | undefined;
81
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
82
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
80
83
  castShareUrl?: string | undefined;
84
+ canonicalDomain?: string | undefined;
81
85
  }>, {
82
86
  name: string;
83
87
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -99,9 +103,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
99
103
  ogDescription?: string | undefined;
100
104
  ogImageUrl?: string | undefined;
101
105
  noindex?: boolean | undefined;
102
- requiredChains?: string[] | undefined;
103
- requiredCapabilities?: string[] | undefined;
106
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
107
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
104
108
  castShareUrl?: string | undefined;
109
+ canonicalDomain?: string | undefined;
105
110
  }, {
106
111
  name: string;
107
112
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -123,9 +128,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
123
128
  ogDescription?: string | undefined;
124
129
  ogImageUrl?: string | undefined;
125
130
  noindex?: boolean | undefined;
126
- requiredChains?: string[] | undefined;
127
- requiredCapabilities?: string[] | undefined;
131
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
132
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
128
133
  castShareUrl?: string | undefined;
134
+ canonicalDomain?: string | undefined;
129
135
  }>;
130
136
  export declare const domainManifestSchema: z.ZodObject<{
131
137
  accountAssociation: z.ZodObject<{
@@ -167,11 +173,13 @@ export declare const domainManifestSchema: z.ZodObject<{
167
173
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
168
174
  noindex: z.ZodOptional<z.ZodBoolean>;
169
175
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
170
- requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
171
- requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
176
+ requiredChains: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["eip155:1", "eip155:8453", "eip155:42161", "eip155:421614", "eip155:84532", "eip155:666666666", "eip155:100", "eip155:10", "eip155:11155420", "eip155:137", "eip155:11155111", "eip155:7777777", "eip155:130", "eip155:10143", "eip155:42220", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]>, "many">, ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[], ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[]>>;
177
+ requiredCapabilities: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"]>, "many">, ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[], ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[]>>;
172
178
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
173
179
  /** Documentation will be added once this feature is finalized. */
174
180
  castShareUrl: z.ZodOptional<z.ZodString>;
181
+ /** Canonical domain for the frame application */
182
+ canonicalDomain: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>>;
175
183
  }, "strip", z.ZodTypeAny, {
176
184
  name: string;
177
185
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -193,9 +201,10 @@ export declare const domainManifestSchema: z.ZodObject<{
193
201
  ogDescription?: string | undefined;
194
202
  ogImageUrl?: string | undefined;
195
203
  noindex?: boolean | undefined;
196
- requiredChains?: string[] | undefined;
197
- requiredCapabilities?: string[] | undefined;
204
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
205
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
198
206
  castShareUrl?: string | undefined;
207
+ canonicalDomain?: string | undefined;
199
208
  }, {
200
209
  name: string;
201
210
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -217,9 +226,10 @@ export declare const domainManifestSchema: z.ZodObject<{
217
226
  ogDescription?: string | undefined;
218
227
  ogImageUrl?: string | undefined;
219
228
  noindex?: boolean | undefined;
220
- requiredChains?: string[] | undefined;
221
- requiredCapabilities?: string[] | undefined;
229
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
230
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
222
231
  castShareUrl?: string | undefined;
232
+ canonicalDomain?: string | undefined;
223
233
  }>, {
224
234
  name: string;
225
235
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -241,9 +251,10 @@ export declare const domainManifestSchema: z.ZodObject<{
241
251
  ogDescription?: string | undefined;
242
252
  ogImageUrl?: string | undefined;
243
253
  noindex?: boolean | undefined;
244
- requiredChains?: string[] | undefined;
245
- requiredCapabilities?: string[] | undefined;
254
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
255
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
246
256
  castShareUrl?: string | undefined;
257
+ canonicalDomain?: string | undefined;
247
258
  }, {
248
259
  name: string;
249
260
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -265,9 +276,10 @@ export declare const domainManifestSchema: z.ZodObject<{
265
276
  ogDescription?: string | undefined;
266
277
  ogImageUrl?: string | undefined;
267
278
  noindex?: boolean | undefined;
268
- requiredChains?: string[] | undefined;
269
- requiredCapabilities?: string[] | undefined;
279
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
280
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
270
281
  castShareUrl?: string | undefined;
282
+ canonicalDomain?: string | undefined;
271
283
  }>>;
272
284
  }, "strip", z.ZodTypeAny, {
273
285
  accountAssociation: {
@@ -296,9 +308,10 @@ export declare const domainManifestSchema: z.ZodObject<{
296
308
  ogDescription?: string | undefined;
297
309
  ogImageUrl?: string | undefined;
298
310
  noindex?: boolean | undefined;
299
- requiredChains?: string[] | undefined;
300
- requiredCapabilities?: string[] | undefined;
311
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
312
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
301
313
  castShareUrl?: string | undefined;
314
+ canonicalDomain?: string | undefined;
302
315
  } | undefined;
303
316
  }, {
304
317
  accountAssociation: {
@@ -327,8 +340,9 @@ export declare const domainManifestSchema: z.ZodObject<{
327
340
  ogDescription?: string | undefined;
328
341
  ogImageUrl?: string | undefined;
329
342
  noindex?: boolean | undefined;
330
- requiredChains?: string[] | undefined;
331
- requiredCapabilities?: string[] | undefined;
343
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
344
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
332
345
  castShareUrl?: string | undefined;
346
+ canonicalDomain?: string | undefined;
333
347
  } | undefined;
334
348
  }>;
@@ -37,6 +37,10 @@ const chainList = [
37
37
  'eip155:42220', // Celo
38
38
  'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // Solana
39
39
  ];
40
+ function removeArrayDuplicates(arr) {
41
+ const set = new Set(arr);
42
+ return Array.from(set);
43
+ }
40
44
  exports.domainFrameConfigSchema = zod_1.z
41
45
  .object({
42
46
  // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
@@ -75,14 +79,19 @@ exports.domainFrameConfigSchema = zod_1.z
75
79
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
76
80
  noindex: zod_1.z.boolean().optional(),
77
81
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
78
- requiredChains: zod_1.z.array(zod_1.z.enum(chainList)).max(chainList.length).optional(),
82
+ requiredChains: zod_1.z
83
+ .array(zod_1.z.enum(chainList))
84
+ .transform(removeArrayDuplicates)
85
+ .optional(),
79
86
  requiredCapabilities: zod_1.z
80
87
  .array(zod_1.z.enum(types_ts_1.miniAppHostCapabilityList))
81
- .max(types_ts_1.miniAppHostCapabilityList.length)
88
+ .transform(removeArrayDuplicates)
82
89
  .optional(),
83
90
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
84
91
  /** Documentation will be added once this feature is finalized. */
85
92
  castShareUrl: shared_ts_1.secureUrlSchema.optional(),
93
+ /** Canonical domain for the frame application */
94
+ canonicalDomain: shared_ts_1.domainSchema.optional(),
86
95
  })
87
96
  .refine((data) => {
88
97
  if (data.castShareUrl === undefined)
@@ -8,6 +8,7 @@ export declare const frameNameSchema: z.ZodString;
8
8
  export declare const buttonTitleSchema: z.ZodString;
9
9
  export declare const caip19TokenSchema: z.ZodString;
10
10
  export declare const hexColorSchema: z.ZodString;
11
+ export declare const domainSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
11
12
  export declare const aspectRatioSchema: z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>;
12
13
  export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
13
14
  header: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.aspectRatioSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = exports.createSimpleStringSchema = void 0;
3
+ exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.aspectRatioSchema = exports.domainSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = exports.createSimpleStringSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const SPECIAL_CHARS_PATTERN = /[@#$%^&*+=\/\\|~«»]/;
6
6
  const REPEATED_PUNCTUATION_PATTERN = /(!{2,}|\?{2,}|-{2,})/;
@@ -45,6 +45,31 @@ exports.hexColorSchema = zod_1.z
45
45
  .regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
46
46
  message: 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
47
47
  });
48
+ // Domain validation regex:
49
+ // - Each label (part between dots) must start and end with alphanumeric
50
+ // - Labels can contain hyphens in the middle
51
+ // - Cannot have consecutive dots
52
+ // - Must have at least one dot (TLD required)
53
+ // - TLD must be at least 2 characters and only letters
54
+ const DOMAIN_REGEX = /^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
55
+ exports.domainSchema = zod_1.z
56
+ .string()
57
+ .max(1024)
58
+ .regex(DOMAIN_REGEX, {
59
+ message: 'Must be a valid domain name (e.g., example.com, sub.example.com)',
60
+ })
61
+ .refine((value) => !value.includes('://'), {
62
+ message: 'Domain must not include protocol (http://, https://, etc.)',
63
+ })
64
+ .refine((value) => !value.includes('/'), {
65
+ message: 'Domain must not include path separators',
66
+ })
67
+ .refine((value) => !value.includes('@'), {
68
+ message: 'Domain must not include @ symbol',
69
+ })
70
+ .refine((value) => !value.includes(':'), {
71
+ message: 'Domain must not include port numbers',
72
+ });
48
73
  exports.aspectRatioSchema = zod_1.z.union([zod_1.z.literal('1:1'), zod_1.z.literal('3:2')]);
49
74
  exports.encodedJsonFarcasterSignatureSchema = zod_1.z.object({
50
75
  header: zod_1.z.string(),
package/dist/types.d.ts CHANGED
@@ -16,8 +16,8 @@ export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready.ts';
16
16
  export type SignInOptions = SignIn.SignInOptions;
17
17
  export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
18
18
  export type { ImpactOccurred, NotificationOccurred, SelectionChanged };
19
- export declare const miniAppHostCapabilityList: [string, ...string[]];
20
- export type MiniAppHostCapability = 'wallet.getEthereumProvider' | 'wallet.getSolanaProvider' | 'actions.ready' | 'actions.openUrl' | 'actions.close' | 'actions.setPrimaryButton' | 'actions.addMiniApp' | 'actions.signIn' | 'actions.viewCast' | 'actions.viewProfile' | 'actions.composeCast' | 'actions.viewToken' | 'actions.sendToken' | 'actions.swapToken' | 'haptics.impactOccurred' | 'haptics.notificationOccurred' | 'haptics.selectionChanged' | 'back';
19
+ export declare const miniAppHostCapabilityList: readonly ["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"];
20
+ export type MiniAppHostCapability = (typeof miniAppHostCapabilityList)[number];
21
21
  export type GetCapabilities = () => Promise<MiniAppHostCapability[]>;
22
22
  export type GetChains = () => Promise<string[]>;
23
23
  export type WireFrameHost = {
package/esm/context.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface MiniappCast {
12
12
  parentFid?: number;
13
13
  timestamp?: number;
14
14
  mentions?: MiniappUser[];
15
+ text: string;
15
16
  embeds?: string[];
16
17
  channelKey?: string;
17
18
  }
package/esm/manifest.d.ts CHANGED
@@ -98,4 +98,10 @@ export type FrameConfig = {
98
98
  * Required if the frame application uses notifications.
99
99
  */
100
100
  webhookUrl?: string;
101
+ /**
102
+ * Canonical domain for the frame application.
103
+ * If specified, this domain will be treated as the primary domain for the frame.
104
+ * Max length of 1024 characters.
105
+ */
106
+ canonicalDomain?: string;
101
107
  };
@@ -25,11 +25,13 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
25
25
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
26
26
  noindex: z.ZodOptional<z.ZodBoolean>;
27
27
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
28
- requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
29
- requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
28
+ requiredChains: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["eip155:1", "eip155:8453", "eip155:42161", "eip155:421614", "eip155:84532", "eip155:666666666", "eip155:100", "eip155:10", "eip155:11155420", "eip155:137", "eip155:11155111", "eip155:7777777", "eip155:130", "eip155:10143", "eip155:42220", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]>, "many">, ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[], ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[]>>;
29
+ requiredCapabilities: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"]>, "many">, ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[], ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[]>>;
30
30
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
31
31
  /** Documentation will be added once this feature is finalized. */
32
32
  castShareUrl: z.ZodOptional<z.ZodString>;
33
+ /** Canonical domain for the frame application */
34
+ canonicalDomain: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>>;
33
35
  }, "strip", z.ZodTypeAny, {
34
36
  name: string;
35
37
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -51,9 +53,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
51
53
  ogDescription?: string | undefined;
52
54
  ogImageUrl?: string | undefined;
53
55
  noindex?: boolean | undefined;
54
- requiredChains?: string[] | undefined;
55
- requiredCapabilities?: string[] | undefined;
56
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
57
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
56
58
  castShareUrl?: string | undefined;
59
+ canonicalDomain?: string | undefined;
57
60
  }, {
58
61
  name: string;
59
62
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -75,9 +78,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
75
78
  ogDescription?: string | undefined;
76
79
  ogImageUrl?: string | undefined;
77
80
  noindex?: boolean | undefined;
78
- requiredChains?: string[] | undefined;
79
- requiredCapabilities?: string[] | undefined;
81
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
82
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
80
83
  castShareUrl?: string | undefined;
84
+ canonicalDomain?: string | undefined;
81
85
  }>, {
82
86
  name: string;
83
87
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -99,9 +103,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
99
103
  ogDescription?: string | undefined;
100
104
  ogImageUrl?: string | undefined;
101
105
  noindex?: boolean | undefined;
102
- requiredChains?: string[] | undefined;
103
- requiredCapabilities?: string[] | undefined;
106
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
107
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
104
108
  castShareUrl?: string | undefined;
109
+ canonicalDomain?: string | undefined;
105
110
  }, {
106
111
  name: string;
107
112
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -123,9 +128,10 @@ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
123
128
  ogDescription?: string | undefined;
124
129
  ogImageUrl?: string | undefined;
125
130
  noindex?: boolean | undefined;
126
- requiredChains?: string[] | undefined;
127
- requiredCapabilities?: string[] | undefined;
131
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
132
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
128
133
  castShareUrl?: string | undefined;
134
+ canonicalDomain?: string | undefined;
129
135
  }>;
130
136
  export declare const domainManifestSchema: z.ZodObject<{
131
137
  accountAssociation: z.ZodObject<{
@@ -167,11 +173,13 @@ export declare const domainManifestSchema: z.ZodObject<{
167
173
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
168
174
  noindex: z.ZodOptional<z.ZodBoolean>;
169
175
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
170
- requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
171
- requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
176
+ requiredChains: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["eip155:1", "eip155:8453", "eip155:42161", "eip155:421614", "eip155:84532", "eip155:666666666", "eip155:100", "eip155:10", "eip155:11155420", "eip155:137", "eip155:11155111", "eip155:7777777", "eip155:130", "eip155:10143", "eip155:42220", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]>, "many">, ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[], ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[]>>;
177
+ requiredCapabilities: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"]>, "many">, ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[], ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[]>>;
172
178
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
173
179
  /** Documentation will be added once this feature is finalized. */
174
180
  castShareUrl: z.ZodOptional<z.ZodString>;
181
+ /** Canonical domain for the frame application */
182
+ canonicalDomain: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>>;
175
183
  }, "strip", z.ZodTypeAny, {
176
184
  name: string;
177
185
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -193,9 +201,10 @@ export declare const domainManifestSchema: z.ZodObject<{
193
201
  ogDescription?: string | undefined;
194
202
  ogImageUrl?: string | undefined;
195
203
  noindex?: boolean | undefined;
196
- requiredChains?: string[] | undefined;
197
- requiredCapabilities?: string[] | undefined;
204
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
205
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
198
206
  castShareUrl?: string | undefined;
207
+ canonicalDomain?: string | undefined;
199
208
  }, {
200
209
  name: string;
201
210
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -217,9 +226,10 @@ export declare const domainManifestSchema: z.ZodObject<{
217
226
  ogDescription?: string | undefined;
218
227
  ogImageUrl?: string | undefined;
219
228
  noindex?: boolean | undefined;
220
- requiredChains?: string[] | undefined;
221
- requiredCapabilities?: string[] | undefined;
229
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
230
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
222
231
  castShareUrl?: string | undefined;
232
+ canonicalDomain?: string | undefined;
223
233
  }>, {
224
234
  name: string;
225
235
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -241,9 +251,10 @@ export declare const domainManifestSchema: z.ZodObject<{
241
251
  ogDescription?: string | undefined;
242
252
  ogImageUrl?: string | undefined;
243
253
  noindex?: boolean | undefined;
244
- requiredChains?: string[] | undefined;
245
- requiredCapabilities?: string[] | undefined;
254
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
255
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
246
256
  castShareUrl?: string | undefined;
257
+ canonicalDomain?: string | undefined;
247
258
  }, {
248
259
  name: string;
249
260
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -265,9 +276,10 @@ export declare const domainManifestSchema: z.ZodObject<{
265
276
  ogDescription?: string | undefined;
266
277
  ogImageUrl?: string | undefined;
267
278
  noindex?: boolean | undefined;
268
- requiredChains?: string[] | undefined;
269
- requiredCapabilities?: string[] | undefined;
279
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
280
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
270
281
  castShareUrl?: string | undefined;
282
+ canonicalDomain?: string | undefined;
271
283
  }>>;
272
284
  }, "strip", z.ZodTypeAny, {
273
285
  accountAssociation: {
@@ -296,9 +308,10 @@ export declare const domainManifestSchema: z.ZodObject<{
296
308
  ogDescription?: string | undefined;
297
309
  ogImageUrl?: string | undefined;
298
310
  noindex?: boolean | undefined;
299
- requiredChains?: string[] | undefined;
300
- requiredCapabilities?: string[] | undefined;
311
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
312
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
301
313
  castShareUrl?: string | undefined;
314
+ canonicalDomain?: string | undefined;
302
315
  } | undefined;
303
316
  }, {
304
317
  accountAssociation: {
@@ -327,8 +340,9 @@ export declare const domainManifestSchema: z.ZodObject<{
327
340
  ogDescription?: string | undefined;
328
341
  ogImageUrl?: string | undefined;
329
342
  noindex?: boolean | undefined;
330
- requiredChains?: string[] | undefined;
331
- requiredCapabilities?: string[] | undefined;
343
+ requiredChains?: ("eip155:1" | "eip155:8453" | "eip155:42161" | "eip155:421614" | "eip155:84532" | "eip155:666666666" | "eip155:100" | "eip155:10" | "eip155:11155420" | "eip155:137" | "eip155:11155111" | "eip155:7777777" | "eip155:130" | "eip155:10143" | "eip155:42220" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp")[] | undefined;
344
+ requiredCapabilities?: ("wallet.getEthereumProvider" | "wallet.getSolanaProvider" | "actions.ready" | "actions.openUrl" | "actions.close" | "actions.setPrimaryButton" | "actions.addMiniApp" | "actions.signIn" | "actions.viewCast" | "actions.viewProfile" | "actions.composeCast" | "actions.viewToken" | "actions.sendToken" | "actions.swapToken" | "haptics.impactOccurred" | "haptics.notificationOccurred" | "haptics.selectionChanged" | "back")[] | undefined;
332
345
  castShareUrl?: string | undefined;
346
+ canonicalDomain?: string | undefined;
333
347
  } | undefined;
334
348
  }>;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { miniAppHostCapabilityList } from "../types.js";
3
- import { buttonTitleSchema, createSimpleStringSchema, encodedJsonFarcasterSignatureSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from "./shared.js";
3
+ import { buttonTitleSchema, createSimpleStringSchema, domainSchema, encodedJsonFarcasterSignatureSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from "./shared.js";
4
4
  const primaryCategorySchema = z.enum([
5
5
  'games',
6
6
  'social',
@@ -34,6 +34,10 @@ const chainList = [
34
34
  'eip155:42220', // Celo
35
35
  'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // Solana
36
36
  ];
37
+ function removeArrayDuplicates(arr) {
38
+ const set = new Set(arr);
39
+ return Array.from(set);
40
+ }
37
41
  export const domainFrameConfigSchema = z
38
42
  .object({
39
43
  // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
@@ -72,14 +76,19 @@ export const domainFrameConfigSchema = z
72
76
  /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
73
77
  noindex: z.boolean().optional(),
74
78
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
75
- requiredChains: z.array(z.enum(chainList)).max(chainList.length).optional(),
79
+ requiredChains: z
80
+ .array(z.enum(chainList))
81
+ .transform(removeArrayDuplicates)
82
+ .optional(),
76
83
  requiredCapabilities: z
77
84
  .array(z.enum(miniAppHostCapabilityList))
78
- .max(miniAppHostCapabilityList.length)
85
+ .transform(removeArrayDuplicates)
79
86
  .optional(),
80
87
  /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
81
88
  /** Documentation will be added once this feature is finalized. */
82
89
  castShareUrl: secureUrlSchema.optional(),
90
+ /** Canonical domain for the frame application */
91
+ canonicalDomain: domainSchema.optional(),
83
92
  })
84
93
  .refine((data) => {
85
94
  if (data.castShareUrl === undefined)
@@ -8,6 +8,7 @@ export declare const frameNameSchema: z.ZodString;
8
8
  export declare const buttonTitleSchema: z.ZodString;
9
9
  export declare const caip19TokenSchema: z.ZodString;
10
10
  export declare const hexColorSchema: z.ZodString;
11
+ export declare const domainSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
11
12
  export declare const aspectRatioSchema: z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>;
12
13
  export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
13
14
  header: z.ZodString;
@@ -41,6 +41,31 @@ export const hexColorSchema = z
41
41
  .regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
42
42
  message: 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
43
43
  });
44
+ // Domain validation regex:
45
+ // - Each label (part between dots) must start and end with alphanumeric
46
+ // - Labels can contain hyphens in the middle
47
+ // - Cannot have consecutive dots
48
+ // - Must have at least one dot (TLD required)
49
+ // - TLD must be at least 2 characters and only letters
50
+ const DOMAIN_REGEX = /^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
51
+ export const domainSchema = z
52
+ .string()
53
+ .max(1024)
54
+ .regex(DOMAIN_REGEX, {
55
+ message: 'Must be a valid domain name (e.g., example.com, sub.example.com)',
56
+ })
57
+ .refine((value) => !value.includes('://'), {
58
+ message: 'Domain must not include protocol (http://, https://, etc.)',
59
+ })
60
+ .refine((value) => !value.includes('/'), {
61
+ message: 'Domain must not include path separators',
62
+ })
63
+ .refine((value) => !value.includes('@'), {
64
+ message: 'Domain must not include @ symbol',
65
+ })
66
+ .refine((value) => !value.includes(':'), {
67
+ message: 'Domain must not include port numbers',
68
+ });
44
69
  export const aspectRatioSchema = z.union([z.literal('1:1'), z.literal('3:2')]);
45
70
  export const encodedJsonFarcasterSignatureSchema = z.object({
46
71
  header: z.string(),