@farcaster/frame-core 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/actions/AddFrame.d.ts +36 -0
  2. package/dist/actions/AddFrame.js +57 -0
  3. package/dist/actions/{signIn.d.ts → SignIn.d.ts} +7 -6
  4. package/dist/actions/{signIn.js → SignIn.js} +1 -1
  5. package/dist/actions/index.d.ts +2 -0
  6. package/dist/actions/index.js +38 -0
  7. package/dist/errors.js +1 -1
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.js +2 -25
  10. package/dist/internal/types.d.ts +3 -2
  11. package/dist/schemas/embeds.d.ts +1 -1
  12. package/dist/schemas/embeds.js +3 -3
  13. package/dist/schemas/events.d.ts +1 -1
  14. package/dist/schemas/events.js +5 -5
  15. package/dist/schemas/index.d.ts +5 -5
  16. package/dist/schemas/manifest.d.ts +1 -1
  17. package/dist/schemas/manifest.js +4 -4
  18. package/dist/schemas/notifications.d.ts +1 -1
  19. package/dist/schemas/shared.d.ts +1 -1
  20. package/dist/schemas/shared.js +4 -4
  21. package/dist/types.d.ts +43 -31
  22. package/esm/actions/AddFrame.d.ts +40 -0
  23. package/esm/actions/AddFrame.js +19 -0
  24. package/esm/actions/SignIn.d.ts +43 -0
  25. package/esm/actions/SignIn.js +10 -0
  26. package/esm/actions/index.d.ts +2 -0
  27. package/esm/actions/index.js +2 -0
  28. package/esm/errors.d.ts +9 -7
  29. package/esm/errors.js +6 -6
  30. package/esm/index.d.ts +3 -3
  31. package/esm/index.js +3 -3
  32. package/esm/internal/types.d.ts +19 -7
  33. package/esm/internal/types.js +1 -1
  34. package/esm/schemas/embeds.d.ts +231 -169
  35. package/esm/schemas/embeds.js +25 -19
  36. package/esm/schemas/events.d.ts +225 -129
  37. package/esm/schemas/events.js +18 -18
  38. package/esm/schemas/index.d.ts +5 -5
  39. package/esm/schemas/index.js +5 -5
  40. package/esm/schemas/manifest.d.ts +154 -110
  41. package/esm/schemas/manifest.js +29 -23
  42. package/esm/schemas/notifications.d.ts +86 -58
  43. package/esm/schemas/notifications.js +17 -17
  44. package/esm/schemas/shared.d.ts +49 -33
  45. package/esm/schemas/shared.js +20 -19
  46. package/esm/tsconfig.tsbuildinfo +1 -1
  47. package/esm/types.d.ts +180 -139
  48. package/esm/types.js +2 -2
  49. package/package.json +4 -5
  50. package/src/actions/AddFrame.ts +51 -0
  51. package/src/actions/SignIn.ts +51 -0
  52. package/src/actions/index.ts +2 -0
  53. package/src/errors.ts +4 -4
  54. package/src/index.ts +3 -3
  55. package/src/internal/types.ts +3 -4
  56. package/src/schemas/embeds.ts +13 -13
  57. package/src/schemas/events.ts +17 -17
  58. package/src/schemas/index.ts +5 -5
  59. package/src/schemas/manifest.ts +11 -11
  60. package/src/schemas/notifications.ts +8 -10
  61. package/src/schemas/shared.ts +13 -13
  62. package/src/types.ts +125 -123
  63. package/esm/actions/signIn.d.ts +0 -40
  64. package/esm/actions/signIn.js +0 -10
  65. package/src/actions/signIn.ts +0 -50
