@farcaster/frame-core 0.1.4 → 0.1.6

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/back.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export type BackState = {
2
+ /**
3
+ * Is the back control visible. Note that on mobile devices Farcaster clients
4
+ * may support a gesture based control rather than button control.
5
+ *
6
+ * @default false
7
+ */
8
+ visible: boolean;
9
+ };
10
+ export declare const DEFAULT_BACK_STATE: {
11
+ visible: false;
12
+ };
13
+ export type UpdateBackState = (state: BackState) => Promise<void>;
package/dist/back.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_BACK_STATE = void 0;
4
+ exports.DEFAULT_BACK_STATE = {
5
+ visible: false,
6
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './actions/index.ts';
2
2
  export * from './wallet/index.ts';
3
+ export * as Back from './back.ts';
3
4
  export * as Errors from './errors.ts';
4
5
  export * as Context from './context.ts';
5
6
  export * as Manifest from './manifest.ts';
package/dist/index.js CHANGED
@@ -36,9 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Manifest = exports.Context = exports.Errors = void 0;
39
+ exports.Manifest = exports.Context = exports.Errors = exports.Back = void 0;
40
40
  __exportStar(require("./actions/index.js"), exports);
41
41
  __exportStar(require("./wallet/index.js"), exports);
42
+ exports.Back = __importStar(require("./back.js"));
42
43
  exports.Errors = __importStar(require("./errors.js"));
43
44
  exports.Context = __importStar(require("./context.js"));
44
45
  exports.Manifest = __importStar(require("./manifest.js"));
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const domainFrameConfigSchema: z.ZodObject<{
2
+ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
3
3
  version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
4
4
  name: z.ZodString;
5
5
  iconUrl: z.ZodString;
@@ -27,6 +27,9 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
27
27
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
28
28
  requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
29
29
  requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
30
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
31
+ /** Documentation will be added once this feature is finalized. */
32
+ castShareUrl: z.ZodOptional<z.ZodString>;
30
33
  }, "strip", z.ZodTypeAny, {
31
34
  name: string;
32
35
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -50,6 +53,7 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
50
53
  noindex?: boolean | undefined;
51
54
  requiredChains?: string[] | undefined;
52
55
  requiredCapabilities?: string[] | undefined;
56
+ castShareUrl?: string | undefined;
53
57
  }, {
54
58
  name: string;
55
59
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -73,6 +77,55 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
73
77
  noindex?: boolean | undefined;
74
78
  requiredChains?: string[] | undefined;
75
79
  requiredCapabilities?: string[] | undefined;
80
+ castShareUrl?: string | undefined;
81
+ }>, {
82
+ name: string;
83
+ version: "1" | "next" | "0.0.0" | "0.0.1";
84
+ iconUrl: string;
85
+ homeUrl: string;
86
+ splashImageUrl?: string | undefined;
87
+ splashBackgroundColor?: string | undefined;
88
+ imageUrl?: string | undefined;
89
+ buttonTitle?: string | undefined;
90
+ webhookUrl?: string | undefined;
91
+ subtitle?: string | undefined;
92
+ description?: string | undefined;
93
+ screenshotUrls?: string[] | undefined;
94
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
95
+ tags?: string[] | undefined;
96
+ heroImageUrl?: string | undefined;
97
+ tagline?: string | undefined;
98
+ ogTitle?: string | undefined;
99
+ ogDescription?: string | undefined;
100
+ ogImageUrl?: string | undefined;
101
+ noindex?: boolean | undefined;
102
+ requiredChains?: string[] | undefined;
103
+ requiredCapabilities?: string[] | undefined;
104
+ castShareUrl?: string | undefined;
105
+ }, {
106
+ name: string;
107
+ version: "1" | "next" | "0.0.0" | "0.0.1";
108
+ iconUrl: string;
109
+ homeUrl: string;
110
+ splashImageUrl?: string | undefined;
111
+ splashBackgroundColor?: string | undefined;
112
+ imageUrl?: string | undefined;
113
+ buttonTitle?: string | undefined;
114
+ webhookUrl?: string | undefined;
115
+ subtitle?: string | undefined;
116
+ description?: string | undefined;
117
+ screenshotUrls?: string[] | undefined;
118
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
119
+ tags?: string[] | undefined;
120
+ heroImageUrl?: string | undefined;
121
+ tagline?: string | undefined;
122
+ ogTitle?: string | undefined;
123
+ ogDescription?: string | undefined;
124
+ ogImageUrl?: string | undefined;
125
+ noindex?: boolean | undefined;
126
+ requiredChains?: string[] | undefined;
127
+ requiredCapabilities?: string[] | undefined;
128
+ castShareUrl?: string | undefined;
76
129
  }>;
77
130
  export declare const domainManifestSchema: z.ZodObject<{
78
131
  accountAssociation: z.ZodObject<{
@@ -88,7 +141,7 @@ export declare const domainManifestSchema: z.ZodObject<{
88
141
  payload: string;
89
142
  signature: string;
90
143
  }>;
91
- frame: z.ZodOptional<z.ZodObject<{
144
+ frame: z.ZodOptional<z.ZodEffects<z.ZodObject<{
92
145
  version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
93
146
  name: z.ZodString;
94
147
  iconUrl: z.ZodString;
@@ -116,6 +169,9 @@ export declare const domainManifestSchema: z.ZodObject<{
116
169
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
117
170
  requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
118
171
  requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
172
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
173
+ /** Documentation will be added once this feature is finalized. */
174
+ castShareUrl: z.ZodOptional<z.ZodString>;
119
175
  }, "strip", z.ZodTypeAny, {
120
176
  name: string;
121
177
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -139,6 +195,55 @@ export declare const domainManifestSchema: z.ZodObject<{
139
195
  noindex?: boolean | undefined;
140
196
  requiredChains?: string[] | undefined;
141
197
  requiredCapabilities?: string[] | undefined;
198
+ castShareUrl?: string | undefined;
199
+ }, {
200
+ name: string;
201
+ version: "1" | "next" | "0.0.0" | "0.0.1";
202
+ iconUrl: string;
203
+ homeUrl: string;
204
+ splashImageUrl?: string | undefined;
205
+ splashBackgroundColor?: string | undefined;
206
+ imageUrl?: string | undefined;
207
+ buttonTitle?: string | undefined;
208
+ webhookUrl?: string | undefined;
209
+ subtitle?: string | undefined;
210
+ description?: string | undefined;
211
+ screenshotUrls?: string[] | undefined;
212
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
213
+ tags?: string[] | undefined;
214
+ heroImageUrl?: string | undefined;
215
+ tagline?: string | undefined;
216
+ ogTitle?: string | undefined;
217
+ ogDescription?: string | undefined;
218
+ ogImageUrl?: string | undefined;
219
+ noindex?: boolean | undefined;
220
+ requiredChains?: string[] | undefined;
221
+ requiredCapabilities?: string[] | undefined;
222
+ castShareUrl?: string | undefined;
223
+ }>, {
224
+ name: string;
225
+ version: "1" | "next" | "0.0.0" | "0.0.1";
226
+ iconUrl: string;
227
+ homeUrl: string;
228
+ splashImageUrl?: string | undefined;
229
+ splashBackgroundColor?: string | undefined;
230
+ imageUrl?: string | undefined;
231
+ buttonTitle?: string | undefined;
232
+ webhookUrl?: string | undefined;
233
+ subtitle?: string | undefined;
234
+ description?: string | undefined;
235
+ screenshotUrls?: string[] | undefined;
236
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
237
+ tags?: string[] | undefined;
238
+ heroImageUrl?: string | undefined;
239
+ tagline?: string | undefined;
240
+ ogTitle?: string | undefined;
241
+ ogDescription?: string | undefined;
242
+ ogImageUrl?: string | undefined;
243
+ noindex?: boolean | undefined;
244
+ requiredChains?: string[] | undefined;
245
+ requiredCapabilities?: string[] | undefined;
246
+ castShareUrl?: string | undefined;
142
247
  }, {
143
248
  name: string;
144
249
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -162,6 +267,7 @@ export declare const domainManifestSchema: z.ZodObject<{
162
267
  noindex?: boolean | undefined;
163
268
  requiredChains?: string[] | undefined;
164
269
  requiredCapabilities?: string[] | undefined;
270
+ castShareUrl?: string | undefined;
165
271
  }>>;
166
272
  }, "strip", z.ZodTypeAny, {
167
273
  accountAssociation: {
@@ -192,6 +298,7 @@ export declare const domainManifestSchema: z.ZodObject<{
192
298
  noindex?: boolean | undefined;
193
299
  requiredChains?: string[] | undefined;
194
300
  requiredCapabilities?: string[] | undefined;
301
+ castShareUrl?: string | undefined;
195
302
  } | undefined;
196
303
  }, {
197
304
  accountAssociation: {
@@ -222,5 +329,6 @@ export declare const domainManifestSchema: z.ZodObject<{
222
329
  noindex?: boolean | undefined;
223
330
  requiredChains?: string[] | undefined;
224
331
  requiredCapabilities?: string[] | undefined;
332
+ castShareUrl?: string | undefined;
225
333
  } | undefined;
226
334
  }>;
@@ -37,7 +37,8 @@ const chainList = [
37
37
  'eip155:42220', // Celo
38
38
  'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // Solana
39
39
  ];
40
- exports.domainFrameConfigSchema = zod_1.z.object({
40
+ exports.domainFrameConfigSchema = zod_1.z
41
+ .object({
41
42
  // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
42
43
  // backwards compatibility. next should always resolve to the most recent
43
44
  // schema version.
@@ -79,6 +80,24 @@ exports.domainFrameConfigSchema = zod_1.z.object({
79
80
  .array(zod_1.z.enum(types_ts_1.miniAppHostCapabilityList))
80
81
  .max(types_ts_1.miniAppHostCapabilityList.length)
81
82
  .optional(),
83
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
84
+ /** Documentation will be added once this feature is finalized. */
85
+ castShareUrl: shared_ts_1.secureUrlSchema.optional(),
86
+ })
87
+ .refine((data) => {
88
+ if (data.castShareUrl === undefined)
89
+ return true;
90
+ try {
91
+ const homeUrlDomain = new URL(data.homeUrl).hostname;
92
+ const castShareUrlDomain = new URL(data.castShareUrl).hostname;
93
+ return homeUrlDomain === castShareUrlDomain;
94
+ }
95
+ catch {
96
+ return false;
97
+ }
98
+ }, {
99
+ message: 'castShareUrl must have the same domain as homeUrl',
100
+ path: ['castShareUrl'],
82
101
  });
83
102
  exports.domainManifestSchema = zod_1.z.object({
84
103
  accountAssociation: shared_ts_1.encodedJsonFarcasterSignatureSchema,
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { ImpactOccurred, NotificationOccurred, SelectionChanged } from './actions/Haptics.ts';
2
2
  import type { AddMiniApp, ComposeCast, Ready, SendToken, SignIn, SwapToken, ViewCast, ViewProfile, ViewToken } from './actions/index.ts';
3
+ import type { UpdateBackState } from './back.ts';
3
4
  import type { FrameContext } from './context.ts';
4
5
  import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas/index.ts';
5
6
  import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts';
@@ -16,7 +17,7 @@ export type SignInOptions = SignIn.SignInOptions;
16
17
  export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
17
18
  export type { ImpactOccurred, NotificationOccurred, SelectionChanged };
18
19
  export declare const miniAppHostCapabilityList: [string, ...string[]];
19
- 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';
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';
20
21
  export type GetCapabilities = () => Promise<MiniAppHostCapability[]>;
21
22
  export type GetChains = () => Promise<string[]>;
22
23
  export type WireFrameHost = {
@@ -42,6 +43,7 @@ export type WireFrameHost = {
42
43
  selectionChanged: SelectionChanged;
43
44
  getCapabilities: GetCapabilities;
44
45
  getChains: GetChains;
46
+ updateBackState: UpdateBackState;
45
47
  };
46
48
  export type FrameHost = {
47
49
  context: FrameContext;
@@ -70,6 +72,7 @@ export type FrameHost = {
70
72
  selectionChanged: SelectionChanged;
71
73
  getCapabilities: GetCapabilities;
72
74
  getChains: GetChains;
75
+ updateBackState: UpdateBackState;
73
76
  };
74
77
  export type EventFrameAddRejected = {
75
78
  event: 'frame_add_rejected';
@@ -78,4 +81,7 @@ export type EventFrameAddRejected = {
78
81
  export type EventPrimaryButtonClicked = {
79
82
  event: 'primary_button_clicked';
80
83
  };
81
- export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | Ethereum.EventEip6963AnnounceProvider;
84
+ export type EventBackNavigationTriggered = {
85
+ event: 'back_navigation_triggered';
86
+ };
87
+ export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | EventBackNavigationTriggered | Ethereum.EventEip6963AnnounceProvider;
package/dist/types.js CHANGED
@@ -37,4 +37,5 @@ exports.miniAppHostCapabilityList = [
37
37
  'haptics.impactOccurred',
38
38
  'haptics.notificationOccurred',
39
39
  'haptics.selectionChanged',
40
+ 'back',
40
41
  ];
package/esm/back.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export type BackState = {
2
+ /**
3
+ * Is the back control visible. Note that on mobile devices Farcaster clients
4
+ * may support a gesture based control rather than button control.
5
+ *
6
+ * @default false
7
+ */
8
+ visible: boolean;
9
+ };
10
+ export declare const DEFAULT_BACK_STATE: {
11
+ visible: false;
12
+ };
13
+ export type UpdateBackState = (state: BackState) => Promise<void>;
package/esm/back.js ADDED
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_BACK_STATE = {
2
+ visible: false,
3
+ };
package/esm/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './actions/index.ts';
2
2
  export * from './wallet/index.ts';
3
+ export * as Back from './back.ts';
3
4
  export * as Errors from './errors.ts';
4
5
  export * as Context from './context.ts';
5
6
  export * as Manifest from './manifest.ts';
package/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./actions/index.js";
2
2
  export * from "./wallet/index.js";
3
+ export * as Back from "./back.js";
3
4
  export * as Errors from "./errors.js";
4
5
  export * as Context from "./context.js";
5
6
  export * as Manifest from "./manifest.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const domainFrameConfigSchema: z.ZodObject<{
2
+ export declare const domainFrameConfigSchema: z.ZodEffects<z.ZodObject<{
3
3
  version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
4
4
  name: z.ZodString;
5
5
  iconUrl: z.ZodString;
@@ -27,6 +27,9 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
27
27
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
28
28
  requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
29
29
  requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
30
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
31
+ /** Documentation will be added once this feature is finalized. */
32
+ castShareUrl: z.ZodOptional<z.ZodString>;
30
33
  }, "strip", z.ZodTypeAny, {
31
34
  name: string;
32
35
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -50,6 +53,7 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
50
53
  noindex?: boolean | undefined;
51
54
  requiredChains?: string[] | undefined;
52
55
  requiredCapabilities?: string[] | undefined;
56
+ castShareUrl?: string | undefined;
53
57
  }, {
54
58
  name: string;
55
59
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -73,6 +77,55 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
73
77
  noindex?: boolean | undefined;
74
78
  requiredChains?: string[] | undefined;
75
79
  requiredCapabilities?: string[] | undefined;
80
+ castShareUrl?: string | undefined;
81
+ }>, {
82
+ name: string;
83
+ version: "1" | "next" | "0.0.0" | "0.0.1";
84
+ iconUrl: string;
85
+ homeUrl: string;
86
+ splashImageUrl?: string | undefined;
87
+ splashBackgroundColor?: string | undefined;
88
+ imageUrl?: string | undefined;
89
+ buttonTitle?: string | undefined;
90
+ webhookUrl?: string | undefined;
91
+ subtitle?: string | undefined;
92
+ description?: string | undefined;
93
+ screenshotUrls?: string[] | undefined;
94
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
95
+ tags?: string[] | undefined;
96
+ heroImageUrl?: string | undefined;
97
+ tagline?: string | undefined;
98
+ ogTitle?: string | undefined;
99
+ ogDescription?: string | undefined;
100
+ ogImageUrl?: string | undefined;
101
+ noindex?: boolean | undefined;
102
+ requiredChains?: string[] | undefined;
103
+ requiredCapabilities?: string[] | undefined;
104
+ castShareUrl?: string | undefined;
105
+ }, {
106
+ name: string;
107
+ version: "1" | "next" | "0.0.0" | "0.0.1";
108
+ iconUrl: string;
109
+ homeUrl: string;
110
+ splashImageUrl?: string | undefined;
111
+ splashBackgroundColor?: string | undefined;
112
+ imageUrl?: string | undefined;
113
+ buttonTitle?: string | undefined;
114
+ webhookUrl?: string | undefined;
115
+ subtitle?: string | undefined;
116
+ description?: string | undefined;
117
+ screenshotUrls?: string[] | undefined;
118
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
119
+ tags?: string[] | undefined;
120
+ heroImageUrl?: string | undefined;
121
+ tagline?: string | undefined;
122
+ ogTitle?: string | undefined;
123
+ ogDescription?: string | undefined;
124
+ ogImageUrl?: string | undefined;
125
+ noindex?: boolean | undefined;
126
+ requiredChains?: string[] | undefined;
127
+ requiredCapabilities?: string[] | undefined;
128
+ castShareUrl?: string | undefined;
76
129
  }>;
77
130
  export declare const domainManifestSchema: z.ZodObject<{
78
131
  accountAssociation: z.ZodObject<{
@@ -88,7 +141,7 @@ export declare const domainManifestSchema: z.ZodObject<{
88
141
  payload: string;
89
142
  signature: string;
90
143
  }>;
91
- frame: z.ZodOptional<z.ZodObject<{
144
+ frame: z.ZodOptional<z.ZodEffects<z.ZodObject<{
92
145
  version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
93
146
  name: z.ZodString;
94
147
  iconUrl: z.ZodString;
@@ -116,6 +169,9 @@ export declare const domainManifestSchema: z.ZodObject<{
116
169
  /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
117
170
  requiredChains: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
118
171
  requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
172
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
173
+ /** Documentation will be added once this feature is finalized. */
174
+ castShareUrl: z.ZodOptional<z.ZodString>;
119
175
  }, "strip", z.ZodTypeAny, {
120
176
  name: string;
121
177
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -139,6 +195,55 @@ export declare const domainManifestSchema: z.ZodObject<{
139
195
  noindex?: boolean | undefined;
140
196
  requiredChains?: string[] | undefined;
141
197
  requiredCapabilities?: string[] | undefined;
198
+ castShareUrl?: string | undefined;
199
+ }, {
200
+ name: string;
201
+ version: "1" | "next" | "0.0.0" | "0.0.1";
202
+ iconUrl: string;
203
+ homeUrl: string;
204
+ splashImageUrl?: string | undefined;
205
+ splashBackgroundColor?: string | undefined;
206
+ imageUrl?: string | undefined;
207
+ buttonTitle?: string | undefined;
208
+ webhookUrl?: string | undefined;
209
+ subtitle?: string | undefined;
210
+ description?: string | undefined;
211
+ screenshotUrls?: string[] | undefined;
212
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
213
+ tags?: string[] | undefined;
214
+ heroImageUrl?: string | undefined;
215
+ tagline?: string | undefined;
216
+ ogTitle?: string | undefined;
217
+ ogDescription?: string | undefined;
218
+ ogImageUrl?: string | undefined;
219
+ noindex?: boolean | undefined;
220
+ requiredChains?: string[] | undefined;
221
+ requiredCapabilities?: string[] | undefined;
222
+ castShareUrl?: string | undefined;
223
+ }>, {
224
+ name: string;
225
+ version: "1" | "next" | "0.0.0" | "0.0.1";
226
+ iconUrl: string;
227
+ homeUrl: string;
228
+ splashImageUrl?: string | undefined;
229
+ splashBackgroundColor?: string | undefined;
230
+ imageUrl?: string | undefined;
231
+ buttonTitle?: string | undefined;
232
+ webhookUrl?: string | undefined;
233
+ subtitle?: string | undefined;
234
+ description?: string | undefined;
235
+ screenshotUrls?: string[] | undefined;
236
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
237
+ tags?: string[] | undefined;
238
+ heroImageUrl?: string | undefined;
239
+ tagline?: string | undefined;
240
+ ogTitle?: string | undefined;
241
+ ogDescription?: string | undefined;
242
+ ogImageUrl?: string | undefined;
243
+ noindex?: boolean | undefined;
244
+ requiredChains?: string[] | undefined;
245
+ requiredCapabilities?: string[] | undefined;
246
+ castShareUrl?: string | undefined;
142
247
  }, {
143
248
  name: string;
144
249
  version: "1" | "next" | "0.0.0" | "0.0.1";
@@ -162,6 +267,7 @@ export declare const domainManifestSchema: z.ZodObject<{
162
267
  noindex?: boolean | undefined;
163
268
  requiredChains?: string[] | undefined;
164
269
  requiredCapabilities?: string[] | undefined;
270
+ castShareUrl?: string | undefined;
165
271
  }>>;
166
272
  }, "strip", z.ZodTypeAny, {
167
273
  accountAssociation: {
@@ -192,6 +298,7 @@ export declare const domainManifestSchema: z.ZodObject<{
192
298
  noindex?: boolean | undefined;
193
299
  requiredChains?: string[] | undefined;
194
300
  requiredCapabilities?: string[] | undefined;
301
+ castShareUrl?: string | undefined;
195
302
  } | undefined;
196
303
  }, {
197
304
  accountAssociation: {
@@ -222,5 +329,6 @@ export declare const domainManifestSchema: z.ZodObject<{
222
329
  noindex?: boolean | undefined;
223
330
  requiredChains?: string[] | undefined;
224
331
  requiredCapabilities?: string[] | undefined;
332
+ castShareUrl?: string | undefined;
225
333
  } | undefined;
226
334
  }>;
@@ -34,7 +34,8 @@ const chainList = [
34
34
  'eip155:42220', // Celo
35
35
  'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // Solana
36
36
  ];
37
- export const domainFrameConfigSchema = z.object({
37
+ export const domainFrameConfigSchema = z
38
+ .object({
38
39
  // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
39
40
  // backwards compatibility. next should always resolve to the most recent
40
41
  // schema version.
@@ -76,6 +77,24 @@ export const domainFrameConfigSchema = z.object({
76
77
  .array(z.enum(miniAppHostCapabilityList))
77
78
  .max(miniAppHostCapabilityList.length)
78
79
  .optional(),
80
+ /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
81
+ /** Documentation will be added once this feature is finalized. */
82
+ castShareUrl: secureUrlSchema.optional(),
83
+ })
84
+ .refine((data) => {
85
+ if (data.castShareUrl === undefined)
86
+ return true;
87
+ try {
88
+ const homeUrlDomain = new URL(data.homeUrl).hostname;
89
+ const castShareUrlDomain = new URL(data.castShareUrl).hostname;
90
+ return homeUrlDomain === castShareUrlDomain;
91
+ }
92
+ catch {
93
+ return false;
94
+ }
95
+ }, {
96
+ message: 'castShareUrl must have the same domain as homeUrl',
97
+ path: ['castShareUrl'],
79
98
  });
80
99
  export const domainManifestSchema = z.object({
81
100
  accountAssociation: encodedJsonFarcasterSignatureSchema,