@@ -1,112 +1,156 @@
1
- import { z } from "zod";
2
- export declare const domainFrameConfigSchema: z.ZodObject<{
3
- version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
4
- name: z.ZodString;
5
- iconUrl: z.ZodString;
6
- homeUrl: z.ZodString;
7
- imageUrl: z.ZodOptional<z.ZodString>;
8
- buttonTitle: z.ZodOptional<z.ZodString>;
9
- splashImageUrl: z.ZodOptional<z.ZodString>;
10
- splashBackgroundColor: z.ZodOptional<z.ZodString>;
11
- webhookUrl: z.ZodOptional<z.ZodString>;
12
- }, "strip", z.ZodTypeAny, {
13
- name: string;
14
- version: "next" | "0.0.0" | "0.0.1" | "1";
15
- iconUrl: string;
16
- homeUrl: string;
17
- splashImageUrl?: string | undefined;
18
- splashBackgroundColor?: string | undefined;
19
- imageUrl?: string | undefined;
20
- buttonTitle?: string | undefined;
21
- webhookUrl?: string | undefined;
22
- }, {
23
- name: string;
24
- version: "next" | "0.0.0" | "0.0.1" | "1";
25
- iconUrl: string;
26
- homeUrl: string;
27
- splashImageUrl?: string | undefined;
28
- splashBackgroundColor?: string | undefined;
29
- imageUrl?: string | undefined;
30
- buttonTitle?: string | undefined;
31
- webhookUrl?: string | undefined;
32
- }>;
33
- export declare const domainManifestSchema: z.ZodObject<{
34
- accountAssociation: z.ZodObject<{
35
- header: z.ZodString;
36
- payload: z.ZodString;
37
- signature: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- header: string;
40
- payload: string;
41
- signature: string;
42
- }, {
43
- header: string;
44
- payload: string;
45
- signature: string;
46
- }>;
47
- frame: z.ZodOptional<z.ZodObject<{
48
- version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
49
- name: z.ZodString;
50
- iconUrl: z.ZodString;
51
- homeUrl: z.ZodString;
52
- imageUrl: z.ZodOptional<z.ZodString>;
53
- buttonTitle: z.ZodOptional<z.ZodString>;
54
- splashImageUrl: z.ZodOptional<z.ZodString>;
55
- splashBackgroundColor: z.ZodOptional<z.ZodString>;
56
- webhookUrl: z.ZodOptional<z.ZodString>;
57
- }, "strip", z.ZodTypeAny, {
58
- name: string;
59
- version: "next" | "0.0.0" | "0.0.1" | "1";
60
- iconUrl: string;
61
- homeUrl: string;
62
- splashImageUrl?: string | undefined;
63
- splashBackgroundColor?: string | undefined;
64
- imageUrl?: string | undefined;
65
- buttonTitle?: string | undefined;
66
- webhookUrl?: string | undefined;
67
- }, {
68
- name: string;
69
- version: "next" | "0.0.0" | "0.0.1" | "1";
70
- iconUrl: string;
71
- homeUrl: string;
72
- splashImageUrl?: string | undefined;
73
- splashBackgroundColor?: string | undefined;
74
- imageUrl?: string | undefined;
75
- buttonTitle?: string | undefined;
76
- webhookUrl?: string | undefined;
77
- }>>;
78
- }, "strip", z.ZodTypeAny, {
1
+ import type { z } from 'zod'
2
+ export declare const domainFrameConfigSchema: z.ZodObject<
3
+ {
4
+ version: z.ZodUnion<
5
+ [
6
+ z.ZodLiteral<'0.0.0'>,
7
+ z.ZodLiteral<'0.0.1'>,
8
+ z.ZodLiteral<'1'>,
9
+ z.ZodLiteral<'next'>,
10
+ ]
11
+ >
12
+ name: z.ZodString
13
+ iconUrl: z.ZodString
14
+ homeUrl: z.ZodString
15
+ imageUrl: z.ZodOptional<z.ZodString>
16
+ buttonTitle: z.ZodOptional<z.ZodString>
17
+ splashImageUrl: z.ZodOptional<z.ZodString>
18
+ splashBackgroundColor: z.ZodOptional<z.ZodString>
19
+ webhookUrl: z.ZodOptional<z.ZodString>
20
+ },
21
+ 'strip',
22
+ z.ZodTypeAny,
23
+ {
24
+ name: string
25
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
26
+ iconUrl: string
27
+ homeUrl: string
28
+ splashImageUrl?: string | undefined
29
+ splashBackgroundColor?: string | undefined
30
+ imageUrl?: string | undefined
31
+ buttonTitle?: string | undefined
32
+ webhookUrl?: string | undefined
33
+ },
34
+ {
35
+ name: string
36
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
37
+ iconUrl: string
38
+ homeUrl: string
39
+ splashImageUrl?: string | undefined
40
+ splashBackgroundColor?: string | undefined
41
+ imageUrl?: string | undefined
42
+ buttonTitle?: string | undefined
43
+ webhookUrl?: string | undefined
44
+ }
45
+ >
46
+ export declare const domainManifestSchema: z.ZodObject<
47
+ {
48
+ accountAssociation: z.ZodObject<
49
+ {
50
+ header: z.ZodString
51
+ payload: z.ZodString
52
+ signature: z.ZodString
53
+ },
54
+ 'strip',
55
+ z.ZodTypeAny,
56
+ {
57
+ header: string
58
+ payload: string
59
+ signature: string
60
+ },
61
+ {
62
+ header: string
63
+ payload: string
64
+ signature: string
65
+ }
66
+ >
67
+ frame: z.ZodOptional<
68
+ z.ZodObject<
69
+ {
70
+ version: z.ZodUnion<
71
+ [
72
+ z.ZodLiteral<'0.0.0'>,
73
+ z.ZodLiteral<'0.0.1'>,
74
+ z.ZodLiteral<'1'>,
75
+ z.ZodLiteral<'next'>,
76
+ ]
77
+ >
78
+ name: z.ZodString
79
+ iconUrl: z.ZodString
80
+ homeUrl: z.ZodString
81
+ imageUrl: z.ZodOptional<z.ZodString>
82
+ buttonTitle: z.ZodOptional<z.ZodString>
83
+ splashImageUrl: z.ZodOptional<z.ZodString>
84
+ splashBackgroundColor: z.ZodOptional<z.ZodString>
85
+ webhookUrl: z.ZodOptional<z.ZodString>
86
+ },
87
+ 'strip',
88
+ z.ZodTypeAny,
89
+ {
90
+ name: string
91
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
92
+ iconUrl: string
93
+ homeUrl: string
94
+ splashImageUrl?: string | undefined
95
+ splashBackgroundColor?: string | undefined
96
+ imageUrl?: string | undefined
97
+ buttonTitle?: string | undefined
98
+ webhookUrl?: string | undefined
99
+ },
100
+ {
101
+ name: string
102
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
103
+ iconUrl: string
104
+ homeUrl: string
105
+ splashImageUrl?: string | undefined
106
+ splashBackgroundColor?: string | undefined
107
+ imageUrl?: string | undefined
108
+ buttonTitle?: string | undefined
109
+ webhookUrl?: string | undefined
110
+ }
111
+ >
112
+ >
113
+ },
114
+ 'strip',
115
+ z.ZodTypeAny,
116
+ {
79
117
  accountAssociation: {
80
- header: string;
81
- payload: string;
82
- signature: string;
83
- };
84
- frame?: {
85
- name: string;
86
- version: "next" | "0.0.0" | "0.0.1" | "1";
87
- iconUrl: string;
88
- homeUrl: string;
89
- splashImageUrl?: string | undefined;
90
- splashBackgroundColor?: string | undefined;
91
- imageUrl?: string | undefined;
92
- buttonTitle?: string | undefined;
93
- webhookUrl?: string | undefined;
94
- } | undefined;
95
- }, {
118
+ header: string
119
+ payload: string
120
+ signature: string
121
+ }
122
+ frame?:
123
+ | {
124
+ name: string
125
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
126
+ iconUrl: string
127
+ homeUrl: string
128
+ splashImageUrl?: string | undefined
129
+ splashBackgroundColor?: string | undefined
130
+ imageUrl?: string | undefined
131
+ buttonTitle?: string | undefined
132
+ webhookUrl?: string | undefined
133
+ }
134
+ | undefined
135
+ },
136
+ {
96
137
  accountAssociation: {
97
- header: string;
98
- payload: string;
99
- signature: string;
100
- };
101
- frame?: {
102
- name: string;
103
- version: "next" | "0.0.0" | "0.0.1" | "1";
104
- iconUrl: string;
105
- homeUrl: string;
106
- splashImageUrl?: string | undefined;
107
- splashBackgroundColor?: string | undefined;
108
- imageUrl?: string | undefined;
109
- buttonTitle?: string | undefined;
110
- webhookUrl?: string | undefined;
111
- } | undefined;
112
- }>;
138
+ header: string
139
+ payload: string
140
+ signature: string
141
+ }
142
+ frame?:
143
+ | {
144
+ name: string
145
+ version: 'next' | '0.0.0' | '0.0.1' | '1'
146
+ iconUrl: string
147
+ homeUrl: string
148
+ splashImageUrl?: string | undefined
149
+ splashBackgroundColor?: string | undefined
150
+ imageUrl?: string | undefined
151
+ buttonTitle?: string | undefined
152
+ webhookUrl?: string | undefined
153
+ }
154
+ | undefined
155
+ }
156
+ >
@@ -1,25 +1,31 @@
1
- import { z } from "zod";
2
- import { secureUrlSchema, frameNameSchema, hexColorSchema, encodedJsonFarcasterSignatureSchema, buttonTitleSchema, } from "./shared";
1
+ import { z } from 'zod'
2
+ import {
3
+ buttonTitleSchema,
4
+ encodedJsonFarcasterSignatureSchema,
5
+ frameNameSchema,
6
+ hexColorSchema,
7
+ secureUrlSchema,
8
+ } from './shared'
3
9
  export const domainFrameConfigSchema = z.object({
4
- // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
5
- // backwards compatibilty. next should always resolve to the most recent
6
- // schema version.
7
- version: z.union([
8
- z.literal("0.0.0"),
9
- z.literal("0.0.1"),
10
- z.literal("1"),
11
- z.literal('next')
12
- ]),
13
- name: frameNameSchema,
14
- iconUrl: secureUrlSchema,
15
- homeUrl: secureUrlSchema,
16
- imageUrl: secureUrlSchema.optional(),
17
- buttonTitle: buttonTitleSchema.optional(),
18
- splashImageUrl: secureUrlSchema.optional(),
19
- splashBackgroundColor: hexColorSchema.optional(),
20
- webhookUrl: secureUrlSchema.optional(),
21
- });
10
+ // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
11
+ // backwards compatibilty. next should always resolve to the most recent
12
+ // schema version.
13
+ version: z.union([
14
+ z.literal('0.0.0'),
15
+ z.literal('0.0.1'),
16
+ z.literal('1'),
17
+ z.literal('next'),
18
+ ]),
19
+ name: frameNameSchema,
20
+ iconUrl: secureUrlSchema,
21
+ homeUrl: secureUrlSchema,
22
+ imageUrl: secureUrlSchema.optional(),
23
+ buttonTitle: buttonTitleSchema.optional(),
24
+ splashImageUrl: secureUrlSchema.optional(),
25
+ splashBackgroundColor: hexColorSchema.optional(),
26
+ webhookUrl: secureUrlSchema.optional(),
27
+ })
22
28
  export const domainManifestSchema = z.object({
23
- accountAssociation: encodedJsonFarcasterSignatureSchema,
24
- frame: domainFrameConfigSchema.optional(),
25
- });
29
+ accountAssociation: encodedJsonFarcasterSignatureSchema,
30
+ frame: domainFrameConfigSchema.optional(),
31
+ })
@@ -1,60 +1,88 @@
1
- import { z } from "zod";
2
- export declare const notificationDetailsSchema: z.ZodObject<{
3
- url: z.ZodString;
4
- token: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- url: string;
7
- token: string;
8
- }, {
9
- url: string;
10
- token: string;
11
- }>;
12
- export type FrameNotificationDetails = z.infer<typeof notificationDetailsSchema>;
13
- export declare const sendNotificationRequestSchema: z.ZodObject<{
14
- notificationId: z.ZodString;
15
- title: z.ZodString;
16
- body: z.ZodString;
17
- targetUrl: z.ZodString;
18
- tokens: z.ZodArray<z.ZodString, "many">;
19
- }, "strip", z.ZodTypeAny, {
20
- title: string;
21
- notificationId: string;
22
- body: string;
23
- targetUrl: string;
24
- tokens: string[];
25
- }, {
26
- title: string;
27
- notificationId: string;
28
- body: string;
29
- targetUrl: string;
30
- tokens: string[];
31
- }>;
32
- export type SendNotificationRequest = z.infer<typeof sendNotificationRequestSchema>;
33
- export declare const sendNotificationResponseSchema: z.ZodObject<{
34
- result: z.ZodObject<{
35
- successfulTokens: z.ZodArray<z.ZodString, "many">;
36
- invalidTokens: z.ZodArray<z.ZodString, "many">;
37
- rateLimitedTokens: z.ZodArray<z.ZodString, "many">;
38
- }, "strip", z.ZodTypeAny, {
39
- successfulTokens: string[];
40
- invalidTokens: string[];
41
- rateLimitedTokens: string[];
42
- }, {
43
- successfulTokens: string[];
44
- invalidTokens: string[];
45
- rateLimitedTokens: string[];
46
- }>;
47
- }, "strip", z.ZodTypeAny, {
1
+ import type { z } from 'zod'
2
+ export declare const notificationDetailsSchema: z.ZodObject<
3
+ {
4
+ url: z.ZodString
5
+ token: z.ZodString
6
+ },
7
+ 'strip',
8
+ z.ZodTypeAny,
9
+ {
10
+ url: string
11
+ token: string
12
+ },
13
+ {
14
+ url: string
15
+ token: string
16
+ }
17
+ >
18
+ export type FrameNotificationDetails = z.infer<typeof notificationDetailsSchema>
19
+ export declare const sendNotificationRequestSchema: z.ZodObject<
20
+ {
21
+ notificationId: z.ZodString
22
+ title: z.ZodString
23
+ body: z.ZodString
24
+ targetUrl: z.ZodString
25
+ tokens: z.ZodArray<z.ZodString, 'many'>
26
+ },
27
+ 'strip',
28
+ z.ZodTypeAny,
29
+ {
30
+ title: string
31
+ notificationId: string
32
+ body: string
33
+ targetUrl: string
34
+ tokens: string[]
35
+ },
36
+ {
37
+ title: string
38
+ notificationId: string
39
+ body: string
40
+ targetUrl: string
41
+ tokens: string[]
42
+ }
43
+ >
44
+ export type SendNotificationRequest = z.infer<
45
+ typeof sendNotificationRequestSchema
46
+ >
47
+ export declare const sendNotificationResponseSchema: z.ZodObject<
48
+ {
49
+ result: z.ZodObject<
50
+ {
51
+ successfulTokens: z.ZodArray<z.ZodString, 'many'>
52
+ invalidTokens: z.ZodArray<z.ZodString, 'many'>
53
+ rateLimitedTokens: z.ZodArray<z.ZodString, 'many'>
54
+ },
55
+ 'strip',
56
+ z.ZodTypeAny,
57
+ {
58
+ successfulTokens: string[]
59
+ invalidTokens: string[]
60
+ rateLimitedTokens: string[]
61
+ },
62
+ {
63
+ successfulTokens: string[]
64
+ invalidTokens: string[]
65
+ rateLimitedTokens: string[]
66
+ }
67
+ >
68
+ },
69
+ 'strip',
70
+ z.ZodTypeAny,
71
+ {
48
72
  result: {
49
- successfulTokens: string[];
50
- invalidTokens: string[];
51
- rateLimitedTokens: string[];
52
- };
53
- }, {
73
+ successfulTokens: string[]
74
+ invalidTokens: string[]
75
+ rateLimitedTokens: string[]
76
+ }
77
+ },
78
+ {
54
79
  result: {
55
- successfulTokens: string[];
56
- invalidTokens: string[];
57
- rateLimitedTokens: string[];
58
- };
59
- }>;
60
- export type SendNotificationResponse = z.infer<typeof sendNotificationResponseSchema>;
80
+ successfulTokens: string[]
81
+ invalidTokens: string[]
82
+ rateLimitedTokens: string[]
83
+ }
84
+ }
85
+ >
86
+ export type SendNotificationResponse = z.infer<
87
+ typeof sendNotificationResponseSchema
88
+ >
@@ -1,20 +1,20 @@
1
- import { z } from "zod";
2
- import { secureUrlSchema } from "./shared";
1
+ import { z } from 'zod'
2
+ import { secureUrlSchema } from './shared'
3
3
  export const notificationDetailsSchema = z.object({
4
- url: z.string(),
5
- token: z.string(),
6
- });
4
+ url: z.string(),
5
+ token: z.string(),
6
+ })
7
7
  export const sendNotificationRequestSchema = z.object({
8
- notificationId: z.string().max(128),
9
- title: z.string().max(32),
10
- body: z.string().max(128),
11
- targetUrl: secureUrlSchema,
12
- tokens: z.string().array().max(100),
13
- });
8
+ notificationId: z.string().max(128),
9
+ title: z.string().max(32),
10
+ body: z.string().max(128),
11
+ targetUrl: secureUrlSchema,
12
+ tokens: z.string().array().max(100),
13
+ })
14
14
  export const sendNotificationResponseSchema = z.object({
15
- result: z.object({
16
- successfulTokens: z.array(z.string()),
17
- invalidTokens: z.array(z.string()),
18
- rateLimitedTokens: z.array(z.string()),
19
- }),
20
- });
15
+ result: z.object({
16
+ successfulTokens: z.array(z.string()),
17
+ invalidTokens: z.array(z.string()),
18
+ rateLimitedTokens: z.array(z.string()),
19
+ }),
20
+ })
@@ -1,33 +1,49 @@
1
- import { z } from "zod";
2
- export declare const secureUrlSchema: z.ZodString;
3
- export declare const frameNameSchema: z.ZodString;
4
- export declare const buttonTitleSchema: z.ZodString;
5
- export declare const hexColorSchema: z.ZodString;
6
- export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
7
- header: z.ZodString;
8
- payload: z.ZodString;
9
- signature: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- header: string;
12
- payload: string;
13
- signature: string;
14
- }, {
15
- header: string;
16
- payload: string;
17
- signature: string;
18
- }>;
19
- export type EncodedJsonFarcasterSignatureSchema = z.infer<typeof encodedJsonFarcasterSignatureSchema>;
20
- export declare const jsonFarcasterSignatureHeaderSchema: z.ZodObject<{
21
- fid: z.ZodNumber;
22
- type: z.ZodLiteral<"app_key">;
23
- key: z.ZodString;
24
- }, "strip", z.ZodTypeAny, {
25
- type: "app_key";
26
- fid: number;
27
- key: string;
28
- }, {
29
- type: "app_key";
30
- fid: number;
31
- key: string;
32
- }>;
33
- export type JsonFarcasterSignatureHeaderSchema = z.infer<typeof jsonFarcasterSignatureHeaderSchema>;
1
+ import type { z } from 'zod'
2
+ export declare const secureUrlSchema: z.ZodString
3
+ export declare const frameNameSchema: z.ZodString
4
+ export declare const buttonTitleSchema: z.ZodString
5
+ export declare const hexColorSchema: z.ZodString
6
+ export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<
7
+ {
8
+ header: z.ZodString
9
+ payload: z.ZodString
10
+ signature: z.ZodString
11
+ },
12
+ 'strip',
13
+ z.ZodTypeAny,
14
+ {
15
+ header: string
16
+ payload: string
17
+ signature: string
18
+ },
19
+ {
20
+ header: string
21
+ payload: string
22
+ signature: string
23
+ }
24
+ >
25
+ export type EncodedJsonFarcasterSignatureSchema = z.infer<
26
+ typeof encodedJsonFarcasterSignatureSchema
27
+ >
28
+ export declare const jsonFarcasterSignatureHeaderSchema: z.ZodObject<
29
+ {
30
+ fid: z.ZodNumber
31
+ type: z.ZodLiteral<'app_key'>
32
+ key: z.ZodString
33
+ },
34
+ 'strip',
35
+ z.ZodTypeAny,
36
+ {
37
+ type: 'app_key'
38
+ fid: number
39
+ key: string
40
+ },
41
+ {
42
+ type: 'app_key'
43
+ fid: number
44
+ key: string
45
+ }
46
+ >
47
+ export type JsonFarcasterSignatureHeaderSchema = z.infer<
48
+ typeof jsonFarcasterSignatureHeaderSchema
49
+ >
@@ -1,23 +1,24 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod'
2
2
  export const secureUrlSchema = z
3
- .string()
4
- .url()
5
- .startsWith("https://", { message: "Must be an https url" })
6
- .max(512);
7
- export const frameNameSchema = z.string().max(32);
8
- export const buttonTitleSchema = z.string().max(32);
3
+ .string()
4
+ .url()
5
+ .startsWith('https://', { message: 'Must be an https url' })
6
+ .max(512)
7
+ export const frameNameSchema = z.string().max(32)
8
+ export const buttonTitleSchema = z.string().max(32)
9
9
  export const hexColorSchema = z
10
- .string()
11
- .regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
12
- message: "Invalid hex color code. It should be in the format #RRGGBB or #RGB.",
13
- });
10
+ .string()
11
+ .regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
12
+ message:
13
+ 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
14
+ })
14
15
  export const encodedJsonFarcasterSignatureSchema = z.object({
15
- header: z.string(),
16
- payload: z.string(),
17
- signature: z.string(),
18
- });
16
+ header: z.string(),
17
+ payload: z.string(),
18
+ signature: z.string(),
19
+ })
19
20
  export const jsonFarcasterSignatureHeaderSchema = z.object({
20
- fid: z.number(),
21
- type: z.literal("app_key"),
22
- key: z.string().startsWith("0x"),
23
- });
21
+ fid: z.number(),
22
+ type: z.literal('app_key'),
23
+ key: z.string().startsWith('0x'),
24
+ })